From f73f2356820468344757dbb9d7f3ec73ece7bf66 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 13 Feb 2023 20:43:51 +0100 Subject: Updating. Signed-off-by: Daniel Baumann --- web/_static/mermaid-js/mermaid.core.js | 36455 +++++++++++ web/_static/mermaid-js/mermaid.core.js.map | 1 + web/_static/mermaid-js/mermaid.js | 89082 +++++++++++++++++++++++++++ web/_static/mermaid-js/mermaid.js.map | 1 + 4 files changed, 125539 insertions(+) create mode 100644 web/_static/mermaid-js/mermaid.core.js create mode 100644 web/_static/mermaid-js/mermaid.core.js.map create mode 100644 web/_static/mermaid-js/mermaid.js create mode 100644 web/_static/mermaid-js/mermaid.js.map (limited to 'web/_static/mermaid-js') diff --git a/web/_static/mermaid-js/mermaid.core.js b/web/_static/mermaid-js/mermaid.core.js new file mode 100644 index 0000000..414243a --- /dev/null +++ b/web/_static/mermaid-js/mermaid.core.js @@ -0,0 +1,36455 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["mermaid"] = factory(); + else + root["mermaid"] = factory(); +})(typeof self !== "undefined" ? self : this, () => { +return /******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./src/diagrams/c4/parser/c4Diagram.jison": +/*!************************************************!*\ + !*** ./src/diagrams/c4/parser/c4Diagram.jison ***! + \************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,6],$V1=[1,7],$V2=[1,8],$V3=[1,9],$V4=[1,16],$V5=[1,11],$V6=[1,12],$V7=[1,13],$V8=[1,14],$V9=[1,15],$Va=[1,27],$Vb=[1,33],$Vc=[1,34],$Vd=[1,35],$Ve=[1,36],$Vf=[1,37],$Vg=[1,72],$Vh=[1,73],$Vi=[1,74],$Vj=[1,75],$Vk=[1,76],$Vl=[1,77],$Vm=[1,78],$Vn=[1,38],$Vo=[1,39],$Vp=[1,40],$Vq=[1,41],$Vr=[1,42],$Vs=[1,43],$Vt=[1,44],$Vu=[1,45],$Vv=[1,46],$Vw=[1,47],$Vx=[1,48],$Vy=[1,49],$Vz=[1,50],$VA=[1,51],$VB=[1,52],$VC=[1,53],$VD=[1,54],$VE=[1,55],$VF=[1,56],$VG=[1,57],$VH=[1,59],$VI=[1,60],$VJ=[1,61],$VK=[1,62],$VL=[1,63],$VM=[1,64],$VN=[1,65],$VO=[1,66],$VP=[1,67],$VQ=[1,68],$VR=[1,69],$VS=[24,52],$VT=[24,44,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],$VU=[15,24,44,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],$VV=[1,94],$VW=[1,95],$VX=[1,96],$VY=[1,97],$VZ=[15,24,52],$V_=[7,8,9,10,18,22,25,26,27,28],$V$=[15,24,43,52],$V01=[15,24,43,52,86,87,89,90],$V11=[15,43],$V21=[44,46,47,48,49,50,51,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"mermaidDoc":4,"direction":5,"directive":6,"direction_tb":7,"direction_bt":8,"direction_rl":9,"direction_lr":10,"graphConfig":11,"openDirective":12,"typeDirective":13,"closeDirective":14,"NEWLINE":15,":":16,"argDirective":17,"open_directive":18,"type_directive":19,"arg_directive":20,"close_directive":21,"C4_CONTEXT":22,"statements":23,"EOF":24,"C4_CONTAINER":25,"C4_COMPONENT":26,"C4_DYNAMIC":27,"C4_DEPLOYMENT":28,"otherStatements":29,"diagramStatements":30,"otherStatement":31,"title":32,"accDescription":33,"acc_title":34,"acc_title_value":35,"acc_descr":36,"acc_descr_value":37,"acc_descr_multiline_value":38,"boundaryStatement":39,"boundaryStartStatement":40,"boundaryStopStatement":41,"boundaryStart":42,"LBRACE":43,"ENTERPRISE_BOUNDARY":44,"attributes":45,"SYSTEM_BOUNDARY":46,"BOUNDARY":47,"CONTAINER_BOUNDARY":48,"NODE":49,"NODE_L":50,"NODE_R":51,"RBRACE":52,"diagramStatement":53,"PERSON":54,"PERSON_EXT":55,"SYSTEM":56,"SYSTEM_DB":57,"SYSTEM_QUEUE":58,"SYSTEM_EXT":59,"SYSTEM_EXT_DB":60,"SYSTEM_EXT_QUEUE":61,"CONTAINER":62,"CONTAINER_DB":63,"CONTAINER_QUEUE":64,"CONTAINER_EXT":65,"CONTAINER_EXT_DB":66,"CONTAINER_EXT_QUEUE":67,"COMPONENT":68,"COMPONENT_DB":69,"COMPONENT_QUEUE":70,"COMPONENT_EXT":71,"COMPONENT_EXT_DB":72,"COMPONENT_EXT_QUEUE":73,"REL":74,"BIREL":75,"REL_U":76,"REL_D":77,"REL_L":78,"REL_R":79,"REL_B":80,"REL_INDEX":81,"UPDATE_EL_STYLE":82,"UPDATE_REL_STYLE":83,"UPDATE_LAYOUT_CONFIG":84,"attribute":85,"STR":86,"STR_KEY":87,"STR_VALUE":88,"ATTRIBUTE":89,"ATTRIBUTE_EMPTY":90,"$accept":0,"$end":1}, +terminals_: {2:"error",7:"direction_tb",8:"direction_bt",9:"direction_rl",10:"direction_lr",15:"NEWLINE",16:":",18:"open_directive",19:"type_directive",20:"arg_directive",21:"close_directive",22:"C4_CONTEXT",24:"EOF",25:"C4_CONTAINER",26:"C4_COMPONENT",27:"C4_DYNAMIC",28:"C4_DEPLOYMENT",32:"title",33:"accDescription",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",43:"LBRACE",44:"ENTERPRISE_BOUNDARY",46:"SYSTEM_BOUNDARY",47:"BOUNDARY",48:"CONTAINER_BOUNDARY",49:"NODE",50:"NODE_L",51:"NODE_R",52:"RBRACE",54:"PERSON",55:"PERSON_EXT",56:"SYSTEM",57:"SYSTEM_DB",58:"SYSTEM_QUEUE",59:"SYSTEM_EXT",60:"SYSTEM_EXT_DB",61:"SYSTEM_EXT_QUEUE",62:"CONTAINER",63:"CONTAINER_DB",64:"CONTAINER_QUEUE",65:"CONTAINER_EXT",66:"CONTAINER_EXT_DB",67:"CONTAINER_EXT_QUEUE",68:"COMPONENT",69:"COMPONENT_DB",70:"COMPONENT_QUEUE",71:"COMPONENT_EXT",72:"COMPONENT_EXT_DB",73:"COMPONENT_EXT_QUEUE",74:"REL",75:"BIREL",76:"REL_U",77:"REL_D",78:"REL_L",79:"REL_R",80:"REL_B",81:"REL_INDEX",82:"UPDATE_EL_STYLE",83:"UPDATE_REL_STYLE",84:"UPDATE_LAYOUT_CONFIG",86:"STR",87:"STR_KEY",88:"STR_VALUE",89:"ATTRIBUTE",90:"ATTRIBUTE_EMPTY"}, +productions_: [0,[3,1],[3,1],[3,2],[5,1],[5,1],[5,1],[5,1],[4,1],[6,4],[6,6],[12,1],[13,1],[17,1],[14,1],[11,4],[11,4],[11,4],[11,4],[11,4],[23,1],[23,1],[23,2],[29,1],[29,2],[29,3],[31,1],[31,1],[31,2],[31,2],[31,1],[39,3],[40,3],[40,3],[40,4],[42,2],[42,2],[42,2],[42,2],[42,2],[42,2],[42,2],[41,1],[30,1],[30,2],[30,3],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,1],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[45,1],[45,2],[85,1],[85,2],[85,1],[85,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 4: + yy.setDirection('TB'); +break; +case 5: + yy.setDirection('BT'); +break; +case 6: + yy.setDirection('RL'); +break; +case 7: + yy.setDirection('LR'); +break; +case 11: + console.log("open_directive: ", $$[$0]); yy.parseDirective('%%{', 'open_directive'); +break; +case 12: + +break; +case 13: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); console.log("arg_directive: ", $$[$0]); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 14: + console.log("close_directive: ", $$[$0]); yy.parseDirective('}%%', 'close_directive', 'c4Context'); +break; +case 15: case 16: case 17: case 18: case 19: +yy.setC4Type($$[$0-3]) +break; +case 26: +yy.setTitle($$[$0].substring(6));this.$=$$[$0].substring(6); +break; +case 27: +yy.setAccDescription($$[$0].substring(15));this.$=$$[$0].substring(15); +break; +case 28: + this.$=$$[$0].trim();yy.setTitle(this.$); +break; +case 29: case 30: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 35: case 36: +console.log($$[$0-1],JSON.stringify($$[$0])); $$[$0].splice(2, 0, 'ENTERPRISE'); yy.addPersonOrSystemBoundary(...$$[$0]); this.$=$$[$0]; +break; +case 37: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystemBoundary(...$$[$0]); this.$=$$[$0]; +break; +case 38: +console.log($$[$0-1],JSON.stringify($$[$0])); $$[$0].splice(2, 0, 'CONTAINER'); yy.addContainerBoundary(...$$[$0]); this.$=$$[$0]; +break; +case 39: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addDeploymentNode('node', ...$$[$0]); this.$=$$[$0]; +break; +case 40: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addDeploymentNode('nodeL', ...$$[$0]); this.$=$$[$0]; +break; +case 41: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addDeploymentNode('nodeR', ...$$[$0]); this.$=$$[$0]; +break; +case 42: + yy.popBoundaryParseStack() +break; +case 46: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('person', ...$$[$0]); this.$=$$[$0]; +break; +case 47: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('external_person', ...$$[$0]); this.$=$$[$0]; +break; +case 48: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('system', ...$$[$0]); this.$=$$[$0]; +break; +case 49: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('system_db', ...$$[$0]); this.$=$$[$0]; +break; +case 50: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('system_queue', ...$$[$0]); this.$=$$[$0]; +break; +case 51: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('external_system', ...$$[$0]); this.$=$$[$0]; +break; +case 52: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('external_system_db', ...$$[$0]); this.$=$$[$0]; +break; +case 53: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('external_system_queue', ...$$[$0]); this.$=$$[$0]; +break; +case 54: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('container', ...$$[$0]); this.$=$$[$0]; +break; +case 55: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('container_db', ...$$[$0]); this.$=$$[$0]; +break; +case 56: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('container_queue', ...$$[$0]); this.$=$$[$0]; +break; +case 57: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('external_container', ...$$[$0]); this.$=$$[$0]; +break; +case 58: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('external_container_db', ...$$[$0]); this.$=$$[$0]; +break; +case 59: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('external_container_queue', ...$$[$0]); this.$=$$[$0]; +break; +case 60: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('component', ...$$[$0]); this.$=$$[$0]; +break; +case 61: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('component_db', ...$$[$0]); this.$=$$[$0]; +break; +case 62: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('component_queue', ...$$[$0]); this.$=$$[$0]; +break; +case 63: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('external_component', ...$$[$0]); this.$=$$[$0]; +break; +case 64: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('external_component_db', ...$$[$0]); this.$=$$[$0]; +break; +case 65: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('external_component_queue', ...$$[$0]); this.$=$$[$0]; +break; +case 67: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel', ...$$[$0]); this.$=$$[$0]; +break; +case 68: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('birel', ...$$[$0]); this.$=$$[$0]; +break; +case 69: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel_u', ...$$[$0]); this.$=$$[$0]; +break; +case 70: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel_d', ...$$[$0]); this.$=$$[$0]; +break; +case 71: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel_l', ...$$[$0]); this.$=$$[$0]; +break; +case 72: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel_r', ...$$[$0]); this.$=$$[$0]; +break; +case 73: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel_b', ...$$[$0]); this.$=$$[$0]; +break; +case 74: +console.log($$[$0-1],JSON.stringify($$[$0])); $$[$0].splice(0, 1); yy.addRel('rel', ...$$[$0]); this.$=$$[$0]; +break; +case 75: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.updateElStyle('update_el_style', ...$$[$0]); this.$=$$[$0]; +break; +case 76: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.updateRelStyle('update_rel_style', ...$$[$0]); this.$=$$[$0]; +break; +case 77: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.updateLayoutConfig('update_layout_config', ...$$[$0]); this.$=$$[$0]; +break; +case 78: + console.log('PUSH ATTRIBUTE: ', $$[$0]); this.$ = [$$[$0]]; +break; +case 79: + console.log('PUSH ATTRIBUTE: ', $$[$0-1]); $$[$0].unshift($$[$0-1]); this.$=$$[$0]; +break; +case 80: case 82: + this.$ = $$[$0].trim(); +break; +case 81: + console.log('kv: ', $$[$0-1], $$[$0]); let kv={}; kv[$$[$0-1].trim()]=$$[$0].trim(); this.$=kv; +break; +case 83: + this.$ = ""; +break; +} +}, +table: [{3:1,4:2,5:3,6:4,7:$V0,8:$V1,9:$V2,10:$V3,11:5,12:10,18:$V4,22:$V5,25:$V6,26:$V7,27:$V8,28:$V9},{1:[3]},{1:[2,1]},{1:[2,2]},{3:17,4:2,5:3,6:4,7:$V0,8:$V1,9:$V2,10:$V3,11:5,12:10,18:$V4,22:$V5,25:$V6,26:$V7,27:$V8,28:$V9},{1:[2,8]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{1:[2,7]},{13:18,19:[1,19]},{15:[1,20]},{15:[1,21]},{15:[1,22]},{15:[1,23]},{15:[1,24]},{19:[2,11]},{1:[2,3]},{14:25,16:[1,26],21:$Va},o([16,21],[2,12]),{23:28,29:29,30:30,31:31,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{23:79,29:29,30:30,31:31,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{23:80,29:29,30:30,31:31,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{23:81,29:29,30:30,31:31,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{23:82,29:29,30:30,31:31,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{15:[1,83]},{17:84,20:[1,85]},{15:[2,14]},{24:[1,86]},o($VS,[2,20],{53:32,39:58,40:70,42:71,30:87,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR}),o($VS,[2,21]),o($VT,[2,23],{15:[1,88]}),o($VS,[2,43],{15:[1,89]}),o($VU,[2,26]),o($VU,[2,27]),{35:[1,90]},{37:[1,91]},o($VU,[2,30]),{45:92,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:98,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:99,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:100,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:101,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:102,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:103,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:104,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:105,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:106,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:107,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:108,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:109,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:110,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:111,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:112,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:113,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:114,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:115,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:116,85:93,86:$VV,87:$VW,89:$VX,90:$VY},o($VZ,[2,66]),{45:117,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:118,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:119,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:120,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:121,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:122,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:123,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:124,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:125,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:126,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:127,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{30:128,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{15:[1,130],43:[1,129]},{45:131,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:132,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:133,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:134,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:135,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:136,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:137,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{24:[1,138]},{24:[1,139]},{24:[1,140]},{24:[1,141]},o($V_,[2,9]),{14:142,21:$Va},{21:[2,13]},{1:[2,15]},o($VS,[2,22]),o($VT,[2,24],{31:31,29:143,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf}),o($VS,[2,44],{29:29,30:30,31:31,53:32,39:58,40:70,42:71,23:144,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR}),o($VU,[2,28]),o($VU,[2,29]),o($VZ,[2,46]),o($V$,[2,78],{85:93,45:145,86:$VV,87:$VW,89:$VX,90:$VY}),o($V01,[2,80]),{88:[1,146]},o($V01,[2,82]),o($V01,[2,83]),o($VZ,[2,47]),o($VZ,[2,48]),o($VZ,[2,49]),o($VZ,[2,50]),o($VZ,[2,51]),o($VZ,[2,52]),o($VZ,[2,53]),o($VZ,[2,54]),o($VZ,[2,55]),o($VZ,[2,56]),o($VZ,[2,57]),o($VZ,[2,58]),o($VZ,[2,59]),o($VZ,[2,60]),o($VZ,[2,61]),o($VZ,[2,62]),o($VZ,[2,63]),o($VZ,[2,64]),o($VZ,[2,65]),o($VZ,[2,67]),o($VZ,[2,68]),o($VZ,[2,69]),o($VZ,[2,70]),o($VZ,[2,71]),o($VZ,[2,72]),o($VZ,[2,73]),o($VZ,[2,74]),o($VZ,[2,75]),o($VZ,[2,76]),o($VZ,[2,77]),{41:147,52:[1,148]},{15:[1,149]},{43:[1,150]},o($V11,[2,35]),o($V11,[2,36]),o($V11,[2,37]),o($V11,[2,38]),o($V11,[2,39]),o($V11,[2,40]),o($V11,[2,41]),{1:[2,16]},{1:[2,17]},{1:[2,18]},{1:[2,19]},{15:[1,151]},o($VT,[2,25]),o($VS,[2,45]),o($V$,[2,79]),o($V01,[2,81]),o($VZ,[2,31]),o($VZ,[2,42]),o($V21,[2,32]),o($V21,[2,33],{15:[1,152]}),o($V_,[2,10]),o($V21,[2,34])], +defaultActions: {2:[2,1],3:[2,2],5:[2,8],6:[2,4],7:[2,5],8:[2,6],9:[2,7],16:[2,11],17:[2,3],27:[2,14],85:[2,13],86:[2,15],138:[2,16],139:[2,17],140:[2,18],141:[2,19]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 18; +break; +case 1:return 7; +break; +case 2:return 8; +break; +case 3:return 9; +break; +case 4:return 10; +break; +case 5: this.begin('type_directive'); return 19; +break; +case 6: this.popState(); this.begin('arg_directive'); return 16; +break; +case 7: this.popState(); this.popState(); return 21; +break; +case 8:return 20; +break; +case 9:return 32; +break; +case 10:return 33; +break; +case 11: this.begin("acc_title");return 34; +break; +case 12: this.popState(); return "acc_title_value"; +break; +case 13: this.begin("acc_descr");return 36; +break; +case 14: this.popState(); return "acc_descr_value"; +break; +case 15: this.begin("acc_descr_multiline"); +break; +case 16: this.popState(); +break; +case 17:return "acc_descr_multiline_value"; +break; +case 18:/* skip comments */ +break; +case 19:c /* skip comments */ +break; +case 20:return 15; +break; +case 21:/* skip whitespace */ +break; +case 22:return 22; +break; +case 23:return 25; +break; +case 24:return 26; +break; +case 25:return 27; +break; +case 26:return 28; +break; +case 27: this.begin("person_ext"); console.log('begin person_ext'); return 55; +break; +case 28: this.begin("person"); console.log('begin person'); return 54; +break; +case 29: this.begin("system_ext_queue"); console.log('begin system_ext_queue'); return 61; +break; +case 30: this.begin("system_ext_db"); console.log('begin system_ext_db'); return 60; +break; +case 31: this.begin("system_ext"); console.log('begin system_ext'); return 59; +break; +case 32: this.begin("system_queue"); console.log('begin system_queue'); return 58; +break; +case 33: this.begin("system_db"); console.log('begin system_db'); return 57; +break; +case 34: this.begin("system"); console.log('begin system'); return 56; +break; +case 35: this.begin("boundary"); console.log('begin boundary'); return 47; +break; +case 36: this.begin("enterprise_boundary"); console.log('begin enterprise_boundary'); return 44; +break; +case 37: this.begin("system_boundary"); console.log('begin system_boundary'); return 46; +break; +case 38: this.begin("container_ext_queue"); console.log('begin container_ext_queue'); return 67; +break; +case 39: this.begin("container_ext_db"); console.log('begin container_ext_db'); return 66; +break; +case 40: this.begin("container_ext"); console.log('begin container_ext'); return 65; +break; +case 41: this.begin("container_queue"); console.log('begin container_queue'); return 64; +break; +case 42: this.begin("container_db"); console.log('begin container_db'); return 63; +break; +case 43: this.begin("container"); console.log('begin container'); return 62; +break; +case 44: this.begin("container_boundary"); console.log('begin container_boundary'); return 48; +break; +case 45: this.begin("component_ext_queue"); console.log('begin component_ext_queue'); return 73; +break; +case 46: this.begin("component_ext_db"); console.log('begin component_ext_db'); return 72; +break; +case 47: this.begin("component_ext"); console.log('begin component_ext'); return 71; +break; +case 48: this.begin("component_queue"); console.log('begin component_queue'); return 70; +break; +case 49: this.begin("component_db"); console.log('begin component_db'); return 69; +break; +case 50: this.begin("component"); console.log('begin component'); return 68; +break; +case 51: this.begin("node"); console.log('begin node'); return 49; +break; +case 52: this.begin("node"); console.log('begin node'); return 49; +break; +case 53: this.begin("node_l"); console.log('begin node_l'); return 50; +break; +case 54: this.begin("node_r"); console.log('begin node_r'); return 51; +break; +case 55: this.begin("rel"); console.log('begin rel'); return 74; +break; +case 56: this.begin("birel"); console.log('begin birel'); return 75; +break; +case 57: this.begin("rel_u"); console.log('begin rel_u'); return 76; +break; +case 58: this.begin("rel_u"); console.log('begin rel_u'); return 76; +break; +case 59: this.begin("rel_d"); console.log('begin rel_d'); return 77; +break; +case 60: this.begin("rel_d"); console.log('begin rel_d'); return 77; +break; +case 61: this.begin("rel_l"); console.log('begin rel_l'); return 78; +break; +case 62: this.begin("rel_l"); console.log('begin rel_l'); return 78; +break; +case 63: this.begin("rel_r"); console.log('begin rel_r'); return 79; +break; +case 64: this.begin("rel_r"); console.log('begin rel_r'); return 79; +break; +case 65: this.begin("rel_b"); console.log('begin rel_b'); return 80; +break; +case 66: this.begin("rel_index"); console.log('begin rel_index'); return 81; +break; +case 67: this.begin("update_el_style"); console.log('begin update_el_style'); return 82; +break; +case 68: this.begin("update_rel_style"); console.log('begin update_rel_style'); return 83; +break; +case 69: this.begin("update_layout_config"); console.log('begin update_layout_config'); return 84; +break; +case 70:return "EOF_IN_STRUCT"; +break; +case 71: console.log('begin attribute with ATTRIBUTE_EMPTY'); this.begin("attribute"); return "ATTRIBUTE_EMPTY"; +break; +case 72: console.log('begin attribute'); this.begin("attribute"); +break; +case 73: console.log('STOP attribute'); this.popState();console.log('STOP diagram'); this.popState(); +break; +case 74: console.log(',,'); return 90; +break; +case 75: console.log(','); +break; +case 76: console.log('ATTRIBUTE_EMPTY'); return 90; +break; +case 77: console.log('begin string'); this.begin("string"); +break; +case 78: console.log('STOP string'); this.popState(); +break; +case 79: console.log('STR'); return "STR"; +break; +case 80: console.log('begin string_kv'); this.begin("string_kv"); +break; +case 81: console.log('STR_KEY'); this.begin("string_kv_key"); return "STR_KEY"; +break; +case 82: console.log('begin string_kv_value'); this.popState(); this.begin("string_kv_value"); +break; +case 83: console.log('STR_VALUE'); return "STR_VALUE"; +break; +case 84: console.log('STOP string_kv_value'); this.popState(); this.popState(); +break; +case 85: console.log('not STR'); return "STR"; +break; +case 86: /* this.begin("lbrace"); */ console.log('begin boundary block'); return "LBRACE"; +break; +case 87: /* this.popState(); */ console.log('STOP boundary block'); return "RBRACE"; +break; +case 88:return 'SPACE'; +break; +case 89:return 'EOL'; +break; +case 90:return 24; +break; +} +}, +rules: [/^(?:%%\{)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/], +conditions: {"acc_descr_multiline":{"rules":[16,17],"inclusive":false},"acc_descr":{"rules":[14],"inclusive":false},"acc_title":{"rules":[12],"inclusive":false},"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[7,8],"inclusive":false},"type_directive":{"rules":[6,7],"inclusive":false},"open_directive":{"rules":[5],"inclusive":false},"string_kv_value":{"rules":[83,84],"inclusive":false},"string_kv_key":{"rules":[82],"inclusive":false},"string_kv":{"rules":[81],"inclusive":false},"string":{"rules":[78,79],"inclusive":false},"attribute":{"rules":[73,74,75,76,77,80,85],"inclusive":false},"update_layout_config":{"rules":[70,71,72,73],"inclusive":false},"update_rel_style":{"rules":[70,71,72,73],"inclusive":false},"update_el_style":{"rules":[70,71,72,73],"inclusive":false},"rel_b":{"rules":[70,71,72,73],"inclusive":false},"rel_r":{"rules":[70,71,72,73],"inclusive":false},"rel_l":{"rules":[70,71,72,73],"inclusive":false},"rel_d":{"rules":[70,71,72,73],"inclusive":false},"rel_u":{"rules":[70,71,72,73],"inclusive":false},"rel_bi":{"rules":[],"inclusive":false},"rel":{"rules":[70,71,72,73],"inclusive":false},"node_r":{"rules":[70,71,72,73],"inclusive":false},"node_l":{"rules":[70,71,72,73],"inclusive":false},"node":{"rules":[70,71,72,73],"inclusive":false},"index":{"rules":[],"inclusive":false},"rel_index":{"rules":[70,71,72,73],"inclusive":false},"component_ext_queue":{"rules":[],"inclusive":false},"component_ext_db":{"rules":[70,71,72,73],"inclusive":false},"component_ext":{"rules":[70,71,72,73],"inclusive":false},"component_queue":{"rules":[70,71,72,73],"inclusive":false},"component_db":{"rules":[70,71,72,73],"inclusive":false},"component":{"rules":[70,71,72,73],"inclusive":false},"container_boundary":{"rules":[70,71,72,73],"inclusive":false},"container_ext_queue":{"rules":[],"inclusive":false},"container_ext_db":{"rules":[70,71,72,73],"inclusive":false},"container_ext":{"rules":[70,71,72,73],"inclusive":false},"container_queue":{"rules":[70,71,72,73],"inclusive":false},"container_db":{"rules":[70,71,72,73],"inclusive":false},"container":{"rules":[70,71,72,73],"inclusive":false},"birel":{"rules":[70,71,72,73],"inclusive":false},"system_boundary":{"rules":[70,71,72,73],"inclusive":false},"enterprise_boundary":{"rules":[70,71,72,73],"inclusive":false},"boundary":{"rules":[70,71,72,73],"inclusive":false},"system_ext_queue":{"rules":[70,71,72,73],"inclusive":false},"system_ext_db":{"rules":[70,71,72,73],"inclusive":false},"system_ext":{"rules":[70,71,72,73],"inclusive":false},"system_queue":{"rules":[70,71,72,73],"inclusive":false},"system_db":{"rules":[70,71,72,73],"inclusive":false},"system":{"rules":[70,71,72,73],"inclusive":false},"person_ext":{"rules":[70,71,72,73],"inclusive":false},"person":{"rules":[70,71,72,73],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,9,10,11,13,15,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,86,87,88,89,90],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?1da1").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/class/parser/classDiagram.jison": +/*!******************************************************!*\ + !*** ./src/diagrams/class/parser/classDiagram.jison ***! + \******************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,7],$V2=[1,8],$V3=[1,9],$V4=[1,10],$V5=[1,13],$V6=[1,12],$V7=[1,16,25],$V8=[1,20],$V9=[1,31],$Va=[1,32],$Vb=[1,33],$Vc=[1,35],$Vd=[1,38],$Ve=[1,36],$Vf=[1,37],$Vg=[1,39],$Vh=[1,40],$Vi=[1,41],$Vj=[1,42],$Vk=[1,45],$Vl=[1,46],$Vm=[1,47],$Vn=[1,48],$Vo=[16,25],$Vp=[1,62],$Vq=[1,63],$Vr=[1,64],$Vs=[1,65],$Vt=[1,66],$Vu=[1,67],$Vv=[16,25,32,44,45,53,56,57,58,59,60,61,66,68],$Vw=[16,25,30,32,44,45,49,53,56,57,58,59,60,61,66,68,83,84,85,86],$Vx=[5,8,9,10,11,16,19,23,25],$Vy=[53,83,84,85,86],$Vz=[53,60,61,83,84,85,86],$VA=[53,56,57,58,59,83,84,85,86],$VB=[16,25,32],$VC=[1,99]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"mermaidDoc":4,"statments":5,"direction":6,"directive":7,"direction_tb":8,"direction_bt":9,"direction_rl":10,"direction_lr":11,"graphConfig":12,"openDirective":13,"typeDirective":14,"closeDirective":15,"NEWLINE":16,":":17,"argDirective":18,"open_directive":19,"type_directive":20,"arg_directive":21,"close_directive":22,"CLASS_DIAGRAM":23,"statements":24,"EOF":25,"statement":26,"className":27,"alphaNumToken":28,"classLiteralName":29,"GENERICTYPE":30,"relationStatement":31,"LABEL":32,"classStatement":33,"methodStatement":34,"annotationStatement":35,"clickStatement":36,"cssClassStatement":37,"acc_title":38,"acc_title_value":39,"acc_descr":40,"acc_descr_value":41,"acc_descr_multiline_value":42,"CLASS":43,"STYLE_SEPARATOR":44,"STRUCT_START":45,"members":46,"STRUCT_STOP":47,"ANNOTATION_START":48,"ANNOTATION_END":49,"MEMBER":50,"SEPARATOR":51,"relation":52,"STR":53,"relationType":54,"lineType":55,"AGGREGATION":56,"EXTENSION":57,"COMPOSITION":58,"DEPENDENCY":59,"LINE":60,"DOTTED_LINE":61,"CALLBACK":62,"LINK":63,"LINK_TARGET":64,"CLICK":65,"CALLBACK_NAME":66,"CALLBACK_ARGS":67,"HREF":68,"CSSCLASS":69,"commentToken":70,"textToken":71,"graphCodeTokens":72,"textNoTagsToken":73,"TAGSTART":74,"TAGEND":75,"==":76,"--":77,"PCT":78,"DEFAULT":79,"SPACE":80,"MINUS":81,"keywords":82,"UNICODE_TEXT":83,"NUM":84,"ALPHA":85,"BQUOTE_STR":86,"$accept":0,"$end":1}, +terminals_: {2:"error",5:"statments",8:"direction_tb",9:"direction_bt",10:"direction_rl",11:"direction_lr",16:"NEWLINE",17:":",19:"open_directive",20:"type_directive",21:"arg_directive",22:"close_directive",23:"CLASS_DIAGRAM",25:"EOF",30:"GENERICTYPE",32:"LABEL",38:"acc_title",39:"acc_title_value",40:"acc_descr",41:"acc_descr_value",42:"acc_descr_multiline_value",43:"CLASS",44:"STYLE_SEPARATOR",45:"STRUCT_START",47:"STRUCT_STOP",48:"ANNOTATION_START",49:"ANNOTATION_END",50:"MEMBER",51:"SEPARATOR",53:"STR",56:"AGGREGATION",57:"EXTENSION",58:"COMPOSITION",59:"DEPENDENCY",60:"LINE",61:"DOTTED_LINE",62:"CALLBACK",63:"LINK",64:"LINK_TARGET",65:"CLICK",66:"CALLBACK_NAME",67:"CALLBACK_ARGS",68:"HREF",69:"CSSCLASS",72:"graphCodeTokens",74:"TAGSTART",75:"TAGEND",76:"==",77:"--",78:"PCT",79:"DEFAULT",80:"SPACE",81:"MINUS",82:"keywords",83:"UNICODE_TEXT",84:"NUM",85:"ALPHA",86:"BQUOTE_STR"}, +productions_: [0,[3,1],[3,1],[3,1],[3,2],[6,1],[6,1],[6,1],[6,1],[4,1],[7,4],[7,6],[13,1],[14,1],[18,1],[15,1],[12,4],[24,1],[24,2],[24,3],[27,1],[27,1],[27,2],[27,2],[27,2],[26,1],[26,2],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,2],[26,2],[26,1],[33,2],[33,4],[33,5],[33,7],[35,4],[46,1],[46,2],[34,1],[34,2],[34,1],[34,1],[31,3],[31,4],[31,4],[31,5],[52,3],[52,2],[52,2],[52,1],[54,1],[54,1],[54,1],[54,1],[55,1],[55,1],[36,3],[36,4],[36,3],[36,4],[36,4],[36,5],[36,3],[36,4],[36,4],[36,5],[36,3],[36,4],[36,4],[36,5],[37,3],[70,1],[70,1],[71,1],[71,1],[71,1],[71,1],[71,1],[71,1],[71,1],[73,1],[73,1],[73,1],[73,1],[28,1],[28,1],[28,1],[29,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 5: + yy.setDirection('TB'); +break; +case 6: + yy.setDirection('BT'); +break; +case 7: + yy.setDirection('RL'); +break; +case 8: + yy.setDirection('LR'); +break; +case 12: + yy.parseDirective('%%{', 'open_directive'); +break; +case 13: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 14: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 15: + yy.parseDirective('}%%', 'close_directive', 'class'); +break; +case 20: case 21: + this.$=$$[$0]; +break; +case 22: + this.$=$$[$0-1]+$$[$0]; +break; +case 23: case 24: + this.$=$$[$0-1]+'~'+$$[$0]; +break; +case 25: + yy.addRelation($$[$0]); +break; +case 26: + $$[$0-1].title = yy.cleanupLabel($$[$0]); yy.addRelation($$[$0-1]); +break; +case 34: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 35: case 36: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 37: +yy.addClass($$[$0]); +break; +case 38: +yy.addClass($$[$0-2]);yy.setCssClass($$[$0-2], $$[$0]); +break; +case 39: +/*console.log($$[$0-3],JSON.stringify($$[$0-1]));*/yy.addClass($$[$0-3]);yy.addMembers($$[$0-3],$$[$0-1]); +break; +case 40: +yy.addClass($$[$0-5]);yy.setCssClass($$[$0-5], $$[$0-3]);yy.addMembers($$[$0-5],$$[$0-1]); +break; +case 41: + yy.addAnnotation($$[$0],$$[$0-2]); +break; +case 42: + this.$ = [$$[$0]]; +break; +case 43: + $$[$0].push($$[$0-1]);this.$=$$[$0]; +break; +case 44: +/*console.log('Rel found',$$[$0]);*/ +break; +case 45: +yy.addMember($$[$0-1],yy.cleanupLabel($$[$0])); +break; +case 46: +/*console.warn('Member',$$[$0]);*/ +break; +case 47: +/*console.log('sep found',$$[$0]);*/ +break; +case 48: + this.$ = {'id1':$$[$0-2],'id2':$$[$0], relation:$$[$0-1], relationTitle1:'none', relationTitle2:'none'}; +break; +case 49: + this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-1], relationTitle1:$$[$0-2], relationTitle2:'none'} +break; +case 50: + this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-2], relationTitle1:'none', relationTitle2:$$[$0-1]}; +break; +case 51: + this.$ = {id1:$$[$0-4], id2:$$[$0], relation:$$[$0-2], relationTitle1:$$[$0-3], relationTitle2:$$[$0-1]} +break; +case 52: + this.$={type1:$$[$0-2],type2:$$[$0],lineType:$$[$0-1]}; +break; +case 53: + this.$={type1:'none',type2:$$[$0],lineType:$$[$0-1]}; +break; +case 54: + this.$={type1:$$[$0-1],type2:'none',lineType:$$[$0]}; +break; +case 55: + this.$={type1:'none',type2:'none',lineType:$$[$0]}; +break; +case 56: + this.$=yy.relationType.AGGREGATION; +break; +case 57: + this.$=yy.relationType.EXTENSION; +break; +case 58: + this.$=yy.relationType.COMPOSITION; +break; +case 59: + this.$=yy.relationType.DEPENDENCY; +break; +case 60: +this.$=yy.lineType.LINE; +break; +case 61: +this.$=yy.lineType.DOTTED_LINE; +break; +case 62: case 68: +this.$ = $$[$0-2];yy.setClickEvent($$[$0-1], $$[$0]); +break; +case 63: case 69: +this.$ = $$[$0-3];yy.setClickEvent($$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-2], $$[$0]); +break; +case 64: case 72: +this.$ = $$[$0-2];yy.setLink($$[$0-1], $$[$0]); +break; +case 65: +this.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1],$$[$0]); +break; +case 66: case 74: +this.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-2], $$[$0]); +break; +case 67: case 75: +this.$ = $$[$0-4];yy.setLink($$[$0-3], $$[$0-2], $$[$0]);yy.setTooltip($$[$0-3], $$[$0-1]); +break; +case 70: +this.$ = $$[$0-3];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]); +break; +case 71: +this.$ = $$[$0-4];yy.setClickEvent($$[$0-3], $$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-3], $$[$0]); +break; +case 73: +this.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1], $$[$0]); +break; +case 76: +yy.setCssClass($$[$0-1], $$[$0]); +break; +} +}, +table: [{3:1,4:2,5:$V0,6:4,7:5,8:$V1,9:$V2,10:$V3,11:$V4,12:6,13:11,19:$V5,23:$V6},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{3:14,4:2,5:$V0,6:4,7:5,8:$V1,9:$V2,10:$V3,11:$V4,12:6,13:11,19:$V5,23:$V6},{1:[2,9]},o($V7,[2,5]),o($V7,[2,6]),o($V7,[2,7]),o($V7,[2,8]),{14:15,20:[1,16]},{16:[1,17]},{20:[2,12]},{1:[2,4]},{15:18,17:[1,19],22:$V8},o([17,22],[2,13]),{6:30,7:29,8:$V1,9:$V2,10:$V3,11:$V4,13:11,19:$V5,24:21,26:22,27:34,28:43,29:44,31:23,33:24,34:25,35:26,36:27,37:28,38:$V9,40:$Va,42:$Vb,43:$Vc,48:$Vd,50:$Ve,51:$Vf,62:$Vg,63:$Vh,65:$Vi,69:$Vj,83:$Vk,84:$Vl,85:$Vm,86:$Vn},{16:[1,49]},{18:50,21:[1,51]},{16:[2,15]},{25:[1,52]},{16:[1,53],25:[2,17]},o($Vo,[2,25],{32:[1,54]}),o($Vo,[2,27]),o($Vo,[2,28]),o($Vo,[2,29]),o($Vo,[2,30]),o($Vo,[2,31]),o($Vo,[2,32]),o($Vo,[2,33]),{39:[1,55]},{41:[1,56]},o($Vo,[2,36]),o($Vo,[2,44],{52:57,54:60,55:61,32:[1,59],53:[1,58],56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu}),{27:68,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},o($Vo,[2,46]),o($Vo,[2,47]),{28:69,83:$Vk,84:$Vl,85:$Vm},{27:70,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},{27:71,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},{27:72,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},{53:[1,73]},o($Vv,[2,20],{28:43,29:44,27:74,30:[1,75],83:$Vk,84:$Vl,85:$Vm,86:$Vn}),o($Vv,[2,21],{30:[1,76]}),o($Vw,[2,90]),o($Vw,[2,91]),o($Vw,[2,92]),o([16,25,30,32,44,45,53,56,57,58,59,60,61,66,68],[2,93]),o($Vx,[2,10]),{15:77,22:$V8},{22:[2,14]},{1:[2,16]},{6:30,7:29,8:$V1,9:$V2,10:$V3,11:$V4,13:11,19:$V5,24:78,25:[2,18],26:22,27:34,28:43,29:44,31:23,33:24,34:25,35:26,36:27,37:28,38:$V9,40:$Va,42:$Vb,43:$Vc,48:$Vd,50:$Ve,51:$Vf,62:$Vg,63:$Vh,65:$Vi,69:$Vj,83:$Vk,84:$Vl,85:$Vm,86:$Vn},o($Vo,[2,26]),o($Vo,[2,34]),o($Vo,[2,35]),{27:79,28:43,29:44,53:[1,80],83:$Vk,84:$Vl,85:$Vm,86:$Vn},{52:81,54:60,55:61,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu},o($Vo,[2,45]),{55:82,60:$Vt,61:$Vu},o($Vy,[2,55],{54:83,56:$Vp,57:$Vq,58:$Vr,59:$Vs}),o($Vz,[2,56]),o($Vz,[2,57]),o($Vz,[2,58]),o($Vz,[2,59]),o($VA,[2,60]),o($VA,[2,61]),o($Vo,[2,37],{44:[1,84],45:[1,85]}),{49:[1,86]},{53:[1,87]},{53:[1,88]},{66:[1,89],68:[1,90]},{28:91,83:$Vk,84:$Vl,85:$Vm},o($Vv,[2,22]),o($Vv,[2,23]),o($Vv,[2,24]),{16:[1,92]},{25:[2,19]},o($VB,[2,48]),{27:93,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},{27:94,28:43,29:44,53:[1,95],83:$Vk,84:$Vl,85:$Vm,86:$Vn},o($Vy,[2,54],{54:96,56:$Vp,57:$Vq,58:$Vr,59:$Vs}),o($Vy,[2,53]),{28:97,83:$Vk,84:$Vl,85:$Vm},{46:98,50:$VC},{27:100,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},o($Vo,[2,62],{53:[1,101]}),o($Vo,[2,64],{53:[1,103],64:[1,102]}),o($Vo,[2,68],{53:[1,104],67:[1,105]}),o($Vo,[2,72],{53:[1,107],64:[1,106]}),o($Vo,[2,76]),o($Vx,[2,11]),o($VB,[2,50]),o($VB,[2,49]),{27:108,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},o($Vy,[2,52]),o($Vo,[2,38],{45:[1,109]}),{47:[1,110]},{46:111,47:[2,42],50:$VC},o($Vo,[2,41]),o($Vo,[2,63]),o($Vo,[2,65]),o($Vo,[2,66],{64:[1,112]}),o($Vo,[2,69]),o($Vo,[2,70],{53:[1,113]}),o($Vo,[2,73]),o($Vo,[2,74],{64:[1,114]}),o($VB,[2,51]),{46:115,50:$VC},o($Vo,[2,39]),{47:[2,43]},o($Vo,[2,67]),o($Vo,[2,71]),o($Vo,[2,75]),{47:[1,116]},o($Vo,[2,40])], +defaultActions: {2:[2,1],3:[2,2],4:[2,3],6:[2,9],13:[2,12],14:[2,4],20:[2,15],51:[2,14],52:[2,16],78:[2,19],111:[2,43]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 19; +break; +case 1:return 8; +break; +case 2:return 9; +break; +case 3:return 10; +break; +case 4:return 11; +break; +case 5: this.begin('type_directive'); return 20; +break; +case 6: this.popState(); this.begin('arg_directive'); return 17; +break; +case 7: this.popState(); this.popState(); return 22; +break; +case 8:return 21; +break; +case 9:/* skip comments */ +break; +case 10:/* skip comments */ +break; +case 11: this.begin("acc_title");return 38; +break; +case 12: this.popState(); return "acc_title_value"; +break; +case 13: this.begin("acc_descr");return 40; +break; +case 14: this.popState(); return "acc_descr_value"; +break; +case 15: this.begin("acc_descr_multiline"); +break; +case 16: this.popState(); +break; +case 17:return "acc_descr_multiline_value"; +break; +case 18:return 16; +break; +case 19:/* skip whitespace */ +break; +case 20:return 23; +break; +case 21:return 23; +break; +case 22: this.begin("struct"); /*console.log('Starting struct');*/ return 45; +break; +case 23:return "EOF_IN_STRUCT"; +break; +case 24:return "OPEN_IN_STRUCT"; +break; +case 25: /*console.log('Ending struct');*/this.popState(); return 47; +break; +case 26:/* nothing */ +break; +case 27: /*console.log('lex-member: ' + yy_.yytext);*/ return "MEMBER"; +break; +case 28:return 43; +break; +case 29:return 69; +break; +case 30:return 62; +break; +case 31:return 63; +break; +case 32:return 65; +break; +case 33:return 48; +break; +case 34:return 49; +break; +case 35:this.begin("generic"); +break; +case 36:this.popState(); +break; +case 37:return "GENERICTYPE"; +break; +case 38:this.begin("string"); +break; +case 39:this.popState(); +break; +case 40:return "STR"; +break; +case 41:this.begin("bqstring"); +break; +case 42:this.popState(); +break; +case 43:return "BQUOTE_STR"; +break; +case 44:this.begin("href"); +break; +case 45:this.popState(); +break; +case 46:return 68; +break; +case 47:this.begin("callback_name"); +break; +case 48:this.popState(); +break; +case 49:this.popState(); this.begin("callback_args"); +break; +case 50:return 66; +break; +case 51:this.popState(); +break; +case 52:return 67; +break; +case 53:return 64; +break; +case 54:return 64; +break; +case 55:return 64; +break; +case 56:return 64; +break; +case 57:return 57; +break; +case 58:return 57; +break; +case 59:return 59; +break; +case 60:return 59; +break; +case 61:return 58; +break; +case 62:return 56; +break; +case 63:return 60; +break; +case 64:return 61; +break; +case 65:return 32; +break; +case 66:return 44; +break; +case 67:return 81; +break; +case 68:return 'DOT'; +break; +case 69:return 'PLUS'; +break; +case 70:return 78; +break; +case 71:return 'EQUALS'; +break; +case 72:return 'EQUALS'; +break; +case 73:return 85; +break; +case 74:return 'PUNCTUATION'; +break; +case 75:return 84; +break; +case 76:return 83; +break; +case 77:return 80; +break; +case 78:return 25; +break; +} +}, +rules: [/^(?:%%\{)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:[{])/,/^(?:$)/,/^(?:[{])/,/^(?:[}])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:class\b)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:[~])/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[`])/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:$)/], +conditions: {"acc_descr_multiline":{"rules":[16,17],"inclusive":false},"acc_descr":{"rules":[14],"inclusive":false},"acc_title":{"rules":[12],"inclusive":false},"arg_directive":{"rules":[7,8],"inclusive":false},"type_directive":{"rules":[6,7],"inclusive":false},"open_directive":{"rules":[5],"inclusive":false},"callback_args":{"rules":[51,52],"inclusive":false},"callback_name":{"rules":[48,49,50],"inclusive":false},"href":{"rules":[45,46],"inclusive":false},"struct":{"rules":[23,24,25,26,27],"inclusive":false},"generic":{"rules":[36,37],"inclusive":false},"bqstring":{"rules":[42,43],"inclusive":false},"string":{"rules":[39,40],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,9,10,11,13,15,18,19,20,21,22,28,29,30,31,32,33,34,35,38,41,44,47,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?35ed").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/er/parser/erDiagram.jison": +/*!************************************************!*\ + !*** ./src/diagrams/er/parser/erDiagram.jison ***! + \************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,5],$V2=[6,9,11,23,25,27,29,30,49],$V3=[1,17],$V4=[1,18],$V5=[1,19],$V6=[1,20],$V7=[1,21],$V8=[1,24],$V9=[1,29],$Va=[1,30],$Vb=[1,31],$Vc=[1,32],$Vd=[6,9,11,15,20,23,25,27,29,30,42,43,44,45,49],$Ve=[1,45],$Vf=[30,46,47],$Vg=[4,6,9,11,23,25,27,29,30,49],$Vh=[42,43,44,45],$Vi=[22,37],$Vj=[1,64]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"ER_DIAGRAM":4,"document":5,"EOF":6,"directive":7,"line":8,"SPACE":9,"statement":10,"NEWLINE":11,"openDirective":12,"typeDirective":13,"closeDirective":14,":":15,"argDirective":16,"entityName":17,"relSpec":18,"role":19,"BLOCK_START":20,"attributes":21,"BLOCK_STOP":22,"title":23,"title_value":24,"acc_title":25,"acc_title_value":26,"acc_descr":27,"acc_descr_value":28,"acc_descr_multiline_value":29,"ALPHANUM":30,".":31,"attribute":32,"attributeType":33,"attributeName":34,"attributeKeyType":35,"attributeComment":36,"ATTRIBUTE_WORD":37,"ATTRIBUTE_KEY":38,"COMMENT":39,"cardinality":40,"relType":41,"ZERO_OR_ONE":42,"ZERO_OR_MORE":43,"ONE_OR_MORE":44,"ONLY_ONE":45,"NON_IDENTIFYING":46,"IDENTIFYING":47,"WORD":48,"open_directive":49,"type_directive":50,"arg_directive":51,"close_directive":52,"$accept":0,"$end":1}, +terminals_: {2:"error",4:"ER_DIAGRAM",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",20:"BLOCK_START",22:"BLOCK_STOP",23:"title",24:"title_value",25:"acc_title",26:"acc_title_value",27:"acc_descr",28:"acc_descr_value",29:"acc_descr_multiline_value",30:"ALPHANUM",31:".",37:"ATTRIBUTE_WORD",38:"ATTRIBUTE_KEY",39:"COMMENT",42:"ZERO_OR_ONE",43:"ZERO_OR_MORE",44:"ONE_OR_MORE",45:"ONLY_ONE",46:"NON_IDENTIFYING",47:"IDENTIFYING",48:"WORD",49:"open_directive",50:"type_directive",51:"arg_directive",52:"close_directive"}, +productions_: [0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,5],[10,4],[10,3],[10,1],[10,2],[10,2],[10,2],[10,1],[17,1],[17,3],[21,1],[21,2],[32,2],[32,3],[32,3],[32,4],[33,1],[34,1],[35,1],[36,1],[18,3],[40,1],[40,1],[40,1],[40,1],[41,1],[41,1],[19,1],[19,1],[12,1],[13,1],[16,1],[14,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 1: + /*console.log('finished parsing');*/ +break; +case 3: + this.$ = [] +break; +case 4: +$$[$0-1].push($$[$0]);this.$ = $$[$0-1] +break; +case 5: case 6: + this.$ = $$[$0] +break; +case 7: case 8: + this.$=[]; +break; +case 12: + + yy.addEntity($$[$0-4]); + yy.addEntity($$[$0-2]); + yy.addRelationship($$[$0-4], $$[$0], $$[$0-2], $$[$0-3]); + /*console.log($$[$0-4] + $$[$0-3] + $$[$0-2] + ':' + $$[$0]);*/ + +break; +case 13: + + /* console.log('detected block'); */ + yy.addEntity($$[$0-3]); + yy.addAttributes($$[$0-3], $$[$0-1]); + /* console.log('handled block'); */ + +break; +case 14: + yy.addEntity($$[$0-2]); +break; +case 15: + yy.addEntity($$[$0]); +break; +case 16: case 17: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 18: case 19: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 20: + this.$ = $$[$0]; /*console.log('Entity: ' + $$[$0]);*/ +break; +case 21: + this.$ = $$[$0-2] + $$[$0-1] + $$[$0]; +break; +case 22: + this.$ = [$$[$0]]; +break; +case 23: + $$[$0].push($$[$0-1]); this.$=$$[$0]; +break; +case 24: + this.$ = { attributeType: $$[$0-1], attributeName: $$[$0] }; +break; +case 25: + this.$ = { attributeType: $$[$0-2], attributeName: $$[$0-1], attributeKeyType: $$[$0] }; +break; +case 26: + this.$ = { attributeType: $$[$0-2], attributeName: $$[$0-1], attributeComment: $$[$0] }; +break; +case 27: + this.$ = { attributeType: $$[$0-3], attributeName: $$[$0-2], attributeKeyType: $$[$0-1], attributeComment: $$[$0] }; +break; +case 28: case 29: case 30: + this.$=$$[$0]; +break; +case 31: + this.$=$$[$0].replace(/"/g, ''); +break; +case 32: + + this.$ = { cardA: $$[$0], relType: $$[$0-1], cardB: $$[$0-2] }; + /*console.log('relSpec: ' + $$[$0] + $$[$0-1] + $$[$0-2]);*/ + +break; +case 33: + this.$ = yy.Cardinality.ZERO_OR_ONE; +break; +case 34: + this.$ = yy.Cardinality.ZERO_OR_MORE; +break; +case 35: + this.$ = yy.Cardinality.ONE_OR_MORE; +break; +case 36: + this.$ = yy.Cardinality.ONLY_ONE; +break; +case 37: + this.$ = yy.Identification.NON_IDENTIFYING; +break; +case 38: + this.$ = yy.Identification.IDENTIFYING; +break; +case 39: + this.$ = $$[$0].replace(/"/g, ''); +break; +case 40: + this.$ = $$[$0]; +break; +case 41: + yy.parseDirective('%%{', 'open_directive'); +break; +case 42: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 43: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 44: + yy.parseDirective('}%%', 'close_directive', 'er'); +break; +} +}, +table: [{3:1,4:$V0,7:3,12:4,49:$V1},{1:[3]},o($V2,[2,3],{5:6}),{3:7,4:$V0,7:3,12:4,49:$V1},{13:8,50:[1,9]},{50:[2,41]},{6:[1,10],7:15,8:11,9:[1,12],10:13,11:[1,14],12:4,17:16,23:$V3,25:$V4,27:$V5,29:$V6,30:$V7,49:$V1},{1:[2,2]},{14:22,15:[1,23],52:$V8},o([15,52],[2,42]),o($V2,[2,8],{1:[2,1]}),o($V2,[2,4]),{7:15,10:25,12:4,17:16,23:$V3,25:$V4,27:$V5,29:$V6,30:$V7,49:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,11]),o($V2,[2,15],{18:26,40:28,20:[1,27],42:$V9,43:$Va,44:$Vb,45:$Vc}),{24:[1,33]},{26:[1,34]},{28:[1,35]},o($V2,[2,19]),o($Vd,[2,20],{31:[1,36]}),{11:[1,37]},{16:38,51:[1,39]},{11:[2,44]},o($V2,[2,5]),{17:40,30:$V7},{21:41,22:[1,42],32:43,33:44,37:$Ve},{41:46,46:[1,47],47:[1,48]},o($Vf,[2,33]),o($Vf,[2,34]),o($Vf,[2,35]),o($Vf,[2,36]),o($V2,[2,16]),o($V2,[2,17]),o($V2,[2,18]),{17:49,30:$V7},o($Vg,[2,9]),{14:50,52:$V8},{52:[2,43]},{15:[1,51]},{22:[1,52]},o($V2,[2,14]),{21:53,22:[2,22],32:43,33:44,37:$Ve},{34:54,37:[1,55]},{37:[2,28]},{40:56,42:$V9,43:$Va,44:$Vb,45:$Vc},o($Vh,[2,37]),o($Vh,[2,38]),o($Vd,[2,21]),{11:[1,57]},{19:58,30:[1,60],48:[1,59]},o($V2,[2,13]),{22:[2,23]},o($Vi,[2,24],{35:61,36:62,38:[1,63],39:$Vj}),o([22,37,38,39],[2,29]),{30:[2,32]},o($Vg,[2,10]),o($V2,[2,12]),o($V2,[2,39]),o($V2,[2,40]),o($Vi,[2,25],{36:65,39:$Vj}),o($Vi,[2,26]),o([22,37,39],[2,30]),o($Vi,[2,31]),o($Vi,[2,27])], +defaultActions: {5:[2,41],7:[2,2],24:[2,44],39:[2,43],45:[2,28],53:[2,23],56:[2,32]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin("acc_title");return 25; +break; +case 1: this.popState(); return "acc_title_value"; +break; +case 2: this.begin("acc_descr");return 27; +break; +case 3: this.popState(); return "acc_descr_value"; +break; +case 4: this.begin("acc_descr_multiline"); +break; +case 5: this.popState(); +break; +case 6:return "acc_descr_multiline_value"; +break; +case 7: this.begin('open_directive'); return 49; +break; +case 8: this.begin('type_directive'); return 50; +break; +case 9: this.popState(); this.begin('arg_directive'); return 15; +break; +case 10: this.popState(); this.popState(); return 52; +break; +case 11:return 51; +break; +case 12:/* skip comments */ +break; +case 13:/* skip comments */ +break; +case 14:return 11; +break; +case 15:/* skip whitespace */ +break; +case 16:return 9; +break; +case 17:return 48; +break; +case 18:return 4; +break; +case 19: this.begin("block"); return 20; +break; +case 20:/* skip whitespace in block */ +break; +case 21:return 38 +break; +case 22:return 37 +break; +case 23:return 39; +break; +case 24:/* nothing */ +break; +case 25: this.popState(); return 22; +break; +case 26:return yy_.yytext[0]; +break; +case 27:return 42; +break; +case 28:return 43; +break; +case 29:return 44; +break; +case 30:return 45; +break; +case 31:return 42; +break; +case 32:return 43; +break; +case 33:return 44; +break; +case 34:return 46; +break; +case 35:return 47; +break; +case 36:return 46; +break; +case 37:return 46; +break; +case 38:return 30; +break; +case 39:return yy_.yytext[0]; +break; +case 40:return 6; +break; +} +}, +rules: [/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK))\b)/i,/^(?:[A-Za-z][A-Za-z0-9\-_]*)/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\|o\b)/i,/^(?:\}o\b)/i,/^(?:\}\|)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:[A-Za-z][A-Za-z0-9\-_]*)/i,/^(?:.)/i,/^(?:$)/i], +conditions: {"acc_descr_multiline":{"rules":[5,6],"inclusive":false},"acc_descr":{"rules":[3],"inclusive":false},"acc_title":{"rules":[1],"inclusive":false},"open_directive":{"rules":[8],"inclusive":false},"type_directive":{"rules":[9,10],"inclusive":false},"arg_directive":{"rules":[10,11],"inclusive":false},"block":{"rules":[20,21,22,23,24,25,26],"inclusive":false},"INITIAL":{"rules":[0,2,4,7,12,13,14,15,16,17,18,19,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?3c87").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/flowchart/parser/flow.jison": +/*!**************************************************!*\ + !*** ./src/diagrams/flowchart/parser/flow.jison ***! + \**************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,9],$V1=[1,7],$V2=[1,6],$V3=[1,8],$V4=[1,20,21,22,23,38,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],$V5=[2,10],$V6=[1,20],$V7=[1,21],$V8=[1,22],$V9=[1,23],$Va=[1,30],$Vb=[1,32],$Vc=[1,33],$Vd=[1,34],$Ve=[1,62],$Vf=[1,48],$Vg=[1,52],$Vh=[1,36],$Vi=[1,37],$Vj=[1,38],$Vk=[1,39],$Vl=[1,40],$Vm=[1,56],$Vn=[1,63],$Vo=[1,51],$Vp=[1,53],$Vq=[1,55],$Vr=[1,59],$Vs=[1,60],$Vt=[1,41],$Vu=[1,42],$Vv=[1,43],$Vw=[1,44],$Vx=[1,61],$Vy=[1,50],$Vz=[1,54],$VA=[1,57],$VB=[1,58],$VC=[1,49],$VD=[1,66],$VE=[1,71],$VF=[1,20,21,22,23,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],$VG=[1,75],$VH=[1,74],$VI=[1,76],$VJ=[20,21,23,81,82],$VK=[1,99],$VL=[1,104],$VM=[1,107],$VN=[1,108],$VO=[1,101],$VP=[1,106],$VQ=[1,109],$VR=[1,102],$VS=[1,114],$VT=[1,113],$VU=[1,103],$VV=[1,105],$VW=[1,110],$VX=[1,111],$VY=[1,112],$VZ=[1,115],$V_=[20,21,22,23,81,82],$V$=[20,21,22,23,53,81,82],$V01=[20,21,22,23,40,52,53,55,57,59,61,63,65,66,67,69,71,73,74,76,81,82,91,95,105,106,109,111,112,122,123,124,125,126,127],$V11=[20,21,23],$V21=[20,21,23,52,66,67,81,82,91,95,105,106,109,111,112,122,123,124,125,126,127],$V31=[1,12,20,21,22,23,24,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],$V41=[52,66,67,91,95,105,106,109,111,112,122,123,124,125,126,127],$V51=[1,149],$V61=[1,157],$V71=[1,158],$V81=[1,159],$V91=[1,160],$Va1=[1,144],$Vb1=[1,145],$Vc1=[1,141],$Vd1=[1,152],$Ve1=[1,153],$Vf1=[1,154],$Vg1=[1,155],$Vh1=[1,156],$Vi1=[1,161],$Vj1=[1,162],$Vk1=[1,147],$Vl1=[1,150],$Vm1=[1,146],$Vn1=[1,143],$Vo1=[20,21,22,23,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],$Vp1=[1,165],$Vq1=[20,21,22,23,26,52,66,67,91,105,106,109,111,112,122,123,124,125,126,127],$Vr1=[20,21,22,23,24,26,38,40,41,42,52,56,58,60,62,64,66,67,68,70,72,73,75,77,81,82,86,87,88,89,90,91,92,95,105,106,109,111,112,113,114,122,123,124,125,126,127],$Vs1=[12,21,22,24],$Vt1=[22,106],$Vu1=[1,250],$Vv1=[1,245],$Vw1=[1,246],$Vx1=[1,254],$Vy1=[1,251],$Vz1=[1,248],$VA1=[1,247],$VB1=[1,249],$VC1=[1,252],$VD1=[1,253],$VE1=[1,255],$VF1=[1,273],$VG1=[20,21,23,106],$VH1=[20,21,22,23,66,67,86,102,105,106,109,110,111,112,113]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"mermaidDoc":4,"directive":5,"openDirective":6,"typeDirective":7,"closeDirective":8,"separator":9,":":10,"argDirective":11,"open_directive":12,"type_directive":13,"arg_directive":14,"close_directive":15,"graphConfig":16,"document":17,"line":18,"statement":19,"SEMI":20,"NEWLINE":21,"SPACE":22,"EOF":23,"GRAPH":24,"NODIR":25,"DIR":26,"FirstStmtSeperator":27,"ending":28,"endToken":29,"spaceList":30,"spaceListNewline":31,"verticeStatement":32,"styleStatement":33,"linkStyleStatement":34,"classDefStatement":35,"classStatement":36,"clickStatement":37,"subgraph":38,"text":39,"SQS":40,"SQE":41,"end":42,"direction":43,"acc_title":44,"acc_title_value":45,"acc_descr":46,"acc_descr_value":47,"acc_descr_multiline_value":48,"link":49,"node":50,"vertex":51,"AMP":52,"STYLE_SEPARATOR":53,"idString":54,"DOUBLECIRCLESTART":55,"DOUBLECIRCLEEND":56,"PS":57,"PE":58,"(-":59,"-)":60,"STADIUMSTART":61,"STADIUMEND":62,"SUBROUTINESTART":63,"SUBROUTINEEND":64,"VERTEX_WITH_PROPS_START":65,"ALPHA":66,"COLON":67,"PIPE":68,"CYLINDERSTART":69,"CYLINDEREND":70,"DIAMOND_START":71,"DIAMOND_STOP":72,"TAGEND":73,"TRAPSTART":74,"TRAPEND":75,"INVTRAPSTART":76,"INVTRAPEND":77,"linkStatement":78,"arrowText":79,"TESTSTR":80,"START_LINK":81,"LINK":82,"textToken":83,"STR":84,"keywords":85,"STYLE":86,"LINKSTYLE":87,"CLASSDEF":88,"CLASS":89,"CLICK":90,"DOWN":91,"UP":92,"textNoTags":93,"textNoTagsToken":94,"DEFAULT":95,"stylesOpt":96,"alphaNum":97,"CALLBACKNAME":98,"CALLBACKARGS":99,"HREF":100,"LINK_TARGET":101,"HEX":102,"numList":103,"INTERPOLATE":104,"NUM":105,"COMMA":106,"style":107,"styleComponent":108,"MINUS":109,"UNIT":110,"BRKT":111,"DOT":112,"PCT":113,"TAGSTART":114,"alphaNumToken":115,"idStringToken":116,"alphaNumStatement":117,"direction_tb":118,"direction_bt":119,"direction_rl":120,"direction_lr":121,"PUNCTUATION":122,"UNICODE_TEXT":123,"PLUS":124,"EQUALS":125,"MULT":126,"UNDERSCORE":127,"graphCodeTokens":128,"ARROW_CROSS":129,"ARROW_POINT":130,"ARROW_CIRCLE":131,"ARROW_OPEN":132,"QUOTE":133,"$accept":0,"$end":1}, +terminals_: {2:"error",10:":",12:"open_directive",13:"type_directive",14:"arg_directive",15:"close_directive",20:"SEMI",21:"NEWLINE",22:"SPACE",23:"EOF",24:"GRAPH",25:"NODIR",26:"DIR",38:"subgraph",40:"SQS",41:"SQE",42:"end",44:"acc_title",45:"acc_title_value",46:"acc_descr",47:"acc_descr_value",48:"acc_descr_multiline_value",52:"AMP",53:"STYLE_SEPARATOR",55:"DOUBLECIRCLESTART",56:"DOUBLECIRCLEEND",57:"PS",58:"PE",59:"(-",60:"-)",61:"STADIUMSTART",62:"STADIUMEND",63:"SUBROUTINESTART",64:"SUBROUTINEEND",65:"VERTEX_WITH_PROPS_START",66:"ALPHA",67:"COLON",68:"PIPE",69:"CYLINDERSTART",70:"CYLINDEREND",71:"DIAMOND_START",72:"DIAMOND_STOP",73:"TAGEND",74:"TRAPSTART",75:"TRAPEND",76:"INVTRAPSTART",77:"INVTRAPEND",80:"TESTSTR",81:"START_LINK",82:"LINK",84:"STR",86:"STYLE",87:"LINKSTYLE",88:"CLASSDEF",89:"CLASS",90:"CLICK",91:"DOWN",92:"UP",95:"DEFAULT",98:"CALLBACKNAME",99:"CALLBACKARGS",100:"HREF",101:"LINK_TARGET",102:"HEX",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"MINUS",110:"UNIT",111:"BRKT",112:"DOT",113:"PCT",114:"TAGSTART",118:"direction_tb",119:"direction_bt",120:"direction_rl",121:"direction_lr",122:"PUNCTUATION",123:"UNICODE_TEXT",124:"PLUS",125:"EQUALS",126:"MULT",127:"UNDERSCORE",129:"ARROW_CROSS",130:"ARROW_POINT",131:"ARROW_CIRCLE",132:"ARROW_OPEN",133:"QUOTE"}, +productions_: [0,[3,1],[3,2],[5,4],[5,6],[6,1],[7,1],[11,1],[8,1],[4,2],[17,0],[17,2],[18,1],[18,1],[18,1],[18,1],[18,1],[16,2],[16,2],[16,2],[16,3],[28,2],[28,1],[29,1],[29,1],[29,1],[27,1],[27,1],[27,2],[31,2],[31,2],[31,1],[31,1],[30,2],[30,1],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,9],[19,6],[19,4],[19,1],[19,2],[19,2],[19,1],[9,1],[9,1],[9,1],[32,3],[32,4],[32,2],[32,1],[50,1],[50,5],[50,3],[51,4],[51,4],[51,6],[51,4],[51,4],[51,4],[51,8],[51,4],[51,4],[51,4],[51,6],[51,4],[51,4],[51,4],[51,4],[51,4],[51,1],[49,2],[49,3],[49,3],[49,1],[49,3],[78,1],[79,3],[39,1],[39,2],[39,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[93,1],[93,2],[35,5],[35,5],[36,5],[37,2],[37,4],[37,3],[37,5],[37,2],[37,4],[37,4],[37,6],[37,2],[37,4],[37,2],[37,4],[37,4],[37,6],[33,5],[33,5],[34,5],[34,5],[34,9],[34,9],[34,7],[34,7],[103,1],[103,3],[96,1],[96,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[94,1],[94,1],[94,1],[94,1],[54,1],[54,2],[97,1],[97,2],[117,1],[117,1],[117,1],[117,1],[43,1],[43,1],[43,1],[43,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 5: + yy.parseDirective('%%{', 'open_directive'); +break; +case 6: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 7: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 8: + yy.parseDirective('}%%', 'close_directive', 'flowchart'); +break; +case 10: + this.$ = []; +break; +case 11: + + if($$[$0] !== []){ + $$[$0-1].push($$[$0]); + } + this.$=$$[$0-1]; +break; +case 12: case 82: case 84: case 96: case 152: case 154: case 155: +this.$=$$[$0]; +break; +case 19: + yy.setDirection('TB');this.$ = 'TB'; +break; +case 20: + yy.setDirection($$[$0-1]);this.$ = $$[$0-1]; +break; +case 35: + /* console.warn('finat vs', $$[$0-1].nodes); */ this.$=$$[$0-1].nodes +break; +case 36: case 37: case 38: case 39: case 40: +this.$=[]; +break; +case 41: +this.$=yy.addSubGraph($$[$0-6],$$[$0-1],$$[$0-4]); +break; +case 42: +this.$=yy.addSubGraph($$[$0-3],$$[$0-1],$$[$0-3]); +break; +case 43: +this.$=yy.addSubGraph(undefined,$$[$0-1],undefined); +break; +case 45: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 46: case 47: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 51: + /* console.warn('vs',$$[$0-2].stmt,$$[$0]); */ yy.addLink($$[$0-2].stmt,$$[$0],$$[$0-1]); this.$ = { stmt: $$[$0], nodes: $$[$0].concat($$[$0-2].nodes) } +break; +case 52: + /* console.warn('vs',$$[$0-3].stmt,$$[$0-1]); */ yy.addLink($$[$0-3].stmt,$$[$0-1],$$[$0-2]); this.$ = { stmt: $$[$0-1], nodes: $$[$0-1].concat($$[$0-3].nodes) } +break; +case 53: +/*console.warn('noda', $$[$0-1]);*/ this.$ = {stmt: $$[$0-1], nodes:$$[$0-1] } +break; +case 54: + /*console.warn('noda', $$[$0]);*/ this.$ = {stmt: $$[$0], nodes:$$[$0] } +break; +case 55: + /* console.warn('nod', $$[$0]); */ this.$ = [$$[$0]]; +break; +case 56: + this.$ = $$[$0-4].concat($$[$0]); /* console.warn('pip', $$[$0-4][0], $$[$0], this.$); */ +break; +case 57: +this.$ = [$$[$0-2]];yy.setClass($$[$0-2],$$[$0]) +break; +case 58: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'square'); +break; +case 59: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'doublecircle'); +break; +case 60: +this.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'circle'); +break; +case 61: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'ellipse'); +break; +case 62: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'stadium'); +break; +case 63: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'subroutine'); +break; +case 64: +this.$ = $$[$0-7];yy.addVertex($$[$0-7],$$[$0-1],'rect',undefined,undefined,undefined, Object.fromEntries([[$$[$0-5], $$[$0-3]]])); +break; +case 65: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'cylinder'); +break; +case 66: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'round'); +break; +case 67: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'diamond'); +break; +case 68: +this.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'hexagon'); +break; +case 69: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'odd'); +break; +case 70: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'trapezoid'); +break; +case 71: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'inv_trapezoid'); +break; +case 72: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_right'); +break; +case 73: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_left'); +break; +case 74: + /*console.warn('h: ', $$[$0]);*/this.$ = $$[$0];yy.addVertex($$[$0]); +break; +case 75: +$$[$0-1].text = $$[$0];this.$ = $$[$0-1]; +break; +case 76: case 77: +$$[$0-2].text = $$[$0-1];this.$ = $$[$0-2]; +break; +case 78: +this.$ = $$[$0]; +break; +case 79: +var inf = yy.destructLink($$[$0], $$[$0-2]); this.$ = {"type":inf.type,"stroke":inf.stroke,"length":inf.length,"text":$$[$0-1]}; +break; +case 80: +var inf = yy.destructLink($$[$0]);this.$ = {"type":inf.type,"stroke":inf.stroke,"length":inf.length}; +break; +case 81: +this.$ = $$[$0-1]; +break; +case 83: case 97: case 153: +this.$=$$[$0-1]+''+$$[$0]; +break; +case 98: case 99: +this.$ = $$[$0-4];yy.addClass($$[$0-2],$$[$0]); +break; +case 100: +this.$ = $$[$0-4];yy.setClass($$[$0-2], $$[$0]); +break; +case 101: case 109: +this.$ = $$[$0-1];yy.setClickEvent($$[$0-1], $$[$0]); +break; +case 102: case 110: +this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-3], $$[$0]); +break; +case 103: +this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]); +break; +case 104: +this.$ = $$[$0-4];yy.setClickEvent($$[$0-4], $$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-4], $$[$0]); +break; +case 105: case 111: +this.$ = $$[$0-1];yy.setLink($$[$0-1], $$[$0]); +break; +case 106: case 112: +this.$ = $$[$0-3];yy.setLink($$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-3], $$[$0]); +break; +case 107: case 113: +this.$ = $$[$0-3];yy.setLink($$[$0-3], $$[$0-2], $$[$0]); +break; +case 108: case 114: +this.$ = $$[$0-5];yy.setLink($$[$0-5], $$[$0-4], $$[$0]);yy.setTooltip($$[$0-5], $$[$0-2]); +break; +case 115: +this.$ = $$[$0-4];yy.addVertex($$[$0-2],undefined,undefined,$$[$0]); +break; +case 116: case 118: +this.$ = $$[$0-4];yy.updateLink($$[$0-2],$$[$0]); +break; +case 117: +this.$ = $$[$0-4];yy.updateLink([$$[$0-2]],$$[$0]); +break; +case 119: +this.$ = $$[$0-8];yy.updateLinkInterpolate([$$[$0-6]],$$[$0-2]);yy.updateLink([$$[$0-6]],$$[$0]); +break; +case 120: +this.$ = $$[$0-8];yy.updateLinkInterpolate($$[$0-6],$$[$0-2]);yy.updateLink($$[$0-6],$$[$0]); +break; +case 121: +this.$ = $$[$0-6];yy.updateLinkInterpolate([$$[$0-4]],$$[$0]); +break; +case 122: +this.$ = $$[$0-6];yy.updateLinkInterpolate($$[$0-4],$$[$0]); +break; +case 123: case 125: +this.$ = [$$[$0]] +break; +case 124: case 126: +$$[$0-2].push($$[$0]);this.$ = $$[$0-2]; +break; +case 128: +this.$ = $$[$0-1] + $$[$0]; +break; +case 150: +this.$=$$[$0] +break; +case 151: +this.$=$$[$0-1]+''+$$[$0] +break; +case 156: +this.$='v'; +break; +case 157: +this.$='-'; +break; +case 158: + this.$={stmt:'dir', value:'TB'}; +break; +case 159: + this.$={stmt:'dir', value:'BT'}; +break; +case 160: + this.$={stmt:'dir', value:'RL'}; +break; +case 161: + this.$={stmt:'dir', value:'LR'}; +break; +} +}, +table: [{3:1,4:2,5:3,6:5,12:$V0,16:4,21:$V1,22:$V2,24:$V3},{1:[3]},{1:[2,1]},{3:10,4:2,5:3,6:5,12:$V0,16:4,21:$V1,22:$V2,24:$V3},o($V4,$V5,{17:11}),{7:12,13:[1,13]},{16:14,21:$V1,22:$V2,24:$V3},{16:15,21:$V1,22:$V2,24:$V3},{25:[1,16],26:[1,17]},{13:[2,5]},{1:[2,2]},{1:[2,9],18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,43:31,44:$Vb,46:$Vc,48:$Vd,50:35,51:45,52:$Ve,54:46,66:$Vf,67:$Vg,86:$Vh,87:$Vi,88:$Vj,89:$Vk,90:$Vl,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,118:$Vt,119:$Vu,120:$Vv,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},{8:64,10:[1,65],15:$VD},o([10,15],[2,6]),o($V4,[2,17]),o($V4,[2,18]),o($V4,[2,19]),{20:[1,68],21:[1,69],22:$VE,27:67,30:70},o($VF,[2,11]),o($VF,[2,12]),o($VF,[2,13]),o($VF,[2,14]),o($VF,[2,15]),o($VF,[2,16]),{9:72,20:$VG,21:$VH,23:$VI,49:73,78:77,81:[1,78],82:[1,79]},{9:80,20:$VG,21:$VH,23:$VI},{9:81,20:$VG,21:$VH,23:$VI},{9:82,20:$VG,21:$VH,23:$VI},{9:83,20:$VG,21:$VH,23:$VI},{9:84,20:$VG,21:$VH,23:$VI},{9:86,20:$VG,21:$VH,22:[1,85],23:$VI},o($VF,[2,44]),{45:[1,87]},{47:[1,88]},o($VF,[2,47]),o($VJ,[2,54],{30:89,22:$VE}),{22:[1,90]},{22:[1,91]},{22:[1,92]},{22:[1,93]},{26:$VK,52:$VL,66:$VM,67:$VN,84:[1,97],91:$VO,97:96,98:[1,94],100:[1,95],105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($VF,[2,158]),o($VF,[2,159]),o($VF,[2,160]),o($VF,[2,161]),o($V_,[2,55],{53:[1,116]}),o($V$,[2,74],{116:129,40:[1,117],52:$Ve,55:[1,118],57:[1,119],59:[1,120],61:[1,121],63:[1,122],65:[1,123],66:$Vf,67:$Vg,69:[1,124],71:[1,125],73:[1,126],74:[1,127],76:[1,128],91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC}),o($V01,[2,150]),o($V01,[2,175]),o($V01,[2,176]),o($V01,[2,177]),o($V01,[2,178]),o($V01,[2,179]),o($V01,[2,180]),o($V01,[2,181]),o($V01,[2,182]),o($V01,[2,183]),o($V01,[2,184]),o($V01,[2,185]),o($V01,[2,186]),o($V01,[2,187]),o($V01,[2,188]),o($V01,[2,189]),o($V01,[2,190]),{9:130,20:$VG,21:$VH,23:$VI},{11:131,14:[1,132]},o($V11,[2,8]),o($V4,[2,20]),o($V4,[2,26]),o($V4,[2,27]),{21:[1,133]},o($V21,[2,34],{30:134,22:$VE}),o($VF,[2,35]),{50:135,51:45,52:$Ve,54:46,66:$Vf,67:$Vg,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},o($V31,[2,48]),o($V31,[2,49]),o($V31,[2,50]),o($V41,[2,78],{79:136,68:[1,138],80:[1,137]}),{22:$V51,24:$V61,26:$V71,38:$V81,39:139,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o([52,66,67,68,80,91,95,105,106,109,111,112,122,123,124,125,126,127],[2,80]),o($VF,[2,36]),o($VF,[2,37]),o($VF,[2,38]),o($VF,[2,39]),o($VF,[2,40]),{22:$V51,24:$V61,26:$V71,38:$V81,39:163,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($Vo1,$V5,{17:164}),o($VF,[2,45]),o($VF,[2,46]),o($VJ,[2,53],{52:$Vp1}),{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,97:166,102:[1,167],105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{95:[1,168],103:169,105:[1,170]},{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,95:[1,171],97:172,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,97:173,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V11,[2,101],{22:[1,174],99:[1,175]}),o($V11,[2,105],{22:[1,176]}),o($V11,[2,109],{115:100,117:178,22:[1,177],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ}),o($V11,[2,111],{22:[1,179]}),o($Vq1,[2,152]),o($Vq1,[2,154]),o($Vq1,[2,155]),o($Vq1,[2,156]),o($Vq1,[2,157]),o($Vr1,[2,162]),o($Vr1,[2,163]),o($Vr1,[2,164]),o($Vr1,[2,165]),o($Vr1,[2,166]),o($Vr1,[2,167]),o($Vr1,[2,168]),o($Vr1,[2,169]),o($Vr1,[2,170]),o($Vr1,[2,171]),o($Vr1,[2,172]),o($Vr1,[2,173]),o($Vr1,[2,174]),{52:$Ve,54:180,66:$Vf,67:$Vg,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},{22:$V51,24:$V61,26:$V71,38:$V81,39:181,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:182,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:184,42:$V91,52:$VL,57:[1,183],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:185,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:186,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:187,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{66:[1,188]},{22:$V51,24:$V61,26:$V71,38:$V81,39:189,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:190,42:$V91,52:$VL,66:$VM,67:$VN,71:[1,191],73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:192,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:193,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:194,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V01,[2,151]),o($Vs1,[2,3]),{8:195,15:$VD},{15:[2,7]},o($V4,[2,28]),o($V21,[2,33]),o($VJ,[2,51],{30:196,22:$VE}),o($V41,[2,75],{22:[1,197]}),{22:[1,198]},{22:$V51,24:$V61,26:$V71,38:$V81,39:199,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,82:[1,200],83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($Vr1,[2,82]),o($Vr1,[2,84]),o($Vr1,[2,140]),o($Vr1,[2,141]),o($Vr1,[2,142]),o($Vr1,[2,143]),o($Vr1,[2,144]),o($Vr1,[2,145]),o($Vr1,[2,146]),o($Vr1,[2,147]),o($Vr1,[2,148]),o($Vr1,[2,149]),o($Vr1,[2,85]),o($Vr1,[2,86]),o($Vr1,[2,87]),o($Vr1,[2,88]),o($Vr1,[2,89]),o($Vr1,[2,90]),o($Vr1,[2,91]),o($Vr1,[2,92]),o($Vr1,[2,93]),o($Vr1,[2,94]),o($Vr1,[2,95]),{9:203,20:$VG,21:$VH,22:$V51,23:$VI,24:$V61,26:$V71,38:$V81,40:[1,202],42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,204],43:31,44:$Vb,46:$Vc,48:$Vd,50:35,51:45,52:$Ve,54:46,66:$Vf,67:$Vg,86:$Vh,87:$Vi,88:$Vj,89:$Vk,90:$Vl,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,118:$Vt,119:$Vu,120:$Vv,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},{22:$VE,30:205},{22:[1,206],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:178,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:[1,207]},{22:[1,208]},{22:[1,209],106:[1,210]},o($Vt1,[2,123]),{22:[1,211]},{22:[1,212],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:178,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:[1,213],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:178,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{84:[1,214]},o($V11,[2,103],{22:[1,215]}),{84:[1,216],101:[1,217]},{84:[1,218]},o($Vq1,[2,153]),{84:[1,219],101:[1,220]},o($V_,[2,57],{116:129,52:$Ve,66:$Vf,67:$Vg,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC}),{22:$V51,24:$V61,26:$V71,38:$V81,41:[1,221],42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,56:[1,222],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:223,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,58:[1,224],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,60:[1,225],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,62:[1,226],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,64:[1,227],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{67:[1,228]},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,70:[1,229],73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,72:[1,230],73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:231,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,41:[1,232],42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,75:[1,233],77:[1,234],81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,75:[1,236],77:[1,235],81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{9:237,20:$VG,21:$VH,23:$VI},o($VJ,[2,52],{52:$Vp1}),o($V41,[2,77]),o($V41,[2,76]),{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,68:[1,238],73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V41,[2,79]),o($Vr1,[2,83]),{22:$V51,24:$V61,26:$V71,38:$V81,39:239,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($Vo1,$V5,{17:240}),o($VF,[2,43]),{51:241,52:$Ve,54:46,66:$Vf,67:$Vg,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:242,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:256,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:257,102:$Vy1,104:[1,258],105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:259,102:$Vy1,104:[1,260],105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{105:[1,261]},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:262,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:263,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,97:264,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V11,[2,102]),{84:[1,265]},o($V11,[2,106],{22:[1,266]}),o($V11,[2,107]),o($V11,[2,110]),o($V11,[2,112],{22:[1,267]}),o($V11,[2,113]),o($V$,[2,58]),o($V$,[2,59]),{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,58:[1,268],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V$,[2,66]),o($V$,[2,61]),o($V$,[2,62]),o($V$,[2,63]),{66:[1,269]},o($V$,[2,65]),o($V$,[2,67]),{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,72:[1,270],73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V$,[2,69]),o($V$,[2,70]),o($V$,[2,72]),o($V$,[2,71]),o($V$,[2,73]),o($Vs1,[2,4]),o([22,52,66,67,91,95,105,106,109,111,112,122,123,124,125,126,127],[2,81]),{22:$V51,24:$V61,26:$V71,38:$V81,41:[1,271],42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,272],43:31,44:$Vb,46:$Vc,48:$Vd,50:35,51:45,52:$Ve,54:46,66:$Vf,67:$Vg,86:$Vh,87:$Vi,88:$Vj,89:$Vk,90:$Vl,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,118:$Vt,119:$Vu,120:$Vv,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},o($V_,[2,56]),o($V11,[2,115],{106:$VF1}),o($VG1,[2,125],{108:274,22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,102:$Vy1,105:$Vz1,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1}),o($VH1,[2,127]),o($VH1,[2,129]),o($VH1,[2,130]),o($VH1,[2,131]),o($VH1,[2,132]),o($VH1,[2,133]),o($VH1,[2,134]),o($VH1,[2,135]),o($VH1,[2,136]),o($VH1,[2,137]),o($VH1,[2,138]),o($VH1,[2,139]),o($V11,[2,116],{106:$VF1}),o($V11,[2,117],{106:$VF1}),{22:[1,275]},o($V11,[2,118],{106:$VF1}),{22:[1,276]},o($Vt1,[2,124]),o($V11,[2,98],{106:$VF1}),o($V11,[2,99],{106:$VF1}),o($V11,[2,100],{115:100,117:178,26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ}),o($V11,[2,104]),{101:[1,277]},{101:[1,278]},{58:[1,279]},{68:[1,280]},{72:[1,281]},{9:282,20:$VG,21:$VH,23:$VI},o($VF,[2,42]),{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,102:$Vy1,105:$Vz1,107:283,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},o($VH1,[2,128]),{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,97:284,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,97:285,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V11,[2,108]),o($V11,[2,114]),o($V$,[2,60]),{22:$V51,24:$V61,26:$V71,38:$V81,39:286,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V$,[2,68]),o($Vo1,$V5,{17:287}),o($VG1,[2,126],{108:274,22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,102:$Vy1,105:$Vz1,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1}),o($V11,[2,121],{115:100,117:178,22:[1,288],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ}),o($V11,[2,122],{115:100,117:178,22:[1,289],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ}),{22:$V51,24:$V61,26:$V71,38:$V81,41:[1,290],42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,291],43:31,44:$Vb,46:$Vc,48:$Vd,50:35,51:45,52:$Ve,54:46,66:$Vf,67:$Vg,86:$Vh,87:$Vi,88:$Vj,89:$Vk,90:$Vl,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,118:$Vt,119:$Vu,120:$Vv,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:292,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:293,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},o($V$,[2,64]),o($VF,[2,41]),o($V11,[2,119],{106:$VF1}),o($V11,[2,120],{106:$VF1})], +defaultActions: {2:[2,1],9:[2,5],10:[2,2],132:[2,7]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 12; +break; +case 1: this.begin('type_directive'); return 13; +break; +case 2: this.popState(); this.begin('arg_directive'); return 10; +break; +case 3: this.popState(); this.popState(); return 15; +break; +case 4:return 14; +break; +case 5:/* skip comments */ +break; +case 6:/* skip comments */ +break; +case 7: this.begin("acc_title");return 44; +break; +case 8: this.popState(); return "acc_title_value"; +break; +case 9: this.begin("acc_descr");return 46; +break; +case 10: this.popState(); return "acc_descr_value"; +break; +case 11: this.begin("acc_descr_multiline"); +break; +case 12: this.popState(); +break; +case 13:return "acc_descr_multiline_value"; +break; +case 14:this.begin("string"); +break; +case 15:this.popState(); +break; +case 16:return "STR"; +break; +case 17:return 86; +break; +case 18:return 95; +break; +case 19:return 87; +break; +case 20:return 104; +break; +case 21:return 88; +break; +case 22:return 89; +break; +case 23:this.begin("href"); +break; +case 24:this.popState(); +break; +case 25:return 100; +break; +case 26:this.begin("callbackname"); +break; +case 27:this.popState(); +break; +case 28:this.popState(); this.begin("callbackargs"); +break; +case 29:return 98; +break; +case 30:this.popState(); +break; +case 31:return 99; +break; +case 32:this.begin("click"); +break; +case 33:this.popState(); +break; +case 34:return 90; +break; +case 35:if(yy.lex.firstGraph()){this.begin("dir");} return 24; +break; +case 36:if(yy.lex.firstGraph()){this.begin("dir");} return 24; +break; +case 37:return 38; +break; +case 38:return 42; +break; +case 39:return 101; +break; +case 40:return 101; +break; +case 41:return 101; +break; +case 42:return 101; +break; +case 43: this.popState(); return 25; +break; +case 44: this.popState(); return 26; +break; +case 45: this.popState(); return 26; +break; +case 46: this.popState(); return 26; +break; +case 47: this.popState(); return 26; +break; +case 48: this.popState(); return 26; +break; +case 49: this.popState(); return 26; +break; +case 50: this.popState(); return 26; +break; +case 51: this.popState(); return 26; +break; +case 52: this.popState(); return 26; +break; +case 53: this.popState(); return 26; +break; +case 54:return 118; +break; +case 55:return 119; +break; +case 56:return 120; +break; +case 57:return 121; +break; +case 58: return 105; +break; +case 59:return 111; +break; +case 60:return 53; +break; +case 61:return 67; +break; +case 62:return 52; +break; +case 63:return 20; +break; +case 64:return 106; +break; +case 65:return 126; +break; +case 66:return 82; +break; +case 67:return 82; +break; +case 68:return 82; +break; +case 69:return 81; +break; +case 70:return 81; +break; +case 71:return 81; +break; +case 72:return 59; +break; +case 73:return 60; +break; +case 74:return 61; +break; +case 75:return 62; +break; +case 76:return 63; +break; +case 77:return 64; +break; +case 78:return 65; +break; +case 79:return 69; +break; +case 80:return 70; +break; +case 81:return 55; +break; +case 82:return 56; +break; +case 83:return 109; +break; +case 84:return 112; +break; +case 85:return 127; +break; +case 86:return 124; +break; +case 87:return 113; +break; +case 88:return 125; +break; +case 89:return 125; +break; +case 90:return 114; +break; +case 91:return 73; +break; +case 92:return 92; +break; +case 93:return 'SEP'; +break; +case 94:return 91; +break; +case 95:return 66; +break; +case 96:return 75; +break; +case 97:return 74; +break; +case 98:return 77; +break; +case 99:return 76; +break; +case 100:return 122; +break; +case 101:return 123; +break; +case 102:return 68; +break; +case 103:return 57; +break; +case 104:return 58; +break; +case 105:return 40; +break; +case 106:return 41; +break; +case 107:return 71 +break; +case 108:return 72 +break; +case 109:return 133; +break; +case 110:return 21; +break; +case 111:return 22; +break; +case 112:return 23; +break; +} +}, +rules: [/^(?:%%\{)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[^\}]%%[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:class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?:\\\])/,/^(?:\[\/)/,/^(?:\/\])/,/^(?:\[\\)/,/^(?:[!"#$%&'*+,-.`?\\_/])/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/], +conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"callbackargs":{"rules":[30,31],"inclusive":false},"callbackname":{"rules":[27,28,29],"inclusive":false},"href":{"rules":[24,25],"inclusive":false},"click":{"rules":[33,34],"inclusive":false},"vertex":{"rules":[],"inclusive":false},"dir":{"rules":[43,44,45,46,47,48,49,50,51,52,53],"inclusive":false},"acc_descr_multiline":{"rules":[12,13],"inclusive":false},"acc_descr":{"rules":[10],"inclusive":false},"acc_title":{"rules":[8],"inclusive":false},"string":{"rules":[15,16],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,9,11,14,17,18,19,20,21,22,23,26,32,35,36,37,38,39,40,41,42,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?dbae").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/gantt/parser/gantt.jison": +/*!***********************************************!*\ + !*** ./src/diagrams/gantt/parser/gantt.jison ***! + \***********************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,5],$V2=[7,9,11,12,13,14,15,16,17,18,19,20,22,24,25,27,34,39],$V3=[1,15],$V4=[1,16],$V5=[1,17],$V6=[1,18],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,23],$Vc=[1,24],$Vd=[1,25],$Ve=[1,26],$Vf=[1,28],$Vg=[1,30],$Vh=[1,33],$Vi=[5,7,9,11,12,13,14,15,16,17,18,19,20,22,24,25,27,34,39]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"directive":4,"gantt":5,"document":6,"EOF":7,"line":8,"SPACE":9,"statement":10,"NL":11,"dateFormat":12,"inclusiveEndDates":13,"topAxis":14,"axisFormat":15,"excludes":16,"includes":17,"todayMarker":18,"title":19,"acc_title":20,"acc_title_value":21,"acc_descr":22,"acc_descr_value":23,"acc_descr_multiline_value":24,"section":25,"clickStatement":26,"taskTxt":27,"taskData":28,"openDirective":29,"typeDirective":30,"closeDirective":31,":":32,"argDirective":33,"click":34,"callbackname":35,"callbackargs":36,"href":37,"clickStatementDebug":38,"open_directive":39,"type_directive":40,"arg_directive":41,"close_directive":42,"$accept":0,"$end":1}, +terminals_: {2:"error",5:"gantt",7:"EOF",9:"SPACE",11:"NL",12:"dateFormat",13:"inclusiveEndDates",14:"topAxis",15:"axisFormat",16:"excludes",17:"includes",18:"todayMarker",19:"title",20:"acc_title",21:"acc_title_value",22:"acc_descr",23:"acc_descr_value",24:"acc_descr_multiline_value",25:"section",27:"taskTxt",28:"taskData",32:":",34:"click",35:"callbackname",36:"callbackargs",37:"href",39:"open_directive",40:"type_directive",41:"arg_directive",42:"close_directive"}, +productions_: [0,[3,2],[3,3],[6,0],[6,2],[8,2],[8,1],[8,1],[8,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[10,1],[10,1],[10,2],[10,1],[4,4],[4,6],[26,2],[26,3],[26,3],[26,4],[26,3],[26,4],[26,2],[38,2],[38,3],[38,3],[38,4],[38,3],[38,4],[38,2],[29,1],[30,1],[33,1],[31,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 2: + return $$[$0-1]; +break; +case 3: + this.$ = [] +break; +case 4: +$$[$0-1].push($$[$0]);this.$ = $$[$0-1] +break; +case 5: case 6: + this.$ = $$[$0] +break; +case 7: case 8: + this.$=[]; +break; +case 9: +yy.setDateFormat($$[$0].substr(11));this.$=$$[$0].substr(11); +break; +case 10: +yy.enableInclusiveEndDates();this.$=$$[$0].substr(18); +break; +case 11: +yy.TopAxis();this.$=$$[$0].substr(8); +break; +case 12: +yy.setAxisFormat($$[$0].substr(11));this.$=$$[$0].substr(11); +break; +case 13: +yy.setExcludes($$[$0].substr(9));this.$=$$[$0].substr(9); +break; +case 14: +yy.setIncludes($$[$0].substr(9));this.$=$$[$0].substr(9); +break; +case 15: +yy.setTodayMarker($$[$0].substr(12));this.$=$$[$0].substr(12); +break; +case 16: +yy.setDiagramTitle($$[$0].substr(6));this.$=$$[$0].substr(6); +break; +case 17: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 18: case 19: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 20: +yy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8); +break; +case 22: +yy.addTask($$[$0-1],$$[$0]);this.$='task'; +break; +case 26: +this.$ = $$[$0-1];yy.setClickEvent($$[$0-1], $$[$0], null); +break; +case 27: +this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]); +break; +case 28: +this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], null);yy.setLink($$[$0-2],$$[$0]); +break; +case 29: +this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-2], $$[$0-1]);yy.setLink($$[$0-3],$$[$0]); +break; +case 30: +this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0], null);yy.setLink($$[$0-2],$$[$0-1]); +break; +case 31: +this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-1], $$[$0]);yy.setLink($$[$0-3],$$[$0-2]); +break; +case 32: +this.$ = $$[$0-1];yy.setLink($$[$0-1], $$[$0]); +break; +case 33: case 39: +this.$=$$[$0-1] + ' ' + $$[$0]; +break; +case 34: case 35: case 37: +this.$=$$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0]; +break; +case 36: case 38: +this.$=$$[$0-3] + ' ' + $$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0]; +break; +case 40: + yy.parseDirective('%%{', 'open_directive'); +break; +case 41: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 42: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 43: + yy.parseDirective('}%%', 'close_directive', 'gantt'); +break; +} +}, +table: [{3:1,4:2,5:$V0,29:4,39:$V1},{1:[3]},{3:6,4:2,5:$V0,29:4,39:$V1},o($V2,[2,3],{6:7}),{30:8,40:[1,9]},{40:[2,40]},{1:[2,1]},{4:29,7:[1,10],8:11,9:[1,12],10:13,11:[1,14],12:$V3,13:$V4,14:$V5,15:$V6,16:$V7,17:$V8,18:$V9,19:$Va,20:$Vb,22:$Vc,24:$Vd,25:$Ve,26:27,27:$Vf,29:4,34:$Vg,39:$V1},{31:31,32:[1,32],42:$Vh},o([32,42],[2,41]),o($V2,[2,8],{1:[2,2]}),o($V2,[2,4]),{4:29,10:34,12:$V3,13:$V4,14:$V5,15:$V6,16:$V7,17:$V8,18:$V9,19:$Va,20:$Vb,22:$Vc,24:$Vd,25:$Ve,26:27,27:$Vf,29:4,34:$Vg,39:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,9]),o($V2,[2,10]),o($V2,[2,11]),o($V2,[2,12]),o($V2,[2,13]),o($V2,[2,14]),o($V2,[2,15]),o($V2,[2,16]),{21:[1,35]},{23:[1,36]},o($V2,[2,19]),o($V2,[2,20]),o($V2,[2,21]),{28:[1,37]},o($V2,[2,23]),{35:[1,38],37:[1,39]},{11:[1,40]},{33:41,41:[1,42]},{11:[2,43]},o($V2,[2,5]),o($V2,[2,17]),o($V2,[2,18]),o($V2,[2,22]),o($V2,[2,26],{36:[1,43],37:[1,44]}),o($V2,[2,32],{35:[1,45]}),o($Vi,[2,24]),{31:46,42:$Vh},{42:[2,42]},o($V2,[2,27],{37:[1,47]}),o($V2,[2,28]),o($V2,[2,30],{36:[1,48]}),{11:[1,49]},o($V2,[2,29]),o($V2,[2,31]),o($Vi,[2,25])], +defaultActions: {5:[2,40],6:[2,1],33:[2,43],42:[2,42]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 39; +break; +case 1: this.begin('type_directive'); return 40; +break; +case 2: this.popState(); this.begin('arg_directive'); return 32; +break; +case 3: this.popState(); this.popState(); return 42; +break; +case 4:return 41; +break; +case 5: this.begin("acc_title");return 20; +break; +case 6: this.popState(); return "acc_title_value"; +break; +case 7: this.begin("acc_descr");return 22; +break; +case 8: this.popState(); return "acc_descr_value"; +break; +case 9: this.begin("acc_descr_multiline"); +break; +case 10: this.popState(); +break; +case 11:return "acc_descr_multiline_value"; +break; +case 12:/* skip comments */ +break; +case 13:/* skip comments */ +break; +case 14:/* do nothing */ +break; +case 15:return 11; +break; +case 16:/* skip whitespace */ +break; +case 17:/* skip comments */ +break; +case 18:/* skip comments */ +break; +case 19:this.begin("href"); +break; +case 20:this.popState(); +break; +case 21:return 37; +break; +case 22:this.begin("callbackname"); +break; +case 23:this.popState(); +break; +case 24:this.popState(); this.begin("callbackargs"); +break; +case 25:return 35; +break; +case 26:this.popState(); +break; +case 27:return 36; +break; +case 28:this.begin("click"); +break; +case 29:this.popState(); +break; +case 30:return 34; +break; +case 31:return 5; +break; +case 32:return 12; +break; +case 33:return 13; +break; +case 34:return 14; +break; +case 35:return 15; +break; +case 36:return 17; +break; +case 37:return 16; +break; +case 38:return 18; +break; +case 39:return 'date'; +break; +case 40:return 19; +break; +case 41:return 'accDescription' +break; +case 42:return 25; +break; +case 43:return 27; +break; +case 44:return 28; +break; +case 45:return 32; +break; +case 46:return 7; +break; +case 47:return 'INVALID'; +break; +} +}, +rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i], +conditions: {"acc_descr_multiline":{"rules":[10,11],"inclusive":false},"acc_descr":{"rules":[8],"inclusive":false},"acc_title":{"rules":[6],"inclusive":false},"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"callbackargs":{"rules":[26,27],"inclusive":false},"callbackname":{"rules":[23,24,25],"inclusive":false},"href":{"rules":[20,21],"inclusive":false},"click":{"rules":[29,30],"inclusive":false},"INITIAL":{"rules":[0,5,7,9,12,13,14,15,16,17,18,19,22,28,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?8ed1").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/git/parser/gitGraph.jison": +/*!************************************************!*\ + !*** ./src/diagrams/git/parser/gitGraph.jison ***! + \************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,7],$V2=[1,5],$V3=[1,9],$V4=[1,6],$V5=[2,6],$V6=[1,16],$V7=[6,8,14,20,22,24,25,27,29,32,35,37,49,53],$V8=[8,14,20,22,24,25,27,29,32,35,37],$V9=[8,13,14,20,22,24,25,27,29,32,35,37],$Va=[1,26],$Vb=[6,8,14,49,53],$Vc=[8,14,53],$Vd=[1,64],$Ve=[1,65],$Vf=[1,66],$Vg=[8,14,33,36,41,53]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"eol":4,"directive":5,"GG":6,"document":7,"EOF":8,":":9,"DIR":10,"options":11,"body":12,"OPT":13,"NL":14,"line":15,"statement":16,"commitStatement":17,"mergeStatement":18,"cherryPickStatement":19,"acc_title":20,"acc_title_value":21,"acc_descr":22,"acc_descr_value":23,"acc_descr_multiline_value":24,"section":25,"branchStatement":26,"CHECKOUT":27,"ID":28,"BRANCH":29,"ORDER":30,"NUM":31,"CHERRY_PICK":32,"COMMIT_ID":33,"STR":34,"MERGE":35,"COMMIT_TAG":36,"COMMIT":37,"commit_arg":38,"COMMIT_TYPE":39,"commitType":40,"COMMIT_MSG":41,"NORMAL":42,"REVERSE":43,"HIGHLIGHT":44,"openDirective":45,"typeDirective":46,"closeDirective":47,"argDirective":48,"open_directive":49,"type_directive":50,"arg_directive":51,"close_directive":52,";":53,"$accept":0,"$end":1}, +terminals_: {2:"error",6:"GG",8:"EOF",9:":",10:"DIR",13:"OPT",14:"NL",20:"acc_title",21:"acc_title_value",22:"acc_descr",23:"acc_descr_value",24:"acc_descr_multiline_value",25:"section",27:"CHECKOUT",28:"ID",29:"BRANCH",30:"ORDER",31:"NUM",32:"CHERRY_PICK",33:"COMMIT_ID",34:"STR",35:"MERGE",36:"COMMIT_TAG",37:"COMMIT",39:"COMMIT_TYPE",41:"COMMIT_MSG",42:"NORMAL",43:"REVERSE",44:"HIGHLIGHT",49:"open_directive",50:"type_directive",51:"arg_directive",52:"close_directive",53:";"}, +productions_: [0,[3,2],[3,2],[3,3],[3,4],[3,5],[7,0],[7,2],[11,2],[11,1],[12,0],[12,2],[15,2],[15,1],[16,1],[16,1],[16,1],[16,2],[16,2],[16,1],[16,1],[16,1],[16,2],[26,2],[26,4],[19,3],[18,2],[18,4],[17,2],[17,3],[17,3],[17,5],[17,5],[17,3],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,3],[17,5],[17,5],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[38,0],[38,1],[40,1],[40,1],[40,1],[5,3],[5,5],[45,1],[46,1],[48,1],[47,1],[4,1],[4,1],[4,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 3: + return $$[$0]; +break; +case 4: + return $$[$0-1]; +break; +case 5: +yy.setDirection($$[$0-3]); return $$[$0-1]; +break; +case 7: + yy.setOptions($$[$0-1]); this.$ = $$[$0] +break; +case 8: +$$[$0-1] +=$$[$0]; this.$=$$[$0-1] +break; +case 10: +this.$ = [] +break; +case 11: +$$[$0-1].push($$[$0]); this.$=$$[$0-1]; +break; +case 12: +this.$ =$$[$0-1] +break; +case 17: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 18: case 19: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 20: +yy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8); +break; +case 22: +yy.checkout($$[$0]) +break; +case 23: +yy.branch($$[$0]) +break; +case 24: +yy.branch($$[$0-2], $$[$0]) +break; +case 25: +yy.cherryPick($$[$0]) +break; +case 26: +yy.merge($$[$0]) +break; +case 27: +yy.merge($$[$0-2], $$[$0]) +break; +case 28: +yy.commit($$[$0]) +break; +case 29: +yy.commit('','',yy.commitType.NORMAL,$$[$0]) +break; +case 30: +yy.commit('','',$$[$0],'') +break; +case 31: +yy.commit('','',$$[$0],$$[$0-2]) +break; +case 32: +yy.commit('','',$$[$0-2],$$[$0]) +break; +case 33: +yy.commit('',$$[$0],yy.commitType.NORMAL,'') +break; +case 34: +yy.commit('',$$[$0-2],yy.commitType.NORMAL,$$[$0]) +break; +case 35: +yy.commit('',$$[$0],yy.commitType.NORMAL,$$[$0-2]) +break; +case 36: +yy.commit('',$$[$0-2],$$[$0],'') +break; +case 37: +yy.commit('',$$[$0],$$[$0-2],'') +break; +case 38: +yy.commit('',$$[$0-4],$$[$0-2],$$[$0]) +break; +case 39: +yy.commit('',$$[$0-4],$$[$0],$$[$0-2]) +break; +case 40: +yy.commit('',$$[$0-2],$$[$0-4],$$[$0]) +break; +case 41: +yy.commit('',$$[$0],$$[$0-4],$$[$0-2]) +break; +case 42: +yy.commit('',$$[$0],$$[$0-2],$$[$0-4]) +break; +case 43: +yy.commit('',$$[$0-2],$$[$0],$$[$0-4]) +break; +case 44: +yy.commit($$[$0],'',yy.commitType.NORMAL,'') +break; +case 45: +yy.commit($$[$0],'',yy.commitType.NORMAL,$$[$0-2]) +break; +case 46: +yy.commit($$[$0-2],'',yy.commitType.NORMAL,$$[$0]) +break; +case 47: +yy.commit($$[$0-2],'',$$[$0],'') +break; +case 48: +yy.commit($$[$0],'',$$[$0-2],'') +break; +case 49: +yy.commit($$[$0],$$[$0-2],yy.commitType.NORMAL,'') +break; +case 50: +yy.commit($$[$0-2],$$[$0],yy.commitType.NORMAL,'') +break; +case 51: +yy.commit($$[$0-4],'',$$[$0-2],$$[$0]) +break; +case 52: +yy.commit($$[$0-4],'',$$[$0],$$[$0-2]) +break; +case 53: +yy.commit($$[$0-2],'',$$[$0-4],$$[$0]) +break; +case 54: +yy.commit($$[$0],'',$$[$0-4],$$[$0-2]) +break; +case 55: +yy.commit($$[$0],'',$$[$0-2],$$[$0-4]) +break; +case 56: +yy.commit($$[$0-2],'',$$[$0],$$[$0-4]) +break; +case 57: +yy.commit($$[$0-4],$$[$0],$$[$0-2],'') +break; +case 58: +yy.commit($$[$0-4],$$[$0-2],$$[$0],'') +break; +case 59: +yy.commit($$[$0-2],$$[$0],$$[$0-4],'') +break; +case 60: +yy.commit($$[$0],$$[$0-2],$$[$0-4],'') +break; +case 61: +yy.commit($$[$0],$$[$0-4],$$[$0-2],'') +break; +case 62: +yy.commit($$[$0-2],$$[$0-4],$$[$0],'') +break; +case 63: +yy.commit($$[$0-4],$$[$0],yy.commitType.NORMAL,$$[$0-2]) +break; +case 64: +yy.commit($$[$0-4],$$[$0-2],yy.commitType.NORMAL,$$[$0]) +break; +case 65: +yy.commit($$[$0-2],$$[$0],yy.commitType.NORMAL,$$[$0-4]) +break; +case 66: +yy.commit($$[$0],$$[$0-2],yy.commitType.NORMAL,$$[$0-4]) +break; +case 67: +yy.commit($$[$0],$$[$0-4],yy.commitType.NORMAL,$$[$0-2]) +break; +case 68: +yy.commit($$[$0-2],$$[$0-4],yy.commitType.NORMAL,$$[$0]) +break; +case 69: +yy.commit($$[$0-6],$$[$0-4],$$[$0-2],$$[$0]) +break; +case 70: +yy.commit($$[$0-6],$$[$0-4],$$[$0],$$[$0-2]) +break; +case 71: +yy.commit($$[$0-6],$$[$0-2],$$[$0-4],$$[$0]) +break; +case 72: +yy.commit($$[$0-6],$$[$0],$$[$0-4],$$[$0-2]) +break; +case 73: +yy.commit($$[$0-6],$$[$0-2],$$[$0],$$[$0-4]) +break; +case 74: +yy.commit($$[$0-6],$$[$0],$$[$0-2],$$[$0-4]) +break; +case 75: +yy.commit($$[$0-4],$$[$0-6],$$[$0-2],$$[$0]) +break; +case 76: +yy.commit($$[$0-4],$$[$0-6],$$[$0],$$[$0-2]) +break; +case 77: +yy.commit($$[$0-2],$$[$0-6],$$[$0-4],$$[$0]) +break; +case 78: +yy.commit($$[$0],$$[$0-6],$$[$0-4],$$[$0-2]) +break; +case 79: +yy.commit($$[$0-2],$$[$0-6],$$[$0],$$[$0-4]) +break; +case 80: +yy.commit($$[$0],$$[$0-6],$$[$0-2],$$[$0-4]) +break; +case 81: +yy.commit($$[$0],$$[$0-4],$$[$0-2],$$[$0-6]) +break; +case 82: +yy.commit($$[$0-2],$$[$0-4],$$[$0],$$[$0-6]) +break; +case 83: +yy.commit($$[$0],$$[$0-2],$$[$0-4],$$[$0-6]) +break; +case 84: +yy.commit($$[$0-2],$$[$0],$$[$0-4],$$[$0-6]) +break; +case 85: +yy.commit($$[$0-4],$$[$0-2],$$[$0],$$[$0-6]) +break; +case 86: +yy.commit($$[$0-4],$$[$0],$$[$0-2],$$[$0-6]) +break; +case 87: +yy.commit($$[$0-2],$$[$0-4],$$[$0-6],$$[$0]) +break; +case 88: +yy.commit($$[$0],$$[$0-4],$$[$0-6],$$[$0-2]) +break; +case 89: +yy.commit($$[$0-2],$$[$0],$$[$0-6],$$[$0-4]) +break; +case 90: +yy.commit($$[$0],$$[$0-2],$$[$0-6],$$[$0-4]) +break; +case 91: +yy.commit($$[$0-4],$$[$0-2],$$[$0-6],$$[$0]) +break; +case 92: +yy.commit($$[$0-4],$$[$0],$$[$0-6],$$[$0-2]) +break; +case 93: +this.$ = "" +break; +case 94: +this.$=$$[$0] +break; +case 95: + this.$=yy.commitType.NORMAL; +break; +case 96: + this.$=yy.commitType.REVERSE; +break; +case 97: + this.$=yy.commitType.HIGHLIGHT; +break; +case 100: + yy.parseDirective('%%{', 'open_directive'); +break; +case 101: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 102: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 103: + yy.parseDirective('}%%', 'close_directive', 'gitGraph'); +break; +} +}, +table: [{3:1,4:2,5:3,6:$V0,8:$V1,14:$V2,45:8,49:$V3,53:$V4},{1:[3]},{3:10,4:2,5:3,6:$V0,8:$V1,14:$V2,45:8,49:$V3,53:$V4},{3:11,4:2,5:3,6:$V0,8:$V1,14:$V2,45:8,49:$V3,53:$V4},{7:12,8:$V5,9:[1,13],10:[1,14],11:15,14:$V6},o($V7,[2,104]),o($V7,[2,105]),o($V7,[2,106]),{46:17,50:[1,18]},{50:[2,100]},{1:[2,1]},{1:[2,2]},{8:[1,19]},{7:20,8:$V5,11:15,14:$V6},{9:[1,21]},o($V8,[2,10],{12:22,13:[1,23]}),o($V9,[2,9]),{9:[1,25],47:24,52:$Va},o([9,52],[2,101]),{1:[2,3]},{8:[1,27]},{7:28,8:$V5,11:15,14:$V6},{8:[2,7],14:[1,31],15:29,16:30,17:32,18:33,19:34,20:[1,35],22:[1,36],24:[1,37],25:[1,38],26:39,27:[1,40],29:[1,44],32:[1,43],35:[1,42],37:[1,41]},o($V9,[2,8]),o($Vb,[2,98]),{48:45,51:[1,46]},o($Vb,[2,103]),{1:[2,4]},{8:[1,47]},o($V8,[2,11]),{4:48,8:$V1,14:$V2,53:$V4},o($V8,[2,13]),o($Vc,[2,14]),o($Vc,[2,15]),o($Vc,[2,16]),{21:[1,49]},{23:[1,50]},o($Vc,[2,19]),o($Vc,[2,20]),o($Vc,[2,21]),{28:[1,51]},o($Vc,[2,93],{38:52,33:[1,55],34:[1,57],36:[1,53],39:[1,54],41:[1,56]}),{28:[1,58]},{33:[1,59]},{28:[1,60]},{47:61,52:$Va},{52:[2,102]},{1:[2,5]},o($V8,[2,12]),o($Vc,[2,17]),o($Vc,[2,18]),o($Vc,[2,22]),o($Vc,[2,28]),{34:[1,62]},{40:63,42:$Vd,43:$Ve,44:$Vf},{34:[1,67]},{34:[1,68]},o($Vc,[2,94]),o($Vc,[2,26],{36:[1,69]}),{34:[1,70]},o($Vc,[2,23],{30:[1,71]}),o($Vb,[2,99]),o($Vc,[2,29],{33:[1,73],39:[1,72],41:[1,74]}),o($Vc,[2,30],{33:[1,76],36:[1,75],41:[1,77]}),o($Vg,[2,95]),o($Vg,[2,96]),o($Vg,[2,97]),o($Vc,[2,33],{36:[1,78],39:[1,79],41:[1,80]}),o($Vc,[2,44],{33:[1,83],36:[1,81],39:[1,82]}),{34:[1,84]},o($Vc,[2,25]),{31:[1,85]},{40:86,42:$Vd,43:$Ve,44:$Vf},{34:[1,87]},{34:[1,88]},{34:[1,89]},{34:[1,90]},{34:[1,91]},{34:[1,92]},{40:93,42:$Vd,43:$Ve,44:$Vf},{34:[1,94]},{34:[1,95]},{40:96,42:$Vd,43:$Ve,44:$Vf},{34:[1,97]},o($Vc,[2,27]),o($Vc,[2,24]),o($Vc,[2,31],{33:[1,98],41:[1,99]}),o($Vc,[2,35],{39:[1,100],41:[1,101]}),o($Vc,[2,45],{33:[1,103],39:[1,102]}),o($Vc,[2,32],{33:[1,104],41:[1,105]}),o($Vc,[2,37],{36:[1,106],41:[1,107]}),o($Vc,[2,48],{33:[1,109],36:[1,108]}),o($Vc,[2,34],{39:[1,110],41:[1,111]}),o($Vc,[2,36],{36:[1,112],41:[1,113]}),o($Vc,[2,49],{36:[1,115],39:[1,114]}),o($Vc,[2,46],{33:[1,117],39:[1,116]}),o($Vc,[2,47],{33:[1,119],36:[1,118]}),o($Vc,[2,50],{36:[1,121],39:[1,120]}),{34:[1,122]},{34:[1,123]},{40:124,42:$Vd,43:$Ve,44:$Vf},{34:[1,125]},{40:126,42:$Vd,43:$Ve,44:$Vf},{34:[1,127]},{34:[1,128]},{34:[1,129]},{34:[1,130]},{34:[1,131]},{34:[1,132]},{34:[1,133]},{40:134,42:$Vd,43:$Ve,44:$Vf},{34:[1,135]},{34:[1,136]},{34:[1,137]},{40:138,42:$Vd,43:$Ve,44:$Vf},{34:[1,139]},{40:140,42:$Vd,43:$Ve,44:$Vf},{34:[1,141]},{34:[1,142]},{34:[1,143]},{40:144,42:$Vd,43:$Ve,44:$Vf},{34:[1,145]},o($Vc,[2,42],{41:[1,146]}),o($Vc,[2,55],{33:[1,147]}),o($Vc,[2,43],{41:[1,148]}),o($Vc,[2,66],{39:[1,149]}),o($Vc,[2,56],{33:[1,150]}),o($Vc,[2,65],{39:[1,151]}),o($Vc,[2,41],{41:[1,152]}),o($Vc,[2,54],{33:[1,153]}),o($Vc,[2,40],{41:[1,154]}),o($Vc,[2,60],{36:[1,155]}),o($Vc,[2,53],{33:[1,156]}),o($Vc,[2,59],{36:[1,157]}),o($Vc,[2,39],{41:[1,158]}),o($Vc,[2,67],{39:[1,159]}),o($Vc,[2,38],{41:[1,160]}),o($Vc,[2,61],{36:[1,161]}),o($Vc,[2,62],{36:[1,162]}),o($Vc,[2,68],{39:[1,163]}),o($Vc,[2,52],{33:[1,164]}),o($Vc,[2,63],{39:[1,165]}),o($Vc,[2,51],{33:[1,166]}),o($Vc,[2,57],{36:[1,167]}),o($Vc,[2,58],{36:[1,168]}),o($Vc,[2,64],{39:[1,169]}),{34:[1,170]},{34:[1,171]},{34:[1,172]},{40:173,42:$Vd,43:$Ve,44:$Vf},{34:[1,174]},{40:175,42:$Vd,43:$Ve,44:$Vf},{34:[1,176]},{34:[1,177]},{34:[1,178]},{34:[1,179]},{34:[1,180]},{34:[1,181]},{34:[1,182]},{40:183,42:$Vd,43:$Ve,44:$Vf},{34:[1,184]},{34:[1,185]},{34:[1,186]},{40:187,42:$Vd,43:$Ve,44:$Vf},{34:[1,188]},{40:189,42:$Vd,43:$Ve,44:$Vf},{34:[1,190]},{34:[1,191]},{34:[1,192]},{40:193,42:$Vd,43:$Ve,44:$Vf},o($Vc,[2,83]),o($Vc,[2,84]),o($Vc,[2,81]),o($Vc,[2,82]),o($Vc,[2,86]),o($Vc,[2,85]),o($Vc,[2,90]),o($Vc,[2,89]),o($Vc,[2,88]),o($Vc,[2,87]),o($Vc,[2,92]),o($Vc,[2,91]),o($Vc,[2,80]),o($Vc,[2,79]),o($Vc,[2,78]),o($Vc,[2,77]),o($Vc,[2,75]),o($Vc,[2,76]),o($Vc,[2,74]),o($Vc,[2,73]),o($Vc,[2,72]),o($Vc,[2,71]),o($Vc,[2,69]),o($Vc,[2,70])], +defaultActions: {9:[2,100],10:[2,1],11:[2,2],19:[2,3],27:[2,4],46:[2,102],47:[2,5]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 49; +break; +case 1: this.begin('type_directive'); return 50; +break; +case 2: this.popState(); this.begin('arg_directive'); return 9; +break; +case 3: this.popState(); this.popState(); return 52; +break; +case 4:return 51; +break; +case 5: this.begin("acc_title");return 20; +break; +case 6: this.popState(); return "acc_title_value"; +break; +case 7: this.begin("acc_descr");return 22; +break; +case 8: this.popState(); return "acc_descr_value"; +break; +case 9: this.begin("acc_descr_multiline"); +break; +case 10: this.popState(); +break; +case 11:return "acc_descr_multiline_value"; +break; +case 12:/*{console.log('New line');return 14;}*/ return 14; +break; +case 13:/* skip all whitespace */ +break; +case 14:/* skip comments */ +break; +case 15:/* skip comments */ +break; +case 16:return 6; +break; +case 17:return 37; +break; +case 18:return 33; +break; +case 19:return 39; +break; +case 20:return 41; +break; +case 21:return 42; +break; +case 22:return 43; +break; +case 23:return 44; +break; +case 24:return 36; +break; +case 25:return 29; +break; +case 26:return 30; +break; +case 27:return 35; +break; +case 28:return 32; +break; +case 29:return 27; +break; +case 30:return 10; +break; +case 31:return 10; +break; +case 32:return 9; +break; +case 33:return 'CARET' +break; +case 34:this.begin("options"); // +break; +case 35:this.popState(); // not used anymore in the renderer, fixed for backward compatibility +break; +case 36:return 13; // +break; +case 37:this.begin("string"); +break; +case 38:this.popState(); +break; +case 39:return 34; +break; +case 40:return 31; +break; +case 41:return 28; +break; +case 42:return 8; +break; +} +}, +rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gitGraph\b)/i,/^(?:commit\b)/i,/^(?:id:)/i,/^(?:type:)/i,/^(?:msg:)/i,/^(?:NORMAL\b)/i,/^(?:REVERSE\b)/i,/^(?:HIGHLIGHT\b)/i,/^(?:tag:)/i,/^(?:branch\b)/i,/^(?:order:)/i,/^(?:merge\b)/i,/^(?:cherry-pick\b)/i,/^(?:checkout\b)/i,/^(?:LR\b)/i,/^(?:BT\b)/i,/^(?::)/i,/^(?:\^)/i,/^(?:options\r?\n)/i,/^(?:[ \r\n\t]+end\b)/i,/^(?:[\s\S]+(?=[ \r\n\t]+end))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[0-9]+)/i,/^(?:[a-zA-Z][-_\./a-zA-Z0-9]*[-_a-zA-Z0-9])/i,/^(?:$)/i], +conditions: {"acc_descr_multiline":{"rules":[10,11],"inclusive":false},"acc_descr":{"rules":[8],"inclusive":false},"acc_title":{"rules":[6],"inclusive":false},"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"options":{"rules":[35,36],"inclusive":false},"string":{"rules":[38,39],"inclusive":false},"INITIAL":{"rules":[0,5,7,9,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,37,40,41,42],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?2b40").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/info/parser/info.jison": +/*!*********************************************!*\ + !*** ./src/diagrams/info/parser/info.jison ***! + \*********************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,9,10]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"info":4,"document":5,"EOF":6,"line":7,"statement":8,"NL":9,"showInfo":10,"$accept":0,"$end":1}, +terminals_: {2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo"}, +productions_: [0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 1: + return yy; +break; +case 4: + +break; +case 6: + yy.setInfo(true); +break; +} +}, +table: [{3:1,4:[1,2]},{1:[3]},o($V0,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8]},{1:[2,1]},o($V0,[2,3]),o($V0,[2,4]),o($V0,[2,5]),o($V0,[2,6])], +defaultActions: {4:[2,1]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { + // Pre-lexer code can go here + +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0:return 4 ; +break; +case 1:return 9 ; +break; +case 2:return 'space'; +break; +case 3:return 10; +break; +case 4:return 6 ; +break; +case 5:return 'TXT' ; +break; +} +}, +rules: [/^(?:info\b)/i,/^(?:[\s\n\r]+)/i,/^(?:[\s]+)/i,/^(?:showInfo\b)/i,/^(?:$)/i,/^(?:.)/i], +conditions: {"INITIAL":{"rules":[0,1,2,3,4,5],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?c5f1").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/pie/parser/pie.jison": +/*!*******************************************!*\ + !*** ./src/diagrams/pie/parser/pie.jison ***! + \*******************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,5],$V2=[1,6],$V3=[1,7],$V4=[1,9],$V5=[1,11,13,15,17,19,20,26,27,28,29],$V6=[2,5],$V7=[1,6,11,13,15,17,19,20,26,27,28,29],$V8=[26,27,28],$V9=[2,8],$Va=[1,18],$Vb=[1,19],$Vc=[1,20],$Vd=[1,21],$Ve=[1,22],$Vf=[1,23],$Vg=[1,28],$Vh=[6,26,27,28,29]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"eol":4,"directive":5,"PIE":6,"document":7,"showData":8,"line":9,"statement":10,"txt":11,"value":12,"title":13,"title_value":14,"acc_title":15,"acc_title_value":16,"acc_descr":17,"acc_descr_value":18,"acc_descr_multiline_value":19,"section":20,"openDirective":21,"typeDirective":22,"closeDirective":23,":":24,"argDirective":25,"NEWLINE":26,";":27,"EOF":28,"open_directive":29,"type_directive":30,"arg_directive":31,"close_directive":32,"$accept":0,"$end":1}, +terminals_: {2:"error",6:"PIE",8:"showData",11:"txt",12:"value",13:"title",14:"title_value",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",24:":",26:"NEWLINE",27:";",28:"EOF",29:"open_directive",30:"type_directive",31:"arg_directive",32:"close_directive"}, +productions_: [0,[3,2],[3,2],[3,2],[3,3],[7,0],[7,2],[9,2],[10,0],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,1],[5,3],[5,5],[4,1],[4,1],[4,1],[21,1],[22,1],[25,1],[23,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 4: +yy.setShowData(true); +break; +case 7: + this.$ = $$[$0-1] +break; +case 9: + yy.addSection($$[$0-1],yy.cleanupValue($$[$0])); +break; +case 10: + this.$=$$[$0].trim();yy.setDiagramTitle(this.$); +break; +case 11: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 12: case 13: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 14: +yy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8); +break; +case 21: + yy.parseDirective('%%{', 'open_directive'); +break; +case 22: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 23: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 24: + yy.parseDirective('}%%', 'close_directive', 'pie'); +break; +} +}, +table: [{3:1,4:2,5:3,6:$V0,21:8,26:$V1,27:$V2,28:$V3,29:$V4},{1:[3]},{3:10,4:2,5:3,6:$V0,21:8,26:$V1,27:$V2,28:$V3,29:$V4},{3:11,4:2,5:3,6:$V0,21:8,26:$V1,27:$V2,28:$V3,29:$V4},o($V5,$V6,{7:12,8:[1,13]}),o($V7,[2,18]),o($V7,[2,19]),o($V7,[2,20]),{22:14,30:[1,15]},{30:[2,21]},{1:[2,1]},{1:[2,2]},o($V8,$V9,{21:8,9:16,10:17,5:24,1:[2,3],11:$Va,13:$Vb,15:$Vc,17:$Vd,19:$Ve,20:$Vf,29:$V4}),o($V5,$V6,{7:25}),{23:26,24:[1,27],32:$Vg},o([24,32],[2,22]),o($V5,[2,6]),{4:29,26:$V1,27:$V2,28:$V3},{12:[1,30]},{14:[1,31]},{16:[1,32]},{18:[1,33]},o($V8,[2,13]),o($V8,[2,14]),o($V8,[2,15]),o($V8,$V9,{21:8,9:16,10:17,5:24,1:[2,4],11:$Va,13:$Vb,15:$Vc,17:$Vd,19:$Ve,20:$Vf,29:$V4}),o($Vh,[2,16]),{25:34,31:[1,35]},o($Vh,[2,24]),o($V5,[2,7]),o($V8,[2,9]),o($V8,[2,10]),o($V8,[2,11]),o($V8,[2,12]),{23:36,32:$Vg},{32:[2,23]},o($Vh,[2,17])], +defaultActions: {9:[2,21],10:[2,1],11:[2,2],35:[2,23]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 29; +break; +case 1: this.begin('type_directive'); return 30; +break; +case 2: this.popState(); this.begin('arg_directive'); return 24; +break; +case 3: this.popState(); this.popState(); return 32; +break; +case 4:return 31; +break; +case 5:/* skip comments */ +break; +case 6:/* skip comments */{ /*console.log('');*/ } +break; +case 7:return 26; +break; +case 8:/* do nothing */ +break; +case 9:/* ignore */ +break; +case 10: this.begin("title");return 13; +break; +case 11: this.popState(); return "title_value"; +break; +case 12: this.begin("acc_title");return 15; +break; +case 13: this.popState(); return "acc_title_value"; +break; +case 14: this.begin("acc_descr");return 17; +break; +case 15: this.popState(); return "acc_descr_value"; +break; +case 16: this.begin("acc_descr_multiline"); +break; +case 17: this.popState(); +break; +case 18:return "acc_descr_multiline_value"; +break; +case 19: this.begin("string"); +break; +case 20: this.popState(); +break; +case 21: return "txt"; +break; +case 22:return 6; +break; +case 23:return 8; +break; +case 24:return "value"; +break; +case 25:return 28; +break; +} +}, +rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?:showData\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i], +conditions: {"acc_descr_multiline":{"rules":[17,18],"inclusive":false},"acc_descr":{"rules":[15],"inclusive":false},"acc_title":{"rules":[13],"inclusive":false},"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"title":{"rules":[11],"inclusive":false},"string":{"rules":[20,21],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,12,14,16,19,22,23,24,25],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?a3fa").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/requirement/parser/requirementDiagram.jison": +/*!******************************************************************!*\ + !*** ./src/diagrams/requirement/parser/requirementDiagram.jison ***! + \******************************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,5],$V2=[1,6],$V3=[1,7],$V4=[1,8],$V5=[5,6,8,14,16,18,19,40,41,42,43,44,45,53,71,72],$V6=[1,22],$V7=[2,13],$V8=[1,26],$V9=[1,27],$Va=[1,28],$Vb=[1,29],$Vc=[1,30],$Vd=[1,31],$Ve=[1,24],$Vf=[1,32],$Vg=[1,33],$Vh=[1,36],$Vi=[71,72],$Vj=[5,8,14,16,18,19,40,41,42,43,44,45,53,60,62,71,72],$Vk=[1,56],$Vl=[1,57],$Vm=[1,58],$Vn=[1,59],$Vo=[1,60],$Vp=[1,61],$Vq=[1,62],$Vr=[62,63],$Vs=[1,74],$Vt=[1,70],$Vu=[1,71],$Vv=[1,72],$Vw=[1,73],$Vx=[1,75],$Vy=[1,79],$Vz=[1,80],$VA=[1,77],$VB=[1,78],$VC=[5,8,14,16,18,19,40,41,42,43,44,45,53,71,72]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"directive":4,"NEWLINE":5,"RD":6,"diagram":7,"EOF":8,"openDirective":9,"typeDirective":10,"closeDirective":11,":":12,"argDirective":13,"acc_title":14,"acc_title_value":15,"acc_descr":16,"acc_descr_value":17,"acc_descr_multiline_value":18,"open_directive":19,"type_directive":20,"arg_directive":21,"close_directive":22,"requirementDef":23,"elementDef":24,"relationshipDef":25,"requirementType":26,"requirementName":27,"STRUCT_START":28,"requirementBody":29,"ID":30,"COLONSEP":31,"id":32,"TEXT":33,"text":34,"RISK":35,"riskLevel":36,"VERIFYMTHD":37,"verifyType":38,"STRUCT_STOP":39,"REQUIREMENT":40,"FUNCTIONAL_REQUIREMENT":41,"INTERFACE_REQUIREMENT":42,"PERFORMANCE_REQUIREMENT":43,"PHYSICAL_REQUIREMENT":44,"DESIGN_CONSTRAINT":45,"LOW_RISK":46,"MED_RISK":47,"HIGH_RISK":48,"VERIFY_ANALYSIS":49,"VERIFY_DEMONSTRATION":50,"VERIFY_INSPECTION":51,"VERIFY_TEST":52,"ELEMENT":53,"elementName":54,"elementBody":55,"TYPE":56,"type":57,"DOCREF":58,"ref":59,"END_ARROW_L":60,"relationship":61,"LINE":62,"END_ARROW_R":63,"CONTAINS":64,"COPIES":65,"DERIVES":66,"SATISFIES":67,"VERIFIES":68,"REFINES":69,"TRACES":70,"unqString":71,"qString":72,"$accept":0,"$end":1}, +terminals_: {2:"error",5:"NEWLINE",6:"RD",8:"EOF",12:":",14:"acc_title",15:"acc_title_value",16:"acc_descr",17:"acc_descr_value",18:"acc_descr_multiline_value",19:"open_directive",20:"type_directive",21:"arg_directive",22:"close_directive",28:"STRUCT_START",30:"ID",31:"COLONSEP",33:"TEXT",35:"RISK",37:"VERIFYMTHD",39:"STRUCT_STOP",40:"REQUIREMENT",41:"FUNCTIONAL_REQUIREMENT",42:"INTERFACE_REQUIREMENT",43:"PERFORMANCE_REQUIREMENT",44:"PHYSICAL_REQUIREMENT",45:"DESIGN_CONSTRAINT",46:"LOW_RISK",47:"MED_RISK",48:"HIGH_RISK",49:"VERIFY_ANALYSIS",50:"VERIFY_DEMONSTRATION",51:"VERIFY_INSPECTION",52:"VERIFY_TEST",53:"ELEMENT",56:"TYPE",58:"DOCREF",60:"END_ARROW_L",62:"LINE",63:"END_ARROW_R",64:"CONTAINS",65:"COPIES",66:"DERIVES",67:"SATISFIES",68:"VERIFIES",69:"REFINES",70:"TRACES",71:"unqString",72:"qString"}, +productions_: [0,[3,3],[3,2],[3,4],[4,3],[4,5],[4,2],[4,2],[4,1],[9,1],[10,1],[13,1],[11,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[23,5],[29,5],[29,5],[29,5],[29,5],[29,2],[29,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[36,1],[36,1],[36,1],[38,1],[38,1],[38,1],[38,1],[24,5],[55,5],[55,5],[55,2],[55,1],[25,5],[25,5],[61,1],[61,1],[61,1],[61,1],[61,1],[61,1],[61,1],[27,1],[27,1],[32,1],[32,1],[34,1],[34,1],[54,1],[54,1],[57,1],[57,1],[59,1],[59,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 6: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 7: case 8: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 9: + yy.parseDirective('%%{', 'open_directive'); +break; +case 10: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 11: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 12: + yy.parseDirective('}%%', 'close_directive', 'pie'); +break; +case 13: + this.$ = [] +break; +case 19: + yy.addRequirement($$[$0-3], $$[$0-4]) +break; +case 20: + yy.setNewReqId($$[$0-2]); +break; +case 21: + yy.setNewReqText($$[$0-2]); +break; +case 22: + yy.setNewReqRisk($$[$0-2]); +break; +case 23: + yy.setNewReqVerifyMethod($$[$0-2]); +break; +case 26: + this.$=yy.RequirementType.REQUIREMENT; +break; +case 27: + this.$=yy.RequirementType.FUNCTIONAL_REQUIREMENT; +break; +case 28: + this.$=yy.RequirementType.INTERFACE_REQUIREMENT; +break; +case 29: + this.$=yy.RequirementType.PERFORMANCE_REQUIREMENT; +break; +case 30: + this.$=yy.RequirementType.PHYSICAL_REQUIREMENT; +break; +case 31: + this.$=yy.RequirementType.DESIGN_CONSTRAINT; +break; +case 32: + this.$=yy.RiskLevel.LOW_RISK; +break; +case 33: + this.$=yy.RiskLevel.MED_RISK; +break; +case 34: + this.$=yy.RiskLevel.HIGH_RISK; +break; +case 35: + this.$=yy.VerifyType.VERIFY_ANALYSIS; +break; +case 36: + this.$=yy.VerifyType.VERIFY_DEMONSTRATION; +break; +case 37: + this.$=yy.VerifyType.VERIFY_INSPECTION; +break; +case 38: + this.$=yy.VerifyType.VERIFY_TEST; +break; +case 39: + yy.addElement($$[$0-3]) +break; +case 40: + yy.setNewElementType($$[$0-2]); +break; +case 41: + yy.setNewElementDocRef($$[$0-2]); +break; +case 44: + yy.addRelationship($$[$0-2], $$[$0], $$[$0-4]) +break; +case 45: + yy.addRelationship($$[$0-2], $$[$0-4], $$[$0]) +break; +case 46: + this.$=yy.Relationships.CONTAINS; +break; +case 47: + this.$=yy.Relationships.COPIES; +break; +case 48: + this.$=yy.Relationships.DERIVES; +break; +case 49: + this.$=yy.Relationships.SATISFIES; +break; +case 50: + this.$=yy.Relationships.VERIFIES; +break; +case 51: + this.$=yy.Relationships.REFINES; +break; +case 52: + this.$=yy.Relationships.TRACES; +break; +} +}, +table: [{3:1,4:2,6:$V0,9:4,14:$V1,16:$V2,18:$V3,19:$V4},{1:[3]},{3:10,4:2,5:[1,9],6:$V0,9:4,14:$V1,16:$V2,18:$V3,19:$V4},{5:[1,11]},{10:12,20:[1,13]},{15:[1,14]},{17:[1,15]},o($V5,[2,8]),{20:[2,9]},{3:16,4:2,6:$V0,9:4,14:$V1,16:$V2,18:$V3,19:$V4},{1:[2,2]},{4:21,5:$V6,7:17,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{11:34,12:[1,35],22:$Vh},o([12,22],[2,10]),o($V5,[2,6]),o($V5,[2,7]),{1:[2,1]},{8:[1,37]},{4:21,5:$V6,7:38,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{4:21,5:$V6,7:39,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{4:21,5:$V6,7:40,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{4:21,5:$V6,7:41,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{4:21,5:$V6,7:42,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{27:43,71:[1,44],72:[1,45]},{54:46,71:[1,47],72:[1,48]},{60:[1,49],62:[1,50]},o($Vi,[2,26]),o($Vi,[2,27]),o($Vi,[2,28]),o($Vi,[2,29]),o($Vi,[2,30]),o($Vi,[2,31]),o($Vj,[2,55]),o($Vj,[2,56]),o($V5,[2,4]),{13:51,21:[1,52]},o($V5,[2,12]),{1:[2,3]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{8:[2,17]},{8:[2,18]},{28:[1,53]},{28:[2,53]},{28:[2,54]},{28:[1,54]},{28:[2,59]},{28:[2,60]},{61:55,64:$Vk,65:$Vl,66:$Vm,67:$Vn,68:$Vo,69:$Vp,70:$Vq},{61:63,64:$Vk,65:$Vl,66:$Vm,67:$Vn,68:$Vo,69:$Vp,70:$Vq},{11:64,22:$Vh},{22:[2,11]},{5:[1,65]},{5:[1,66]},{62:[1,67]},o($Vr,[2,46]),o($Vr,[2,47]),o($Vr,[2,48]),o($Vr,[2,49]),o($Vr,[2,50]),o($Vr,[2,51]),o($Vr,[2,52]),{63:[1,68]},o($V5,[2,5]),{5:$Vs,29:69,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},{5:$Vy,39:$Vz,55:76,56:$VA,58:$VB},{32:81,71:$Vf,72:$Vg},{32:82,71:$Vf,72:$Vg},o($VC,[2,19]),{31:[1,83]},{31:[1,84]},{31:[1,85]},{31:[1,86]},{5:$Vs,29:87,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},o($VC,[2,25]),o($VC,[2,39]),{31:[1,88]},{31:[1,89]},{5:$Vy,39:$Vz,55:90,56:$VA,58:$VB},o($VC,[2,43]),o($VC,[2,44]),o($VC,[2,45]),{32:91,71:$Vf,72:$Vg},{34:92,71:[1,93],72:[1,94]},{36:95,46:[1,96],47:[1,97],48:[1,98]},{38:99,49:[1,100],50:[1,101],51:[1,102],52:[1,103]},o($VC,[2,24]),{57:104,71:[1,105],72:[1,106]},{59:107,71:[1,108],72:[1,109]},o($VC,[2,42]),{5:[1,110]},{5:[1,111]},{5:[2,57]},{5:[2,58]},{5:[1,112]},{5:[2,32]},{5:[2,33]},{5:[2,34]},{5:[1,113]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[2,38]},{5:[1,114]},{5:[2,61]},{5:[2,62]},{5:[1,115]},{5:[2,63]},{5:[2,64]},{5:$Vs,29:116,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},{5:$Vs,29:117,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},{5:$Vs,29:118,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},{5:$Vs,29:119,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},{5:$Vy,39:$Vz,55:120,56:$VA,58:$VB},{5:$Vy,39:$Vz,55:121,56:$VA,58:$VB},o($VC,[2,20]),o($VC,[2,21]),o($VC,[2,22]),o($VC,[2,23]),o($VC,[2,40]),o($VC,[2,41])], +defaultActions: {8:[2,9],10:[2,2],16:[2,1],37:[2,3],38:[2,14],39:[2,15],40:[2,16],41:[2,17],42:[2,18],44:[2,53],45:[2,54],47:[2,59],48:[2,60],52:[2,11],93:[2,57],94:[2,58],96:[2,32],97:[2,33],98:[2,34],100:[2,35],101:[2,36],102:[2,37],103:[2,38],105:[2,61],106:[2,62],108:[2,63],109:[2,64]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 19; +break; +case 1: this.begin('type_directive'); return 20; +break; +case 2: this.popState(); this.begin('arg_directive'); return 12; +break; +case 3: this.popState(); this.popState(); return 22; +break; +case 4:return 21; +break; +case 5:return 'title'; +break; +case 6: this.begin("acc_title");return 14; +break; +case 7: this.popState(); return "acc_title_value"; +break; +case 8: this.begin("acc_descr");return 16; +break; +case 9: this.popState(); return "acc_descr_value"; +break; +case 10: this.begin("acc_descr_multiline"); +break; +case 11: this.popState(); +break; +case 12:return "acc_descr_multiline_value"; +break; +case 13:return 5; +break; +case 14:/* skip all whitespace */ +break; +case 15:/* skip comments */ +break; +case 16:/* skip comments */ +break; +case 17:return 8; +break; +case 18:return 6; +break; +case 19:return 28; +break; +case 20:return 39; +break; +case 21:return 31; +break; +case 22:return 30; +break; +case 23:return 33; +break; +case 24:return 35; +break; +case 25:return 37; +break; +case 26:return 40; +break; +case 27:return 41; +break; +case 28:return 42; +break; +case 29:return 43; +break; +case 30:return 44; +break; +case 31:return 45; +break; +case 32:return 46; +break; +case 33:return 47; +break; +case 34:return 48; +break; +case 35:return 49; +break; +case 36:return 50; +break; +case 37:return 51; +break; +case 38:return 52; +break; +case 39:return 53; +break; +case 40:return 64; +break; +case 41:return 65; +break; +case 42:return 66; +break; +case 43:return 67; +break; +case 44:return 68; +break; +case 45:return 69; +break; +case 46:return 70; +break; +case 47:return 56; +break; +case 48:return 58; +break; +case 49:return 60; +break; +case 50:return 63; +break; +case 51:return 62; +break; +case 52: this.begin("string"); +break; +case 53: this.popState(); +break; +case 54: return "qString"; +break; +case 55: yy_.yytext = yy_.yytext.trim(); return 71; +break; +} +}, +rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^\r\n\{\<\>\-\=]*)/i], +conditions: {"acc_descr_multiline":{"rules":[11,12],"inclusive":false},"acc_descr":{"rules":[9],"inclusive":false},"acc_title":{"rules":[7],"inclusive":false},"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"unqString":{"rules":[],"inclusive":false},"token":{"rules":[],"inclusive":false},"string":{"rules":[53,54],"inclusive":false},"INITIAL":{"rules":[0,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?ebf4").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/sequence/parser/sequenceDiagram.jison": +/*!************************************************************!*\ + !*** ./src/diagrams/sequence/parser/sequenceDiagram.jison ***! + \************************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,18],$V8=[1,19],$V9=[1,21],$Va=[1,22],$Vb=[1,23],$Vc=[1,29],$Vd=[1,30],$Ve=[1,31],$Vf=[1,32],$Vg=[1,33],$Vh=[1,34],$Vi=[1,35],$Vj=[1,36],$Vk=[1,37],$Vl=[1,38],$Vm=[1,39],$Vn=[1,40],$Vo=[1,43],$Vp=[1,44],$Vq=[1,45],$Vr=[1,46],$Vs=[1,47],$Vt=[1,48],$Vu=[1,51],$Vv=[1,4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,51,52,53,58,59,60,61,69,79],$Vw=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,53,58,59,60,61,69,79],$Vx=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,52,53,58,59,60,61,69,79],$Vy=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,51,53,58,59,60,61,69,79],$Vz=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,53,58,59,60,61,69,79],$VA=[67,68,69],$VB=[1,121],$VC=[1,4,5,7,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,51,52,53,58,59,60,61,69,79]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"SPACE":4,"NEWLINE":5,"directive":6,"SD":7,"document":8,"line":9,"statement":10,"openDirective":11,"typeDirective":12,"closeDirective":13,":":14,"argDirective":15,"participant":16,"actor":17,"AS":18,"restOfLine":19,"participant_actor":20,"signal":21,"autonumber":22,"NUM":23,"off":24,"activate":25,"deactivate":26,"note_statement":27,"links_statement":28,"link_statement":29,"properties_statement":30,"details_statement":31,"title":32,"legacy_title":33,"acc_title":34,"acc_title_value":35,"acc_descr":36,"acc_descr_value":37,"acc_descr_multiline_value":38,"loop":39,"end":40,"rect":41,"opt":42,"alt":43,"else_sections":44,"par":45,"par_sections":46,"critical":47,"option_sections":48,"break":49,"option":50,"and":51,"else":52,"note":53,"placement":54,"text2":55,"over":56,"actor_pair":57,"links":58,"link":59,"properties":60,"details":61,"spaceList":62,",":63,"left_of":64,"right_of":65,"signaltype":66,"+":67,"-":68,"ACTOR":69,"SOLID_OPEN_ARROW":70,"DOTTED_OPEN_ARROW":71,"SOLID_ARROW":72,"DOTTED_ARROW":73,"SOLID_CROSS":74,"DOTTED_CROSS":75,"SOLID_POINT":76,"DOTTED_POINT":77,"TXT":78,"open_directive":79,"type_directive":80,"arg_directive":81,"close_directive":82,"$accept":0,"$end":1}, +terminals_: {2:"error",4:"SPACE",5:"NEWLINE",7:"SD",14:":",16:"participant",18:"AS",19:"restOfLine",20:"participant_actor",22:"autonumber",23:"NUM",24:"off",25:"activate",26:"deactivate",32:"title",33:"legacy_title",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",39:"loop",40:"end",41:"rect",42:"opt",43:"alt",45:"par",47:"critical",49:"break",50:"option",51:"and",52:"else",53:"note",56:"over",58:"links",59:"link",60:"properties",61:"details",63:",",64:"left_of",65:"right_of",67:"+",68:"-",69:"ACTOR",70:"SOLID_OPEN_ARROW",71:"DOTTED_OPEN_ARROW",72:"SOLID_ARROW",73:"DOTTED_ARROW",74:"SOLID_CROSS",75:"DOTTED_CROSS",76:"SOLID_POINT",77:"DOTTED_POINT",78:"TXT",79:"open_directive",80:"type_directive",81:"arg_directive",82:"close_directive"}, +productions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[6,4],[6,6],[10,5],[10,3],[10,5],[10,3],[10,2],[10,4],[10,3],[10,3],[10,2],[10,3],[10,3],[10,2],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,2],[10,2],[10,1],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,1],[48,1],[48,4],[46,1],[46,4],[44,1],[44,4],[27,4],[27,4],[28,3],[29,3],[30,3],[31,3],[62,2],[62,1],[57,3],[57,1],[54,1],[54,1],[21,5],[21,5],[21,4],[17,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[55,1],[11,1],[12,1],[15,1],[13,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 4: + yy.apply($$[$0]);return $$[$0]; +break; +case 5: + this.$ = [] +break; +case 6: +$$[$0-1].push($$[$0]);this.$ = $$[$0-1] +break; +case 7: case 8: + this.$ = $$[$0] +break; +case 9: + this.$=[]; +break; +case 12: +$$[$0-3].type='addParticipant';$$[$0-3].description=yy.parseMessage($$[$0-1]); this.$=$$[$0-3]; +break; +case 13: +$$[$0-1].type='addParticipant';this.$=$$[$0-1]; +break; +case 14: +$$[$0-3].type='addActor';$$[$0-3].description=yy.parseMessage($$[$0-1]); this.$=$$[$0-3]; +break; +case 15: +$$[$0-1].type='addActor'; this.$=$$[$0-1]; +break; +case 17: + this.$= {type:'sequenceIndex',sequenceIndex: Number($$[$0-2]), sequenceIndexStep:Number($$[$0-1]), sequenceVisible:true, signalType:yy.LINETYPE.AUTONUMBER}; +break; +case 18: + this.$ = {type:'sequenceIndex',sequenceIndex: Number($$[$0-1]), sequenceIndexStep:1, sequenceVisible:true, signalType:yy.LINETYPE.AUTONUMBER}; +break; +case 19: + this.$ = {type:'sequenceIndex', sequenceVisible:false, signalType:yy.LINETYPE.AUTONUMBER}; +break; +case 20: +this.$ = {type:'sequenceIndex', sequenceVisible:true, signalType:yy.LINETYPE.AUTONUMBER}; +break; +case 21: +this.$={type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]}; +break; +case 22: +this.$={type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-1]}; +break; +case 28: +yy.setDiagramTitle($$[$0].substring(6));this.$=$$[$0].substring(6); +break; +case 29: +yy.setDiagramTitle($$[$0].substring(7));this.$=$$[$0].substring(7); +break; +case 30: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 31: case 32: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 33: + + $$[$0-1].unshift({type: 'loopStart', loopText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.LOOP_START}); + $$[$0-1].push({type: 'loopEnd', loopText:$$[$0-2], signalType: yy.LINETYPE.LOOP_END}); + this.$=$$[$0-1]; +break; +case 34: + + $$[$0-1].unshift({type: 'rectStart', color:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.RECT_START }); + $$[$0-1].push({type: 'rectEnd', color:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.RECT_END }); + this.$=$$[$0-1]; +break; +case 35: + + $$[$0-1].unshift({type: 'optStart', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.OPT_START}); + $$[$0-1].push({type: 'optEnd', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.OPT_END}); + this.$=$$[$0-1]; +break; +case 36: + + // Alt start + $$[$0-1].unshift({type: 'altStart', altText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.ALT_START}); + // Content in alt is already in $$[$0-1] + // End + $$[$0-1].push({type: 'altEnd', signalType: yy.LINETYPE.ALT_END}); + this.$=$$[$0-1]; +break; +case 37: + + // Parallel start + $$[$0-1].unshift({type: 'parStart', parText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.PAR_START}); + // Content in par is already in $$[$0-1] + // End + $$[$0-1].push({type: 'parEnd', signalType: yy.LINETYPE.PAR_END}); + this.$=$$[$0-1]; +break; +case 38: + + // critical start + $$[$0-1].unshift({type: 'criticalStart', criticalText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.CRITICAL_START}); + // Content in critical is already in $$[$0-1] + // critical end + $$[$0-1].push({type: 'criticalEnd', signalType: yy.LINETYPE.CRITICAL_END}); + this.$=$$[$0-1]; +break; +case 39: + + $$[$0-1].unshift({type: 'breakStart', breakText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.BREAK_START}); + $$[$0-1].push({type: 'breakEnd', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.BREAK_END}); + this.$=$$[$0-1]; +break; +case 42: + this.$ = $$[$0-3].concat([{type: 'option', optionText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.CRITICAL_OPTION}, $$[$0]]); +break; +case 44: + this.$ = $$[$0-3].concat([{type: 'and', parText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.PAR_AND}, $$[$0]]); +break; +case 46: + this.$ = $$[$0-3].concat([{type: 'else', altText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.ALT_ELSE}, $$[$0]]); +break; +case 47: + + this.$ = [$$[$0-1], {type:'addNote', placement:$$[$0-2], actor:$$[$0-1].actor, text:$$[$0]}]; +break; +case 48: + + // Coerce actor_pair into a [to, from, ...] array + $$[$0-2] = [].concat($$[$0-1], $$[$0-1]).slice(0, 2); + $$[$0-2][0] = $$[$0-2][0].actor; + $$[$0-2][1] = $$[$0-2][1].actor; + this.$ = [$$[$0-1], {type:'addNote', placement:yy.PLACEMENT.OVER, actor:$$[$0-2].slice(0, 2), text:$$[$0]}]; +break; +case 49: + + this.$ = [$$[$0-1], {type:'addLinks', actor:$$[$0-1].actor, text:$$[$0]}]; + +break; +case 50: + + this.$ = [$$[$0-1], {type:'addALink', actor:$$[$0-1].actor, text:$$[$0]}]; + +break; +case 51: + + this.$ = [$$[$0-1], {type:'addProperties', actor:$$[$0-1].actor, text:$$[$0]}]; + +break; +case 52: + + this.$ = [$$[$0-1], {type:'addDetails', actor:$$[$0-1].actor, text:$$[$0]}]; + +break; +case 55: + this.$ = [$$[$0-2], $$[$0]]; +break; +case 56: + this.$ = $$[$0]; +break; +case 57: + this.$ = yy.PLACEMENT.LEFTOF; +break; +case 58: + this.$ = yy.PLACEMENT.RIGHTOF; +break; +case 59: + this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]}, + {type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]} + ] +break; +case 60: + this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]}, + {type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-4]} + ] +break; +case 61: + this.$ = [$$[$0-3],$$[$0-1],{type: 'addMessage', from:$$[$0-3].actor, to:$$[$0-1].actor, signalType:$$[$0-2], msg:$$[$0]}] +break; +case 62: +this.$={ type: 'addParticipant', actor:$$[$0]} +break; +case 63: + this.$ = yy.LINETYPE.SOLID_OPEN; +break; +case 64: + this.$ = yy.LINETYPE.DOTTED_OPEN; +break; +case 65: + this.$ = yy.LINETYPE.SOLID; +break; +case 66: + this.$ = yy.LINETYPE.DOTTED; +break; +case 67: + this.$ = yy.LINETYPE.SOLID_CROSS; +break; +case 68: + this.$ = yy.LINETYPE.DOTTED_CROSS; +break; +case 69: + this.$ = yy.LINETYPE.SOLID_POINT; +break; +case 70: + this.$ = yy.LINETYPE.DOTTED_POINT; +break; +case 71: +this.$ = yy.parseMessage($$[$0].trim().substring(1)) +break; +case 72: + yy.parseDirective('%%{', 'open_directive'); +break; +case 73: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 74: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 75: + yy.parseDirective('}%%', 'close_directive', 'sequence'); +break; +} +}, +table: [{3:1,4:$V0,5:$V1,6:4,7:$V2,11:6,79:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,11:6,79:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,11:6,79:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,11:6,79:$V3},o([1,4,5,16,20,22,25,26,32,33,34,36,38,39,41,42,43,45,47,49,53,58,59,60,61,69,79],$V4,{8:11}),{12:12,80:[1,13]},{80:[2,72]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{13:49,14:[1,50],82:$Vu},o([14,82],[2,73]),o($Vv,[2,6]),{6:41,10:52,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},o($Vv,[2,8]),o($Vv,[2,9]),{17:53,69:$Vt},{17:54,69:$Vt},{5:[1,55]},{5:[1,58],23:[1,56],24:[1,57]},{17:59,69:$Vt},{17:60,69:$Vt},{5:[1,61]},{5:[1,62]},{5:[1,63]},{5:[1,64]},{5:[1,65]},o($Vv,[2,28]),o($Vv,[2,29]),{35:[1,66]},{37:[1,67]},o($Vv,[2,32]),{19:[1,68]},{19:[1,69]},{19:[1,70]},{19:[1,71]},{19:[1,72]},{19:[1,73]},{19:[1,74]},o($Vv,[2,40]),{66:75,70:[1,76],71:[1,77],72:[1,78],73:[1,79],74:[1,80],75:[1,81],76:[1,82],77:[1,83]},{54:84,56:[1,85],64:[1,86],65:[1,87]},{17:88,69:$Vt},{17:89,69:$Vt},{17:90,69:$Vt},{17:91,69:$Vt},o([5,18,63,70,71,72,73,74,75,76,77,78],[2,62]),{5:[1,92]},{15:93,81:[1,94]},{5:[2,75]},o($Vv,[2,7]),{5:[1,96],18:[1,95]},{5:[1,98],18:[1,97]},o($Vv,[2,16]),{5:[1,100],23:[1,99]},{5:[1,101]},o($Vv,[2,20]),{5:[1,102]},{5:[1,103]},o($Vv,[2,23]),o($Vv,[2,24]),o($Vv,[2,25]),o($Vv,[2,26]),o($Vv,[2,27]),o($Vv,[2,30]),o($Vv,[2,31]),o($Vw,$V4,{8:104}),o($Vw,$V4,{8:105}),o($Vw,$V4,{8:106}),o($Vx,$V4,{44:107,8:108}),o($Vy,$V4,{46:109,8:110}),o($Vz,$V4,{48:111,8:112}),o($Vw,$V4,{8:113}),{17:116,67:[1,114],68:[1,115],69:$Vt},o($VA,[2,63]),o($VA,[2,64]),o($VA,[2,65]),o($VA,[2,66]),o($VA,[2,67]),o($VA,[2,68]),o($VA,[2,69]),o($VA,[2,70]),{17:117,69:$Vt},{17:119,57:118,69:$Vt},{69:[2,57]},{69:[2,58]},{55:120,78:$VB},{55:122,78:$VB},{55:123,78:$VB},{55:124,78:$VB},o($VC,[2,10]),{13:125,82:$Vu},{82:[2,74]},{19:[1,126]},o($Vv,[2,13]),{19:[1,127]},o($Vv,[2,15]),{5:[1,128]},o($Vv,[2,18]),o($Vv,[2,19]),o($Vv,[2,21]),o($Vv,[2,22]),{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[1,129],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[1,130],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[1,131],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{40:[1,132]},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[2,45],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,52:[1,133],53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{40:[1,134]},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[2,43],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,51:[1,135],53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{40:[1,136]},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[2,41],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,50:[1,137],53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[1,138],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{17:139,69:$Vt},{17:140,69:$Vt},{55:141,78:$VB},{55:142,78:$VB},{55:143,78:$VB},{63:[1,144],78:[2,56]},{5:[2,49]},{5:[2,71]},{5:[2,50]},{5:[2,51]},{5:[2,52]},{5:[1,145]},{5:[1,146]},{5:[1,147]},o($Vv,[2,17]),o($Vv,[2,33]),o($Vv,[2,34]),o($Vv,[2,35]),o($Vv,[2,36]),{19:[1,148]},o($Vv,[2,37]),{19:[1,149]},o($Vv,[2,38]),{19:[1,150]},o($Vv,[2,39]),{55:151,78:$VB},{55:152,78:$VB},{5:[2,61]},{5:[2,47]},{5:[2,48]},{17:153,69:$Vt},o($VC,[2,11]),o($Vv,[2,12]),o($Vv,[2,14]),o($Vx,$V4,{8:108,44:154}),o($Vy,$V4,{8:110,46:155}),o($Vz,$V4,{8:112,48:156}),{5:[2,59]},{5:[2,60]},{78:[2,55]},{40:[2,46]},{40:[2,44]},{40:[2,42]}], +defaultActions: {7:[2,72],8:[2,1],9:[2,2],10:[2,3],51:[2,75],86:[2,57],87:[2,58],94:[2,74],120:[2,49],121:[2,71],122:[2,50],123:[2,51],124:[2,52],141:[2,61],142:[2,47],143:[2,48],151:[2,59],152:[2,60],153:[2,55],154:[2,46],155:[2,44],156:[2,42]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 79; +break; +case 1: this.begin('type_directive'); return 80; +break; +case 2: this.popState(); this.begin('arg_directive'); return 14; +break; +case 3: this.popState(); this.popState(); return 82; +break; +case 4:return 81; +break; +case 5:return 5; +break; +case 6:/* skip all whitespace */ +break; +case 7:/* skip same-line whitespace */ +break; +case 8:/* skip comments */ +break; +case 9:/* skip comments */ +break; +case 10:/* skip comments */ +break; +case 11:return 23; +break; +case 12: this.begin('ID'); return 16; +break; +case 13: this.begin('ID'); return 20; +break; +case 14: yy_.yytext = yy_.yytext.trim(); this.begin('ALIAS'); return 69; +break; +case 15: this.popState(); this.popState(); this.begin('LINE'); return 18; +break; +case 16: this.popState(); this.popState(); return 5; +break; +case 17: this.begin('LINE'); return 39; +break; +case 18: this.begin('LINE'); return 41; +break; +case 19: this.begin('LINE'); return 42; +break; +case 20: this.begin('LINE'); return 43; +break; +case 21: this.begin('LINE'); return 52; +break; +case 22: this.begin('LINE'); return 45; +break; +case 23: this.begin('LINE'); return 51; +break; +case 24: this.begin('LINE'); return 47; +break; +case 25: this.begin('LINE'); return 50; +break; +case 26: this.begin('LINE'); return 49; +break; +case 27: this.popState(); return 19; +break; +case 28:return 40; +break; +case 29:return 64; +break; +case 30:return 65; +break; +case 31:return 58; +break; +case 32:return 59; +break; +case 33:return 60; +break; +case 34:return 61; +break; +case 35:return 56; +break; +case 36:return 53; +break; +case 37: this.begin('ID'); return 25; +break; +case 38: this.begin('ID'); return 26; +break; +case 39:return 32; +break; +case 40:return 33; +break; +case 41: this.begin("acc_title");return 34; +break; +case 42: this.popState(); return "acc_title_value"; +break; +case 43: this.begin("acc_descr");return 36; +break; +case 44: this.popState(); return "acc_descr_value"; +break; +case 45: this.begin("acc_descr_multiline"); +break; +case 46: this.popState(); +break; +case 47:return "acc_descr_multiline_value"; +break; +case 48:return 7; +break; +case 49:return 22; +break; +case 50:return 24; +break; +case 51:return 63; +break; +case 52:return 5; +break; +case 53: yy_.yytext = yy_.yytext.trim(); return 69; +break; +case 54:return 72; +break; +case 55:return 73; +break; +case 56:return 70; +break; +case 57:return 71; +break; +case 58:return 74; +break; +case 59:return 75; +break; +case 60:return 76; +break; +case 61:return 77; +break; +case 62:return 78; +break; +case 63:return 67; +break; +case 64:return 68; +break; +case 65:return 5; +break; +case 66:return 'INVALID'; +break; +} +}, +rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i], +conditions: {"acc_descr_multiline":{"rules":[46,47],"inclusive":false},"acc_descr":{"rules":[44],"inclusive":false},"acc_title":{"rules":[42],"inclusive":false},"open_directive":{"rules":[1,8],"inclusive":false},"type_directive":{"rules":[2,3,8],"inclusive":false},"arg_directive":{"rules":[3,4,8],"inclusive":false},"ID":{"rules":[7,8,14],"inclusive":false},"ALIAS":{"rules":[7,8,15,16],"inclusive":false},"LINE":{"rules":[7,8,27],"inclusive":false},"INITIAL":{"rules":[0,5,6,8,9,10,11,12,13,17,18,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,45,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?e940").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/state/parser/stateDiagram.jison": +/*!******************************************************!*\ + !*** ./src/diagrams/state/parser/stateDiagram.jison ***! + \******************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,33],$Vc=[1,23],$Vd=[1,24],$Ve=[1,25],$Vf=[1,26],$Vg=[1,27],$Vh=[1,30],$Vi=[1,31],$Vj=[1,32],$Vk=[1,35],$Vl=[1,36],$Vm=[1,37],$Vn=[1,38],$Vo=[1,34],$Vp=[1,41],$Vq=[1,4,5,14,15,17,19,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50],$Vr=[1,4,5,12,13,14,15,17,19,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50],$Vs=[1,4,5,7,14,15,17,19,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50],$Vt=[4,5,14,15,17,19,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"SPACE":4,"NL":5,"directive":6,"SD":7,"document":8,"line":9,"statement":10,"idStatement":11,"DESCR":12,"-->":13,"HIDE_EMPTY":14,"scale":15,"WIDTH":16,"COMPOSIT_STATE":17,"STRUCT_START":18,"STRUCT_STOP":19,"STATE_DESCR":20,"AS":21,"ID":22,"FORK":23,"JOIN":24,"CHOICE":25,"CONCURRENT":26,"note":27,"notePosition":28,"NOTE_TEXT":29,"direction":30,"acc_title":31,"acc_title_value":32,"acc_descr":33,"acc_descr_value":34,"acc_descr_multiline_value":35,"openDirective":36,"typeDirective":37,"closeDirective":38,":":39,"argDirective":40,"direction_tb":41,"direction_bt":42,"direction_rl":43,"direction_lr":44,"eol":45,";":46,"EDGE_STATE":47,"left_of":48,"right_of":49,"open_directive":50,"type_directive":51,"arg_directive":52,"close_directive":53,"$accept":0,"$end":1}, +terminals_: {2:"error",4:"SPACE",5:"NL",7:"SD",12:"DESCR",13:"-->",14:"HIDE_EMPTY",15:"scale",16:"WIDTH",17:"COMPOSIT_STATE",18:"STRUCT_START",19:"STRUCT_STOP",20:"STATE_DESCR",21:"AS",22:"ID",23:"FORK",24:"JOIN",25:"CHOICE",26:"CONCURRENT",27:"note",29:"NOTE_TEXT",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",39:":",41:"direction_tb",42:"direction_bt",43:"direction_rl",44:"direction_lr",46:";",47:"EDGE_STATE",48:"left_of",49:"right_of",50:"open_directive",51:"type_directive",52:"arg_directive",53:"close_directive"}, +productions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,1],[10,2],[10,1],[10,4],[10,3],[10,6],[10,1],[10,1],[10,1],[10,1],[10,4],[10,4],[10,1],[10,1],[10,2],[10,2],[10,1],[6,3],[6,5],[30,1],[30,1],[30,1],[30,1],[45,1],[45,1],[11,1],[11,1],[28,1],[28,1],[36,1],[37,1],[40,1],[38,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 4: + /*console.warn('Root document', $$[$0]);*/ yy.setRootDoc($$[$0]);return $$[$0]; +break; +case 5: + this.$ = [] +break; +case 6: + + if($$[$0]!='nl'){ + $$[$0-1].push($$[$0]);this.$ = $$[$0-1] + } + // console.warn('Got document',$$[$0-1], $$[$0]); + +break; +case 7: case 8: + this.$ = $$[$0] +break; +case 9: + this.$='nl'; +break; +case 10: + /*console.warn('got id and descr', $$[$0]);*/this.$={ stmt: 'state', id: $$[$0], type: 'default', description: ''}; +break; +case 11: + /*console.warn('got id and descr', $$[$0-1], $$[$0].trim());*/this.$={ stmt: 'state', id: $$[$0-1], type: 'default', description: yy.trimColon($$[$0])}; +break; +case 12: + + /*console.warn('got id', $$[$0-2]);yy.addRelation($$[$0-2], $$[$0]);*/ + this.$={ stmt: 'relation', state1: { stmt: 'state', id: $$[$0-2], type: 'default', description: '' }, state2:{ stmt: 'state', id: $$[$0] ,type: 'default', description: ''}}; + +break; +case 13: + + /*yy.addRelation($$[$0-3], $$[$0-1], $$[$0].substr(1).trim());*/ + this.$={ stmt: 'relation', state1: { stmt: 'state', id: $$[$0-3], type: 'default', description: '' }, state2:{ stmt: 'state', id: $$[$0-1] ,type: 'default', description: ''}, description: $$[$0].substr(1).trim()}; + +break; +case 17: + + /* console.warn('Adding document for state without id ', $$[$0-3]);*/ + this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: '', doc: $$[$0-1] } + +break; +case 18: + + var id=$$[$0]; + var description = $$[$0-2].trim(); + if($$[$0].match(':')){ + var parts = $$[$0].split(':'); + id=parts[0]; + description = [description, parts[1]]; + } + this.$={stmt: 'state', id: id, type: 'default', description: description}; + + +break; +case 19: + + // console.warn('Adding document for state with id zxzx', $$[$0-3], $$[$0-2], yy.getDirection()); yy.addDocument($$[$0-3]); + this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: $$[$0-5], doc: $$[$0-1] } + +break; +case 20: + + this.$={ stmt: 'state', id: $$[$0], type: 'fork' } + +break; +case 21: + + this.$={ stmt: 'state', id: $$[$0], type: 'join' } + +break; +case 22: + + this.$={ stmt: 'state', id: $$[$0], type: 'choice' } + +break; +case 23: + + this.$={ stmt: 'state', id: yy.getDividerId(), type: 'divider' } + +break; +case 24: + + /* console.warn('got NOTE, position: ', $$[$0-2].trim(), 'id = ', $$[$0-1].trim(), 'note: ', $$[$0]);*/ + this.$={ stmt: 'state', id: $$[$0-1].trim(), note:{position: $$[$0-2].trim(), text: $$[$0].trim()}}; + +break; +case 28: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 29: case 30: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 33: + yy.setDirection('TB');this.$={stmt:'dir', value:'TB'}; +break; +case 34: + yy.setDirection('BT');this.$={stmt:'dir', value:'BT'}; +break; +case 35: + yy.setDirection('RL'); this.$={stmt:'dir', value:'RL'}; +break; +case 36: + yy.setDirection('LR');this.$={stmt:'dir', value:'LR'}; +break; +case 39: case 40: +this.$=$$[$0]; +break; +case 43: + yy.parseDirective('%%{', 'open_directive'); +break; +case 44: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 45: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 46: + yy.parseDirective('}%%', 'close_directive', 'state'); +break; +} +}, +table: [{3:1,4:$V0,5:$V1,6:4,7:$V2,36:6,50:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,36:6,50:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,36:6,50:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,36:6,50:$V3},o([1,4,5,14,15,17,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50],$V4,{8:11}),{37:12,51:[1,13]},{51:[2,43]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:$Vh,33:$Vi,35:$Vj,36:6,41:$Vk,42:$Vl,43:$Vm,44:$Vn,47:$Vo,50:$V3},{38:39,39:[1,40],53:$Vp},o([39,53],[2,44]),o($Vq,[2,6]),{6:28,10:42,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:$Vh,33:$Vi,35:$Vj,36:6,41:$Vk,42:$Vl,43:$Vm,44:$Vn,47:$Vo,50:$V3},o($Vq,[2,8]),o($Vq,[2,9]),o($Vq,[2,10],{12:[1,43],13:[1,44]}),o($Vq,[2,14]),{16:[1,45]},o($Vq,[2,16],{18:[1,46]}),{21:[1,47]},o($Vq,[2,20]),o($Vq,[2,21]),o($Vq,[2,22]),o($Vq,[2,23]),{28:48,29:[1,49],48:[1,50],49:[1,51]},o($Vq,[2,26]),o($Vq,[2,27]),{32:[1,52]},{34:[1,53]},o($Vq,[2,30]),o($Vr,[2,39]),o($Vr,[2,40]),o($Vq,[2,33]),o($Vq,[2,34]),o($Vq,[2,35]),o($Vq,[2,36]),o($Vs,[2,31]),{40:54,52:[1,55]},o($Vs,[2,46]),o($Vq,[2,7]),o($Vq,[2,11]),{11:56,22:$Vb,47:$Vo},o($Vq,[2,15]),o($Vt,$V4,{8:57}),{22:[1,58]},{22:[1,59]},{21:[1,60]},{22:[2,41]},{22:[2,42]},o($Vq,[2,28]),o($Vq,[2,29]),{38:61,53:$Vp},{53:[2,45]},o($Vq,[2,12],{12:[1,62]}),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,63],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:$Vh,33:$Vi,35:$Vj,36:6,41:$Vk,42:$Vl,43:$Vm,44:$Vn,47:$Vo,50:$V3},o($Vq,[2,18],{18:[1,64]}),{29:[1,65]},{22:[1,66]},o($Vs,[2,32]),o($Vq,[2,13]),o($Vq,[2,17]),o($Vt,$V4,{8:67}),o($Vq,[2,24]),o($Vq,[2,25]),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,68],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:$Vh,33:$Vi,35:$Vj,36:6,41:$Vk,42:$Vl,43:$Vm,44:$Vn,47:$Vo,50:$V3},o($Vq,[2,19])], +defaultActions: {7:[2,43],8:[2,1],9:[2,2],10:[2,3],50:[2,41],51:[2,42],55:[2,45]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0:return 41; +break; +case 1:return 42; +break; +case 2:return 43; +break; +case 3:return 44; +break; +case 4: this.begin('open_directive'); return 50; +break; +case 5: this.begin('type_directive'); return 51; +break; +case 6: this.popState(); this.begin('arg_directive'); return 39; +break; +case 7: this.popState(); this.popState(); return 53; +break; +case 8:return 52; +break; +case 9:/* skip comments */ +break; +case 10:/* skip comments */{ /*console.log('Crap after close');*/ } +break; +case 11:return 5; +break; +case 12:/* skip all whitespace */ +break; +case 13:/* skip same-line whitespace */ +break; +case 14:/* skip comments */ +break; +case 15:/* skip comments */ +break; +case 16: this.pushState('SCALE'); /* console.log('Got scale', yy_.yytext);*/ return 15; +break; +case 17:return 16; +break; +case 18:this.popState(); +break; +case 19: this.begin("acc_title");return 31; +break; +case 20: this.popState(); return "acc_title_value"; +break; +case 21: this.begin("acc_descr");return 33; +break; +case 22: this.popState(); return "acc_descr_value"; +break; +case 23: this.begin("acc_descr_multiline"); +break; +case 24: this.popState(); +break; +case 25:return "acc_descr_multiline_value"; +break; +case 26: /*console.log('Starting STATE zxzx'+yy.getDirection());*/this.pushState('STATE'); +break; +case 27:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim(); /*console.warn('Fork Fork: ',yy_.yytext);*/return 23; +break; +case 28:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24; +break; +case 29:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25; +break; +case 30:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Fork: ',yy_.yytext);*/return 23; +break; +case 31:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24; +break; +case 32:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25; +break; +case 33: return 41; +break; +case 34: return 42; +break; +case 35: return 43; +break; +case 36: return 44; +break; +case 37: /*console.log('Starting STATE_STRING zxzx');*/this.begin("STATE_STRING"); +break; +case 38:this.popState();this.pushState('STATE_ID');return "AS"; +break; +case 39:this.popState();/* console.log('STATE_ID', yy_.yytext);*/return "ID"; +break; +case 40:this.popState(); +break; +case 41: /*console.log('Long description:', yy_.yytext);*/return "STATE_DESCR"; +break; +case 42:/*console.log('COMPOSIT_STATE', yy_.yytext);*/return 17; +break; +case 43:this.popState(); +break; +case 44:this.popState();this.pushState('struct'); /*console.log('begin struct', yy_.yytext);*/return 18; +break; +case 45: /*console.log('Ending struct');*/ this.popState(); return 19; +break; +case 46:/* nothing */ +break; +case 47: this.begin('NOTE'); return 27; +break; +case 48: this.popState();this.pushState('NOTE_ID');return 48; +break; +case 49: this.popState();this.pushState('NOTE_ID');return 49; +break; +case 50: this.popState();this.pushState('FLOATING_NOTE'); +break; +case 51:this.popState();this.pushState('FLOATING_NOTE_ID');return "AS"; +break; +case 52:/**/ +break; +case 53: /*console.log('Floating note text: ', yy_.yytext);*/return "NOTE_TEXT"; +break; +case 54:this.popState();/*console.log('Floating note ID', yy_.yytext);*/return "ID"; +break; +case 55: this.popState();this.pushState('NOTE_TEXT');/*console.log('Got ID for note', yy_.yytext);*/return 22; +break; +case 56: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.substr(2).trim();return 29; +break; +case 57: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.slice(0,-8).trim();return 29; +break; +case 58: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7; +break; +case 59: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7; +break; +case 60: /*console.log('HIDE_EMPTY', yy_.yytext,'#');*/return 14; +break; +case 61: /*console.log('EDGE_STATE=',yy_.yytext);*/ return 47; +break; +case 62: /*console.log('=>ID=',yy_.yytext);*/ return 22; +break; +case 63: yy_.yytext = yy_.yytext.trim(); /*console.log('Descr = ', yy_.yytext);*/ return 12; +break; +case 64:return 13; +break; +case 65:return 26; +break; +case 66:return 5; +break; +case 67:return 'INVALID'; +break; +} +}, +rules: [/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?:$)/i,/^(?:.)/i], +conditions: {"LINE":{"rules":[13,14],"inclusive":false},"close_directive":{"rules":[13,14],"inclusive":false},"arg_directive":{"rules":[7,8,13,14],"inclusive":false},"type_directive":{"rules":[6,7,13,14],"inclusive":false},"open_directive":{"rules":[5,13,14],"inclusive":false},"struct":{"rules":[13,14,26,33,34,35,36,45,46,47,61,62,63,64,65],"inclusive":false},"FLOATING_NOTE_ID":{"rules":[54],"inclusive":false},"FLOATING_NOTE":{"rules":[51,52,53],"inclusive":false},"NOTE_TEXT":{"rules":[56,57],"inclusive":false},"NOTE_ID":{"rules":[55],"inclusive":false},"NOTE":{"rules":[48,49,50],"inclusive":false},"acc_descr_multiline":{"rules":[24,25],"inclusive":false},"acc_descr":{"rules":[22],"inclusive":false},"acc_title":{"rules":[20],"inclusive":false},"SCALE":{"rules":[17,18],"inclusive":false},"ALIAS":{"rules":[],"inclusive":false},"STATE_ID":{"rules":[39],"inclusive":false},"STATE_STRING":{"rules":[40,41],"inclusive":false},"FORK_STATE":{"rules":[],"inclusive":false},"STATE":{"rules":[13,14,27,28,29,30,31,32,37,38,42,43,44],"inclusive":false},"ID":{"rules":[13,14],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,9,10,11,12,14,15,16,19,21,23,26,44,47,58,59,60,61,62,63,64,66,67],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?a3b8").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/user-journey/parser/journey.jison": +/*!********************************************************!*\ + !*** ./src/diagrams/user-journey/parser/journey.jison ***! + \********************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,5],$V2=[6,9,11,17,18,20,22,23,24,26],$V3=[1,15],$V4=[1,16],$V5=[1,17],$V6=[1,18],$V7=[1,19],$V8=[1,20],$V9=[1,24],$Va=[4,6,9,11,17,18,20,22,23,24,26]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"journey":4,"document":5,"EOF":6,"directive":7,"line":8,"SPACE":9,"statement":10,"NEWLINE":11,"openDirective":12,"typeDirective":13,"closeDirective":14,":":15,"argDirective":16,"title":17,"acc_title":18,"acc_title_value":19,"acc_descr":20,"acc_descr_value":21,"acc_descr_multiline_value":22,"section":23,"taskName":24,"taskData":25,"open_directive":26,"type_directive":27,"arg_directive":28,"close_directive":29,"$accept":0,"$end":1}, +terminals_: {2:"error",4:"journey",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",17:"title",18:"acc_title",19:"acc_title_value",20:"acc_descr",21:"acc_descr_value",22:"acc_descr_multiline_value",23:"section",24:"taskName",25:"taskData",26:"open_directive",27:"type_directive",28:"arg_directive",29:"close_directive"}, +productions_: [0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,2],[10,2],[10,1],[10,1],[10,2],[10,1],[12,1],[13,1],[16,1],[14,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 1: + return $$[$0-1]; +break; +case 3: + this.$ = [] +break; +case 4: +$$[$0-1].push($$[$0]);this.$ = $$[$0-1] +break; +case 5: case 6: + this.$ = $$[$0] +break; +case 7: case 8: + this.$=[]; +break; +case 11: +yy.setDiagramTitle($$[$0].substr(6));this.$=$$[$0].substr(6); +break; +case 12: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 13: case 14: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 15: +yy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8); +break; +case 16: +yy.addTask($$[$0-1], $$[$0]);this.$='task'; +break; +case 18: + yy.parseDirective('%%{', 'open_directive'); +break; +case 19: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 20: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 21: + yy.parseDirective('}%%', 'close_directive', 'journey'); +break; +} +}, +table: [{3:1,4:$V0,7:3,12:4,26:$V1},{1:[3]},o($V2,[2,3],{5:6}),{3:7,4:$V0,7:3,12:4,26:$V1},{13:8,27:[1,9]},{27:[2,18]},{6:[1,10],7:21,8:11,9:[1,12],10:13,11:[1,14],12:4,17:$V3,18:$V4,20:$V5,22:$V6,23:$V7,24:$V8,26:$V1},{1:[2,2]},{14:22,15:[1,23],29:$V9},o([15,29],[2,19]),o($V2,[2,8],{1:[2,1]}),o($V2,[2,4]),{7:21,10:25,12:4,17:$V3,18:$V4,20:$V5,22:$V6,23:$V7,24:$V8,26:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,11]),{19:[1,26]},{21:[1,27]},o($V2,[2,14]),o($V2,[2,15]),{25:[1,28]},o($V2,[2,17]),{11:[1,29]},{16:30,28:[1,31]},{11:[2,21]},o($V2,[2,5]),o($V2,[2,12]),o($V2,[2,13]),o($V2,[2,16]),o($Va,[2,9]),{14:32,29:$V9},{29:[2,20]},{11:[1,33]},o($Va,[2,10])], +defaultActions: {5:[2,18],7:[2,2],24:[2,21],31:[2,20]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 26; +break; +case 1: this.begin('type_directive'); return 27; +break; +case 2: this.popState(); this.begin('arg_directive'); return 15; +break; +case 3: this.popState(); this.popState(); return 29; +break; +case 4:return 28; +break; +case 5:/* skip comments */ +break; +case 6:/* skip comments */ +break; +case 7:return 11; +break; +case 8:/* skip whitespace */ +break; +case 9:/* skip comments */ +break; +case 10:return 4; +break; +case 11:return 17; +break; +case 12: this.begin("acc_title");return 18; +break; +case 13: this.popState(); return "acc_title_value"; +break; +case 14: this.begin("acc_descr");return 20; +break; +case 15: this.popState(); return "acc_descr_value"; +break; +case 16: this.begin("acc_descr_multiline"); +break; +case 17: this.popState(); +break; +case 18:return "acc_descr_multiline_value"; +break; +case 19:return 23; +break; +case 20:return 24; +break; +case 21:return 25; +break; +case 22:return 15; +break; +case 23:return 6; +break; +case 24:return 'INVALID'; +break; +} +}, +rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i], +conditions: {"open_directive":{"rules":[1],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"acc_descr_multiline":{"rules":[17,18],"inclusive":false},"acc_descr":{"rules":[15],"inclusive":false},"acc_title":{"rules":[13],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,11,12,14,16,19,20,21,22,23,24],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?0f62").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/accessibility.js": +/*!******************************!*\ + !*** ./src/accessibility.js ***! + \******************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ addSVGAccessibilityFields) +/* harmony export */ }); +/** + * This method will add a basic title and description element to a chart. The yy parser will need to + * respond to getAccTitle and getAccDescription, where the title is the title element on the chart, + * which is generally not displayed and the accDescription is the description element on the chart, + * which is never displayed. + * + * The following charts display their title as a visual and accessibility element: gantt + * + * @param yy_parser + * @param svg + * @param id + */ +function addSVGAccessibilityFields(yy_parser, svg, id) { + if (typeof svg.insert === 'undefined') { + return; + } + + var title_string = yy_parser.getAccTitle(); + var description = yy_parser.getAccDescription(); + svg.attr('role', 'img').attr('aria-labelledby', 'chart-title-' + id + ' chart-desc-' + id); + svg.insert('desc', ':first-child').attr('id', 'chart-desc-' + id).text(description); + svg.insert('title', ':first-child').attr('id', 'chart-title-' + id).text(title_string); +} + +/***/ }), + +/***/ "./src/commonDb.js": +/*!*************************!*\ + !*** ./src/commonDb.js ***! + \*************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "clear": () => (/* binding */ clear), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "getAccDescription": () => (/* binding */ getAccDescription), +/* harmony export */ "getAccTitle": () => (/* binding */ getAccTitle), +/* harmony export */ "getDiagramTitle": () => (/* binding */ getDiagramTitle), +/* harmony export */ "setAccDescription": () => (/* binding */ setAccDescription), +/* harmony export */ "setAccTitle": () => (/* binding */ setAccTitle), +/* harmony export */ "setDiagramTitle": () => (/* binding */ setDiagramTitle) +/* harmony export */ }); +/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diagrams/common/common */ "./src/diagrams/common/common.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./config */ "./src/config.js"); + + +var title = ''; +var diagramTitle = ''; +var description = ''; + +var sanitizeText = function sanitizeText(txt) { + return (0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_0__.sanitizeText)(txt, (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)()); +}; + +var clear = function clear() { + title = ''; + description = ''; + diagramTitle = ''; +}; +var setAccTitle = function setAccTitle(txt) { + title = sanitizeText(txt).replace(/^\s+/g, ''); +}; +var getAccTitle = function getAccTitle() { + return title || diagramTitle; +}; +var setAccDescription = function setAccDescription(txt) { + description = sanitizeText(txt).replace(/\n\s+/g, '\n'); +}; +var getAccDescription = function getAccDescription() { + return description; +}; +var setDiagramTitle = function setDiagramTitle(txt) { + diagramTitle = sanitizeText(txt); +}; +var getDiagramTitle = function getDiagramTitle() { + return diagramTitle; +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + setAccTitle: setAccTitle, + getAccTitle: getAccTitle, + setDiagramTitle: setDiagramTitle, + getDiagramTitle: getDiagramTitle, + getAccDescription: getAccDescription, + setAccDescription: setAccDescription, + clear: clear +}); + +/***/ }), + +/***/ "./src/config.js": +/*!***********************!*\ + !*** ./src/config.js ***! + \***********************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "addDirective": () => (/* binding */ addDirective), +/* harmony export */ "defaultConfig": () => (/* binding */ defaultConfig), +/* harmony export */ "getConfig": () => (/* binding */ getConfig), +/* harmony export */ "getSiteConfig": () => (/* binding */ getSiteConfig), +/* harmony export */ "reset": () => (/* binding */ reset), +/* harmony export */ "sanitize": () => (/* binding */ sanitize), +/* harmony export */ "saveConfigFromInitialize": () => (/* binding */ saveConfigFromInitialize), +/* harmony export */ "setConfig": () => (/* binding */ setConfig), +/* harmony export */ "setSiteConfig": () => (/* binding */ setSiteConfig), +/* harmony export */ "updateCurrentConfig": () => (/* binding */ updateCurrentConfig), +/* harmony export */ "updateSiteConfig": () => (/* binding */ updateSiteConfig) +/* harmony export */ }); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./src/utils.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./logger */ "./src/logger.js"); +/* harmony import */ var _themes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./themes */ "./src/themes/index.js"); +/* harmony import */ var _defaultConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultConfig */ "./src/defaultConfig.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + + + + + +var defaultConfig = Object.freeze(_defaultConfig__WEBPACK_IMPORTED_MODULE_0__["default"]); +var siteConfig = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, defaultConfig); +var configFromInitialize; +var directives = []; +var currentConfig = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, defaultConfig); +var updateCurrentConfig = function updateCurrentConfig(siteCfg, _directives) { + // start with config beeing the siteConfig + var cfg = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, siteCfg); // let sCfg = assignWithDepth(defaultConfig, siteConfigDelta); + // Join directives + + var sumOfDirectives = {}; + + for (var i = 0; i < _directives.length; i++) { + var d = _directives[i]; + sanitize(d); // Apply the data from the directive where the the overrides the themeVariables + + sumOfDirectives = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(sumOfDirectives, d); + } + + cfg = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(cfg, sumOfDirectives); + + if (sumOfDirectives.theme && _themes__WEBPACK_IMPORTED_MODULE_2__["default"][sumOfDirectives.theme]) { + var tmpConfigFromInitialize = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, configFromInitialize); + var themeVariables = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(tmpConfigFromInitialize.themeVariables || {}, sumOfDirectives.themeVariables); + cfg.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_2__["default"][cfg.theme].getThemeVariables(themeVariables); + } + + currentConfig = cfg; + return cfg; +}; +/** + * ## setSiteConfig + * + * | Function | Description | Type | Values | + * | ------------- | ------------------------------------- | ----------- | --------------------------------------- | + * | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array | + * + * **Notes:** Sets the siteConfig. The siteConfig is a protected configuration for repeat use. Calls + * to reset() will reset the currentConfig to siteConfig. Calls to reset(configApi.defaultConfig) + * will reset siteConfig and currentConfig to the defaultConfig Note: currentConfig is set in this + * function _Default value: At default, will mirror Global Config_ + * + * @param conf - The base currentConfig to use as siteConfig + * @returns {object} - The siteConfig + */ + +var setSiteConfig = function setSiteConfig(conf) { + siteConfig = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, defaultConfig); + siteConfig = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(siteConfig, conf); + + if (conf.theme && _themes__WEBPACK_IMPORTED_MODULE_2__["default"][conf.theme]) { + siteConfig.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_2__["default"][conf.theme].getThemeVariables(conf.themeVariables); + } + + currentConfig = updateCurrentConfig(siteConfig, directives); + return siteConfig; +}; +var saveConfigFromInitialize = function saveConfigFromInitialize(conf) { + configFromInitialize = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, conf); +}; +var updateSiteConfig = function updateSiteConfig(conf) { + siteConfig = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(siteConfig, conf); + updateCurrentConfig(siteConfig, directives); + return siteConfig; +}; +/** + * ## getSiteConfig + * + * | Function | Description | Type | Values | + * | ------------- | ------------------------------------------------- | ----------- | -------------------------------- | + * | setSiteConfig | Returns the current siteConfig base configuration | Get Request | Returns Any Values in siteConfig | + * + * **Notes**: Returns **any** values in siteConfig. + * + * @returns {object} - The siteConfig + */ + +var getSiteConfig = function getSiteConfig() { + return (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, siteConfig); +}; +/** + * ## setConfig + * + * | Function | Description | Type | Values | + * | ------------- | ------------------------------------- | ----------- | --------------------------------------- | + * | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array | + * + * **Notes**: Sets the currentConfig. The parameter conf is sanitized based on the siteConfig.secure + * keys. Any values found in conf with key found in siteConfig.secure will be replaced with the + * corresponding siteConfig value. + * + * @param {any} conf - The potential currentConfig + * @returns {any} - The currentConfig merged with the sanitized conf + */ + +var setConfig = function setConfig(conf) { + // sanitize(conf); + // Object.keys(conf).forEach(key => { + // const manipulator = manipulators[key]; + // conf[key] = manipulator ? manipulator(conf[key]) : conf[key]; + // }); + (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(currentConfig, conf); + return getConfig(); +}; +/** + * ## getConfig + * + * | Function | Description | Type | Return Values | + * | --------- | ------------------------- | ----------- | ------------------------------ | + * | getConfig | Obtains the currentConfig | Get Request | Any Values from current Config | + * + * **Notes**: Returns **any** the currentConfig + * + * @returns {any} - The currentConfig + */ + +var getConfig = function getConfig() { + return (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, currentConfig); +}; +/** + * ## sanitize + * + * | Function | Description | Type | Values | + * | -------- | -------------------------------------- | ----------- | ------ | + * | sanitize | Sets the siteConfig to desired values. | Put Request | None | + * + * Ensures options parameter does not attempt to override siteConfig secure keys **Notes**: modifies + * options in-place + * + * @param {any} options - The potential setConfig parameter + */ + +var sanitize = function sanitize(options) { + // Checking that options are not in the list of excluded options + Object.keys(siteConfig.secure).forEach(function (key) { + if (typeof options[siteConfig.secure[key]] !== 'undefined') { + // DO NOT attempt to print options[siteConfig.secure[key]] within `${}` as a malicious script + // can exploit the logger's attempt to stringify the value and execute arbitrary code + _logger__WEBPACK_IMPORTED_MODULE_3__.log.debug("Denied attempt to modify a secure key ".concat(siteConfig.secure[key]), options[siteConfig.secure[key]]); + delete options[siteConfig.secure[key]]; + } + }); // Check that there no attempts of prototype pollution + + Object.keys(options).forEach(function (key) { + if (key.indexOf('__') === 0) { + delete options[key]; + } + }); // Check that there no attempts of xss, there should be no tags at all in the directive + // blocking data urls as base64 urls can contain svgs with inline script tags + + Object.keys(options).forEach(function (key) { + if (typeof options[key] === 'string') { + if (options[key].indexOf('<') > -1 || options[key].indexOf('>') > -1 || options[key].indexOf('url(data:') > -1) { + delete options[key]; + } + } + + if (_typeof(options[key]) === 'object') { + sanitize(options[key]); + } + }); +}; +/** + * Pushes in a directive to the configuration + * + * @param {object} directive The directive to push in + */ + +var addDirective = function addDirective(directive) { + if (directive.fontFamily) { + if (!directive.themeVariables) { + directive.themeVariables = { + fontFamily: directive.fontFamily + }; + } else { + if (!directive.themeVariables.fontFamily) { + directive.themeVariables = { + fontFamily: directive.fontFamily + }; + } + } + } + + directives.push(directive); + updateCurrentConfig(siteConfig, directives); +}; +/** + * ## reset + * + * | Function | Description | Type | Required | Values | + * | -------- | ---------------------------- | ----------- | -------- | ------ | + * | reset | Resets currentConfig to conf | Put Request | Required | None | + * + * ## conf + * + * | Parameter | Description | Type | Required | Values | + * | --------- | -------------------------------------------------------------- | ---------- | -------- | -------------------------------------------- | + * | conf | base set of values, which currentConfig could be **reset** to. | Dictionary | Required | Any Values, with respect to the secure Array | + * + * **Notes**: (default: current siteConfig ) (optional, default `getSiteConfig()`) + */ + +var reset = function reset() { + // Replace current config with siteConfig + directives = []; + updateCurrentConfig(siteConfig, directives); +}; + +/***/ }), + +/***/ "./src/dagre-wrapper/clusters.js": +/*!***************************************!*\ + !*** ./src/dagre-wrapper/clusters.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "clear": () => (/* binding */ clear), +/* harmony export */ "getClusterTitleWidth": () => (/* binding */ getClusterTitleWidth), +/* harmony export */ "insertCluster": () => (/* binding */ insertCluster), +/* harmony export */ "positionCluster": () => (/* binding */ positionCluster) +/* harmony export */ }); +/* harmony import */ var _intersect_intersect_rect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./intersect/intersect-rect */ "./src/dagre-wrapper/intersect/intersect-rect.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); +/* harmony import */ var _createLabel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./createLabel */ "./src/dagre-wrapper/createLabel.js"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../config */ "./src/config.js"); +/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js"); + + + + + + + +var rect = function rect(parent, node) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Creating subgraph rect for ', node.id, node); // Add outer g element + + var shapeSvg = parent.insert('g').attr('class', 'cluster' + (node.class ? ' ' + node.class : '')).attr('id', node.id); // add the rect + + var rect = shapeSvg.insert('rect', ':first-child'); // Create the label and insert it after the rect + + var label = shapeSvg.insert('g').attr('class', 'cluster-label'); + var text = label.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_2__["default"])(node.labelText, node.labelStyle, undefined, true)); // Get the size of the label + + var bbox = text.getBBox(); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_4__.getConfig)().flowchart.htmlLabels)) { + var div = text.children[0]; + var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(text); + bbox = div.getBoundingClientRect(); + dv.attr('width', bbox.width); + dv.attr('height', bbox.height); + } + + var padding = 0 * node.padding; + var halfPadding = padding / 2; + var width = node.width <= bbox.width + padding ? bbox.width + padding : node.width; + + if (node.width <= bbox.width + padding) { + node.diff = (bbox.width - node.width) / 2 - node.padding / 2; + } else { + node.diff = -node.padding / 2; + } + + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Data ', node, JSON.stringify(node)); // center the rect around its coordinate + + rect.attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('x', node.x - width / 2).attr('y', node.y - node.height / 2 - halfPadding).attr('width', width).attr('height', node.height + padding); // Center the label + + label.attr('transform', 'translate(' + (node.x - bbox.width / 2) + ', ' + (node.y - node.height / 2 + node.padding / 3) + ')'); + var rectBox = rect.node().getBBox(); + node.width = rectBox.width; + node.height = rectBox.height; + + node.intersect = function (point) { + return (0,_intersect_intersect_rect__WEBPACK_IMPORTED_MODULE_5__["default"])(node, point); + }; + + return shapeSvg; +}; +/** + * Non visible cluster where the note is group with its + * + * @param {any} parent + * @param {any} node + * @returns {any} ShapeSvg + */ + + +var noteGroup = function noteGroup(parent, node) { + // Add outer g element + var shapeSvg = parent.insert('g').attr('class', 'note-cluster').attr('id', node.id); // add the rect + + var rect = shapeSvg.insert('rect', ':first-child'); + var padding = 0 * node.padding; + var halfPadding = padding / 2; // center the rect around its coordinate + + rect.attr('rx', node.rx).attr('ry', node.ry).attr('x', node.x - node.width / 2 - halfPadding).attr('y', node.y - node.height / 2 - halfPadding).attr('width', node.width + padding).attr('height', node.height + padding).attr('fill', 'none'); + var rectBox = rect.node().getBBox(); + node.width = rectBox.width; + node.height = rectBox.height; + + node.intersect = function (point) { + return (0,_intersect_intersect_rect__WEBPACK_IMPORTED_MODULE_5__["default"])(node, point); + }; + + return shapeSvg; +}; + +var roundedWithTitle = function roundedWithTitle(parent, node) { + // Add outer g element + var shapeSvg = parent.insert('g').attr('class', node.classes).attr('id', node.id); // add the rect + + var rect = shapeSvg.insert('rect', ':first-child'); // Create the label and insert it after the rect + + var label = shapeSvg.insert('g').attr('class', 'cluster-label'); + var innerRect = shapeSvg.append('rect'); + var text = label.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_2__["default"])(node.labelText, node.labelStyle, undefined, true)); // Get the size of the label + + var bbox = text.getBBox(); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_4__.getConfig)().flowchart.htmlLabels)) { + var div = text.children[0]; + var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(text); + bbox = div.getBoundingClientRect(); + dv.attr('width', bbox.width); + dv.attr('height', bbox.height); + } + + bbox = text.getBBox(); + var padding = 0 * node.padding; + var halfPadding = padding / 2; + var width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width; + + if (node.width <= bbox.width + node.padding) { + node.diff = (bbox.width + node.padding * 0 - node.width) / 2; + } else { + node.diff = -node.padding / 2; + } // center the rect around its coordinate + + + rect.attr('class', 'outer').attr('x', node.x - width / 2 - halfPadding).attr('y', node.y - node.height / 2 - halfPadding).attr('width', width + padding).attr('height', node.height + padding); + innerRect.attr('class', 'inner').attr('x', node.x - width / 2 - halfPadding).attr('y', node.y - node.height / 2 - halfPadding + bbox.height - 1).attr('width', width + padding).attr('height', node.height + padding - bbox.height - 3); // Center the label + + label.attr('transform', 'translate(' + (node.x - bbox.width / 2) + ', ' + (node.y - node.height / 2 - node.padding / 3 + ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_4__.getConfig)().flowchart.htmlLabels) ? 5 : 3)) + ')'); + var rectBox = rect.node().getBBox(); + node.height = rectBox.height; + + node.intersect = function (point) { + return (0,_intersect_intersect_rect__WEBPACK_IMPORTED_MODULE_5__["default"])(node, point); + }; + + return shapeSvg; +}; + +var divider = function divider(parent, node) { + // Add outer g element + var shapeSvg = parent.insert('g').attr('class', node.classes).attr('id', node.id); // add the rect + + var rect = shapeSvg.insert('rect', ':first-child'); + var padding = 0 * node.padding; + var halfPadding = padding / 2; // center the rect around its coordinate + + rect.attr('class', 'divider').attr('x', node.x - node.width / 2 - halfPadding).attr('y', node.y - node.height / 2).attr('width', node.width + padding).attr('height', node.height + padding); + var rectBox = rect.node().getBBox(); + node.width = rectBox.width; + node.height = rectBox.height; + node.diff = -node.padding / 2; + + node.intersect = function (point) { + return (0,_intersect_intersect_rect__WEBPACK_IMPORTED_MODULE_5__["default"])(node, point); + }; + + return shapeSvg; +}; + +var shapes = { + rect: rect, + roundedWithTitle: roundedWithTitle, + noteGroup: noteGroup, + divider: divider +}; +var clusterElems = {}; +var insertCluster = function insertCluster(elem, node) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Inserting cluster'); + var shape = node.shape || 'rect'; + clusterElems[node.id] = shapes[shape](elem, node); +}; +var getClusterTitleWidth = function getClusterTitleWidth(elem, node) { + var label = (0,_createLabel__WEBPACK_IMPORTED_MODULE_2__["default"])(node.labelText, node.labelStyle, undefined, true); + elem.node().appendChild(label); + var width = label.getBBox().width; + elem.node().removeChild(label); + return width; +}; +var clear = function clear() { + clusterElems = {}; +}; +var positionCluster = function positionCluster(node) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Position cluster (' + node.id + ', ' + node.x + ', ' + node.y + ')'); + var el = clusterElems[node.id]; + el.attr('transform', 'translate(' + node.x + ', ' + node.y + ')'); +}; + +/***/ }), + +/***/ "./src/dagre-wrapper/createLabel.js": +/*!******************************************!*\ + !*** ./src/dagre-wrapper/createLabel.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config */ "./src/config.js"); +/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + + + // eslint-disable-line + + + + +var sanitizeTxt = function sanitizeTxt(txt) { + return (0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.sanitizeText)(txt, (0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)()); +}; +/** + * @param dom + * @param styleFn + */ + + +function applyStyle(dom, styleFn) { + if (styleFn) { + dom.attr('style', styleFn); + } +} +/** + * @param {any} node + * @returns {SVGForeignObjectElement} Node + */ + + +function addHtmlLabel(node) { + var fo = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject')); + var div = fo.append('xhtml:div'); + var label = node.label; + var labelClass = node.isNode ? 'nodeLabel' : 'edgeLabel'; + div.html('' + label + ''); + applyStyle(div, node.labelStyle); + div.style('display', 'inline-block'); // Fix for firefox + + div.style('white-space', 'nowrap'); + div.attr('xmlns', 'http://www.w3.org/1999/xhtml'); + return fo.node(); +} + +var createLabel = function createLabel(_vertexText, style, isTitle, isNode) { + var vertexText = _vertexText || ''; + if (_typeof(vertexText) === 'object') vertexText = vertexText[0]; + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { + // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that? + vertexText = vertexText.replace(/\\n|\n/g, '
'); + _logger__WEBPACK_IMPORTED_MODULE_3__.log.info('vertexText' + vertexText); + var node = { + isNode: isNode, + label: vertexText.replace(/fa[lrsb]?:fa-[\w-]+/g, function (s) { + return ""); + }), + labelStyle: style.replace('fill:', 'color:') + }; + var vertexNode = addHtmlLabel(node); // vertexNode.parentNode.removeChild(vertexNode); + + return vertexNode; + } else { + var svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text'); + svgLabel.setAttribute('style', style.replace('color:', 'fill:')); + var rows = []; + + if (typeof vertexText === 'string') { + rows = vertexText.split(/\\n|\n|/gi); + } else if (Array.isArray(vertexText)) { + rows = vertexText; + } else { + rows = []; + } + + for (var j = 0; j < rows.length; j++) { + var tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); + tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve'); + tspan.setAttribute('dy', '1em'); + tspan.setAttribute('x', '0'); + + if (isTitle) { + tspan.setAttribute('class', 'title-row'); + } else { + tspan.setAttribute('class', 'row'); + } + + tspan.textContent = rows[j].trim(); + svgLabel.appendChild(tspan); + } + + return svgLabel; + } +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (createLabel); + +/***/ }), + +/***/ "./src/dagre-wrapper/edges.js": +/*!************************************!*\ + !*** ./src/dagre-wrapper/edges.js ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "clear": () => (/* binding */ clear), +/* harmony export */ "insertEdge": () => (/* binding */ insertEdge), +/* harmony export */ "insertEdgeLabel": () => (/* binding */ insertEdgeLabel), +/* harmony export */ "intersection": () => (/* binding */ intersection), +/* harmony export */ "positionEdgeLabel": () => (/* binding */ positionEdgeLabel) +/* harmony export */ }); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); +/* harmony import */ var _createLabel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./createLabel */ "./src/dagre-wrapper/createLabel.js"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config */ "./src/config.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils */ "./src/utils.js"); +/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js"); + // eslint-disable-line + + + + + + +var edgeLabels = {}; +var terminalLabels = {}; +var clear = function clear() { + edgeLabels = {}; + terminalLabels = {}; +}; +var insertEdgeLabel = function insertEdgeLabel(elem, edge) { + // Create the actual text element + var labelElement = (0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])(edge.label, edge.labelStyle); // Create outer g, edgeLabel, this will be positioned after graph layout + + var edgeLabel = elem.insert('g').attr('class', 'edgeLabel'); // Create inner g, label, this will be positioned now for centering the text + + var label = edgeLabel.insert('g').attr('class', 'label'); + label.node().appendChild(labelElement); // Center the label + + var bbox = labelElement.getBBox(); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_3__.getConfig)().flowchart.htmlLabels)) { + var div = labelElement.children[0]; + var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(labelElement); + bbox = div.getBoundingClientRect(); + dv.attr('width', bbox.width); + dv.attr('height', bbox.height); + } + + label.attr('transform', 'translate(' + -bbox.width / 2 + ', ' + -bbox.height / 2 + ')'); // Make element accessible by id for positioning + + edgeLabels[edge.id] = edgeLabel; // Update the abstract data of the edge with the new information about its width and height + + edge.width = bbox.width; + edge.height = bbox.height; + var fo; + + if (edge.startLabelLeft) { + // Create the actual text element + var startLabelElement = (0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])(edge.startLabelLeft, edge.labelStyle); + var startEdgeLabelLeft = elem.insert('g').attr('class', 'edgeTerminals'); + var inner = startEdgeLabelLeft.insert('g').attr('class', 'inner'); + fo = inner.node().appendChild(startLabelElement); + var slBox = startLabelElement.getBBox(); + inner.attr('transform', 'translate(' + -slBox.width / 2 + ', ' + -slBox.height / 2 + ')'); + + if (!terminalLabels[edge.id]) { + terminalLabels[edge.id] = {}; + } + + terminalLabels[edge.id].startLeft = startEdgeLabelLeft; + setTerminalWidth(fo, edge.startLabelLeft); + } + + if (edge.startLabelRight) { + // Create the actual text element + var _startLabelElement = (0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])(edge.startLabelRight, edge.labelStyle); + + var startEdgeLabelRight = elem.insert('g').attr('class', 'edgeTerminals'); + + var _inner = startEdgeLabelRight.insert('g').attr('class', 'inner'); + + fo = startEdgeLabelRight.node().appendChild(_startLabelElement); + + _inner.node().appendChild(_startLabelElement); + + var _slBox = _startLabelElement.getBBox(); + + _inner.attr('transform', 'translate(' + -_slBox.width / 2 + ', ' + -_slBox.height / 2 + ')'); + + if (!terminalLabels[edge.id]) { + terminalLabels[edge.id] = {}; + } + + terminalLabels[edge.id].startRight = startEdgeLabelRight; + setTerminalWidth(fo, edge.startLabelRight); + } + + if (edge.endLabelLeft) { + // Create the actual text element + var endLabelElement = (0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])(edge.endLabelLeft, edge.labelStyle); + var endEdgeLabelLeft = elem.insert('g').attr('class', 'edgeTerminals'); + + var _inner2 = endEdgeLabelLeft.insert('g').attr('class', 'inner'); + + fo = _inner2.node().appendChild(endLabelElement); + + var _slBox2 = endLabelElement.getBBox(); + + _inner2.attr('transform', 'translate(' + -_slBox2.width / 2 + ', ' + -_slBox2.height / 2 + ')'); + + endEdgeLabelLeft.node().appendChild(endLabelElement); + + if (!terminalLabels[edge.id]) { + terminalLabels[edge.id] = {}; + } + + terminalLabels[edge.id].endLeft = endEdgeLabelLeft; + setTerminalWidth(fo, edge.endLabelLeft); + } + + if (edge.endLabelRight) { + // Create the actual text element + var _endLabelElement = (0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])(edge.endLabelRight, edge.labelStyle); + + var endEdgeLabelRight = elem.insert('g').attr('class', 'edgeTerminals'); + + var _inner3 = endEdgeLabelRight.insert('g').attr('class', 'inner'); + + fo = _inner3.node().appendChild(_endLabelElement); + + var _slBox3 = _endLabelElement.getBBox(); + + _inner3.attr('transform', 'translate(' + -_slBox3.width / 2 + ', ' + -_slBox3.height / 2 + ')'); + + endEdgeLabelRight.node().appendChild(_endLabelElement); + + if (!terminalLabels[edge.id]) { + terminalLabels[edge.id] = {}; + } + + terminalLabels[edge.id].endRight = endEdgeLabelRight; + setTerminalWidth(fo, edge.endLabelRight); + } +}; +/** + * @param {any} fo + * @param {any} value + */ + +function setTerminalWidth(fo, value) { + if ((0,_config__WEBPACK_IMPORTED_MODULE_3__.getConfig)().flowchart.htmlLabels && fo) { + fo.style.width = value.length * 9 + 'px'; + fo.style.height = '12px'; + } +} + +var positionEdgeLabel = function positionEdgeLabel(edge, paths) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Moving label abc78 ', edge.id, edge.label, edgeLabels[edge.id]); + var path = paths.updatedPath ? paths.updatedPath : paths.originalPath; + + if (edge.label) { + var el = edgeLabels[edge.id]; + var x = edge.x; + var y = edge.y; + + if (path) { + // // debugger; + var pos = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcLabelPosition(path); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Moving label from (', x, ',', y, ') to (', pos.x, ',', pos.y, ') abc78'); // x = pos.x; + // y = pos.y; + } + + el.attr('transform', 'translate(' + x + ', ' + y + ')'); + } //let path = paths.updatedPath ? paths.updatedPath : paths.originalPath; + + + if (edge.startLabelLeft) { + var _el = terminalLabels[edge.id].startLeft; + var _x2 = edge.x; + var _y2 = edge.y; + + if (path) { + // debugger; + var _pos = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, 'start_left', path); + + _x2 = _pos.x; + _y2 = _pos.y; + } + + _el.attr('transform', 'translate(' + _x2 + ', ' + _y2 + ')'); + } + + if (edge.startLabelRight) { + var _el2 = terminalLabels[edge.id].startRight; + var _x3 = edge.x; + var _y3 = edge.y; + + if (path) { + // debugger; + var _pos2 = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, 'start_right', path); + + _x3 = _pos2.x; + _y3 = _pos2.y; + } + + _el2.attr('transform', 'translate(' + _x3 + ', ' + _y3 + ')'); + } + + if (edge.endLabelLeft) { + var _el3 = terminalLabels[edge.id].endLeft; + var _x4 = edge.x; + var _y4 = edge.y; + + if (path) { + // debugger; + var _pos3 = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, 'end_left', path); + + _x4 = _pos3.x; + _y4 = _pos3.y; + } + + _el3.attr('transform', 'translate(' + _x4 + ', ' + _y4 + ')'); + } + + if (edge.endLabelRight) { + var _el4 = terminalLabels[edge.id].endRight; + var _x5 = edge.x; + var _y5 = edge.y; + + if (path) { + // debugger; + var _pos4 = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, 'end_right', path); + + _x5 = _pos4.x; + _y5 = _pos4.y; + } + + _el4.attr('transform', 'translate(' + _x5 + ', ' + _y5 + ')'); + } +}; + +var outsideNode = function outsideNode(node, point) { + // log.warn('Checking bounds ', node, point); + var x = node.x; + var y = node.y; + var dx = Math.abs(point.x - x); + var dy = Math.abs(point.y - y); + var w = node.width / 2; + var h = node.height / 2; + + if (dx >= w || dy >= h) { + return true; + } + + return false; +}; + +var intersection = function intersection(node, outsidePoint, insidePoint) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn("intersection calc abc89:\n outsidePoint: ".concat(JSON.stringify(outsidePoint), "\n insidePoint : ").concat(JSON.stringify(insidePoint), "\n node : x:").concat(node.x, " y:").concat(node.y, " w:").concat(node.width, " h:").concat(node.height)); + var x = node.x; + var y = node.y; + var dx = Math.abs(x - insidePoint.x); // const dy = Math.abs(y - insidePoint.y); + + var w = node.width / 2; + var r = insidePoint.x < outsidePoint.x ? w - dx : w + dx; + var h = node.height / 2; // const edges = { + // x1: x - w, + // x2: x + w, + // y1: y - h, + // y2: y + h + // }; + // if ( + // outsidePoint.x === edges.x1 || + // outsidePoint.x === edges.x2 || + // outsidePoint.y === edges.y1 || + // outsidePoint.y === edges.y2 + // ) { + // log.warn('abc89 calc equals on edge', outsidePoint, edges); + // return outsidePoint; + // } + + var Q = Math.abs(outsidePoint.y - insidePoint.y); + var R = Math.abs(outsidePoint.x - insidePoint.x); // log.warn(); + + if (Math.abs(y - outsidePoint.y) * w > Math.abs(x - outsidePoint.x) * h) { + // eslint-disable-line + // Intersection is top or bottom of rect. + // let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y; + var q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y; + r = R * q / Q; + var res = { + x: insidePoint.x < outsidePoint.x ? insidePoint.x + r : insidePoint.x - R + r, + y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q + }; + + if (r === 0) { + res.x = outsidePoint.x; + res.y = outsidePoint.y; + } + + if (R === 0) { + res.x = outsidePoint.x; + } + + if (Q === 0) { + res.y = outsidePoint.y; + } + + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn("abc89 topp/bott calc, Q ".concat(Q, ", q ").concat(q, ", R ").concat(R, ", r ").concat(r), res); + return res; + } else { + // Intersection onn sides of rect + if (insidePoint.x < outsidePoint.x) { + r = outsidePoint.x - w - x; + } else { + // r = outsidePoint.x - w - x; + r = x - w - outsidePoint.x; + } + + var _q = Q * r / R; // OK let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x + dx - w; + // OK let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : outsidePoint.x + r; + + + var _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x - R + r; // let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : outsidePoint.x + r; + + + var _y = insidePoint.y < outsidePoint.y ? insidePoint.y + _q : insidePoint.y - _q; + + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn("sides calc abc89, Q ".concat(Q, ", q ").concat(_q, ", R ").concat(R, ", r ").concat(r), { + _x: _x, + _y: _y + }); + + if (r === 0) { + _x = outsidePoint.x; + _y = outsidePoint.y; + } + + if (R === 0) { + _x = outsidePoint.x; + } + + if (Q === 0) { + _y = outsidePoint.y; + } + + return { + x: _x, + y: _y + }; + } +}; +/** + * This function will page a path and node where the last point(s) in the path is inside the node + * and return an update path ending by the border of the node. + * + * @param {Array} _points + * @param {any} boundryNode + * @returns {Array} Points + */ + +var cutPathAtIntersect = function cutPathAtIntersect(_points, boundryNode) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 cutPathAtIntersect', _points, boundryNode); + var points = []; + var lastPointOutside = _points[0]; + var isInside = false; + + _points.forEach(function (point) { + // const node = clusterDb[edge.toCluster].node; + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('abc88 checking point', point, boundryNode); // check if point is inside the boundry rect + + if (!outsideNode(boundryNode, point) && !isInside) { + // First point inside the rect found + // Calc the intersection coord between the point anf the last point outside the rect + var inter = intersection(boundryNode, lastPointOutside, point); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 inside', point, lastPointOutside, inter); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 intersection', inter); // // Check case where the intersection is the same as the last point + + var pointPresent = false; + points.forEach(function (p) { + pointPresent = pointPresent || p.x === inter.x && p.y === inter.y; + }); // // if (!pointPresent) { + + if (!points.find(function (e) { + return e.x === inter.x && e.y === inter.y; + })) { + points.push(inter); + } else { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 no intersect', inter, points); + } // points.push(inter); + + + isInside = true; + } else { + // Outside + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 outside', point, lastPointOutside); + lastPointOutside = point; // points.push(point); + + if (!isInside) points.push(point); + } + }); + + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 returning points', points); + return points; +}; //(edgePaths, e, edge, clusterDb, diagramtype, graph) + + +var insertEdge = function insertEdge(elem, e, edge, clusterDb, diagramType, graph) { + var points = edge.points; + var pointsHasChanged = false; + var tail = graph.node(e.v); + var head = graph.node(e.w); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('abc88 InsertEdge: ', edge); + + if (head.intersect && tail.intersect) { + points = points.slice(1, edge.points.length - 1); + points.unshift(tail.intersect(points[0])); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Last point', points[points.length - 1], head, head.intersect(points[points.length - 1])); + points.push(head.intersect(points[points.length - 1])); + } + + if (edge.toCluster) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('to cluster abc88', clusterDb[edge.toCluster]); + points = cutPathAtIntersect(edge.points, clusterDb[edge.toCluster].node); // log.trace('edge', edge); + // points = []; + // let lastPointOutside; // = edge.points[0]; + // let isInside = false; + // edge.points.forEach(point => { + // const node = clusterDb[edge.toCluster].node; + // log.warn('checking from', edge.fromCluster, point, node); + // if (!outsideNode(node, point) && !isInside) { + // log.trace('inside', edge.toCluster, point, lastPointOutside); + // // First point inside the rect + // const inter = intersection(node, lastPointOutside, point); + // let pointPresent = false; + // points.forEach(p => { + // pointPresent = pointPresent || (p.x === inter.x && p.y === inter.y); + // }); + // // if (!pointPresent) { + // if (!points.find(e => e.x === inter.x && e.y === inter.y)) { + // points.push(inter); + // } else { + // log.warn('no intersect', inter, points); + // } + // isInside = true; + // } else { + // // outside + // lastPointOutside = point; + // if (!isInside) points.push(point); + // } + // }); + + pointsHasChanged = true; + } + + if (edge.fromCluster) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('from cluster abc88', clusterDb[edge.fromCluster]); + points = cutPathAtIntersect(points.reverse(), clusterDb[edge.fromCluster].node).reverse(); + pointsHasChanged = true; + } // The data for our line + + + var lineData = points.filter(function (p) { + return !Number.isNaN(p.y); + }); // This is the accessor function we talked about above + + var curve; // Currently only flowcharts get the curve from the settings, perhaps this should + // be expanded to a common setting? Restricting it for now in order not to cause side-effects that + // have not been thought through + + if (diagramType === 'graph' || diagramType === 'flowchart') { + curve = edge.curve || d3__WEBPACK_IMPORTED_MODULE_0__.curveBasis; + } else { + curve = d3__WEBPACK_IMPORTED_MODULE_0__.curveBasis; + } // curve = curveLinear; + + + var lineFunction = (0,d3__WEBPACK_IMPORTED_MODULE_0__.line)().x(function (d) { + return d.x; + }).y(function (d) { + return d.y; + }).curve(curve); // Contruct stroke classes based on properties + + var strokeClasses; + + switch (edge.thickness) { + case 'normal': + strokeClasses = 'edge-thickness-normal'; + break; + + case 'thick': + strokeClasses = 'edge-thickness-thick'; + break; + + default: + strokeClasses = ''; + } + + switch (edge.pattern) { + case 'solid': + strokeClasses += ' edge-pattern-solid'; + break; + + case 'dotted': + strokeClasses += ' edge-pattern-dotted'; + break; + + case 'dashed': + strokeClasses += ' edge-pattern-dashed'; + break; + } + + var svgPath = elem.append('path').attr('d', lineFunction(lineData)).attr('id', edge.id).attr('class', ' ' + strokeClasses + (edge.classes ? ' ' + edge.classes : '')).attr('style', edge.style); // DEBUG code, adds a red circle at each edge coordinate + // edge.points.forEach(point => { + // elem + // .append('circle') + // .style('stroke', 'red') + // .style('fill', 'red') + // .attr('r', 1) + // .attr('cx', point.x) + // .attr('cy', point.y); + // }); + + var url = ''; + + if ((0,_config__WEBPACK_IMPORTED_MODULE_3__.getConfig)().state.arrowMarkerAbsolute) { + url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search; + url = url.replace(/\(/g, '\\('); + url = url.replace(/\)/g, '\\)'); + } + + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('arrowTypeStart', edge.arrowTypeStart); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('arrowTypeEnd', edge.arrowTypeEnd); + + switch (edge.arrowTypeStart) { + case 'arrow_cross': + svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-crossStart' + ')'); + break; + + case 'arrow_point': + svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-pointStart' + ')'); + break; + + case 'arrow_barb': + svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-barbStart' + ')'); + break; + + case 'arrow_circle': + svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-circleStart' + ')'); + break; + + case 'aggregation': + svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-aggregationStart' + ')'); + break; + + case 'extension': + svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-extensionStart' + ')'); + break; + + case 'composition': + svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-compositionStart' + ')'); + break; + + case 'dependency': + svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-dependencyStart' + ')'); + break; + + default: + } + + switch (edge.arrowTypeEnd) { + case 'arrow_cross': + svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-crossEnd' + ')'); + break; + + case 'arrow_point': + svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-pointEnd' + ')'); + break; + + case 'arrow_barb': + svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-barbEnd' + ')'); + break; + + case 'arrow_circle': + svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-circleEnd' + ')'); + break; + + case 'aggregation': + svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-aggregationEnd' + ')'); + break; + + case 'extension': + svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-extensionEnd' + ')'); + break; + + case 'composition': + svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-compositionEnd' + ')'); + break; + + case 'dependency': + svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-dependencyEnd' + ')'); + break; + + default: + } + + var paths = {}; + + if (pointsHasChanged) { + paths.updatedPath = points; + } + + paths.originalPath = edge.points; + return paths; +}; + +/***/ }), + +/***/ "./src/dagre-wrapper/index.js": +/*!************************************!*\ + !*** ./src/dagre-wrapper/index.js ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "render": () => (/* binding */ render) +/* harmony export */ }); +/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dagre */ "dagre"); +/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! graphlib */ "graphlib"); +/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _markers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./markers */ "./src/dagre-wrapper/markers.js"); +/* harmony import */ var _shapes_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shapes/util */ "./src/dagre-wrapper/shapes/util.js"); +/* harmony import */ var _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mermaid-graphlib */ "./src/dagre-wrapper/mermaid-graphlib.js"); +/* harmony import */ var _nodes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./nodes */ "./src/dagre-wrapper/nodes.js"); +/* harmony import */ var _clusters__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./clusters */ "./src/dagre-wrapper/clusters.js"); +/* harmony import */ var _edges__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./edges */ "./src/dagre-wrapper/edges.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); + + + + + + + + + + +var recursiveRender = function recursiveRender(_elem, graph, diagramtype, parentCluster) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Graph in recursive render: XXX', graphlib__WEBPACK_IMPORTED_MODULE_1___default().json.write(graph), parentCluster); + var dir = graph.graph().rankdir; + _logger__WEBPACK_IMPORTED_MODULE_2__.log.trace('Dir in recursive render - dir:', dir); + + var elem = _elem.insert('g').attr('class', 'root'); // eslint-disable-line + + + if (!graph.nodes()) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('No nodes found for', graph); + } else { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Recursive render XXX', graph.nodes()); + } + + if (graph.edges().length > 0) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.trace('Recursive edges', graph.edge(graph.edges()[0])); + } + + var clusters = elem.insert('g').attr('class', 'clusters'); // eslint-disable-line + + var edgePaths = elem.insert('g').attr('class', 'edgePaths'); + var edgeLabels = elem.insert('g').attr('class', 'edgeLabels'); + var nodes = elem.insert('g').attr('class', 'nodes'); // Insert nodes, this will insert them into the dom and each node will get a size. The size is updated + // to the abstract node and is later used by dagre for the layout + + graph.nodes().forEach(function (v) { + var node = graph.node(v); + + if (typeof parentCluster !== 'undefined') { + var data = JSON.parse(JSON.stringify(parentCluster.clusterData)); // data.clusterPositioning = true; + + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Setting data for cluster XXX (', v, ') ', data, parentCluster); + graph.setNode(parentCluster.id, data); + + if (!graph.parent(v)) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.trace('Setting parent', v, parentCluster.id); + graph.setParent(v, parentCluster.id, data); + } + } + + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('(Insert) Node XXX' + v + ': ' + JSON.stringify(graph.node(v))); + + if (node && node.clusterNode) { + // const children = graph.children(v); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Cluster identified', v, node.width, graph.node(v)); + var o = recursiveRender(nodes, node.graph, diagramtype, graph.node(v)); + var newEl = o.elem; + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, newEl); + node.diff = o.diff || 0; + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Node bounds (abc123)', v, node, node.width, node.x, node.y); + (0,_nodes__WEBPACK_IMPORTED_MODULE_4__.setNodeElem)(newEl, node); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.warn('Recursive render complete ', newEl, node); + } else { + if (graph.children(v).length > 0) { + // This is a cluster but not to be rendered recursively + // Render as before + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Cluster - the non recursive path XXX', v, node.id, node, graph); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info((0,_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.findNonClusterChild)(node.id, graph)); + _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb[node.id] = { + id: (0,_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.findNonClusterChild)(node.id, graph), + node: node + }; // insertCluster(clusters, graph.node(v)); + } else { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Node - the non recursive path', v, node.id, node); + (0,_nodes__WEBPACK_IMPORTED_MODULE_4__.insertNode)(nodes, graph.node(v), dir); + } + } + }); // Insert labels, this will insert them into the dom so that the width can be calculated + // Also figure out which edges point to/from clusters and adjust them accordingly + // Edges from/to clusters really points to the first child in the cluster. + // TODO: pick optimal child in the cluster to us as link anchor + + graph.edges().forEach(function (e) { + var edge = graph.edge(e.v, e.w, e.name); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e)); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Edge ' + e.v + ' -> ' + e.w + ': ', e, ' ', JSON.stringify(graph.edge(e))); // Check if link is either from or to a cluster + + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Fix', _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb, 'ids:', e.v, e.w, 'Translateing: ', _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb[e.v], _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb[e.w]); + (0,_edges__WEBPACK_IMPORTED_MODULE_6__.insertEdgeLabel)(edgeLabels, edge); + }); + graph.edges().forEach(function (e) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e)); + }); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('#############################################'); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('### Layout ###'); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('#############################################'); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info(graph); + dagre__WEBPACK_IMPORTED_MODULE_0___default().layout(graph); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Graph after layout:', graphlib__WEBPACK_IMPORTED_MODULE_1___default().json.write(graph)); // Move the nodes to the correct place + + var diff = 0; + (0,_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.sortNodesByHierarchy)(graph).forEach(function (v) { + var node = graph.node(v); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Position ' + v + ': ' + JSON.stringify(graph.node(v))); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Position ' + v + ': (' + node.x, ',' + node.y, ') width: ', node.width, ' height: ', node.height); + + if (node && node.clusterNode) { + // clusterDb[node.id].node = node; + (0,_nodes__WEBPACK_IMPORTED_MODULE_4__.positionNode)(node); + } else { + // Non cluster node + if (graph.children(v).length > 0) { + // A cluster in the non-recursive way + // positionCluster(node); + (0,_clusters__WEBPACK_IMPORTED_MODULE_7__.insertCluster)(clusters, node); + _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb[node.id].node = node; + } else { + (0,_nodes__WEBPACK_IMPORTED_MODULE_4__.positionNode)(node); + } + } + }); // Move the edge labels to the correct place after layout + + graph.edges().forEach(function (e) { + var edge = graph.edge(e); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(edge), edge); + var paths = (0,_edges__WEBPACK_IMPORTED_MODULE_6__.insertEdge)(edgePaths, e, edge, _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb, diagramtype, graph); + (0,_edges__WEBPACK_IMPORTED_MODULE_6__.positionEdgeLabel)(edge, paths); + }); + graph.nodes().forEach(function (v) { + var n = graph.node(v); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info(v, n.type, n.diff); + + if (n.type === 'group') { + diff = n.diff; + } + }); + return { + elem: elem, + diff: diff + }; +}; + +var render = function render(elem, graph, markers, diagramtype, id) { + (0,_markers__WEBPACK_IMPORTED_MODULE_8__["default"])(elem, markers, diagramtype, id); + (0,_nodes__WEBPACK_IMPORTED_MODULE_4__.clear)(); + (0,_edges__WEBPACK_IMPORTED_MODULE_6__.clear)(); + (0,_clusters__WEBPACK_IMPORTED_MODULE_7__.clear)(); + (0,_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clear)(); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.warn('Graph at first:', graphlib__WEBPACK_IMPORTED_MODULE_1___default().json.write(graph)); + (0,_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.adjustClustersAndEdges)(graph); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.warn('Graph after:', graphlib__WEBPACK_IMPORTED_MODULE_1___default().json.write(graph)); // log.warn('Graph ever after:', graphlib.json.write(graph.node('A').graph)); + + recursiveRender(elem, graph, diagramtype); +}; // const shapeDefinitions = {}; +// export const addShape = ({ shapeType: fun }) => { +// shapeDefinitions[shapeType] = fun; +// }; +// const arrowDefinitions = {}; +// export const addArrow = ({ arrowType: fun }) => { +// arrowDefinitions[arrowType] = fun; +// }; + +/***/ }), + +/***/ "./src/dagre-wrapper/intersect/index.js": +/*!**********************************************!*\ + !*** ./src/dagre-wrapper/intersect/index.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _intersect_node_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./intersect-node.js */ "./src/dagre-wrapper/intersect/intersect-node.js"); +/* harmony import */ var _intersect_node_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_intersect_node_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _intersect_circle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./intersect-circle.js */ "./src/dagre-wrapper/intersect/intersect-circle.js"); +/* harmony import */ var _intersect_ellipse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./intersect-ellipse.js */ "./src/dagre-wrapper/intersect/intersect-ellipse.js"); +/* harmony import */ var _intersect_polygon_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./intersect-polygon.js */ "./src/dagre-wrapper/intersect/intersect-polygon.js"); +/* harmony import */ var _intersect_rect_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./intersect-rect.js */ "./src/dagre-wrapper/intersect/intersect-rect.js"); +/* + * Borrowed with love from from dagrge-d3. Many thanks to cpettitt! + */ + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + node: (_intersect_node_js__WEBPACK_IMPORTED_MODULE_0___default()), + circle: _intersect_circle_js__WEBPACK_IMPORTED_MODULE_1__["default"], + ellipse: _intersect_ellipse_js__WEBPACK_IMPORTED_MODULE_2__["default"], + polygon: _intersect_polygon_js__WEBPACK_IMPORTED_MODULE_3__["default"], + rect: _intersect_rect_js__WEBPACK_IMPORTED_MODULE_4__["default"] +}); + +/***/ }), + +/***/ "./src/dagre-wrapper/intersect/intersect-circle.js": +/*!*********************************************************!*\ + !*** ./src/dagre-wrapper/intersect/intersect-circle.js ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _intersect_ellipse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./intersect-ellipse */ "./src/dagre-wrapper/intersect/intersect-ellipse.js"); + +/** + * @param node + * @param rx + * @param point + */ + +function intersectCircle(node, rx, point) { + return (0,_intersect_ellipse__WEBPACK_IMPORTED_MODULE_0__["default"])(node, rx, rx, point); +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (intersectCircle); + +/***/ }), + +/***/ "./src/dagre-wrapper/intersect/intersect-ellipse.js": +/*!**********************************************************!*\ + !*** ./src/dagre-wrapper/intersect/intersect-ellipse.js ***! + \**********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/** + * @param node + * @param rx + * @param ry + * @param point + */ +function intersectEllipse(node, rx, ry, point) { + // Formulae from: https://mathworld.wolfram.com/Ellipse-LineIntersection.html + var cx = node.x; + var cy = node.y; + var px = cx - point.x; + var py = cy - point.y; + var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px); + var dx = Math.abs(rx * ry * px / det); + + if (point.x < cx) { + dx = -dx; + } + + var dy = Math.abs(rx * ry * py / det); + + if (point.y < cy) { + dy = -dy; + } + + return { + x: cx + dx, + y: cy + dy + }; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (intersectEllipse); + +/***/ }), + +/***/ "./src/dagre-wrapper/intersect/intersect-line.js": +/*!*******************************************************!*\ + !*** ./src/dagre-wrapper/intersect/intersect-line.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/** + * Returns the point at which two lines, p and q, intersect or returns undefined if they do not intersect. + * + * @param p1 + * @param p2 + * @param q1 + * @param q2 + */ +function intersectLine(p1, p2, q1, q2) { + // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994, + // p7 and p473. + var a1, a2, b1, b2, c1, c2; + var r1, r2, r3, r4; + var denom, offset, num; + var x, y; // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x + + // b1 y + c1 = 0. + + a1 = p2.y - p1.y; + b1 = p1.x - p2.x; + c1 = p2.x * p1.y - p1.x * p2.y; // Compute r3 and r4. + + r3 = a1 * q1.x + b1 * q1.y + c1; + r4 = a1 * q2.x + b1 * q2.y + c1; // Check signs of r3 and r4. If both point 3 and point 4 lie on + // same side of line 1, the line segments do not intersect. + + if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) { + return; + } // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0 + + + a2 = q2.y - q1.y; + b2 = q1.x - q2.x; + c2 = q2.x * q1.y - q1.x * q2.y; // Compute r1 and r2 + + r1 = a2 * p1.x + b2 * p1.y + c2; + r2 = a2 * p2.x + b2 * p2.y + c2; // Check signs of r1 and r2. If both point 1 and point 2 lie + // on same side of second line segment, the line segments do + // not intersect. + + if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) { + return; + } // Line segments intersect: compute intersection point. + + + denom = a1 * b2 - a2 * b1; + + if (denom === 0) { + return; + } + + offset = Math.abs(denom / 2); // The denom/2 is to get rounding instead of truncating. It + // is added or subtracted to the numerator, depending upon the + // sign of the numerator. + + num = b1 * c2 - b2 * c1; + x = num < 0 ? (num - offset) / denom : (num + offset) / denom; + num = a2 * c1 - a1 * c2; + y = num < 0 ? (num - offset) / denom : (num + offset) / denom; + return { + x: x, + y: y + }; +} +/** + * @param r1 + * @param r2 + */ + + +function sameSign(r1, r2) { + return r1 * r2 > 0; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (intersectLine); + +/***/ }), + +/***/ "./src/dagre-wrapper/intersect/intersect-node.js": +/*!*******************************************************!*\ + !*** ./src/dagre-wrapper/intersect/intersect-node.js ***! + \*******************************************************/ +/***/ ((module) => { + +module.exports = intersectNode; +/** + * @param node + * @param point + */ + +function intersectNode(node, point) { + // console.info('Intersect Node'); + return node.intersect(point); +} + +/***/ }), + +/***/ "./src/dagre-wrapper/intersect/intersect-polygon.js": +/*!**********************************************************!*\ + !*** ./src/dagre-wrapper/intersect/intersect-polygon.js ***! + \**********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _intersect_line__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./intersect-line */ "./src/dagre-wrapper/intersect/intersect-line.js"); +/* eslint "no-console": off */ + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (intersectPolygon); +/** + * Returns the point ({x, y}) at which the point argument intersects with the node argument assuming + * that it has the shape specified by polygon. + * + * @param node + * @param polyPoints + * @param point + */ + +function intersectPolygon(node, polyPoints, point) { + var x1 = node.x; + var y1 = node.y; + var intersections = []; + var minX = Number.POSITIVE_INFINITY; + var minY = Number.POSITIVE_INFINITY; + + if (typeof polyPoints.forEach === 'function') { + polyPoints.forEach(function (entry) { + minX = Math.min(minX, entry.x); + minY = Math.min(minY, entry.y); + }); + } else { + minX = Math.min(minX, polyPoints.x); + minY = Math.min(minY, polyPoints.y); + } + + var left = x1 - node.width / 2 - minX; + var top = y1 - node.height / 2 - minY; + + for (var i = 0; i < polyPoints.length; i++) { + var p1 = polyPoints[i]; + var p2 = polyPoints[i < polyPoints.length - 1 ? i + 1 : 0]; + var intersect = (0,_intersect_line__WEBPACK_IMPORTED_MODULE_0__["default"])(node, point, { + x: left + p1.x, + y: top + p1.y + }, { + x: left + p2.x, + y: top + p2.y + }); + + if (intersect) { + intersections.push(intersect); + } + } + + if (!intersections.length) { + // console.log('NO INTERSECTION FOUND, RETURN NODE CENTER', node); + return node; + } + + if (intersections.length > 1) { + // More intersections, find the one nearest to edge end point + intersections.sort(function (p, q) { + var pdx = p.x - point.x; + var pdy = p.y - point.y; + var distp = Math.sqrt(pdx * pdx + pdy * pdy); + var qdx = q.x - point.x; + var qdy = q.y - point.y; + var distq = Math.sqrt(qdx * qdx + qdy * qdy); + return distp < distq ? -1 : distp === distq ? 0 : 1; + }); + } + + return intersections[0]; +} + +/***/ }), + +/***/ "./src/dagre-wrapper/intersect/intersect-rect.js": +/*!*******************************************************!*\ + !*** ./src/dagre-wrapper/intersect/intersect-rect.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +var intersectRect = function intersectRect(node, point) { + var x = node.x; + var y = node.y; // Rectangle intersection algorithm from: + // https://math.stackexchange.com/questions/108113/find-edge-between-two-boxes + + var dx = point.x - x; + var dy = point.y - y; + var w = node.width / 2; + var h = node.height / 2; + var sx, sy; + + if (Math.abs(dy) * w > Math.abs(dx) * h) { + // Intersection is top or bottom of rect. + if (dy < 0) { + h = -h; + } + + sx = dy === 0 ? 0 : h * dx / dy; + sy = h; + } else { + // Intersection is left or right of rect. + if (dx < 0) { + w = -w; + } + + sx = w; + sy = dx === 0 ? 0 : w * dy / dx; + } + + return { + x: x + sx, + y: y + sy + }; +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (intersectRect); + +/***/ }), + +/***/ "./src/dagre-wrapper/markers.js": +/*!**************************************!*\ + !*** ./src/dagre-wrapper/markers.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); +/** Setup arrow head and define the marker. The result is appended to the svg. */ + // Only add the number of markers that the diagram needs + +var insertMarkers = function insertMarkers(elem, markerArray, type, id) { + markerArray.forEach(function (markerName) { + markers[markerName](elem, type, id); + }); +}; + +var extension = function extension(elem, type, id) { + _logger__WEBPACK_IMPORTED_MODULE_0__.log.trace('Making markers for ', id); + elem.append('defs').append('marker').attr('id', type + '-extensionStart').attr('class', 'marker extension ' + type).attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 1,7 L18,13 V 1 Z'); + elem.append('defs').append('marker').attr('id', type + '-extensionEnd').attr('class', 'marker extension ' + type).attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead +}; + +var composition = function composition(elem, type) { + elem.append('defs').append('marker').attr('id', type + '-compositionStart').attr('class', 'marker composition ' + type).attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); + elem.append('defs').append('marker').attr('id', type + '-compositionEnd').attr('class', 'marker composition ' + type).attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); +}; + +var aggregation = function aggregation(elem, type) { + elem.append('defs').append('marker').attr('id', type + '-aggregationStart').attr('class', 'marker aggregation ' + type).attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); + elem.append('defs').append('marker').attr('id', type + '-aggregationEnd').attr('class', 'marker aggregation ' + type).attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); +}; + +var dependency = function dependency(elem, type) { + elem.append('defs').append('marker').attr('id', type + '-dependencyStart').attr('class', 'marker dependency ' + type).attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z'); + elem.append('defs').append('marker').attr('id', type + '-dependencyEnd').attr('class', 'marker dependency ' + type).attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z'); +}; + +var point = function point(elem, type) { + elem.append('marker').attr('id', type + '-pointEnd').attr('class', 'marker ' + type).attr('viewBox', '0 0 10 10').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 12).attr('markerHeight', 12).attr('orient', 'auto').append('path').attr('d', 'M 0 0 L 10 5 L 0 10 z').attr('class', 'arrowMarkerPath').style('stroke-width', 1).style('stroke-dasharray', '1,0'); + elem.append('marker').attr('id', type + '-pointStart').attr('class', 'marker ' + type).attr('viewBox', '0 0 10 10').attr('refX', 0).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 12).attr('markerHeight', 12).attr('orient', 'auto').append('path').attr('d', 'M 0 5 L 10 10 L 10 0 z').attr('class', 'arrowMarkerPath').style('stroke-width', 1).style('stroke-dasharray', '1,0'); +}; + +var circle = function circle(elem, type) { + elem.append('marker').attr('id', type + '-circleEnd').attr('class', 'marker ' + type).attr('viewBox', '0 0 10 10').attr('refX', 11).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 11).attr('markerHeight', 11).attr('orient', 'auto').append('circle').attr('cx', '5').attr('cy', '5').attr('r', '5').attr('class', 'arrowMarkerPath').style('stroke-width', 1).style('stroke-dasharray', '1,0'); + elem.append('marker').attr('id', type + '-circleStart').attr('class', 'marker ' + type).attr('viewBox', '0 0 10 10').attr('refX', -1).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 11).attr('markerHeight', 11).attr('orient', 'auto').append('circle').attr('cx', '5').attr('cy', '5').attr('r', '5').attr('class', 'arrowMarkerPath').style('stroke-width', 1).style('stroke-dasharray', '1,0'); +}; + +var cross = function cross(elem, type) { + elem.append('marker').attr('id', type + '-crossEnd').attr('class', 'marker cross ' + type).attr('viewBox', '0 0 11 11').attr('refX', 12).attr('refY', 5.2).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 11).attr('markerHeight', 11).attr('orient', 'auto').append('path') // .attr('stroke', 'black') + .attr('d', 'M 1,1 l 9,9 M 10,1 l -9,9').attr('class', 'arrowMarkerPath').style('stroke-width', 2).style('stroke-dasharray', '1,0'); + elem.append('marker').attr('id', type + '-crossStart').attr('class', 'marker cross ' + type).attr('viewBox', '0 0 11 11').attr('refX', -1).attr('refY', 5.2).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 11).attr('markerHeight', 11).attr('orient', 'auto').append('path') // .attr('stroke', 'black') + .attr('d', 'M 1,1 l 9,9 M 10,1 l -9,9').attr('class', 'arrowMarkerPath').style('stroke-width', 2).style('stroke-dasharray', '1,0'); +}; + +var barb = function barb(elem, type) { + elem.append('defs').append('marker').attr('id', type + '-barbEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 14).attr('markerUnits', 'strokeWidth').attr('orient', 'auto').append('path').attr('d', 'M 19,7 L9,13 L14,7 L9,1 Z'); +}; // TODO rename the class diagram markers to something shape descriptive and semantic free + + +var markers = { + extension: extension, + composition: composition, + aggregation: aggregation, + dependency: dependency, + point: point, + circle: circle, + cross: cross, + barb: barb +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (insertMarkers); + +/***/ }), + +/***/ "./src/dagre-wrapper/mermaid-graphlib.js": +/*!***********************************************!*\ + !*** ./src/dagre-wrapper/mermaid-graphlib.js ***! + \***********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "adjustClustersAndEdges": () => (/* binding */ adjustClustersAndEdges), +/* harmony export */ "clear": () => (/* binding */ clear), +/* harmony export */ "clusterDb": () => (/* binding */ clusterDb), +/* harmony export */ "extractDecendants": () => (/* binding */ extractDecendants), +/* harmony export */ "extractor": () => (/* binding */ extractor), +/* harmony export */ "findNonClusterChild": () => (/* binding */ findNonClusterChild), +/* harmony export */ "sortNodesByHierarchy": () => (/* binding */ sortNodesByHierarchy), +/* harmony export */ "validate": () => (/* binding */ validate) +/* harmony export */ }); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); +/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! graphlib */ "graphlib"); +/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_0__); +/** Decorates with functions required by mermaids dagre-wrapper. */ + + +var clusterDb = {}; +var decendants = {}; +var parents = {}; +var clear = function clear() { + decendants = {}; + parents = {}; + clusterDb = {}; +}; + +var isDecendant = function isDecendant(id, ancenstorId) { + // if (id === ancenstorId) return true; + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('In isDecendant', ancenstorId, ' ', id, ' = ', decendants[ancenstorId].indexOf(id) >= 0); + if (decendants[ancenstorId].indexOf(id) >= 0) return true; + return false; +}; + +var edgeInCluster = function edgeInCluster(edge, clusterId) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Decendants of ', clusterId, ' is ', decendants[clusterId]); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Edge is ', edge); // Edges to/from the cluster is not in the cluster, they are in the parent + + if (edge.v === clusterId) return false; + if (edge.w === clusterId) return false; + + if (!decendants[clusterId]) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Tilt, ', clusterId, ',not in decendants'); + return false; + } + + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Here '); + if (decendants[clusterId].indexOf(edge.v) >= 0) return true; + if (isDecendant(edge.v, clusterId)) return true; + if (isDecendant(edge.w, clusterId)) return true; + if (decendants[clusterId].indexOf(edge.w) >= 0) return true; + return false; +}; + +var copy = function copy(clusterId, graph, newGraph, rootId) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Copying children of ', clusterId, 'root', rootId, 'data', graph.node(clusterId), rootId); + var nodes = graph.children(clusterId) || []; // Include cluster node if it is not the root + + if (clusterId !== rootId) { + nodes.push(clusterId); + } + + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Copying (nodes) clusterId', clusterId, 'nodes', nodes); + nodes.forEach(function (node) { + if (graph.children(node).length > 0) { + copy(node, graph, newGraph, rootId); + } else { + var data = graph.node(node); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('cp ', node, ' to ', rootId, ' with parent ', clusterId); //,node, data, ' parent is ', clusterId); + + newGraph.setNode(node, data); + + if (rootId !== graph.parent(node)) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Setting parent', node, graph.parent(node)); + newGraph.setParent(node, graph.parent(node)); + } + + if (clusterId !== rootId && node !== clusterId) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Setting parent', node, clusterId); + newGraph.setParent(node, clusterId); + } else { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('In copy ', clusterId, 'root', rootId, 'data', graph.node(clusterId), rootId); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Not Setting parent for node=', node, 'cluster!==rootId', clusterId !== rootId, 'node!==clusterId', node !== clusterId); + } + + var edges = graph.edges(node); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Copying Edges', edges); + edges.forEach(function (edge) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Edge', edge); + var data = graph.edge(edge.v, edge.w, edge.name); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Edge data', data, rootId); + + try { + // Do not copy edges in and out of the root cluster, they belong to the parent graph + if (edgeInCluster(edge, rootId)) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Copying as ', edge.v, edge.w, data, edge.name); + newGraph.setEdge(edge.v, edge.w, data, edge.name); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('newGraph edges ', newGraph.edges(), newGraph.edge(newGraph.edges()[0])); + } else { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Skipping copy of edge ', edge.v, '-->', edge.w, ' rootId: ', rootId, ' clusterId:', clusterId); + } + } catch (e) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.error(e); + } + }); + } + + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Removing node', node); + graph.removeNode(node); + }); +}; + +var extractDecendants = function extractDecendants(id, graph) { + // log.debug('Extracting ', id); + var children = graph.children(id); + var res = [].concat(children); + + for (var i = 0; i < children.length; i++) { + parents[children[i]] = id; + res = res.concat(extractDecendants(children[i], graph)); + } + + return res; +}; +/** + * Validates the graph, checking that all parent child relation points to existing nodes and that + * edges between nodes also ia correct. When not correct the function logs the discrepancies. + * + * @param graph + */ + +var validate = function validate(graph) { + var edges = graph.edges(); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Edges: ', edges); + + for (var i = 0; i < edges.length; i++) { + if (graph.children(edges[i].v).length > 0) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('The node ', edges[i].v, ' is part of and edge even though it has children'); + return false; + } + + if (graph.children(edges[i].w).length > 0) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('The node ', edges[i].w, ' is part of and edge even though it has children'); + return false; + } + } + + return true; +}; +/** + * Finds a child that is not a cluster. When faking a edge between a node and a cluster. + * + * @param {Finds a} id + * @param {any} graph + */ + +var findNonClusterChild = function findNonClusterChild(id, graph) { + // const node = graph.node(id); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Searching', id); // const children = graph.children(id).reverse(); + + var children = graph.children(id); //.reverse(); + + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Searching children of id ', id, children); + + if (children.length < 1) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('This is a valid node', id); + return id; + } + + for (var i = 0; i < children.length; i++) { + var _id = findNonClusterChild(children[i], graph); + + if (_id) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Found replacement for', id, ' => ', _id); + return _id; + } + } +}; + +var getAnchorId = function getAnchorId(id) { + if (!clusterDb[id]) { + return id; + } // If the cluster has no external connections + + + if (!clusterDb[id].externalConnections) { + return id; + } // Return the replacement node + + + if (clusterDb[id]) { + return clusterDb[id].id; + } + + return id; +}; + +var adjustClustersAndEdges = function adjustClustersAndEdges(graph, depth) { + if (!graph || depth > 10) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Opting out, no graph '); + return; + } else { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Opting in, graph '); + } // Go through the nodes and for each cluster found, save a replacement node, this can be used when + // faking a link to a cluster + + + graph.nodes().forEach(function (id) { + var children = graph.children(id); + + if (children.length > 0) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Cluster identified', id, ' Replacement id in edges: ', findNonClusterChild(id, graph)); + decendants[id] = extractDecendants(id, graph); + clusterDb[id] = { + id: findNonClusterChild(id, graph), + clusterData: graph.node(id) + }; + } + }); // Check incoming and outgoing edges for each cluster + + graph.nodes().forEach(function (id) { + var children = graph.children(id); + var edges = graph.edges(); + + if (children.length > 0) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Cluster identified', id, decendants); + edges.forEach(function (edge) { + // log.debug('Edge, decendants: ', edge, decendants[id]); + // Check if any edge leaves the cluster (not the actual cluster, thats a link from the box) + if (edge.v !== id && edge.w !== id) { + // Any edge where either the one of the nodes is decending to the cluster but not the other + // if (decendants[id].indexOf(edge.v) < 0 && decendants[id].indexOf(edge.w) < 0) { + var d1 = isDecendant(edge.v, id); + var d2 = isDecendant(edge.w, id); // d1 xor d2 - if either d1 is true and d2 is false or the other way around + + if (d1 ^ d2) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Edge: ', edge, ' leaves cluster ', id); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Decendants of XXX ', id, ': ', decendants[id]); + clusterDb[id].externalConnections = true; + } + } + }); + } else { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Not a cluster ', id, decendants); + } + }); // For clusters with incoming and/or outgoing edges translate those edges to a real node + // in the cluster in order to fake the edge + + graph.edges().forEach(function (e) { + var edge = graph.edge(e); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e)); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(graph.edge(e))); + var v = e.v; + var w = e.w; // Check if link is either from or to a cluster + + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Fix XXX', clusterDb, 'ids:', e.v, e.w, 'Translateing: ', clusterDb[e.v], ' --- ', clusterDb[e.w]); + + if (clusterDb[e.v] && clusterDb[e.w] && clusterDb[e.v] === clusterDb[e.w]) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Fixing and trixing link to self - removing XXX', e.v, e.w, e.name); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Fixing and trixing - removing XXX', e.v, e.w, e.name); + v = getAnchorId(e.v); + w = getAnchorId(e.w); + graph.removeEdge(e.v, e.w, e.name); + var specialId = e.w + '---' + e.v; + graph.setNode(specialId, { + domId: specialId, + id: specialId, + labelStyle: '', + labelText: edge.label, + padding: 0, + shape: 'labelRect', + style: '' + }); + var edge1 = JSON.parse(JSON.stringify(edge)); + var edge2 = JSON.parse(JSON.stringify(edge)); + edge1.label = ''; + edge1.arrowTypeEnd = 'none'; + edge2.label = ''; + edge1.fromCluster = e.v; + edge2.toCluster = e.v; + graph.setEdge(v, specialId, edge1, e.name + '-cyclic-special'); + graph.setEdge(specialId, w, edge2, e.name + '-cyclic-special'); + } else if (clusterDb[e.v] || clusterDb[e.w]) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Fixing and trixing - removing XXX', e.v, e.w, e.name); + v = getAnchorId(e.v); + w = getAnchorId(e.w); + graph.removeEdge(e.v, e.w, e.name); + if (v !== e.v) edge.fromCluster = e.v; + if (w !== e.w) edge.toCluster = e.w; + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Fix Replacing with XXX', v, w, e.name); + graph.setEdge(v, w, edge, e.name); + } + }); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Adjusted Graph', graphlib__WEBPACK_IMPORTED_MODULE_0___default().json.write(graph)); + extractor(graph, 0); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace(clusterDb); // Remove references to extracted cluster + // graph.edges().forEach(edge => { + // if (isDecendant(edge.v, clusterId) || isDecendant(edge.w, clusterId)) { + // graph.removeEdge(edge); + // } + // }); +}; +var extractor = function extractor(graph, depth) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('extractor - ', depth, graphlib__WEBPACK_IMPORTED_MODULE_0___default().json.write(graph), graph.children('D')); + + if (depth > 10) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.error('Bailing out'); + return; + } // For clusters without incoming and/or outgoing edges, create a new cluster-node + // containing the nodes and edges in the custer in a new graph + // for (let i = 0;) + + + var nodes = graph.nodes(); + var hasChildren = false; + + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + var children = graph.children(node); + hasChildren = hasChildren || children.length > 0; + } + + if (!hasChildren) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Done, no node has children', graph.nodes()); + return; + } // const clusters = Object.keys(clusterDb); + // clusters.forEach(clusterId => { + + + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Nodes = ', nodes, depth); + + for (var _i = 0; _i < nodes.length; _i++) { + var _node = nodes[_i]; + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Extracting node', _node, clusterDb, clusterDb[_node] && !clusterDb[_node].externalConnections, !graph.parent(_node), graph.node(_node), graph.children('D'), ' Depth ', depth); // Note that the node might have been removed after the Object.keys call so better check + // that it still is in the game + + if (!clusterDb[_node]) { + // Skip if the node is not a cluster + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Not a cluster', _node, depth); // break; + } else if (!clusterDb[_node].externalConnections && // !graph.parent(node) && + graph.children(_node) && graph.children(_node).length > 0) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Cluster without external connections, without a parent and with children', _node, depth); + var graphSettings = graph.graph(); + var dir = graphSettings.rankdir === 'TB' ? 'LR' : 'TB'; + + if (clusterDb[_node]) { + if (clusterDb[_node].clusterData && clusterDb[_node].clusterData.dir) { + dir = clusterDb[_node].clusterData.dir; + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Fixing dir', clusterDb[_node].clusterData.dir, dir); + } + } + + var clusterGraph = new (graphlib__WEBPACK_IMPORTED_MODULE_0___default().Graph)({ + multigraph: true, + compound: true + }).setGraph({ + rankdir: dir, + // Todo: set proper spacing + nodesep: 50, + ranksep: 50, + marginx: 8, + marginy: 8 + }).setDefaultEdgeLabel(function () { + return {}; + }); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Old graph before copy', graphlib__WEBPACK_IMPORTED_MODULE_0___default().json.write(graph)); + copy(_node, graph, clusterGraph, _node); + graph.setNode(_node, { + clusterNode: true, + id: _node, + clusterData: clusterDb[_node].clusterData, + labelText: clusterDb[_node].labelText, + graph: clusterGraph + }); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('New graph after copy node: (', _node, ')', graphlib__WEBPACK_IMPORTED_MODULE_0___default().json.write(clusterGraph)); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Old graph after copy', graphlib__WEBPACK_IMPORTED_MODULE_0___default().json.write(graph)); + } else { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Cluster ** ', _node, ' **not meeting the criteria !externalConnections:', !clusterDb[_node].externalConnections, ' no parent: ', !graph.parent(_node), ' children ', graph.children(_node) && graph.children(_node).length > 0, graph.children('D'), depth); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug(clusterDb); + } + } + + nodes = graph.nodes(); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('New list of nodes', nodes); + + for (var _i2 = 0; _i2 < nodes.length; _i2++) { + var _node2 = nodes[_i2]; + var data = graph.node(_node2); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn(' Now next level', _node2, data); + + if (data.clusterNode) { + extractor(data.graph, depth + 1); + } + } +}; + +var sorter = function sorter(graph, nodes) { + if (nodes.length === 0) return []; + var result = Object.assign(nodes); + nodes.forEach(function (node) { + var children = graph.children(node); + var sorted = sorter(graph, children); + result = result.concat(sorted); + }); + return result; +}; + +var sortNodesByHierarchy = function sortNodesByHierarchy(graph) { + return sorter(graph, graph.children()); +}; + +/***/ }), + +/***/ "./src/dagre-wrapper/nodes.js": +/*!************************************!*\ + !*** ./src/dagre-wrapper/nodes.js ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "clear": () => (/* binding */ clear), +/* harmony export */ "insertNode": () => (/* binding */ insertNode), +/* harmony export */ "positionNode": () => (/* binding */ positionNode), +/* harmony export */ "setNodeElem": () => (/* binding */ setNodeElem) +/* harmony export */ }); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); +/* harmony import */ var _shapes_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shapes/util */ "./src/dagre-wrapper/shapes/util.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config */ "./src/config.js"); +/* harmony import */ var _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./intersect/index.js */ "./src/dagre-wrapper/intersect/index.js"); +/* harmony import */ var _createLabel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./createLabel */ "./src/dagre-wrapper/createLabel.js"); +/* harmony import */ var _shapes_note__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./shapes/note */ "./src/dagre-wrapper/shapes/note.js"); +/* harmony import */ var _diagrams_class_svgDraw__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../diagrams/class/svgDraw */ "./src/diagrams/class/svgDraw.js"); +/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + + + // eslint-disable-line + + + + + + + + + +var sanitizeText = function sanitizeText(txt) { + return (0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.sanitizeText)(txt, (0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)()); +}; + +var question = function question(parent, node) { + var _labelHelper = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper.shapeSvg, + bbox = _labelHelper.bbox; + + var w = bbox.width + node.padding; + var h = bbox.height + node.padding; + var s = w + h; + var points = [{ + x: s / 2, + y: 0 + }, { + x: s, + y: -s / 2 + }, { + x: s / 2, + y: -s + }, { + x: 0, + y: -s / 2 + }]; + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Question main (Circle)'); + var questionElem = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, s, s, points); + questionElem.attr('style', node.style); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, questionElem); + + node.intersect = function (point) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('Intersect called'); + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var choice = function choice(parent, node) { + var shapeSvg = parent.insert('g').attr('class', 'node default').attr('id', node.domId || node.id); + var s = 28; + var points = [{ + x: 0, + y: s / 2 + }, { + x: s / 2, + y: 0 + }, { + x: 0, + y: -s / 2 + }, { + x: -s / 2, + y: 0 + }]; + var choice = shapeSvg.insert('polygon', ':first-child').attr('points', points.map(function (d) { + return d.x + ',' + d.y; + }).join(' ')); // center the circle around its coordinate + + choice.attr('class', 'state-start').attr('r', 7).attr('width', 28).attr('height', 28); + node.width = 28; + node.height = 28; + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].circle(node, 14, point); + }; + + return shapeSvg; +}; + +var hexagon = function hexagon(parent, node) { + var _labelHelper2 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper2.shapeSvg, + bbox = _labelHelper2.bbox; + + var f = 4; + var h = bbox.height + node.padding; + var m = h / f; + var w = bbox.width + 2 * m + node.padding; + var points = [{ + x: m, + y: 0 + }, { + x: w - m, + y: 0 + }, { + x: w, + y: -h / 2 + }, { + x: w - m, + y: -h + }, { + x: m, + y: -h + }, { + x: 0, + y: -h / 2 + }]; + var hex = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); + hex.attr('style', node.style); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, hex); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var rect_left_inv_arrow = function rect_left_inv_arrow(parent, node) { + var _labelHelper3 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper3.shapeSvg, + bbox = _labelHelper3.bbox; + + var w = bbox.width + node.padding; + var h = bbox.height + node.padding; + var points = [{ + x: -h / 2, + y: 0 + }, { + x: w, + y: 0 + }, { + x: w, + y: -h + }, { + x: -h / 2, + y: -h + }, { + x: 0, + y: -h / 2 + }]; + var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); + el.attr('style', node.style); + node.width = w + h; + node.height = h; + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var lean_right = function lean_right(parent, node) { + var _labelHelper4 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper4.shapeSvg, + bbox = _labelHelper4.bbox; + + var w = bbox.width + node.padding; + var h = bbox.height + node.padding; + var points = [{ + x: -2 * h / 6, + y: 0 + }, { + x: w - h / 6, + y: 0 + }, { + x: w + 2 * h / 6, + y: -h + }, { + x: h / 6, + y: -h + }]; + var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); + el.attr('style', node.style); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var lean_left = function lean_left(parent, node) { + var _labelHelper5 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper5.shapeSvg, + bbox = _labelHelper5.bbox; + + var w = bbox.width + node.padding; + var h = bbox.height + node.padding; + var points = [{ + x: 2 * h / 6, + y: 0 + }, { + x: w + h / 6, + y: 0 + }, { + x: w - 2 * h / 6, + y: -h + }, { + x: -h / 6, + y: -h + }]; + var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); + el.attr('style', node.style); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var trapezoid = function trapezoid(parent, node) { + var _labelHelper6 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper6.shapeSvg, + bbox = _labelHelper6.bbox; + + var w = bbox.width + node.padding; + var h = bbox.height + node.padding; + var points = [{ + x: -2 * h / 6, + y: 0 + }, { + x: w + 2 * h / 6, + y: 0 + }, { + x: w - h / 6, + y: -h + }, { + x: h / 6, + y: -h + }]; + var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); + el.attr('style', node.style); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var inv_trapezoid = function inv_trapezoid(parent, node) { + var _labelHelper7 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper7.shapeSvg, + bbox = _labelHelper7.bbox; + + var w = bbox.width + node.padding; + var h = bbox.height + node.padding; + var points = [{ + x: h / 6, + y: 0 + }, { + x: w - h / 6, + y: 0 + }, { + x: w + 2 * h / 6, + y: -h + }, { + x: -2 * h / 6, + y: -h + }]; + var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); + el.attr('style', node.style); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var rect_right_inv_arrow = function rect_right_inv_arrow(parent, node) { + var _labelHelper8 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper8.shapeSvg, + bbox = _labelHelper8.bbox; + + var w = bbox.width + node.padding; + var h = bbox.height + node.padding; + var points = [{ + x: 0, + y: 0 + }, { + x: w + h / 2, + y: 0 + }, { + x: w, + y: -h / 2 + }, { + x: w + h / 2, + y: -h + }, { + x: 0, + y: -h + }]; + var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); + el.attr('style', node.style); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var cylinder = function cylinder(parent, node) { + var _labelHelper9 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper9.shapeSvg, + bbox = _labelHelper9.bbox; + + var w = bbox.width + node.padding; + var rx = w / 2; + var ry = rx / (2.5 + w / 50); + var h = bbox.height + ry + node.padding; + var shape = 'M 0,' + ry + ' a ' + rx + ',' + ry + ' 0,0,0 ' + w + ' 0 a ' + rx + ',' + ry + ' 0,0,0 ' + -w + ' 0 l 0,' + h + ' a ' + rx + ',' + ry + ' 0,0,0 ' + w + ' 0 l 0,' + -h; + var el = shapeSvg.attr('label-offset-y', ry).insert('path', ':first-child').attr('style', node.style).attr('d', shape).attr('transform', 'translate(' + -w / 2 + ',' + -(h / 2 + ry) + ')'); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); + + node.intersect = function (point) { + var pos = _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); + var x = pos.x - node.x; + + if (rx != 0 && (Math.abs(x) < node.width / 2 || Math.abs(x) == node.width / 2 && Math.abs(pos.y - node.y) > node.height / 2 - ry)) { + // ellipsis equation: x*x / a*a + y*y / b*b = 1 + // solve for y to get adjustion value for pos.y + var y = ry * ry * (1 - x * x / (rx * rx)); + if (y != 0) y = Math.sqrt(y); + y = ry - y; + if (point.y - node.y > 0) y = -y; + pos.y += y; + } + + return pos; + }; + + return shapeSvg; +}; + +var rect = function rect(parent, node) { + var _labelHelper10 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, 'node ' + node.classes, true), + shapeSvg = _labelHelper10.shapeSvg, + bbox = _labelHelper10.bbox, + halfPadding = _labelHelper10.halfPadding; + + _logger__WEBPACK_IMPORTED_MODULE_4__.log.trace('Classes = ', node.classes); // add the rect + + var rect = shapeSvg.insert('rect', ':first-child'); + var totalWidth = bbox.width + node.padding; + var totalHeight = bbox.height + node.padding; + rect.attr('class', 'basic label-container').attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('x', -bbox.width / 2 - halfPadding).attr('y', -bbox.height / 2 - halfPadding).attr('width', totalWidth).attr('height', totalHeight); + + if (node.props) { + var propKeys = new Set(Object.keys(node.props)); + + if (node.props.borders) { + applyNodePropertyBorders(rect, node.props.borders, totalWidth, totalHeight); + propKeys.delete('borders'); + } + + propKeys.forEach(function (propKey) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn("Unknown node property ".concat(propKey)); + }); + } + + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, rect); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); + }; + + return shapeSvg; +}; + +var labelRect = function labelRect(parent, node) { + var _labelHelper11 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, 'label', true), + shapeSvg = _labelHelper11.shapeSvg, + bbox = _labelHelper11.bbox, + halfPadding = _labelHelper11.halfPadding; + + _logger__WEBPACK_IMPORTED_MODULE_4__.log.trace('Classes = ', node.classes); // add the rect + + var rect = shapeSvg.insert('rect', ':first-child'); // Hide the rect we are only after the label + + var totalWidth = 0; + var totalHeight = 0; + rect.attr('width', totalWidth).attr('height', totalHeight); + shapeSvg.attr('class', 'label edgeLabel'); + + if (node.props) { + var propKeys = new Set(Object.keys(node.props)); + + if (node.props.borders) { + applyNodePropertyBorders(rect, node.props.borders, totalWidth, totalHeight); + propKeys.delete('borders'); + } + + propKeys.forEach(function (propKey) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn("Unknown node property ".concat(propKey)); + }); + } + + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, rect); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); + }; + + return shapeSvg; +}; +/** + * @param rect + * @param borders + * @param totalWidth + * @param totalHeight + */ + + +function applyNodePropertyBorders(rect, borders, totalWidth, totalHeight) { + var strokeDashArray = []; + + var addBorder = function addBorder(length) { + strokeDashArray.push(length); + strokeDashArray.push(0); + }; + + var skipBorder = function skipBorder(length) { + strokeDashArray.push(0); + strokeDashArray.push(length); + }; + + if (borders.includes('t')) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('add top border'); + addBorder(totalWidth); + } else { + skipBorder(totalWidth); + } + + if (borders.includes('r')) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('add right border'); + addBorder(totalHeight); + } else { + skipBorder(totalHeight); + } + + if (borders.includes('b')) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('add bottom border'); + addBorder(totalWidth); + } else { + skipBorder(totalWidth); + } + + if (borders.includes('l')) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('add left border'); + addBorder(totalHeight); + } else { + skipBorder(totalHeight); + } + + rect.attr('stroke-dasharray', strokeDashArray.join(' ')); +} + +var rectWithTitle = function rectWithTitle(parent, node) { + // const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, 'node ' + node.classes); + var classes; + + if (!node.classes) { + classes = 'node default'; + } else { + classes = 'node ' + node.classes; + } // Add outer g element + + + var shapeSvg = parent.insert('g').attr('class', classes).attr('id', node.domId || node.id); // Create the title label and insert it after the rect + + var rect = shapeSvg.insert('rect', ':first-child'); // const innerRect = shapeSvg.insert('rect'); + + var innerLine = shapeSvg.insert('line'); + var label = shapeSvg.insert('g').attr('class', 'label'); + var text2 = node.labelText.flat ? node.labelText.flat() : node.labelText; // const text2 = typeof text2prim === 'object' ? text2prim[0] : text2prim; + + var title = ''; + + if (_typeof(text2) === 'object') { + title = text2[0]; + } else { + title = text2; + } + + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Label text abc79', title, text2, _typeof(text2) === 'object'); + var text = label.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(title, node.labelStyle, true, true)); + var bbox = { + width: 0, + height: 0 + }; + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { + var div = text.children[0]; + var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(text); + bbox = div.getBoundingClientRect(); + dv.attr('width', bbox.width); + dv.attr('height', bbox.height); + } + + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Text 2', text2); + var textRows = text2.slice(1, text2.length); + var titleBox = text.getBBox(); + var descr = label.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(textRows.join ? textRows.join('
') : textRows, node.labelStyle, true, true)); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { + var _div = descr.children[0]; + + var _dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(descr); + + bbox = _div.getBoundingClientRect(); + + _dv.attr('width', bbox.width); + + _dv.attr('height', bbox.height); + } // bbox = label.getBBox(); + // log.info(descr); + + + var halfPadding = node.padding / 2; + (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(descr).attr('transform', 'translate( ' + ( // (titleBox.width - bbox.width) / 2 + + bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ', ' + (titleBox.height + halfPadding + 5) + ')'); + (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(text).attr('transform', 'translate( ' + ( // (titleBox.width - bbox.width) / 2 + + bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + ', ' + 0 + ')'); // Get the size of the label + // Bounding box for title and text + + bbox = label.node().getBBox(); // Center the label + + label.attr('transform', 'translate(' + -bbox.width / 2 + ', ' + (-bbox.height / 2 - halfPadding + 3) + ')'); + rect.attr('class', 'outer title-state').attr('x', -bbox.width / 2 - halfPadding).attr('y', -bbox.height / 2 - halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding); + innerLine.attr('class', 'divider').attr('x1', -bbox.width / 2 - halfPadding).attr('x2', bbox.width / 2 + halfPadding).attr('y1', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding).attr('y2', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, rect); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); + }; + + return shapeSvg; +}; + +var stadium = function stadium(parent, node) { + var _labelHelper12 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper12.shapeSvg, + bbox = _labelHelper12.bbox; + + var h = bbox.height + node.padding; + var w = bbox.width + h / 4 + node.padding; // add the rect + + var rect = shapeSvg.insert('rect', ':first-child').attr('style', node.style).attr('rx', h / 2).attr('ry', h / 2).attr('x', -w / 2).attr('y', -h / 2).attr('width', w).attr('height', h); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, rect); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); + }; + + return shapeSvg; +}; + +var circle = function circle(parent, node) { + var _labelHelper13 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper13.shapeSvg, + bbox = _labelHelper13.bbox, + halfPadding = _labelHelper13.halfPadding; + + var circle = shapeSvg.insert('circle', ':first-child'); // center the circle around its coordinate + + circle.attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('r', bbox.width / 2 + halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Circle main'); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, circle); + + node.intersect = function (point) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Circle intersect', node, bbox.width / 2 + halfPadding, point); + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].circle(node, bbox.width / 2 + halfPadding, point); + }; + + return shapeSvg; +}; + +var doublecircle = function doublecircle(parent, node) { + var _labelHelper14 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper14.shapeSvg, + bbox = _labelHelper14.bbox, + halfPadding = _labelHelper14.halfPadding; + + var gap = 5; + var circleGroup = shapeSvg.insert('g', ':first-child'); + var outerCircle = circleGroup.insert('circle'); + var innerCircle = circleGroup.insert('circle'); // center the circle around its coordinate + + outerCircle.attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('r', bbox.width / 2 + halfPadding + gap).attr('width', bbox.width + node.padding + gap * 2).attr('height', bbox.height + node.padding + gap * 2); + innerCircle.attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('r', bbox.width / 2 + halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('DoubleCircle main'); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, outerCircle); + + node.intersect = function (point) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('DoubleCircle intersect', node, bbox.width / 2 + halfPadding + gap, point); + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].circle(node, bbox.width / 2 + halfPadding + gap, point); + }; + + return shapeSvg; +}; + +var subroutine = function subroutine(parent, node) { + var _labelHelper15 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper15.shapeSvg, + bbox = _labelHelper15.bbox; + + var w = bbox.width + node.padding; + var h = bbox.height + node.padding; + var points = [{ + x: 0, + y: 0 + }, { + x: w, + y: 0 + }, { + x: w, + y: -h + }, { + x: 0, + y: -h + }, { + x: 0, + y: 0 + }, { + x: -8, + y: 0 + }, { + x: w + 8, + y: 0 + }, { + x: w + 8, + y: -h + }, { + x: -8, + y: -h + }, { + x: -8, + y: 0 + }]; + var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); + el.attr('style', node.style); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var start = function start(parent, node) { + var shapeSvg = parent.insert('g').attr('class', 'node default').attr('id', node.domId || node.id); + var circle = shapeSvg.insert('circle', ':first-child'); // center the circle around its coordinate + + circle.attr('class', 'state-start').attr('r', 7).attr('width', 14).attr('height', 14); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, circle); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].circle(node, 7, point); + }; + + return shapeSvg; +}; + +var forkJoin = function forkJoin(parent, node, dir) { + var shapeSvg = parent.insert('g').attr('class', 'node default').attr('id', node.domId || node.id); + var width = 70; + var height = 10; + + if (dir === 'LR') { + width = 10; + height = 70; + } + + var shape = shapeSvg.append('rect').attr('x', -1 * width / 2).attr('y', -1 * height / 2).attr('width', width).attr('height', height).attr('class', 'fork-join'); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, shape); + node.height = node.height + node.padding / 2; + node.width = node.width + node.padding / 2; + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); + }; + + return shapeSvg; +}; + +var end = function end(parent, node) { + var shapeSvg = parent.insert('g').attr('class', 'node default').attr('id', node.domId || node.id); + var innerCircle = shapeSvg.insert('circle', ':first-child'); + var circle = shapeSvg.insert('circle', ':first-child'); + circle.attr('class', 'state-start').attr('r', 7).attr('width', 14).attr('height', 14); + innerCircle.attr('class', 'state-end').attr('r', 5).attr('width', 10).attr('height', 10); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, circle); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].circle(node, 7, point); + }; + + return shapeSvg; +}; + +var class_box = function class_box(parent, node) { + var halfPadding = node.padding / 2; + var rowPadding = 4; + var lineHeight = 8; + var classes; + + if (!node.classes) { + classes = 'node default'; + } else { + classes = 'node ' + node.classes; + } // Add outer g element + + + var shapeSvg = parent.insert('g').attr('class', classes).attr('id', node.domId || node.id); // Create the title label and insert it after the rect + + var rect = shapeSvg.insert('rect', ':first-child'); + var topLine = shapeSvg.insert('line'); + var bottomLine = shapeSvg.insert('line'); + var maxWidth = 0; + var maxHeight = rowPadding; + var labelContainer = shapeSvg.insert('g').attr('class', 'label'); + var verticalPos = 0; + var hasInterface = node.classData.annotations && node.classData.annotations[0]; // 1. Create the labels + + var interfaceLabelText = node.classData.annotations[0] ? '«' + node.classData.annotations[0] + '»' : ''; + var interfaceLabel = labelContainer.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(interfaceLabelText, node.labelStyle, true, true)); + var interfaceBBox = interfaceLabel.getBBox(); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { + var div = interfaceLabel.children[0]; + var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(interfaceLabel); + interfaceBBox = div.getBoundingClientRect(); + dv.attr('width', interfaceBBox.width); + dv.attr('height', interfaceBBox.height); + } + + if (node.classData.annotations[0]) { + maxHeight += interfaceBBox.height + rowPadding; + maxWidth += interfaceBBox.width; + } + + var classTitleString = node.classData.id; + + if (node.classData.type !== undefined && node.classData.type !== '') { + if ((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels) { + classTitleString += '<' + node.classData.type + '>'; + } else { + classTitleString += '<' + node.classData.type + '>'; + } + } + + var classTitleLabel = labelContainer.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(classTitleString, node.labelStyle, true, true)); + (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(classTitleLabel).attr('class', 'classTitle'); + var classTitleBBox = classTitleLabel.getBBox(); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { + var _div2 = classTitleLabel.children[0]; + + var _dv2 = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(classTitleLabel); + + classTitleBBox = _div2.getBoundingClientRect(); + + _dv2.attr('width', classTitleBBox.width); + + _dv2.attr('height', classTitleBBox.height); + } + + maxHeight += classTitleBBox.height + rowPadding; + + if (classTitleBBox.width > maxWidth) { + maxWidth = classTitleBBox.width; + } + + var classAttributes = []; + node.classData.members.forEach(function (str) { + var parsedInfo = (0,_diagrams_class_svgDraw__WEBPACK_IMPORTED_MODULE_7__.parseMember)(str); + var parsedText = parsedInfo.displayText; + + if ((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels) { + parsedText = parsedText.replace(//g, '>'); + } + + var lbl = labelContainer.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(parsedText, parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle, true, true)); + var bbox = lbl.getBBox(); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { + var _div3 = lbl.children[0]; + + var _dv3 = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(lbl); + + bbox = _div3.getBoundingClientRect(); + + _dv3.attr('width', bbox.width); + + _dv3.attr('height', bbox.height); + } + + if (bbox.width > maxWidth) { + maxWidth = bbox.width; + } + + maxHeight += bbox.height + rowPadding; + classAttributes.push(lbl); + }); + maxHeight += lineHeight; + var classMethods = []; + node.classData.methods.forEach(function (str) { + var parsedInfo = (0,_diagrams_class_svgDraw__WEBPACK_IMPORTED_MODULE_7__.parseMember)(str); + var displayText = parsedInfo.displayText; + + if ((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels) { + displayText = displayText.replace(//g, '>'); + } + + var lbl = labelContainer.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(displayText, parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle, true, true)); + var bbox = lbl.getBBox(); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { + var _div4 = lbl.children[0]; + + var _dv4 = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(lbl); + + bbox = _div4.getBoundingClientRect(); + + _dv4.attr('width', bbox.width); + + _dv4.attr('height', bbox.height); + } + + if (bbox.width > maxWidth) { + maxWidth = bbox.width; + } + + maxHeight += bbox.height + rowPadding; + classMethods.push(lbl); + }); + maxHeight += lineHeight; // 2. Position the labels + // position the interface label + + if (hasInterface) { + var _diffX = (maxWidth - interfaceBBox.width) / 2; + + (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(interfaceLabel).attr('transform', 'translate( ' + (-1 * maxWidth / 2 + _diffX) + ', ' + -1 * maxHeight / 2 + ')'); + verticalPos = interfaceBBox.height + rowPadding; + } // Position the class title label + + + var diffX = (maxWidth - classTitleBBox.width) / 2; + (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(classTitleLabel).attr('transform', 'translate( ' + (-1 * maxWidth / 2 + diffX) + ', ' + (-1 * maxHeight / 2 + verticalPos) + ')'); + verticalPos += classTitleBBox.height + rowPadding; + topLine.attr('class', 'divider').attr('x1', -maxWidth / 2 - halfPadding).attr('x2', maxWidth / 2 + halfPadding).attr('y1', -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr('y2', -maxHeight / 2 - halfPadding + lineHeight + verticalPos); + verticalPos += lineHeight; + classAttributes.forEach(function (lbl) { + (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(lbl).attr('transform', 'translate( ' + -maxWidth / 2 + ', ' + (-1 * maxHeight / 2 + verticalPos + lineHeight / 2) + ')'); + verticalPos += classTitleBBox.height + rowPadding; + }); + verticalPos += lineHeight; + bottomLine.attr('class', 'divider').attr('x1', -maxWidth / 2 - halfPadding).attr('x2', maxWidth / 2 + halfPadding).attr('y1', -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr('y2', -maxHeight / 2 - halfPadding + lineHeight + verticalPos); + verticalPos += lineHeight; + classMethods.forEach(function (lbl) { + (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(lbl).attr('transform', 'translate( ' + -maxWidth / 2 + ', ' + (-1 * maxHeight / 2 + verticalPos) + ')'); + verticalPos += classTitleBBox.height + rowPadding; + }); // + // let bbox; + // if (evaluate(getConfig().flowchart.htmlLabels)) { + // const div = interfaceLabel.children[0]; + // const dv = select(interfaceLabel); + // bbox = div.getBoundingClientRect(); + // dv.attr('width', bbox.width); + // dv.attr('height', bbox.height); + // } + // bbox = labelContainer.getBBox(); + // log.info('Text 2', text2); + // const textRows = text2.slice(1, text2.length); + // let titleBox = text.getBBox(); + // const descr = label + // .node() + // .appendChild(createLabel(textRows.join('
'), node.labelStyle, true, true)); + // if (evaluate(getConfig().flowchart.htmlLabels)) { + // const div = descr.children[0]; + // const dv = select(descr); + // bbox = div.getBoundingClientRect(); + // dv.attr('width', bbox.width); + // dv.attr('height', bbox.height); + // } + // // bbox = label.getBBox(); + // // log.info(descr); + // select(descr).attr( + // 'transform', + // 'translate( ' + + // // (titleBox.width - bbox.width) / 2 + + // (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + + // ', ' + + // (titleBox.height + halfPadding + 5) + + // ')' + // ); + // select(text).attr( + // 'transform', + // 'translate( ' + + // // (titleBox.width - bbox.width) / 2 + + // (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + + // ', ' + + // 0 + + // ')' + // ); + // // Get the size of the label + // // Bounding box for title and text + // bbox = label.node().getBBox(); + // // Center the label + // label.attr( + // 'transform', + // 'translate(' + -bbox.width / 2 + ', ' + (-bbox.height / 2 - halfPadding + 3) + ')' + // ); + + rect.attr('class', 'outer title-state').attr('x', -maxWidth / 2 - halfPadding).attr('y', -(maxHeight / 2) - halfPadding).attr('width', maxWidth + node.padding).attr('height', maxHeight + node.padding); // innerLine + // .attr('class', 'divider') + // .attr('x1', -bbox.width / 2 - halfPadding) + // .attr('x2', bbox.width / 2 + halfPadding) + // .attr('y1', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding) + // .attr('y2', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding); + + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, rect); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); + }; + + return shapeSvg; +}; + +var shapes = { + question: question, + rect: rect, + labelRect: labelRect, + rectWithTitle: rectWithTitle, + choice: choice, + circle: circle, + doublecircle: doublecircle, + stadium: stadium, + hexagon: hexagon, + rect_left_inv_arrow: rect_left_inv_arrow, + lean_right: lean_right, + lean_left: lean_left, + trapezoid: trapezoid, + inv_trapezoid: inv_trapezoid, + rect_right_inv_arrow: rect_right_inv_arrow, + cylinder: cylinder, + start: start, + end: end, + note: _shapes_note__WEBPACK_IMPORTED_MODULE_8__["default"], + subroutine: subroutine, + fork: forkJoin, + join: forkJoin, + class_box: class_box +}; +var nodeElems = {}; +var insertNode = function insertNode(elem, node, dir) { + var newEl; + var el; // Add link when appropriate + + if (node.link) { + var target; + + if ((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().securityLevel === 'sandbox') { + target = '_top'; + } else if (node.linkTarget) { + target = node.linkTarget || '_blank'; + } + + newEl = elem.insert('svg:a').attr('xlink:href', node.link).attr('target', target); + el = shapes[node.shape](newEl, node, dir); + } else { + el = shapes[node.shape](elem, node, dir); + newEl = el; + } + + if (node.tooltip) { + el.attr('title', node.tooltip); + } + + if (node.class) { + el.attr('class', 'node default ' + node.class); + } + + nodeElems[node.id] = newEl; + + if (node.haveCallback) { + nodeElems[node.id].attr('class', nodeElems[node.id].attr('class') + ' clickable'); + } +}; +var setNodeElem = function setNodeElem(elem, node) { + nodeElems[node.id] = elem; +}; +var clear = function clear() { + nodeElems = {}; +}; +var positionNode = function positionNode(node) { + var el = nodeElems[node.id]; + _logger__WEBPACK_IMPORTED_MODULE_4__.log.trace('Transforming node', node.diff, node, 'translate(' + (node.x - node.width / 2 - 5) + ', ' + node.width / 2 + ')'); + var padding = 8; + var diff = node.diff || 0; + + if (node.clusterNode) { + el.attr('transform', 'translate(' + (node.x + diff - node.width / 2) + ', ' + (node.y - node.height / 2 - padding) + ')'); + } else { + el.attr('transform', 'translate(' + node.x + ', ' + node.y + ')'); + } + + return diff; +}; + +/***/ }), + +/***/ "./src/dagre-wrapper/shapes/note.js": +/*!******************************************!*\ + !*** ./src/dagre-wrapper/shapes/note.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "./src/dagre-wrapper/shapes/util.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); +/* harmony import */ var _intersect_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../intersect/index.js */ "./src/dagre-wrapper/intersect/index.js"); + + // eslint-disable-line + + + +var note = function note(parent, node) { + var _labelHelper = (0,_util__WEBPACK_IMPORTED_MODULE_0__.labelHelper)(parent, node, 'node ' + node.classes, true), + shapeSvg = _labelHelper.shapeSvg, + bbox = _labelHelper.bbox, + halfPadding = _labelHelper.halfPadding; + + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Classes = ', node.classes); // add the rect + + var rect = shapeSvg.insert('rect', ':first-child'); + rect.attr('rx', node.rx).attr('ry', node.ry).attr('x', -bbox.width / 2 - halfPadding).attr('y', -bbox.height / 2 - halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding); + (0,_util__WEBPACK_IMPORTED_MODULE_0__.updateNodeBounds)(node, rect); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].rect(node, point); + }; + + return shapeSvg; +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (note); + +/***/ }), + +/***/ "./src/dagre-wrapper/shapes/util.js": +/*!******************************************!*\ + !*** ./src/dagre-wrapper/shapes/util.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "insertPolygonShape": () => (/* binding */ insertPolygonShape), +/* harmony export */ "labelHelper": () => (/* binding */ labelHelper), +/* harmony export */ "updateNodeBounds": () => (/* binding */ updateNodeBounds) +/* harmony export */ }); +/* harmony import */ var _createLabel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../createLabel */ "./src/dagre-wrapper/createLabel.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js"); +/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../diagrams/common/common */ "./src/diagrams/common/common.js"); + + + + + +var labelHelper = function labelHelper(parent, node, _classes, isNode) { + var classes; + + if (!_classes) { + classes = 'node default'; + } else { + classes = _classes; + } // Add outer g element + + + var shapeSvg = parent.insert('g').attr('class', classes).attr('id', node.domId || node.id); // Create the label and insert it after the rect + + var label = shapeSvg.insert('g').attr('class', 'label').attr('style', node.labelStyle); + var labelText = typeof node.labelText === 'string' ? node.labelText : node.labelText[0]; + var text = label.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__.sanitizeText)((0,_mermaidAPI__WEBPACK_IMPORTED_MODULE_3__.decodeEntities)(labelText), (0,_config__WEBPACK_IMPORTED_MODULE_4__.getConfig)()), node.labelStyle, false, isNode)); // Get the size of the label + + var bbox = text.getBBox(); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_4__.getConfig)().flowchart.htmlLabels)) { + var div = text.children[0]; + var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(text); + bbox = div.getBoundingClientRect(); + dv.attr('width', bbox.width); + dv.attr('height', bbox.height); + } + + var halfPadding = node.padding / 2; // Center the label + + label.attr('transform', 'translate(' + -bbox.width / 2 + ', ' + -bbox.height / 2 + ')'); + return { + shapeSvg: shapeSvg, + bbox: bbox, + halfPadding: halfPadding, + label: label + }; +}; +var updateNodeBounds = function updateNodeBounds(node, element) { + var bbox = element.node().getBBox(); + node.width = bbox.width; + node.height = bbox.height; +}; +/** + * @param parent + * @param w + * @param h + * @param points + */ + +function insertPolygonShape(parent, w, h, points) { + return parent.insert('polygon', ':first-child').attr('points', points.map(function (d) { + return d.x + ',' + d.y; + }).join(' ')).attr('class', 'label-container').attr('transform', 'translate(' + -w / 2 + ',' + h / 2 + ')'); +} + +/***/ }), + +/***/ "./src/defaultConfig.js": +/*!******************************!*\ + !*** ./src/defaultConfig.js ***! + \******************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "configKeys": () => (/* binding */ configKeys), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./themes */ "./src/themes/index.js"); +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + + +/** + * **Configuration methods in Mermaid version 8.6.0 have been updated, to learn more[[click + * here](8.6.0_docs.md)].** + * + * ## **What follows are config instructions for older versions** + * + * These are the default options which can be overridden with the initialization call like so: + * + * **Example 1:**
 mermaid.initialize({ flowchart:{ htmlLabels: false } }); 
+ * + * **Example 2:**
  
+ * + * A summary of all options and their defaults is found [here](#mermaidapi-configuration-defaults). + * A description of each option follows below. + * + * @name Configuration + */ + +var config = { + /** + * Theme , the CSS style sheet + * + * | Parameter | Description | Type | Required | Values | + * | --------- | --------------- | ------ | -------- | ---------------------------------------------- | + * | theme | Built in Themes | string | Optional | 'default', 'forest', 'dark', 'neutral', 'null' | + * + * **Notes:** To disable any pre-defined mermaid theme, use "null".
 "theme": "forest",
+   * "themeCSS": ".node rect { fill: red; }" 
+ */ + theme: 'default', + themeVariables: _themes__WEBPACK_IMPORTED_MODULE_0__["default"]["default"].getThemeVariables(), + themeCSS: undefined, + + /* **maxTextSize** - The maximum allowed size of the users text diagram */ + maxTextSize: 50000, + darkMode: false, + + /** + * | Parameter | Description | Type | Required | Values | + * | ---------- | ------------------------------------------------------ | ------ | -------- | --------------------------- | + * | fontFamily | specifies the font to be used in the rendered diagrams | string | Required | Any Possible CSS FontFamily | + * + * **Notes:** Default value: '"trebuchet ms", verdana, arial, sans-serif;'. + */ + fontFamily: '"trebuchet ms", verdana, arial, sans-serif;', + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ----------------------------------------------------- | ---------------- | -------- | ------------- | + * | logLevel | This option decides the amount of logging to be used. | string \| number | Required | 1, 2, 3, 4, 5 | + * + * **Notes:** + * + * - Debug: 1 + * - Info: 2 + * - Warn: 3 + * - Error: 4 + * - Fatal: 5 (default) + */ + logLevel: 5, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------- | --------------------------------- | ------ | -------- | ------------------------------- | + * | securitylevel | Level of trust for parsed diagram | string | Required | 'strict', 'loose', 'antiscript' | + * + * **Notes**: + * + * - **strict**: (**default**) tags in text are encoded, click functionality is disabled + * - **loose**: tags in text are allowed, click functionality is enabled + * - **antiscript**: html tags in text are allowed, (only script element is removed), click + * functionality is enabled + */ + securityLevel: 'strict', + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | -------------------------------------------- | ------- | -------- | ----------- | + * | startOnLoad | Dictates whether mermaid starts on Page load | boolean | Required | true, false | + * + * **Notes:** Default value: true + */ + startOnLoad: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------------- | ---------------------------------------------------------------------------- | ------- | -------- | ----------- | + * | arrowMarkerAbsolute | Controls whether or arrow markers in html code are absolute paths or anchors | boolean | Required | true, false | + * + * **Notes**: + * + * This matters if you are using base tag settings. + * + * Default value: false + */ + arrowMarkerAbsolute: false, + + /** + * This option controls which currentConfig keys are considered _secure_ and can only be changed + * via call to mermaidAPI.initialize. Calls to mermaidAPI.reinitialize cannot make changes to the + * `secure` keys in the current currentConfig. This prevents malicious graph directives from + * overriding a site's default security. + * + * **Notes**: + * + * Default value: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'] + */ + secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'], + + /** + * This option controls if the generated ids of nodes in the SVG are generated randomly or based + * on a seed. If set to false, the IDs are generated based on the current date and thus are not + * deterministic. This is the default behaviour. + * + * **Notes**: + * + * This matters if your files are checked into sourcecontrol e.g. git and should not change unless + * content is changed. + * + * Default value: false + */ + deterministicIds: false, + + /** + * This option is the optional seed for deterministic ids. if set to undefined but + * deterministicIds is true, a simple number iterator is used. You can set this attribute to base + * the seed on a static string. + */ + deterministicIDSeed: undefined, + + /** The object containing configurations specific for flowcharts */ + flowchart: { + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ----------------------------------------------- | ------- | -------- | ------------------ | + * | diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value | + * + * **Notes:** + * + * The amount of padding around the diagram as a whole so that embedded diagrams have margins, + * expressed in pixels + * + * Default value: 8 + */ + diagramPadding: 8, + + /** + * | Parameter | Description | Type | Required | Values | + * | ---------- | -------------------------------------------------------------------------------------------- | ------- | -------- | ----------- | + * | htmlLabels | Flag for setting whether or not a html tag should be used for rendering labels on the edges. | boolean | Required | true, false | + * + * **Notes:** Default value: true. + */ + htmlLabels: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | --------------------------------------------------- | ------- | -------- | ------------------- | + * | nodeSpacing | Defines the spacing between nodes on the same level | Integer | Required | Any positive Number | + * + * **Notes:** + * + * Pertains to horizontal spacing for TB (top to bottom) or BT (bottom to top) graphs, and the + * vertical spacing for LR as well as RL graphs.** + * + * Default value: 50 + */ + nodeSpacing: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------------------------------------------------- | ------- | -------- | ------------------- | + * | rankSpacing | Defines the spacing between nodes on different levels | Integer | Required | Any Positive Number | + * + * **Notes**: + * + * Pertains to vertical spacing for TB (top to bottom) or BT (bottom to top), and the horizontal + * spacing for LR as well as RL graphs. + * + * Default value 50 + */ + rankSpacing: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | -------------------------------------------------- | ------ | -------- | ----------------------------- | + * | curve | Defines how mermaid renders curves for flowcharts. | string | Required | 'basis', 'linear', 'cardinal' | + * + * **Notes:** + * + * Default Value: 'basis' + */ + curve: 'basis', + // Only used in new experimental rendering + // represents the padding between the labels and the shape + padding: 15, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See notes | boolean | 4 | true, false | + * + * **Notes:** + * + * When this flag is set the height and width is set to 100% and is then scaling with the + * available space if not the absolute space required is used. + * + * Default value: true + */ + useMaxWidth: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------- | ------- | -------- | ----------------------- | + * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper | + * + * **Notes:** + * + * Decides which rendering engine that is to be used for the rendering. Legal values are: + * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid + * + * Default value: 'dagre-d3' + */ + defaultRenderer: 'dagre-d3' + }, + + /** The object containing configurations specific for sequence diagrams */ + sequence: { + hideUnusedParticipants: false, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ---------------------------- | ------- | -------- | ------------------ | + * | activationWidth | Width of the activation rect | Integer | Required | Any Positive Value | + * + * **Notes:** Default value :10 + */ + activationWidth: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ + diagramMarginX: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ------------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginY | Margin to the over and under the sequence diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ + diagramMarginY: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | --------------------- | ------- | -------- | ------------------ | + * | actorMargin | Margin between actors | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ + actorMargin: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | -------------------- | ------- | -------- | ------------------ | + * | width | Width of actor boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 150 + */ + width: 150, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | --------------------- | ------- | -------- | ------------------ | + * | height | Height of actor boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 65 + */ + height: 65, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ------------------------ | ------- | -------- | ------------------ | + * | boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ + boxMargin: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------- | -------------------------------------------- | ------- | -------- | ------------------ | + * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 5 + */ + boxTextMargin: 5, + + /** + * | Parameter | Description | Type | Required | Values | + * | ---------- | ------------------- | ------- | -------- | ------------------ | + * | noteMargin | margin around notes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ + noteMargin: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------- | ---------------------- | ------- | -------- | ------------------ | + * | messageMargin | Space between messages | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 35 + */ + messageMargin: 35, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------ | --------------------------- | ------ | -------- | ------------------------- | + * | messageAlign | Multiline message alignment | string | Required | 'left', 'center', 'right' | + * + * **Notes:** Default value: 'center' + */ + messageAlign: 'center', + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------ | --------------------------- | ------- | -------- | ----------- | + * | mirrorActors | Mirror actors under diagram | boolean | Required | true, false | + * + * **Notes:** Default value: true + */ + mirrorActors: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | ---------- | ----------------------------------------------------------------------- | ------- | -------- | ----------- | + * | forceMenus | forces actor popup menus to always be visible (to support E2E testing). | Boolean | Required | True, False | + * + * **Notes:** + * + * Default value: false. + */ + forceMenus: false, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ------------------------------------------ | ------- | -------- | ------------------ | + * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | Required | Any Positive Value | + * + * **Notes:** + * + * Depending on css styling this might need adjustment. + * + * Default value: 1 + */ + bottomMarginAdj: 1, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See Notes | boolean | Required | true, false | + * + * **Notes:** When this flag is set to true, the height and width is set to 100% and is then + * scaling with the available space. If set to false, the absolute space required is used. + * + * Default value: true + */ + useMaxWidth: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ------------------------------------ | ------- | -------- | ----------- | + * | rightAngles | display curve arrows as right angles | boolean | Required | true, false | + * + * **Notes:** + * + * This will display arrows that start and begin at the same node as right angles, rather than a curve + * + * Default value: false + */ + rightAngles: false, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------------- | ------------------------------- | ------- | -------- | ----------- | + * | showSequenceNumbers | This will show the node numbers | boolean | Required | true, false | + * + * **Notes:** Default value: false + */ + showSequenceNumbers: false, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------- | -------------------------------------------------- | ------- | -------- | ------------------ | + * | actorFontSize | This sets the font size of the actor's description | Integer | Require | Any Positive Value | + * + * **Notes:** **Default value 14**.. + */ + actorFontSize: 14, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ---------------------------------------------------- | ------ | -------- | --------------------------- | + * | actorFontFamily | This sets the font family of the actor's description | string | Required | Any Possible CSS FontFamily | + * + * **Notes:** Default value: "'Open Sans", sans-serif' + */ + actorFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of the actor's description + * + * **Notes:** Default value: 400. + */ + actorFontWeight: 400, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------ | ----------------------------------------------- | ------- | -------- | ------------------ | + * | noteFontSize | This sets the font size of actor-attached notes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 14 + */ + noteFontSize: 14, + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | -------------------------------------------------- | ------ | -------- | --------------------------- | + * | noteFontFamily | This sets the font family of actor-attached notes. | string | Required | Any Possible CSS FontFamily | + * + * **Notes:** Default value: ''"trebuchet ms", verdana, arial, sans-serif' + */ + noteFontFamily: '"trebuchet ms", verdana, arial, sans-serif', + + /** + * This sets the font weight of the note's description + * + * **Notes:** Default value: 400 + */ + noteFontWeight: 400, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ---------------------------------------------------- | ------ | -------- | ------------------------- | + * | noteAlign | This sets the text alignment of actor-attached notes | string | required | 'left', 'center', 'right' | + * + * **Notes:** Default value: 'center' + */ + noteAlign: 'center', + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------------------------------------- | ------- | -------- | ------------------- | + * | messageFontSize | This sets the font size of actor messages | Integer | Required | Any Positive Number | + * + * **Notes:** Default value: 16 + */ + messageFontSize: 16, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------------- | ------------------------------------------- | ------ | -------- | --------------------------- | + * | messageFontFamily | This sets the font family of actor messages | string | Required | Any Possible CSS FontFamily | + * + * **Notes:** Default value: '"trebuchet ms", verdana, arial, sans-serif' + */ + messageFontFamily: '"trebuchet ms", verdana, arial, sans-serif', + + /** + * This sets the font weight of the message's description + * + * **Notes:** Default value: 400. + */ + messageFontWeight: 400, + + /** + * This sets the auto-wrap state for the diagram + * + * **Notes:** Default value: false. + */ + wrap: false, + + /** + * This sets the auto-wrap padding for the diagram (sides only) + * + * **Notes:** Default value: 0. + */ + wrapPadding: 10, + + /** + * This sets the width of the loop-box (loop, alt, opt, par) + * + * **Notes:** Default value: 50. + */ + labelBoxWidth: 50, + + /** + * This sets the height of the loop-box (loop, alt, opt, par) + * + * **Notes:** Default value: 20. + */ + labelBoxHeight: 20, + messageFont: function messageFont() { + return { + fontFamily: this.messageFontFamily, + fontSize: this.messageFontSize, + fontWeight: this.messageFontWeight + }; + }, + noteFont: function noteFont() { + return { + fontFamily: this.noteFontFamily, + fontSize: this.noteFontSize, + fontWeight: this.noteFontWeight + }; + }, + actorFont: function actorFont() { + return { + fontFamily: this.actorFontFamily, + fontSize: this.actorFontSize, + fontWeight: this.actorFontWeight + }; + } + }, + + /** The object containing configurations specific for gantt diagrams */ + gantt: { + /** + * ### titleTopMargin + * + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | + * | titleTopMargin | Margin top for the text over the gantt diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 25 + */ + titleTopMargin: 25, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ----------------------------------- | ------- | -------- | ------------------ | + * | barHeight | The height of the bars in the graph | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 20 + */ + barHeight: 20, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ---------------------------------------------------------------- | ------- | -------- | ------------------ | + * | barGap | The margin between the different activities in the gantt diagram | Integer | Optional | Any Positive Value | + * + * **Notes:** Default value: 4 + */ + barGap: 4, + + /** + * | Parameter | Description | Type | Required | Values | + * | ---------- | -------------------------------------------------------------------------- | ------- | -------- | ------------------ | + * | topPadding | Margin between title and gantt diagram and between axis and gantt diagram. | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ + topPadding: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------ | ----------------------------------------------------------------------- | ------- | -------- | ------------------ | + * | rightPadding | The space allocated for the section name to the right of the activities | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 75 + */ + rightPadding: 75, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ---------------------------------------------------------------------- | ------- | -------- | ------------------ | + * | leftPadding | The space allocated for the section name to the left of the activities | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 75 + */ + leftPadding: 75, + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------------- | -------------------------------------------- | ------- | -------- | ------------------ | + * | gridLineStartPadding | Vertical starting position of the grid lines | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 35 + */ + gridLineStartPadding: 35, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ----------- | ------- | -------- | ------------------ | + * | fontSize | Font size | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 11 + */ + fontSize: 11, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ---------------------- | ------- | -------- | ------------------ | + * | sectionFontSize | Font size for sections | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 11 + */ + sectionFontSize: 11, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------------- | ---------------------------------------- | ------- | -------- | ------------------ | + * | numberSectionStyles | The number of alternating section styles | Integer | 4 | Any Positive Value | + * + * **Notes:** Default value: 4 + */ + numberSectionStyles: 4, + + /** + * | Parameter | Description | Type | Required | Values | + * | ---------- | --------------------------- | ---- | -------- | ---------------- | + * | axisFormat | Datetime format of the axis | 3 | Required | Date in yy-mm-dd | + * + * **Notes:** + * + * This might need adjustment to match your locale and preferences + * + * Default value: '%Y-%m-%d'. + */ + axisFormat: '%Y-%m-%d', + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See notes | boolean | 4 | true, false | + * + * **Notes:** + * + * When this flag is set the height and width is set to 100% and is then scaling with the + * available space if not the absolute space required is used. + * + * Default value: true + */ + useMaxWidth: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ----------- | ------- | -------- | ----------- | + * | topAxis | See notes | Boolean | 4 | True, False | + * + * **Notes:** when this flag is set date labels will be added to the top of the chart + * + * **Default value false**. + */ + topAxis: false, + useWidth: undefined + }, + + /** The object containing configurations specific for journey diagrams */ + journey: { + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ + diagramMarginX: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | -------------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginY | Margin to the over and under the sequence diagram. | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ + diagramMarginY: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | --------------------- | ------- | -------- | ------------------ | + * | actorMargin | Margin between actors | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ + leftMargin: 150, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | -------------------- | ------- | -------- | ------------------ | + * | width | Width of actor boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 150 + */ + width: 150, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | --------------------- | ------- | -------- | ------------------ | + * | height | Height of actor boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 65 + */ + height: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ------------------------ | ------- | -------- | ------------------ | + * | boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ + boxMargin: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------- | -------------------------------------------- | ------- | -------- | ------------------ | + * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 5 + */ + boxTextMargin: 5, + + /** + * | Parameter | Description | Type | Required | Values | + * | ---------- | ------------------- | ------- | -------- | ------------------ | + * | noteMargin | Margin around notes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ + noteMargin: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------- | ----------------------- | ------- | -------- | ------------------ | + * | messageMargin | Space between messages. | Integer | Required | Any Positive Value | + * + * **Notes:** + * + * Space between messages. + * + * Default value: 35 + */ + messageMargin: 35, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------ | --------------------------- | ---- | -------- | ------------------------- | + * | messageAlign | Multiline message alignment | 3 | 4 | 'left', 'center', 'right' | + * + * **Notes:** Default value: 'center' + */ + messageAlign: 'center', + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ------------------------------------------ | ------- | -------- | ------------------ | + * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | 4 | Any Positive Value | + * + * **Notes:** + * + * Depending on css styling this might need adjustment. + * + * Default value: 1 + */ + bottomMarginAdj: 1, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See notes | boolean | 4 | true, false | + * + * **Notes:** + * + * When this flag is set the height and width is set to 100% and is then scaling with the + * available space if not the absolute space required is used. + * + * Default value: true + */ + useMaxWidth: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | --------------------------------- | ---- | -------- | ----------- | + * | rightAngles | Curved Arrows become Right Angles | 3 | 4 | true, false | + * + * **Notes:** + * + * This will display arrows that start and begin at the same node as right angles, rather than a curves + * + * Default value: false + */ + rightAngles: false, + taskFontSize: 14, + taskFontFamily: '"Open Sans", sans-serif', + taskMargin: 50, + // width of activation box + activationWidth: 10, + // text placement as: tspan | fo | old only text as before + textPlacement: 'fo', + actorColours: ['#8FBC8F', '#7CFC00', '#00FFFF', '#20B2AA', '#B0E0E6', '#FFFFE0'], + sectionFills: ['#191970', '#8B008B', '#4B0082', '#2F4F4F', '#800000', '#8B4513', '#00008B'], + sectionColours: ['#fff'] + }, + class: { + arrowMarkerAbsolute: false, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See notes | boolean | 4 | true, false | + * + * **Notes:** + * + * When this flag is set the height and width is set to 100% and is then scaling with the + * available space if not the absolute space required is used. + * + * Default value: true + */ + useMaxWidth: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------- | ------- | -------- | ----------------------- | + * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper | + * + * **Notes**: + * + * Decides which rendering engine that is to be used for the rendering. Legal values are: + * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid + * + * Default value: 'dagre-d3' + */ + defaultRenderer: 'dagre-wrapper' + }, + state: { + dividerMargin: 10, + sizeUnit: 5, + padding: 8, + textHeight: 10, + titleShift: -15, + noteMargin: 10, + forkWidth: 70, + forkHeight: 7, + // Used + miniPadding: 2, + // Font size factor, this is used to guess the width of the edges labels before rendering by dagre + // layout. This might need updating if/when switching font + fontSizeFactor: 5.02, + fontSize: 24, + labelHeight: 16, + edgeLengthFactor: '20', + compositTitleSize: 35, + radius: 5, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See notes | boolean | 4 | true, false | + * + * **Notes:** + * + * When this flag is set the height and width is set to 100% and is then scaling with the + * available space if not the absolute space required is used. + * + * Default value: true + */ + useMaxWidth: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------- | ------- | -------- | ----------------------- | + * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper | + * + * **Notes:** + * + * Decides which rendering engine that is to be used for the rendering. Legal values are: + * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid + * + * Default value: 'dagre-d3' + */ + defaultRenderer: 'dagre-wrapper' + }, + + /** The object containing configurations specific for entity relationship diagrams */ + er: { + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ----------------------------------------------- | ------- | -------- | ------------------ | + * | diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value | + * + * **Notes:** + * + * The amount of padding around the diagram as a whole so that embedded diagrams have margins, + * expressed in pixels + * + * Default value: 20 + */ + diagramPadding: 20, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ---------------------------------------- | ------ | -------- | ---------------------- | + * | layoutDirection | Directional bias for layout of entities. | string | Required | "TB", "BT", "LR", "RL" | + * + * **Notes:** + * + * 'TB' for Top-Bottom, 'BT'for Bottom-Top, 'LR' for Left-Right, or 'RL' for Right to Left. + * + * T = top, B = bottom, L = left, and R = right. + * + * Default value: 'TB' + */ + layoutDirection: 'TB', + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------- | ------- | -------- | ------------------ | + * | minEntityWidth | The minimum width of an entity box | Integer | Required | Any Positive Value | + * + * **Notes:** Expressed in pixels. Default value: 100 + */ + minEntityWidth: 100, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------------------------------- | ------- | -------- | ------------------ | + * | minEntityHeight | The minimum height of an entity box | Integer | 4 | Any Positive Value | + * + * **Notes:** Expressed in pixels Default value: 75 + */ + minEntityHeight: 75, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------- | ------------------------------------------------------------ | ------- | -------- | ------------------ | + * | entityPadding | Minimum internal padding between text in box and box borders | Integer | 4 | Any Positive Value | + * + * **Notes:** + * + * The minimum internal padding between text in an entity box and the enclosing box borders, + * expressed in pixels. + * + * Default value: 15 + */ + entityPadding: 15, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ----------------------------------- | ------ | -------- | -------------------- | + * | stroke | Stroke color of box edges and lines | string | 4 | Any recognized color | + * + * **Notes:** Default value: 'gray' + */ + stroke: 'gray', + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | -------------------------- | ------ | -------- | -------------------- | + * | fill | Fill color of entity boxes | string | 4 | Any recognized color | + * + * **Notes:** Default value: 'honeydew' + */ + fill: 'honeydew', + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ------------------- | ------- | -------- | ------------------ | + * | fontSize | Font Size in pixels | Integer | | Any Positive Value | + * + * **Notes:** + * + * Font size (expressed as an integer representing a number of pixels) Default value: 12 + */ + fontSize: 12, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See Notes | boolean | Required | true, false | + * + * **Notes:** + * + * When this flag is set to true, the diagram width is locked to 100% and scaled based on + * available space. If set to false, the diagram reserves its absolute width. + * + * Default value: true + */ + useMaxWidth: true + }, + + /** The object containing configurations specific for pie diagrams */ + pie: { + useWidth: undefined, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See Notes | boolean | Required | true, false | + * + * **Notes:** + * + * When this flag is set to true, the diagram width is locked to 100% and scaled based on + * available space. If set to false, the diagram reserves its absolute width. + * + * Default value: true + */ + useMaxWidth: true + }, + + /** The object containing configurations specific for req diagrams */ + requirement: { + useWidth: undefined, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See Notes | boolean | Required | true, false | + * + * **Notes:** + * + * When this flag is set to true, the diagram width is locked to 100% and scaled based on + * available space. If set to false, the diagram reserves its absolute width. + * + * Default value: true + */ + useMaxWidth: true, + rect_fill: '#f9f9f9', + text_color: '#333', + rect_border_size: '0.5px', + rect_border_color: '#bbb', + rect_min_width: 200, + rect_min_height: 200, + fontSize: 14, + rect_padding: 10, + line_height: 20 + }, + gitGraph: { + diagramPadding: 8, + nodeLabel: { + width: 75, + height: 100, + x: -25, + y: 0 + }, + mainBranchName: 'main', + mainBranchOrder: 0, + showCommitLabel: true, + showBranches: true, + rotateCommitLabel: true + }, + + /** The object containing configurations specific for c4 diagrams */ + c4: { + useWidth: undefined, + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginX | Margin to the right and left of the c4 diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ + diagramMarginX: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginY | Margin to the over and under the c4 diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ + diagramMarginY: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------- | --------------------- | ------- | -------- | ------------------ | + * | c4ShapeMargin | Margin between shapes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ + c4ShapeMargin: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------- | ------- | -------- | ------------------ | + * | c4ShapePadding | Padding between shapes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 20 + */ + c4ShapePadding: 20, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | --------------------- | ------- | -------- | ------------------ | + * | width | Width of person boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 216 + */ + width: 216, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ---------------------- | ------- | -------- | ------------------ | + * | height | Height of person boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 60 + */ + height: 60, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ------------------- | ------- | -------- | ------------------ | + * | boxMargin | Margin around boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ + boxMargin: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See Notes | boolean | Required | true, false | + * + * **Notes:** When this flag is set to true, the height and width is set to 100% and is then + * scaling with the available space. If set to false, the absolute space required is used. + * + * Default value: true + */ + useMaxWidth: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------ | ----------- | ------- | -------- | ------------------ | + * | c4ShapeInRow | See Notes | Integer | Required | Any Positive Value | + * + * **Notes:** How many shapes to place in each row. + * + * Default value: 4 + */ + c4ShapeInRow: 4, + nextLinePaddingX: 0, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------- | ------- | -------- | ------------------ | + * | c4BoundaryInRow | See Notes | Integer | Required | Any Positive Value | + * + * **Notes:** How many boundarys to place in each row. + * + * Default value: 2 + */ + c4BoundaryInRow: 2, + + /** + * This sets the font size of Person shape for the diagram + * + * **Notes:** Default value: 14. + */ + personFontSize: 14, + + /** + * This sets the font family of Person shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + personFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Person shape for the diagram + * + * **Notes:** Default value: normal. + */ + personFontWeight: 'normal', + + /** + * This sets the font size of External Person shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_personFontSize: 14, + + /** + * This sets the font family of External Person shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_personFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External Person shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_personFontWeight: 'normal', + + /** + * This sets the font size of System shape for the diagram + * + * **Notes:** Default value: 14. + */ + systemFontSize: 14, + + /** + * This sets the font family of System shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + systemFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of System shape for the diagram + * + * **Notes:** Default value: normal. + */ + systemFontWeight: 'normal', + + /** + * This sets the font size of External System shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_systemFontSize: 14, + + /** + * This sets the font family of External System shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_systemFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External System shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_systemFontWeight: 'normal', + + /** + * This sets the font size of System DB shape for the diagram + * + * **Notes:** Default value: 14. + */ + system_dbFontSize: 14, + + /** + * This sets the font family of System DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + system_dbFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of System DB shape for the diagram + * + * **Notes:** Default value: normal. + */ + system_dbFontWeight: 'normal', + + /** + * This sets the font size of External System DB shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_system_dbFontSize: 14, + + /** + * This sets the font family of External System DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_system_dbFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External System DB shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_system_dbFontWeight: 'normal', + + /** + * This sets the font size of System Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ + system_queueFontSize: 14, + + /** + * This sets the font family of System Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + system_queueFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of System Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ + system_queueFontWeight: 'normal', + + /** + * This sets the font size of External System Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_system_queueFontSize: 14, + + /** + * This sets the font family of External System Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_system_queueFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External System Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_system_queueFontWeight: 'normal', + + /** + * This sets the font size of Boundary shape for the diagram + * + * **Notes:** Default value: 14. + */ + boundaryFontSize: 14, + + /** + * This sets the font family of Boundary shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + boundaryFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Boundary shape for the diagram + * + * **Notes:** Default value: normal. + */ + boundaryFontWeight: 'normal', + + /** + * This sets the font size of Message shape for the diagram + * + * **Notes:** Default value: 12. + */ + messageFontSize: 12, + + /** + * This sets the font family of Message shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + messageFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Message shape for the diagram + * + * **Notes:** Default value: normal. + */ + messageFontWeight: 'normal', + + /** + * This sets the font size of Container shape for the diagram + * + * **Notes:** Default value: 14. + */ + containerFontSize: 14, + + /** + * This sets the font family of Container shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + containerFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Container shape for the diagram + * + * **Notes:** Default value: normal. + */ + containerFontWeight: 'normal', + + /** + * This sets the font size of External Container shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_containerFontSize: 14, + + /** + * This sets the font family of External Container shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_containerFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External Container shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_containerFontWeight: 'normal', + + /** + * This sets the font size of Container DB shape for the diagram + * + * **Notes:** Default value: 14. + */ + container_dbFontSize: 14, + + /** + * This sets the font family of Container DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + container_dbFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Container DB shape for the diagram + * + * **Notes:** Default value: normal. + */ + container_dbFontWeight: 'normal', + + /** + * This sets the font size of External Container DB shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_container_dbFontSize: 14, + + /** + * This sets the font family of External Container DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_container_dbFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External Container DB shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_container_dbFontWeight: 'normal', + + /** + * This sets the font size of Container Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ + container_queueFontSize: 14, + + /** + * This sets the font family of Container Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + container_queueFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Container Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ + container_queueFontWeight: 'normal', + + /** + * This sets the font size of External Container Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_container_queueFontSize: 14, + + /** + * This sets the font family of External Container Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_container_queueFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External Container Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_container_queueFontWeight: 'normal', + + /** + * This sets the font size of Component shape for the diagram + * + * **Notes:** Default value: 14. + */ + componentFontSize: 14, + + /** + * This sets the font family of Component shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + componentFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Component shape for the diagram + * + * **Notes:** Default value: normal. + */ + componentFontWeight: 'normal', + + /** + * This sets the font size of External Component shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_componentFontSize: 14, + + /** + * This sets the font family of External Component shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_componentFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External Component shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_componentFontWeight: 'normal', + + /** + * This sets the font size of Component DB shape for the diagram + * + * **Notes:** Default value: 14. + */ + component_dbFontSize: 14, + + /** + * This sets the font family of Component DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + component_dbFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Component DB shape for the diagram + * + * **Notes:** Default value: normal. + */ + component_dbFontWeight: 'normal', + + /** + * This sets the font size of External Component DB shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_component_dbFontSize: 14, + + /** + * This sets the font family of External Component DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_component_dbFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External Component DB shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_component_dbFontWeight: 'normal', + + /** + * This sets the font size of Component Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ + component_queueFontSize: 14, + + /** + * This sets the font family of Component Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + component_queueFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Component Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ + component_queueFontWeight: 'normal', + + /** + * This sets the font size of External Component Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_component_queueFontSize: 14, + + /** + * This sets the font family of External Component Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_component_queueFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External Component Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_component_queueFontWeight: 'normal', + + /** + * This sets the auto-wrap state for the diagram + * + * **Notes:** Default value: true. + */ + wrap: true, + + /** + * This sets the auto-wrap padding for the diagram (sides only) + * + * **Notes:** Default value: 0. + */ + wrapPadding: 10, + personFont: function personFont() { + return { + fontFamily: this.personFontFamily, + fontSize: this.personFontSize, + fontWeight: this.personFontWeight + }; + }, + external_personFont: function external_personFont() { + return { + fontFamily: this.external_personFontFamily, + fontSize: this.external_personFontSize, + fontWeight: this.external_personFontWeight + }; + }, + systemFont: function systemFont() { + return { + fontFamily: this.systemFontFamily, + fontSize: this.systemFontSize, + fontWeight: this.systemFontWeight + }; + }, + external_systemFont: function external_systemFont() { + return { + fontFamily: this.external_systemFontFamily, + fontSize: this.external_systemFontSize, + fontWeight: this.external_systemFontWeight + }; + }, + system_dbFont: function system_dbFont() { + return { + fontFamily: this.system_dbFontFamily, + fontSize: this.system_dbFontSize, + fontWeight: this.system_dbFontWeight + }; + }, + external_system_dbFont: function external_system_dbFont() { + return { + fontFamily: this.external_system_dbFontFamily, + fontSize: this.external_system_dbFontSize, + fontWeight: this.external_system_dbFontWeight + }; + }, + system_queueFont: function system_queueFont() { + return { + fontFamily: this.system_queueFontFamily, + fontSize: this.system_queueFontSize, + fontWeight: this.system_queueFontWeight + }; + }, + external_system_queueFont: function external_system_queueFont() { + return { + fontFamily: this.external_system_queueFontFamily, + fontSize: this.external_system_queueFontSize, + fontWeight: this.external_system_queueFontWeight + }; + }, + containerFont: function containerFont() { + return { + fontFamily: this.containerFontFamily, + fontSize: this.containerFontSize, + fontWeight: this.containerFontWeight + }; + }, + external_containerFont: function external_containerFont() { + return { + fontFamily: this.external_containerFontFamily, + fontSize: this.external_containerFontSize, + fontWeight: this.external_containerFontWeight + }; + }, + container_dbFont: function container_dbFont() { + return { + fontFamily: this.container_dbFontFamily, + fontSize: this.container_dbFontSize, + fontWeight: this.container_dbFontWeight + }; + }, + external_container_dbFont: function external_container_dbFont() { + return { + fontFamily: this.external_container_dbFontFamily, + fontSize: this.external_container_dbFontSize, + fontWeight: this.external_container_dbFontWeight + }; + }, + container_queueFont: function container_queueFont() { + return { + fontFamily: this.container_queueFontFamily, + fontSize: this.container_queueFontSize, + fontWeight: this.container_queueFontWeight + }; + }, + external_container_queueFont: function external_container_queueFont() { + return { + fontFamily: this.external_container_queueFontFamily, + fontSize: this.external_container_queueFontSize, + fontWeight: this.external_container_queueFontWeight + }; + }, + componentFont: function componentFont() { + return { + fontFamily: this.componentFontFamily, + fontSize: this.componentFontSize, + fontWeight: this.componentFontWeight + }; + }, + external_componentFont: function external_componentFont() { + return { + fontFamily: this.external_componentFontFamily, + fontSize: this.external_componentFontSize, + fontWeight: this.external_componentFontWeight + }; + }, + component_dbFont: function component_dbFont() { + return { + fontFamily: this.component_dbFontFamily, + fontSize: this.component_dbFontSize, + fontWeight: this.component_dbFontWeight + }; + }, + external_component_dbFont: function external_component_dbFont() { + return { + fontFamily: this.external_component_dbFontFamily, + fontSize: this.external_component_dbFontSize, + fontWeight: this.external_component_dbFontWeight + }; + }, + component_queueFont: function component_queueFont() { + return { + fontFamily: this.component_queueFontFamily, + fontSize: this.component_queueFontSize, + fontWeight: this.component_queueFontWeight + }; + }, + external_component_queueFont: function external_component_queueFont() { + return { + fontFamily: this.external_component_queueFontFamily, + fontSize: this.external_component_queueFontSize, + fontWeight: this.external_component_queueFontWeight + }; + }, + boundaryFont: function boundaryFont() { + return { + fontFamily: this.boundaryFontFamily, + fontSize: this.boundaryFontSize, + fontWeight: this.boundaryFontWeight + }; + }, + messageFont: function messageFont() { + return { + fontFamily: this.messageFontFamily, + fontSize: this.messageFontSize, + fontWeight: this.messageFontWeight + }; + }, + // ' Colors + // ' ################################## + person_bg_color: '#08427B', + person_border_color: '#073B6F', + external_person_bg_color: '#686868', + external_person_border_color: '#8A8A8A', + system_bg_color: '#1168BD', + system_border_color: '#3C7FC0', + system_db_bg_color: '#1168BD', + system_db_border_color: '#3C7FC0', + system_queue_bg_color: '#1168BD', + system_queue_border_color: '#3C7FC0', + external_system_bg_color: '#999999', + external_system_border_color: '#8A8A8A', + external_system_db_bg_color: '#999999', + external_system_db_border_color: '#8A8A8A', + external_system_queue_bg_color: '#999999', + external_system_queue_border_color: '#8A8A8A', + container_bg_color: '#438DD5', + container_border_color: '#3C7FC0', + container_db_bg_color: '#438DD5', + container_db_border_color: '#3C7FC0', + container_queue_bg_color: '#438DD5', + container_queue_border_color: '#3C7FC0', + external_container_bg_color: '#B3B3B3', + external_container_border_color: '#A6A6A6', + external_container_db_bg_color: '#B3B3B3', + external_container_db_border_color: '#A6A6A6', + external_container_queue_bg_color: '#B3B3B3', + external_container_queue_border_color: '#A6A6A6', + component_bg_color: '#85BBF0', + component_border_color: '#78A8D8', + component_db_bg_color: '#85BBF0', + component_db_border_color: '#78A8D8', + component_queue_bg_color: '#85BBF0', + component_queue_border_color: '#78A8D8', + external_component_bg_color: '#CCCCCC', + external_component_border_color: '#BFBFBF', + external_component_db_bg_color: '#CCCCCC', + external_component_db_border_color: '#BFBFBF', + external_component_queue_bg_color: '#CCCCCC', + external_component_queue_border_color: '#BFBFBF' + } +}; +config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute; +config.gitGraph.arrowMarkerAbsolute = config.arrowMarkerAbsolute; + +var keyify = function keyify(obj) { + var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + return Object.keys(obj).reduce(function (res, el) { + if (Array.isArray(obj[el])) { + return res; + } else if (_typeof(obj[el]) === 'object' && obj[el] !== null) { + return [].concat(_toConsumableArray(res), [prefix + el], _toConsumableArray(keyify(obj[el], ''))); + } + + return [].concat(_toConsumableArray(res), [prefix + el]); + }, []); +}; + +var configKeys = keyify(config, ''); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (config); + +/***/ }), + +/***/ "./src/diagrams/c4/c4Db.js": +/*!*********************************!*\ + !*** ./src/diagrams/c4/c4Db.js ***! + \*********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "ARROWTYPE": () => (/* binding */ ARROWTYPE), +/* harmony export */ "LINETYPE": () => (/* binding */ LINETYPE), +/* harmony export */ "PLACEMENT": () => (/* binding */ PLACEMENT), +/* harmony export */ "addComponent": () => (/* binding */ addComponent), +/* harmony export */ "addContainer": () => (/* binding */ addContainer), +/* harmony export */ "addContainerBoundary": () => (/* binding */ addContainerBoundary), +/* harmony export */ "addDeploymentNode": () => (/* binding */ addDeploymentNode), +/* harmony export */ "addPersonOrSystem": () => (/* binding */ addPersonOrSystem), +/* harmony export */ "addPersonOrSystemBoundary": () => (/* binding */ addPersonOrSystemBoundary), +/* harmony export */ "addRel": () => (/* binding */ addRel), +/* harmony export */ "autoWrap": () => (/* binding */ autoWrap), +/* harmony export */ "clear": () => (/* binding */ clear), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "getBoundarys": () => (/* binding */ getBoundarys), +/* harmony export */ "getC4BoundaryInRow": () => (/* binding */ getC4BoundaryInRow), +/* harmony export */ "getC4Shape": () => (/* binding */ getC4Shape), +/* harmony export */ "getC4ShapeArray": () => (/* binding */ getC4ShapeArray), +/* harmony export */ "getC4ShapeInRow": () => (/* binding */ getC4ShapeInRow), +/* harmony export */ "getC4ShapeKeys": () => (/* binding */ getC4ShapeKeys), +/* harmony export */ "getC4Type": () => (/* binding */ getC4Type), +/* harmony export */ "getCurrentBoundaryParse": () => (/* binding */ getCurrentBoundaryParse), +/* harmony export */ "getParentBoundaryParse": () => (/* binding */ getParentBoundaryParse), +/* harmony export */ "getRels": () => (/* binding */ getRels), +/* harmony export */ "getTitle": () => (/* binding */ getTitle), +/* harmony export */ "parseDirective": () => (/* binding */ parseDirective), +/* harmony export */ "popBoundaryParseStack": () => (/* binding */ popBoundaryParseStack), +/* harmony export */ "setC4Type": () => (/* binding */ setC4Type), +/* harmony export */ "setTitle": () => (/* binding */ setTitle), +/* harmony export */ "setWrap": () => (/* binding */ setWrap), +/* harmony export */ "updateElStyle": () => (/* binding */ updateElStyle), +/* harmony export */ "updateLayoutConfig": () => (/* binding */ updateLayoutConfig), +/* harmony export */ "updateRelStyle": () => (/* binding */ updateRelStyle) +/* harmony export */ }); +/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../config */ "./src/config.js"); +/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); +/* harmony import */ var _commonDb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../commonDb */ "./src/commonDb.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + + + + + + +var c4ShapeArray = []; +var boundaryParseStack = ['']; +var currentBoundaryParse = 'global'; +var parentBoundaryParse = ''; +var boundarys = [{ + alias: 'global', + label: { + text: 'global' + }, + type: { + text: 'global' + }, + tags: null, + link: null, + parentBoundary: '' +}]; +var rels = []; +var title = ''; +var wrapEnabled = false; +var description = ''; +var c4ShapeInRow = 4; +var c4BoundaryInRow = 2; +var c4Type; +var getC4Type = function getC4Type() { + return c4Type; +}; +var setC4Type = function setC4Type(c4TypeParam) { + var sanitizedText = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.sanitizeText)(c4TypeParam, _config__WEBPACK_IMPORTED_MODULE_1__.getConfig()); + c4Type = sanitizedText; +}; +var parseDirective = function parseDirective(statement, context, type) { + _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"].parseDirective(this, statement, context, type); +}; //type, from, to, label, ?techn, ?descr, ?sprite, ?tags, $link + +var addRel = function addRel(type, from, to, label, techn, descr, sprite, tags, link) { + // Don't allow label nulling + if (type === undefined || type === null || from === undefined || from === null || to === undefined || to === null || label === undefined || label === null) return; + var rel = {}; + var old = rels.find(function (rel) { + return rel.from === from && rel.to === to; + }); + + if (old) { + rel = old; + } else { + rels.push(rel); + } + + rel.type = type; + rel.from = from; + rel.to = to; + rel.label = { + text: label + }; + + if (techn === undefined || techn === null) { + rel.techn = { + text: '' + }; + } else { + if (_typeof(techn) === 'object') { + var _Object$entries$ = _slicedToArray(Object.entries(techn)[0], 2), + key = _Object$entries$[0], + value = _Object$entries$[1]; + + rel[key] = { + text: value + }; + } else { + rel.techn = { + text: techn + }; + } + } + + if (descr === undefined || descr === null) { + rel.descr = { + text: '' + }; + } else { + if (_typeof(descr) === 'object') { + var _Object$entries$2 = _slicedToArray(Object.entries(descr)[0], 2), + _key = _Object$entries$2[0], + _value = _Object$entries$2[1]; + + rel[_key] = { + text: _value + }; + } else { + rel.descr = { + text: descr + }; + } + } + + if (_typeof(sprite) === 'object') { + var _Object$entries$3 = _slicedToArray(Object.entries(sprite)[0], 2), + _key2 = _Object$entries$3[0], + _value2 = _Object$entries$3[1]; + + rel[_key2] = _value2; + } else { + rel.sprite = sprite; + } + + if (_typeof(tags) === 'object') { + var _Object$entries$4 = _slicedToArray(Object.entries(tags)[0], 2), + _key3 = _Object$entries$4[0], + _value3 = _Object$entries$4[1]; + + rel[_key3] = _value3; + } else { + rel.tags = tags; + } + + if (_typeof(link) === 'object') { + var _Object$entries$5 = _slicedToArray(Object.entries(link)[0], 2), + _key4 = _Object$entries$5[0], + _value4 = _Object$entries$5[1]; + + rel[_key4] = _value4; + } else { + rel.link = link; + } + + rel.wrap = autoWrap(); +}; //type, alias, label, ?descr, ?sprite, ?tags, $link + +var addPersonOrSystem = function addPersonOrSystem(typeC4Shape, alias, label, descr, sprite, tags, link) { + // Don't allow label nulling + if (alias === null || label === null) return; + var personOrSystem = {}; + var old = c4ShapeArray.find(function (personOrSystem) { + return personOrSystem.alias === alias; + }); + + if (old && alias === old.alias) { + personOrSystem = old; + } else { + personOrSystem.alias = alias; + c4ShapeArray.push(personOrSystem); + } // Don't allow null labels, either + + + if (label === undefined || label === null) { + personOrSystem.label = { + text: '' + }; + } else { + personOrSystem.label = { + text: label + }; + } + + if (descr === undefined || descr === null) { + personOrSystem.descr = { + text: '' + }; + } else { + if (_typeof(descr) === 'object') { + var _Object$entries$6 = _slicedToArray(Object.entries(descr)[0], 2), + key = _Object$entries$6[0], + value = _Object$entries$6[1]; + + personOrSystem[key] = { + text: value + }; + } else { + personOrSystem.descr = { + text: descr + }; + } + } + + if (_typeof(sprite) === 'object') { + var _Object$entries$7 = _slicedToArray(Object.entries(sprite)[0], 2), + _key5 = _Object$entries$7[0], + _value5 = _Object$entries$7[1]; + + personOrSystem[_key5] = _value5; + } else { + personOrSystem.sprite = sprite; + } + + if (_typeof(tags) === 'object') { + var _Object$entries$8 = _slicedToArray(Object.entries(tags)[0], 2), + _key6 = _Object$entries$8[0], + _value6 = _Object$entries$8[1]; + + personOrSystem[_key6] = _value6; + } else { + personOrSystem.tags = tags; + } + + if (_typeof(link) === 'object') { + var _Object$entries$9 = _slicedToArray(Object.entries(link)[0], 2), + _key7 = _Object$entries$9[0], + _value7 = _Object$entries$9[1]; + + personOrSystem[_key7] = _value7; + } else { + personOrSystem.link = link; + } + + personOrSystem.typeC4Shape = { + text: typeC4Shape + }; + personOrSystem.parentBoundary = currentBoundaryParse; + personOrSystem.wrap = autoWrap(); +}; //type, alias, label, ?techn, ?descr ?sprite, ?tags, $link + +var addContainer = function addContainer(typeC4Shape, alias, label, techn, descr, sprite, tags, link) { + // Don't allow label nulling + if (alias === null || label === null) return; + var container = {}; + var old = c4ShapeArray.find(function (container) { + return container.alias === alias; + }); + + if (old && alias === old.alias) { + container = old; + } else { + container.alias = alias; + c4ShapeArray.push(container); + } // Don't allow null labels, either + + + if (label === undefined || label === null) { + container.label = { + text: '' + }; + } else { + container.label = { + text: label + }; + } + + if (techn === undefined || techn === null) { + container.techn = { + text: '' + }; + } else { + if (_typeof(techn) === 'object') { + var _Object$entries$10 = _slicedToArray(Object.entries(techn)[0], 2), + key = _Object$entries$10[0], + value = _Object$entries$10[1]; + + container[key] = { + text: value + }; + } else { + container.techn = { + text: techn + }; + } + } + + if (descr === undefined || descr === null) { + container.descr = { + text: '' + }; + } else { + if (_typeof(descr) === 'object') { + var _Object$entries$11 = _slicedToArray(Object.entries(descr)[0], 2), + _key8 = _Object$entries$11[0], + _value8 = _Object$entries$11[1]; + + container[_key8] = { + text: _value8 + }; + } else { + container.descr = { + text: descr + }; + } + } + + if (_typeof(sprite) === 'object') { + var _Object$entries$12 = _slicedToArray(Object.entries(sprite)[0], 2), + _key9 = _Object$entries$12[0], + _value9 = _Object$entries$12[1]; + + container[_key9] = _value9; + } else { + container.sprite = sprite; + } + + if (_typeof(tags) === 'object') { + var _Object$entries$13 = _slicedToArray(Object.entries(tags)[0], 2), + _key10 = _Object$entries$13[0], + _value10 = _Object$entries$13[1]; + + container[_key10] = _value10; + } else { + container.tags = tags; + } + + if (_typeof(link) === 'object') { + var _Object$entries$14 = _slicedToArray(Object.entries(link)[0], 2), + _key11 = _Object$entries$14[0], + _value11 = _Object$entries$14[1]; + + container[_key11] = _value11; + } else { + container.link = link; + } + + container.wrap = autoWrap(); + container.typeC4Shape = { + text: typeC4Shape + }; + container.parentBoundary = currentBoundaryParse; +}; //type, alias, label, ?techn, ?descr ?sprite, ?tags, $link + +var addComponent = function addComponent(typeC4Shape, alias, label, techn, descr, sprite, tags, link) { + // Don't allow label nulling + if (alias === null || label === null) return; + var component = {}; + var old = c4ShapeArray.find(function (component) { + return component.alias === alias; + }); + + if (old && alias === old.alias) { + component = old; + } else { + component.alias = alias; + c4ShapeArray.push(component); + } // Don't allow null labels, either + + + if (label === undefined || label === null) { + component.label = { + text: '' + }; + } else { + component.label = { + text: label + }; + } + + if (techn === undefined || techn === null) { + component.techn = { + text: '' + }; + } else { + if (_typeof(techn) === 'object') { + var _Object$entries$15 = _slicedToArray(Object.entries(techn)[0], 2), + key = _Object$entries$15[0], + value = _Object$entries$15[1]; + + component[key] = { + text: value + }; + } else { + component.techn = { + text: techn + }; + } + } + + if (descr === undefined || descr === null) { + component.descr = { + text: '' + }; + } else { + if (_typeof(descr) === 'object') { + var _Object$entries$16 = _slicedToArray(Object.entries(descr)[0], 2), + _key12 = _Object$entries$16[0], + _value12 = _Object$entries$16[1]; + + component[_key12] = { + text: _value12 + }; + } else { + component.descr = { + text: descr + }; + } + } + + if (_typeof(sprite) === 'object') { + var _Object$entries$17 = _slicedToArray(Object.entries(sprite)[0], 2), + _key13 = _Object$entries$17[0], + _value13 = _Object$entries$17[1]; + + component[_key13] = _value13; + } else { + component.sprite = sprite; + } + + if (_typeof(tags) === 'object') { + var _Object$entries$18 = _slicedToArray(Object.entries(tags)[0], 2), + _key14 = _Object$entries$18[0], + _value14 = _Object$entries$18[1]; + + component[_key14] = _value14; + } else { + component.tags = tags; + } + + if (_typeof(link) === 'object') { + var _Object$entries$19 = _slicedToArray(Object.entries(link)[0], 2), + _key15 = _Object$entries$19[0], + _value15 = _Object$entries$19[1]; + + component[_key15] = _value15; + } else { + component.link = link; + } + + component.wrap = autoWrap(); + component.typeC4Shape = { + text: typeC4Shape + }; + component.parentBoundary = currentBoundaryParse; +}; //alias, label, ?type, ?tags, $link + +var addPersonOrSystemBoundary = function addPersonOrSystemBoundary(alias, label, type, tags, link) { + // if (parentBoundary === null) return; + // Don't allow label nulling + if (alias === null || label === null) return; + var boundary = {}; + var old = boundarys.find(function (boundary) { + return boundary.alias === alias; + }); + + if (old && alias === old.alias) { + boundary = old; + } else { + boundary.alias = alias; + boundarys.push(boundary); + } // Don't allow null labels, either + + + if (label === undefined || label === null) { + boundary.label = { + text: '' + }; + } else { + boundary.label = { + text: label + }; + } + + if (type === undefined || type === null) { + boundary.type = { + text: 'system' + }; + } else { + if (_typeof(type) === 'object') { + var _Object$entries$20 = _slicedToArray(Object.entries(type)[0], 2), + key = _Object$entries$20[0], + value = _Object$entries$20[1]; + + boundary[key] = { + text: value + }; + } else { + boundary.type = { + text: type + }; + } + } + + if (_typeof(tags) === 'object') { + var _Object$entries$21 = _slicedToArray(Object.entries(tags)[0], 2), + _key16 = _Object$entries$21[0], + _value16 = _Object$entries$21[1]; + + boundary[_key16] = _value16; + } else { + boundary.tags = tags; + } + + if (_typeof(link) === 'object') { + var _Object$entries$22 = _slicedToArray(Object.entries(link)[0], 2), + _key17 = _Object$entries$22[0], + _value17 = _Object$entries$22[1]; + + boundary[_key17] = _value17; + } else { + boundary.link = link; + } + + boundary.parentBoundary = currentBoundaryParse; + boundary.wrap = autoWrap(); + parentBoundaryParse = currentBoundaryParse; + currentBoundaryParse = alias; + boundaryParseStack.push(parentBoundaryParse); +}; //alias, label, ?type, ?tags, $link + +var addContainerBoundary = function addContainerBoundary(alias, label, type, tags, link) { + // if (parentBoundary === null) return; + // Don't allow label nulling + if (alias === null || label === null) return; + var boundary = {}; + var old = boundarys.find(function (boundary) { + return boundary.alias === alias; + }); + + if (old && alias === old.alias) { + boundary = old; + } else { + boundary.alias = alias; + boundarys.push(boundary); + } // Don't allow null labels, either + + + if (label === undefined || label === null) { + boundary.label = { + text: '' + }; + } else { + boundary.label = { + text: label + }; + } + + if (type === undefined || type === null) { + boundary.type = { + text: 'container' + }; + } else { + if (_typeof(type) === 'object') { + var _Object$entries$23 = _slicedToArray(Object.entries(type)[0], 2), + key = _Object$entries$23[0], + value = _Object$entries$23[1]; + + boundary[key] = { + text: value + }; + } else { + boundary.type = { + text: type + }; + } + } + + if (_typeof(tags) === 'object') { + var _Object$entries$24 = _slicedToArray(Object.entries(tags)[0], 2), + _key18 = _Object$entries$24[0], + _value18 = _Object$entries$24[1]; + + boundary[_key18] = _value18; + } else { + boundary.tags = tags; + } + + if (_typeof(link) === 'object') { + var _Object$entries$25 = _slicedToArray(Object.entries(link)[0], 2), + _key19 = _Object$entries$25[0], + _value19 = _Object$entries$25[1]; + + boundary[_key19] = _value19; + } else { + boundary.link = link; + } + + boundary.parentBoundary = currentBoundaryParse; + boundary.wrap = autoWrap(); + parentBoundaryParse = currentBoundaryParse; + currentBoundaryParse = alias; + boundaryParseStack.push(parentBoundaryParse); +}; //alias, label, ?type, ?descr, ?sprite, ?tags, $link + +var addDeploymentNode = function addDeploymentNode(nodeType, alias, label, type, descr, sprite, tags, link) { + // if (parentBoundary === null) return; + // Don't allow label nulling + if (alias === null || label === null) return; + var boundary = {}; + var old = boundarys.find(function (boundary) { + return boundary.alias === alias; + }); + + if (old && alias === old.alias) { + boundary = old; + } else { + boundary.alias = alias; + boundarys.push(boundary); + } // Don't allow null labels, either + + + if (label === undefined || label === null) { + boundary.label = { + text: '' + }; + } else { + boundary.label = { + text: label + }; + } + + if (type === undefined || type === null) { + boundary.type = { + text: 'node' + }; + } else { + if (_typeof(type) === 'object') { + var _Object$entries$26 = _slicedToArray(Object.entries(type)[0], 2), + key = _Object$entries$26[0], + value = _Object$entries$26[1]; + + boundary[key] = { + text: value + }; + } else { + boundary.type = { + text: type + }; + } + } + + if (descr === undefined || descr === null) { + boundary.descr = { + text: '' + }; + } else { + if (_typeof(descr) === 'object') { + var _Object$entries$27 = _slicedToArray(Object.entries(descr)[0], 2), + _key20 = _Object$entries$27[0], + _value20 = _Object$entries$27[1]; + + boundary[_key20] = { + text: _value20 + }; + } else { + boundary.descr = { + text: descr + }; + } + } + + if (_typeof(tags) === 'object') { + var _Object$entries$28 = _slicedToArray(Object.entries(tags)[0], 2), + _key21 = _Object$entries$28[0], + _value21 = _Object$entries$28[1]; + + boundary[_key21] = _value21; + } else { + boundary.tags = tags; + } + + if (_typeof(link) === 'object') { + var _Object$entries$29 = _slicedToArray(Object.entries(link)[0], 2), + _key22 = _Object$entries$29[0], + _value22 = _Object$entries$29[1]; + + boundary[_key22] = _value22; + } else { + boundary.link = link; + } + + boundary.nodeType = nodeType; + boundary.parentBoundary = currentBoundaryParse; + boundary.wrap = autoWrap(); + parentBoundaryParse = currentBoundaryParse; + currentBoundaryParse = alias; + boundaryParseStack.push(parentBoundaryParse); +}; +var popBoundaryParseStack = function popBoundaryParseStack() { + currentBoundaryParse = parentBoundaryParse; + boundaryParseStack.pop(); + parentBoundaryParse = boundaryParseStack.pop(); + boundaryParseStack.push(parentBoundaryParse); +}; //elementName, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?sprite, ?techn, ?legendText, ?legendSprite + +var updateElStyle = function updateElStyle(typeC4Shape, elementName, bgColor, fontColor, borderColor, shadowing, shape, sprite, techn, legendText, legendSprite) { + var old = c4ShapeArray.find(function (element) { + return element.alias === elementName; + }); + + if (old === undefined) { + old = boundarys.find(function (element) { + return element.alias === elementName; + }); + + if (old === undefined) { + return; + } + } + + if (bgColor !== undefined && bgColor !== null) { + if (_typeof(bgColor) === 'object') { + var _Object$entries$30 = _slicedToArray(Object.entries(bgColor)[0], 2), + key = _Object$entries$30[0], + value = _Object$entries$30[1]; + + old[key] = value; + } else { + old.bgColor = bgColor; + } + } + + if (fontColor !== undefined && fontColor !== null) { + if (_typeof(fontColor) === 'object') { + var _Object$entries$31 = _slicedToArray(Object.entries(fontColor)[0], 2), + _key23 = _Object$entries$31[0], + _value23 = _Object$entries$31[1]; + + old[_key23] = _value23; + } else { + old.fontColor = fontColor; + } + } + + if (borderColor !== undefined && borderColor !== null) { + if (_typeof(borderColor) === 'object') { + var _Object$entries$32 = _slicedToArray(Object.entries(borderColor)[0], 2), + _key24 = _Object$entries$32[0], + _value24 = _Object$entries$32[1]; + + old[_key24] = _value24; + } else { + old.borderColor = borderColor; + } + } + + if (shadowing !== undefined && shadowing !== null) { + if (_typeof(shadowing) === 'object') { + var _Object$entries$33 = _slicedToArray(Object.entries(shadowing)[0], 2), + _key25 = _Object$entries$33[0], + _value25 = _Object$entries$33[1]; + + old[_key25] = _value25; + } else { + old.shadowing = shadowing; + } + } + + if (shape !== undefined && shape !== null) { + if (_typeof(shape) === 'object') { + var _Object$entries$34 = _slicedToArray(Object.entries(shape)[0], 2), + _key26 = _Object$entries$34[0], + _value26 = _Object$entries$34[1]; + + old[_key26] = _value26; + } else { + old.shape = shape; + } + } + + if (sprite !== undefined && sprite !== null) { + if (_typeof(sprite) === 'object') { + var _Object$entries$35 = _slicedToArray(Object.entries(sprite)[0], 2), + _key27 = _Object$entries$35[0], + _value27 = _Object$entries$35[1]; + + old[_key27] = _value27; + } else { + old.sprite = sprite; + } + } + + if (techn !== undefined && techn !== null) { + if (_typeof(techn) === 'object') { + var _Object$entries$36 = _slicedToArray(Object.entries(techn)[0], 2), + _key28 = _Object$entries$36[0], + _value28 = _Object$entries$36[1]; + + old[_key28] = _value28; + } else { + old.techn = techn; + } + } + + if (legendText !== undefined && legendText !== null) { + if (_typeof(legendText) === 'object') { + var _Object$entries$37 = _slicedToArray(Object.entries(legendText)[0], 2), + _key29 = _Object$entries$37[0], + _value29 = _Object$entries$37[1]; + + old[_key29] = _value29; + } else { + old.legendText = legendText; + } + } + + if (legendSprite !== undefined && legendSprite !== null) { + if (_typeof(legendSprite) === 'object') { + var _Object$entries$38 = _slicedToArray(Object.entries(legendSprite)[0], 2), + _key30 = _Object$entries$38[0], + _value30 = _Object$entries$38[1]; + + old[_key30] = _value30; + } else { + old.legendSprite = legendSprite; + } + } +}; //textColor, lineColor, ?offsetX, ?offsetY + +var updateRelStyle = function updateRelStyle(typeC4Shape, from, to, textColor, lineColor, offsetX, offsetY) { + var old = rels.find(function (rel) { + return rel.from === from && rel.to === to; + }); + + if (old === undefined) { + return; + } + + if (textColor !== undefined && textColor !== null) { + if (_typeof(textColor) === 'object') { + var _Object$entries$39 = _slicedToArray(Object.entries(textColor)[0], 2), + key = _Object$entries$39[0], + value = _Object$entries$39[1]; + + old[key] = value; + } else { + old.textColor = textColor; + } + } + + if (lineColor !== undefined && lineColor !== null) { + if (_typeof(lineColor) === 'object') { + var _Object$entries$40 = _slicedToArray(Object.entries(lineColor)[0], 2), + _key31 = _Object$entries$40[0], + _value31 = _Object$entries$40[1]; + + old[_key31] = _value31; + } else { + old.lineColor = lineColor; + } + } + + if (offsetX !== undefined && offsetX !== null) { + if (_typeof(offsetX) === 'object') { + var _Object$entries$41 = _slicedToArray(Object.entries(offsetX)[0], 2), + _key32 = _Object$entries$41[0], + _value32 = _Object$entries$41[1]; + + old[_key32] = parseInt(_value32); + } else { + old.offsetX = parseInt(offsetX); + } + } + + if (offsetY !== undefined && offsetY !== null) { + if (_typeof(offsetY) === 'object') { + var _Object$entries$42 = _slicedToArray(Object.entries(offsetY)[0], 2), + _key33 = _Object$entries$42[0], + _value33 = _Object$entries$42[1]; + + old[_key33] = parseInt(_value33); + } else { + old.offsetY = parseInt(offsetY); + } + } +}; //?c4ShapeInRow, ?c4BoundaryInRow + +var updateLayoutConfig = function updateLayoutConfig(typeC4Shape, c4ShapeInRowParam, c4BoundaryInRowParam) { + var c4ShapeInRowValue = c4ShapeInRow; + var c4BoundaryInRowValue = c4BoundaryInRow; + + if (_typeof(c4ShapeInRowParam) === 'object') { + var _Object$entries$43 = _slicedToArray(Object.entries(c4ShapeInRowParam)[0], 2), + key = _Object$entries$43[0], + value = _Object$entries$43[1]; + + c4ShapeInRowValue = parseInt(value); + } else { + c4ShapeInRowValue = parseInt(c4ShapeInRowParam); + } + + if (_typeof(c4BoundaryInRowParam) === 'object') { + var _Object$entries$44 = _slicedToArray(Object.entries(c4BoundaryInRowParam)[0], 2), + _key34 = _Object$entries$44[0], + _value34 = _Object$entries$44[1]; + + c4BoundaryInRowValue = parseInt(_value34); + } else { + c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam); + } + + if (c4ShapeInRowValue >= 1) c4ShapeInRow = c4ShapeInRowValue; + if (c4BoundaryInRowValue >= 1) c4BoundaryInRow = c4BoundaryInRowValue; +}; +var getC4ShapeInRow = function getC4ShapeInRow() { + return c4ShapeInRow; +}; +var getC4BoundaryInRow = function getC4BoundaryInRow() { + return c4BoundaryInRow; +}; +var getCurrentBoundaryParse = function getCurrentBoundaryParse() { + return currentBoundaryParse; +}; +var getParentBoundaryParse = function getParentBoundaryParse() { + return parentBoundaryParse; +}; +var getC4ShapeArray = function getC4ShapeArray(parentBoundary) { + if (parentBoundary === undefined || parentBoundary === null) return c4ShapeArray;else return c4ShapeArray.filter(function (personOrSystem) { + return personOrSystem.parentBoundary === parentBoundary; + }); +}; +var getC4Shape = function getC4Shape(alias) { + return c4ShapeArray.find(function (personOrSystem) { + return personOrSystem.alias === alias; + }); +}; +var getC4ShapeKeys = function getC4ShapeKeys(parentBoundary) { + return Object.keys(getC4ShapeArray(parentBoundary)); +}; +var getBoundarys = function getBoundarys(parentBoundary) { + if (parentBoundary === undefined || parentBoundary === null) return boundarys;else return boundarys.filter(function (boundary) { + return boundary.parentBoundary === parentBoundary; + }); +}; +var getRels = function getRels() { + return rels; +}; +var getTitle = function getTitle() { + return title; +}; +var setWrap = function setWrap(wrapSetting) { + wrapEnabled = wrapSetting; +}; +var autoWrap = function autoWrap() { + return wrapEnabled; +}; +var clear = function clear() { + c4ShapeArray = []; + boundarys = [{ + alias: 'global', + label: { + text: 'global' + }, + type: { + text: 'global' + }, + tags: null, + link: null, + parentBoundary: '' + }]; + parentBoundaryParse = ''; + currentBoundaryParse = 'global'; + boundaryParseStack = ['']; + rels = []; + boundaryParseStack = ['']; + title = ''; + wrapEnabled = false; + description = ''; + c4ShapeInRow = 4; + c4BoundaryInRow = 2; +}; +var LINETYPE = { + SOLID: 0, + DOTTED: 1, + NOTE: 2, + SOLID_CROSS: 3, + DOTTED_CROSS: 4, + SOLID_OPEN: 5, + DOTTED_OPEN: 6, + LOOP_START: 10, + LOOP_END: 11, + ALT_START: 12, + ALT_ELSE: 13, + ALT_END: 14, + OPT_START: 15, + OPT_END: 16, + ACTIVE_START: 17, + ACTIVE_END: 18, + PAR_START: 19, + PAR_AND: 20, + PAR_END: 21, + RECT_START: 22, + RECT_END: 23, + SOLID_POINT: 24, + DOTTED_POINT: 25 +}; +var ARROWTYPE = { + FILLED: 0, + OPEN: 1 +}; +var PLACEMENT = { + LEFTOF: 0, + RIGHTOF: 1, + OVER: 2 +}; +var setTitle = function setTitle(txt) { + var sanitizedText = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.sanitizeText)(txt, _config__WEBPACK_IMPORTED_MODULE_1__.getConfig()); + title = sanitizedText; +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + addPersonOrSystem: addPersonOrSystem, + addPersonOrSystemBoundary: addPersonOrSystemBoundary, + addContainer: addContainer, + addContainerBoundary: addContainerBoundary, + addComponent: addComponent, + addDeploymentNode: addDeploymentNode, + popBoundaryParseStack: popBoundaryParseStack, + addRel: addRel, + updateElStyle: updateElStyle, + updateRelStyle: updateRelStyle, + updateLayoutConfig: updateLayoutConfig, + autoWrap: autoWrap, + setWrap: setWrap, + getC4ShapeArray: getC4ShapeArray, + getC4Shape: getC4Shape, + getC4ShapeKeys: getC4ShapeKeys, + getBoundarys: getBoundarys, + getCurrentBoundaryParse: getCurrentBoundaryParse, + getParentBoundaryParse: getParentBoundaryParse, + getRels: getRels, + getTitle: getTitle, + getC4Type: getC4Type, + getC4ShapeInRow: getC4ShapeInRow, + getC4BoundaryInRow: getC4BoundaryInRow, + setAccTitle: _commonDb__WEBPACK_IMPORTED_MODULE_3__.setAccTitle, + getAccTitle: _commonDb__WEBPACK_IMPORTED_MODULE_3__.getAccTitle, + getAccDescription: _commonDb__WEBPACK_IMPORTED_MODULE_3__.getAccDescription, + setAccDescription: _commonDb__WEBPACK_IMPORTED_MODULE_3__.setAccDescription, + parseDirective: parseDirective, + getConfig: function getConfig() { + return _config__WEBPACK_IMPORTED_MODULE_1__.getConfig().c4; + }, + clear: clear, + LINETYPE: LINETYPE, + ARROWTYPE: ARROWTYPE, + PLACEMENT: PLACEMENT, + setTitle: setTitle, + setC4Type: setC4Type // apply, + +}); + +/***/ }), + +/***/ "./src/diagrams/c4/c4Renderer.js": +/*!***************************************!*\ + !*** ./src/diagrams/c4/c4Renderer.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "draw": () => (/* binding */ draw), +/* harmony export */ "drawBoundary": () => (/* binding */ drawBoundary), +/* harmony export */ "drawC4ShapeArray": () => (/* binding */ drawC4ShapeArray), +/* harmony export */ "drawRels": () => (/* binding */ drawRels), +/* harmony export */ "setConf": () => (/* binding */ setConf) +/* harmony export */ }); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _svgDraw__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./svgDraw */ "./src/diagrams/c4/svgDraw.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); +/* harmony import */ var _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parser/c4Diagram */ "./src/diagrams/c4/parser/c4Diagram.jison"); +/* harmony import */ var _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); +/* harmony import */ var _c4Db__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./c4Db */ "./src/diagrams/c4/c4Db.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../config */ "./src/config.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); +/* harmony import */ var _accessibility__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../accessibility */ "./src/accessibility.js"); +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + + + + + + + + + + +var globalBoundaryMaxX = 0, + globalBoundaryMaxY = 0; +var c4ShapeInRow = 4; +var c4BoundaryInRow = 2; +_parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy = _c4Db__WEBPACK_IMPORTED_MODULE_2__["default"]; +var conf = {}; + +var Bounds = /*#__PURE__*/function () { + function Bounds() { + _classCallCheck(this, Bounds); + + this.name = ''; + this.data = {}; + this.data.startx = undefined; + this.data.stopx = undefined; + this.data.starty = undefined; + this.data.stopy = undefined; + this.data.widthLimit = undefined; + this.nextData = {}; + this.nextData.startx = undefined; + this.nextData.stopx = undefined; + this.nextData.starty = undefined; + this.nextData.stopy = undefined; + this.nextData.cnt = 0; + setConf(_parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getConfig()); + } + + _createClass(Bounds, [{ + key: "setData", + value: function setData(startx, stopx, starty, stopy) { + this.nextData.startx = this.data.startx = startx; + this.nextData.stopx = this.data.stopx = stopx; + this.nextData.starty = this.data.starty = starty; + this.nextData.stopy = this.data.stopy = stopy; + } + }, { + key: "updateVal", + value: function updateVal(obj, key, val, fun) { + if (typeof obj[key] === 'undefined') { + obj[key] = val; + } else { + obj[key] = fun(val, obj[key]); + } + } + }, { + key: "insert", + value: function insert(c4Shape) { + this.nextData.cnt = this.nextData.cnt + 1; + + var _startx = this.nextData.startx === this.nextData.stopx ? this.nextData.stopx + c4Shape.margin : this.nextData.stopx + c4Shape.margin * 2; + + var _stopx = _startx + c4Shape.width; + + var _starty = this.nextData.starty + c4Shape.margin * 2; + + var _stopy = _starty + c4Shape.height; + + if (_startx >= this.data.widthLimit || _stopx >= this.data.widthLimit || this.nextData.cnt > c4ShapeInRow) { + _startx = this.nextData.startx + c4Shape.margin + conf.nextLinePaddingX; + _starty = this.nextData.stopy + c4Shape.margin * 2; + this.nextData.stopx = _stopx = _startx + c4Shape.width; + this.nextData.starty = this.nextData.stopy; + this.nextData.stopy = _stopy = _starty + c4Shape.height; + this.nextData.cnt = 1; + } + + c4Shape.x = _startx; + c4Shape.y = _starty; + this.updateVal(this.data, 'startx', _startx, Math.min); + this.updateVal(this.data, 'starty', _starty, Math.min); + this.updateVal(this.data, 'stopx', _stopx, Math.max); + this.updateVal(this.data, 'stopy', _stopy, Math.max); + this.updateVal(this.nextData, 'startx', _startx, Math.min); + this.updateVal(this.nextData, 'starty', _starty, Math.min); + this.updateVal(this.nextData, 'stopx', _stopx, Math.max); + this.updateVal(this.nextData, 'stopy', _stopy, Math.max); + } + }, { + key: "init", + value: function init() { + this.name = ''; + this.data = { + startx: undefined, + stopx: undefined, + starty: undefined, + stopy: undefined, + widthLimit: undefined + }; + this.nextData = { + startx: undefined, + stopx: undefined, + starty: undefined, + stopy: undefined, + cnt: 0 + }; + setConf(_parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getConfig()); + } + }, { + key: "bumpLastMargin", + value: function bumpLastMargin(margin) { + this.data.stopx += margin; + this.data.stopy += margin; + } + }]); + + return Bounds; +}(); + +var setConf = function setConf(cnf) { + (0,_utils__WEBPACK_IMPORTED_MODULE_3__.assignWithDepth)(conf, cnf); + + if (cnf.fontFamily) { + conf.personFontFamily = conf.systemFontFamily = conf.messageFontFamily = cnf.fontFamily; + } + + if (cnf.fontSize) { + conf.personFontSize = conf.systemFontSize = conf.messageFontSize = cnf.fontSize; + } + + if (cnf.fontWeight) { + conf.personFontWeight = conf.systemFontWeight = conf.messageFontWeight = cnf.fontWeight; + } +}; + +var c4ShapeFont = function c4ShapeFont(cnf, typeC4Shape) { + return { + fontFamily: cnf[typeC4Shape + 'FontFamily'], + fontSize: cnf[typeC4Shape + 'FontSize'], + fontWeight: cnf[typeC4Shape + 'FontWeight'] + }; +}; + +var boundaryFont = function boundaryFont(cnf) { + return { + fontFamily: cnf.boundaryFontFamily, + fontSize: cnf.boundaryFontSize, + fontWeight: cnf.boundaryFontWeight + }; +}; + +var messageFont = function messageFont(cnf) { + return { + fontFamily: cnf.messageFontFamily, + fontSize: cnf.messageFontSize, + fontWeight: cnf.messageFontWeight + }; +}; +/** + * @param textType + * @param c4Shape + * @param c4ShapeTextWrap + * @param textConf + * @param textLimitWidth + */ + + +function calcC4ShapeTextWH(textType, c4Shape, c4ShapeTextWrap, textConf, textLimitWidth) { + if (!c4Shape[textType].width) { + if (c4ShapeTextWrap) { + c4Shape[textType].text = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.wrapLabel)(c4Shape[textType].text, textLimitWidth, textConf); + c4Shape[textType].textLines = c4Shape[textType].text.split(_common_common__WEBPACK_IMPORTED_MODULE_4__["default"].lineBreakRegex).length; // c4Shape[textType].width = calculateTextWidth(c4Shape[textType].text, textConf); + + c4Shape[textType].width = textLimitWidth; // c4Shape[textType].height = c4Shape[textType].textLines * textConf.fontSize; + + c4Shape[textType].height = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.calculateTextHeight)(c4Shape[textType].text, textConf); + } else { + var lines = c4Shape[textType].text.split(_common_common__WEBPACK_IMPORTED_MODULE_4__["default"].lineBreakRegex); + c4Shape[textType].textLines = lines.length; + var lineHeight = 0; + c4Shape[textType].height = 0; + c4Shape[textType].width = 0; + + for (var i = 0; i < lines.length; i++) { + c4Shape[textType].width = Math.max((0,_utils__WEBPACK_IMPORTED_MODULE_3__.calculateTextWidth)(lines[i], textConf), c4Shape[textType].width); + lineHeight = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.calculateTextHeight)(lines[i], textConf); + c4Shape[textType].height = c4Shape[textType].height + lineHeight; + } // c4Shapes[textType].height = c4Shapes[textType].textLines * textConf.fontSize; + + } + } +} + +var drawBoundary = function drawBoundary(diagram, boundary, bounds) { + boundary.x = bounds.data.startx; + boundary.y = bounds.data.starty; + boundary.width = bounds.data.stopx - bounds.data.startx; + boundary.height = bounds.data.stopy - bounds.data.starty; + boundary.label.y = conf.c4ShapeMargin - 35; + var boundaryTextWrap = boundary.wrap && conf.wrap; + var boundaryLabelConf = boundaryFont(conf); + boundaryLabelConf.fontSize = boundaryLabelConf.fontSize + 2; + boundaryLabelConf.fontWeight = 'bold'; + var textLimitWidth = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.calculateTextWidth)(boundary.label.text, boundaryLabelConf); + calcC4ShapeTextWH('label', boundary, boundaryTextWrap, boundaryLabelConf, textLimitWidth); + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].drawBoundary(diagram, boundary, conf); +}; +var drawC4ShapeArray = function drawC4ShapeArray(currentBounds, diagram, c4ShapeArray, c4ShapeKeys) { + // Upper Y is relative point + var Y = 0; // Draw the c4ShapeArray + + for (var i = 0; i < c4ShapeKeys.length; i++) { + Y = 0; + var c4Shape = c4ShapeArray[c4ShapeKeys[i]]; // calc c4 shape type width and height + + var c4ShapeTypeConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text); + c4ShapeTypeConf.fontSize = c4ShapeTypeConf.fontSize - 2; + c4Shape.typeC4Shape.width = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.calculateTextWidth)('<<' + c4Shape.typeC4Shape.text + '>>', c4ShapeTypeConf); + c4Shape.typeC4Shape.height = c4ShapeTypeConf.fontSize + 2; + c4Shape.typeC4Shape.Y = conf.c4ShapePadding; + Y = c4Shape.typeC4Shape.Y + c4Shape.typeC4Shape.height - 4; // set image width and height c4Shape.x + c4Shape.width / 2 - 24, c4Shape.y + 28 + // let imageWidth = 0, + // imageHeight = 0, + // imageY = 0; + // + + c4Shape.image = { + width: 0, + height: 0, + Y: 0 + }; + + switch (c4Shape.typeC4Shape.text) { + case 'person': + case 'external_person': + c4Shape.image.width = 48; + c4Shape.image.height = 48; + c4Shape.image.Y = Y; + Y = c4Shape.image.Y + c4Shape.image.height; + break; + } + + if (c4Shape.sprite) { + c4Shape.image.width = 48; + c4Shape.image.height = 48; + c4Shape.image.Y = Y; + Y = c4Shape.image.Y + c4Shape.image.height; + } // Y = conf.c4ShapePadding + c4Shape.image.height; + + + var c4ShapeTextWrap = c4Shape.wrap && conf.wrap; + var textLimitWidth = conf.width - conf.c4ShapePadding * 2; + var c4ShapeLabelConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text); + c4ShapeLabelConf.fontSize = c4ShapeLabelConf.fontSize + 2; + c4ShapeLabelConf.fontWeight = 'bold'; + calcC4ShapeTextWH('label', c4Shape, c4ShapeTextWrap, c4ShapeLabelConf, textLimitWidth); + c4Shape['label'].Y = Y + 8; + Y = c4Shape['label'].Y + c4Shape['label'].height; + + if (c4Shape.type && c4Shape.type.text !== '') { + c4Shape.type.text = '[' + c4Shape.type.text + ']'; + + var _c4ShapeTypeConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text); + + calcC4ShapeTextWH('type', c4Shape, c4ShapeTextWrap, _c4ShapeTypeConf, textLimitWidth); + c4Shape['type'].Y = Y + 5; + Y = c4Shape['type'].Y + c4Shape['type'].height; + } else if (c4Shape.techn && c4Shape.techn.text !== '') { + c4Shape.techn.text = '[' + c4Shape.techn.text + ']'; + var c4ShapeTechnConf = c4ShapeFont(conf, c4Shape.techn.text); + calcC4ShapeTextWH('techn', c4Shape, c4ShapeTextWrap, c4ShapeTechnConf, textLimitWidth); + c4Shape['techn'].Y = Y + 5; + Y = c4Shape['techn'].Y + c4Shape['techn'].height; + } + + var rectHeight = Y; + var rectWidth = c4Shape.label.width; + + if (c4Shape.descr && c4Shape.descr.text !== '') { + var c4ShapeDescrConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text); + calcC4ShapeTextWH('descr', c4Shape, c4ShapeTextWrap, c4ShapeDescrConf, textLimitWidth); + c4Shape['descr'].Y = Y + 20; + Y = c4Shape['descr'].Y + c4Shape['descr'].height; + rectWidth = Math.max(c4Shape.label.width, c4Shape.descr.width); + rectHeight = Y - c4Shape['descr'].textLines * 5; + } + + rectWidth = rectWidth + conf.c4ShapePadding; // let rectHeight = + + c4Shape.width = Math.max(c4Shape.width || conf.width, rectWidth, conf.width); + c4Shape.height = Math.max(c4Shape.height || conf.height, rectHeight, conf.height); + c4Shape.margin = c4Shape.margin || conf.c4ShapeMargin; + currentBounds.insert(c4Shape); + var height = _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].drawC4Shape(diagram, c4Shape, conf); + } + + currentBounds.bumpLastMargin(conf.c4ShapeMargin); +}; + +var Point = /*#__PURE__*/_createClass(function Point(x, y) { + _classCallCheck(this, Point); + + this.x = x; + this.y = y; +}); +/* * * + * Get the intersection of the line between the center point of a rectangle and a point outside the rectangle. + * Algorithm idea. + * Using a point outside the rectangle as the coordinate origin, the graph is divided into four quadrants, and each quadrant is divided into two cases, with separate treatment on the coordinate axes + * 1. The case of coordinate axes. + * 1. The case of the negative x-axis + * 2. The case of the positive x-axis + * 3. The case of the positive y-axis + * 4. The negative y-axis case + * 2. Quadrant cases. + * 2.1. first quadrant: the case where the line intersects the left side of the rectangle; the case where it intersects the lower side of the rectangle + * 2.2. second quadrant: the case where the line intersects the right side of the rectangle; the case where it intersects the lower edge of the rectangle + * 2.3. third quadrant: the case where the line intersects the right side of the rectangle; the case where it intersects the upper edge of the rectangle + * 2.4. fourth quadrant: the case where the line intersects the left side of the rectangle; the case where it intersects the upper side of the rectangle + * + */ + + +var getIntersectPoint = function getIntersectPoint(fromNode, endPoint) { + var x1 = fromNode.x; + var y1 = fromNode.y; + var x2 = endPoint.x; + var y2 = endPoint.y; + var fromCenterX = x1 + fromNode.width / 2; + var fromCenterY = y1 + fromNode.height / 2; + var dx = Math.abs(x1 - x2); + var dy = Math.abs(y1 - y2); + var tanDYX = dy / dx; + var fromDYX = fromNode.height / fromNode.width; + var returnPoint = null; + + if (y1 == y2 && x1 < x2) { + returnPoint = new Point(x1 + fromNode.width, fromCenterY); + } else if (y1 == y2 && x1 > x2) { + returnPoint = new Point(x1, fromCenterY); + } else if (x1 == x2 && y1 < y2) { + returnPoint = new Point(fromCenterX, y1 + fromNode.height); + } else if (x1 == x2 && y1 > y2) { + returnPoint = new Point(fromCenterX, y1); + } + + if (x1 > x2 && y1 < y2) { + if (fromDYX >= tanDYX) { + returnPoint = new Point(x1, fromCenterY + tanDYX * fromNode.width / 2); + } else { + returnPoint = new Point(fromCenterX - dx / dy * fromNode.height / 2, y1 + fromNode.height); + } + } else if (x1 < x2 && y1 < y2) { + // + if (fromDYX >= tanDYX) { + returnPoint = new Point(x1 + fromNode.width, fromCenterY + tanDYX * fromNode.width / 2); + } else { + returnPoint = new Point(fromCenterX + dx / dy * fromNode.height / 2, y1 + fromNode.height); + } + } else if (x1 < x2 && y1 > y2) { + if (fromDYX >= tanDYX) { + returnPoint = new Point(x1 + fromNode.width, fromCenterY - tanDYX * fromNode.width / 2); + } else { + returnPoint = new Point(fromCenterX + fromNode.height / 2 * dx / dy, y1); + } + } else if (x1 > x2 && y1 > y2) { + if (fromDYX >= tanDYX) { + returnPoint = new Point(x1, fromCenterY - fromNode.width / 2 * tanDYX); + } else { + returnPoint = new Point(fromCenterX - fromNode.height / 2 * dx / dy, y1); + } + } + + return returnPoint; +}; + +var getIntersectPoints = function getIntersectPoints(fromNode, endNode) { + var endIntersectPoint = { + x: 0, + y: 0 + }; + endIntersectPoint.x = endNode.x + endNode.width / 2; + endIntersectPoint.y = endNode.y + endNode.height / 2; + var startPoint = getIntersectPoint(fromNode, endIntersectPoint); + endIntersectPoint.x = fromNode.x + fromNode.width / 2; + endIntersectPoint.y = fromNode.y + fromNode.height / 2; + var endPoint = getIntersectPoint(endNode, endIntersectPoint); + return { + startPoint: startPoint, + endPoint: endPoint + }; +}; + +var drawRels = function drawRels(diagram, rels, getC4ShapeObj) { + var i = 0; + + var _iterator = _createForOfIteratorHelper(rels), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var rel = _step.value; + i = i + 1; + var relTextWrap = rel.wrap && conf.wrap; + var relConf = messageFont(conf); + var diagramType = _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getC4Type(); + if (diagramType === 'C4Dynamic') rel.label.text = i + ': ' + rel.label.text; + var textLimitWidth = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.calculateTextWidth)(rel.label.text, relConf); + calcC4ShapeTextWH('label', rel, relTextWrap, relConf, textLimitWidth); + + if (rel.techn && rel.techn.text !== '') { + textLimitWidth = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.calculateTextWidth)(rel.techn.text, relConf); + calcC4ShapeTextWH('techn', rel, relTextWrap, relConf, textLimitWidth); + } + + if (rel.descr && rel.descr.text !== '') { + textLimitWidth = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.calculateTextWidth)(rel.descr.text, relConf); + calcC4ShapeTextWH('descr', rel, relTextWrap, relConf, textLimitWidth); + } + + var fromNode = getC4ShapeObj(rel.from); + var endNode = getC4ShapeObj(rel.to); + var points = getIntersectPoints(fromNode, endNode); + rel.startPoint = points.startPoint; + rel.endPoint = points.endPoint; + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].drawRels(diagram, rels, conf); +}; +/** + * @param diagram + * @param parentBoundaryAlias + * @param parentBounds + * @param currentBoundarys + */ + +function drawInsideBoundary(diagram, parentBoundaryAlias, parentBounds, currentBoundarys) { + var currentBounds = new Bounds(); // Calculate the width limit of the boundar. label/type 的长度, + + currentBounds.data.widthLimit = parentBounds.data.widthLimit / Math.min(c4BoundaryInRow, currentBoundarys.length); // Math.min( + // conf.width * conf.c4ShapeInRow + conf.c4ShapeMargin * conf.c4ShapeInRow * 2, + // parentBounds.data.widthLimit / Math.min(conf.c4BoundaryInRow, currentBoundarys.length) + // ); + + for (var i = 0; i < currentBoundarys.length; i++) { + var currentBoundary = currentBoundarys[i]; + var Y = 0; + currentBoundary.image = { + width: 0, + height: 0, + Y: 0 + }; + + if (currentBoundary.sprite) { + currentBoundary.image.width = 48; + currentBoundary.image.height = 48; + currentBoundary.image.Y = Y; + Y = currentBoundary.image.Y + currentBoundary.image.height; + } + + var currentBoundaryTextWrap = currentBoundary.wrap && conf.wrap; + var currentBoundaryLabelConf = boundaryFont(conf); + currentBoundaryLabelConf.fontSize = currentBoundaryLabelConf.fontSize + 2; + currentBoundaryLabelConf.fontWeight = 'bold'; + calcC4ShapeTextWH('label', currentBoundary, currentBoundaryTextWrap, currentBoundaryLabelConf, currentBounds.data.widthLimit); + currentBoundary['label'].Y = Y + 8; + Y = currentBoundary['label'].Y + currentBoundary['label'].height; + + if (currentBoundary.type && currentBoundary.type.text !== '') { + currentBoundary.type.text = '[' + currentBoundary.type.text + ']'; + var currentBoundaryTypeConf = boundaryFont(conf); + calcC4ShapeTextWH('type', currentBoundary, currentBoundaryTextWrap, currentBoundaryTypeConf, currentBounds.data.widthLimit); + currentBoundary['type'].Y = Y + 5; + Y = currentBoundary['type'].Y + currentBoundary['type'].height; + } + + if (currentBoundary.descr && currentBoundary.descr.text !== '') { + var currentBoundaryDescrConf = boundaryFont(conf); + currentBoundaryDescrConf.fontSize = currentBoundaryDescrConf.fontSize - 2; + calcC4ShapeTextWH('descr', currentBoundary, currentBoundaryTextWrap, currentBoundaryDescrConf, currentBounds.data.widthLimit); + currentBoundary['descr'].Y = Y + 20; + Y = currentBoundary['descr'].Y + currentBoundary['descr'].height; + } + + if (i == 0 || i % c4BoundaryInRow === 0) { + // Calculate the drawing start point of the currentBoundarys. + var _x = parentBounds.data.startx + conf.diagramMarginX; + + var _y = parentBounds.data.stopy + conf.diagramMarginY + Y; + + currentBounds.setData(_x, _x, _y, _y); + } else { + // Calculate the drawing start point of the currentBoundarys. + var _x2 = currentBounds.data.stopx !== currentBounds.data.startx ? currentBounds.data.stopx + conf.diagramMarginX : currentBounds.data.startx; + + var _y2 = currentBounds.data.starty; + currentBounds.setData(_x2, _x2, _y2, _y2); + } + + currentBounds.name = currentBoundary.alias; + var currentPersonOrSystemArray = _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getC4ShapeArray(currentBoundary.alias); + var currentPersonOrSystemKeys = _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getC4ShapeKeys(currentBoundary.alias); + + if (currentPersonOrSystemKeys.length > 0) { + drawC4ShapeArray(currentBounds, diagram, currentPersonOrSystemArray, currentPersonOrSystemKeys); + } + + parentBoundaryAlias = currentBoundary.alias; + var nextCurrentBoundarys = _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getBoundarys(parentBoundaryAlias); + + if (nextCurrentBoundarys.length > 0) { + // draw boundary inside currentBoundary + // bounds.init(); + // parentBoundaryWidthLimit = bounds.data.stopx - bounds.startx; + drawInsideBoundary(diagram, parentBoundaryAlias, currentBounds, nextCurrentBoundarys); + } // draw boundary + + + if (currentBoundary.alias !== 'global') drawBoundary(diagram, currentBoundary, currentBounds); + parentBounds.data.stopy = Math.max(currentBounds.data.stopy + conf.c4ShapeMargin, parentBounds.data.stopy); + parentBounds.data.stopx = Math.max(currentBounds.data.stopx + conf.c4ShapeMargin, parentBounds.data.stopx); + globalBoundaryMaxX = Math.max(globalBoundaryMaxX, parentBounds.data.stopx); + globalBoundaryMaxY = Math.max(globalBoundaryMaxY, parentBounds.data.stopy); + } +} +/** + * Draws a sequenceDiagram in the tag with id: id based on the graph definition in text. + * + * @param {any} text + * @param {any} id + */ + + +var draw = function draw(text, id) { + conf = _config__WEBPACK_IMPORTED_MODULE_6__.getConfig().c4; + var securityLevel = _config__WEBPACK_IMPORTED_MODULE_6__.getConfig().securityLevel; // Handle root and Document for when rendering in sanbox mode + + var sandboxElement; + + if (securityLevel === 'sandbox') { + sandboxElement = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('#i' + id); + } + + var root = securityLevel === 'sandbox' ? (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(sandboxElement.nodes()[0].contentDocument.body) : (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('body'); + var doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; + var db = _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy; + _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.clear(); + _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.setWrap(conf.wrap); + _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.parse(text + '\n'); + c4ShapeInRow = db.getC4ShapeInRow(); + c4BoundaryInRow = db.getC4BoundaryInRow(); + _logger__WEBPACK_IMPORTED_MODULE_7__.log.debug("C:".concat(JSON.stringify(conf, null, 2))); + var diagram = securityLevel === 'sandbox' ? root.select("[id=\"".concat(id, "\"]")) : (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)("[id=\"".concat(id, "\"]")); + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].insertComputerIcon(diagram); + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].insertDatabaseIcon(diagram); + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].insertClockIcon(diagram); + var screenBounds = new Bounds(); + screenBounds.setData(conf.diagramMarginX, conf.diagramMarginX, conf.diagramMarginY, conf.diagramMarginY); + screenBounds.data.widthLimit = screen.availWidth; + globalBoundaryMaxX = conf.diagramMarginX; + globalBoundaryMaxY = conf.diagramMarginY; + var title = _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getTitle(); + var c4type = _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getC4Type(); + var currentBoundarys = _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getBoundarys(''); // switch (c4type) { + // case 'C4Context': + + drawInsideBoundary(diagram, '', screenBounds, currentBoundarys); // break; + // } + // The arrow head definition is attached to the svg once + + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].insertArrowHead(diagram); + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].insertArrowEnd(diagram); + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].insertArrowCrossHead(diagram); + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].insertArrowFilledHead(diagram); + drawRels(diagram, _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getRels(), _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getC4Shape); + screenBounds.data.stopx = globalBoundaryMaxX; + screenBounds.data.stopy = globalBoundaryMaxY; + var box = screenBounds.data; // Make sure the height of the diagram supports long menus. + + var boxHeight = box.stopy - box.starty; + var height = boxHeight + 2 * conf.diagramMarginY; // Make sure the width of the diagram supports wide menus. + + var boxWidth = box.stopx - box.startx; + var width = boxWidth + 2 * conf.diagramMarginX; + + if (title) { + diagram.append('text').text(title).attr('x', (box.stopx - box.startx) / 2 - 4 * conf.diagramMarginX).attr('y', box.starty + conf.diagramMarginY); + } + + (0,_utils__WEBPACK_IMPORTED_MODULE_3__.configureSvgSize)(diagram, height, width, conf.useMaxWidth); + var extraVertForTitle = title ? 60 : 0; + diagram.attr('viewBox', box.startx - conf.diagramMarginX + ' -' + (conf.diagramMarginY + extraVertForTitle) + ' ' + width + ' ' + (height + extraVertForTitle)); + (0,_accessibility__WEBPACK_IMPORTED_MODULE_8__["default"])(_parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy, diagram, id); + _logger__WEBPACK_IMPORTED_MODULE_7__.log.debug("models:", box); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + drawPersonOrSystemArray: drawC4ShapeArray, + drawBoundary: drawBoundary, + setConf: setConf, + draw: draw +}); + +/***/ }), + +/***/ "./src/diagrams/c4/styles.js": +/*!***********************************!*\ + !*** ./src/diagrams/c4/styles.js ***! + \***********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +var getStyles = function getStyles(options) { + return ".person {\n stroke: ".concat(options.personBorder, ";\n fill: ").concat(options.personBkg, ";\n }\n"); +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getStyles); + +/***/ }), + +/***/ "./src/diagrams/c4/svgDraw.js": +/*!************************************!*\ + !*** ./src/diagrams/c4/svgDraw.js ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "drawC4Shape": () => (/* binding */ drawC4Shape), +/* harmony export */ "drawEmbeddedImage": () => (/* binding */ drawEmbeddedImage), +/* harmony export */ "drawImage": () => (/* binding */ drawImage), +/* harmony export */ "drawLabel": () => (/* binding */ drawLabel), +/* harmony export */ "drawRect": () => (/* binding */ drawRect), +/* harmony export */ "drawRels": () => (/* binding */ drawRels), +/* harmony export */ "drawText": () => (/* binding */ drawText), +/* harmony export */ "getNoteRect": () => (/* binding */ getNoteRect), +/* harmony export */ "getTextObj": () => (/* binding */ getTextObj), +/* harmony export */ "insertArrowCrossHead": () => (/* binding */ insertArrowCrossHead), +/* harmony export */ "insertArrowEnd": () => (/* binding */ insertArrowEnd), +/* harmony export */ "insertArrowFilledHead": () => (/* binding */ insertArrowFilledHead), +/* harmony export */ "insertArrowHead": () => (/* binding */ insertArrowHead), +/* harmony export */ "insertClockIcon": () => (/* binding */ insertClockIcon), +/* harmony export */ "insertComputerIcon": () => (/* binding */ insertComputerIcon), +/* harmony export */ "insertDatabaseIcon": () => (/* binding */ insertDatabaseIcon), +/* harmony export */ "insertDynamicNumber": () => (/* binding */ insertDynamicNumber) +/* harmony export */ }); +/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); +/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @braintree/sanitize-url */ "@braintree/sanitize-url"); +/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__); +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + + + +var drawRect = function drawRect(elem, rectData) { + var rectElem = elem.append('rect'); + rectElem.attr('x', rectData.x); + rectElem.attr('y', rectData.y); + rectElem.attr('fill', rectData.fill); + rectElem.attr('stroke', rectData.stroke); + rectElem.attr('width', rectData.width); + rectElem.attr('height', rectData.height); + rectElem.attr('rx', rectData.rx); + rectElem.attr('ry', rectData.ry); + + if (rectData.attrs !== 'undefined' && rectData.attrs !== null) { + for (var attrKey in rectData.attrs) { + rectElem.attr(attrKey, rectData.attrs[attrKey]); + } + } + + if (rectData.class !== 'undefined') { + rectElem.attr('class', rectData.class); + } + + return rectElem; +}; +var drawImage = function drawImage(elem, width, height, x, y, link) { + var imageElem = elem.append('image'); + imageElem.attr('width', width); + imageElem.attr('height', height); + imageElem.attr('x', x); + imageElem.attr('y', y); + var sanitizedLink = link.startsWith('data:image/png;base64') ? link : (0,_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__.sanitizeUrl)(link); + imageElem.attr('xlink:href', sanitizedLink); +}; +var drawEmbeddedImage = function drawEmbeddedImage(elem, x, y, link) { + var imageElem = elem.append('use'); + imageElem.attr('x', x); + imageElem.attr('y', y); + var sanitizedLink = (0,_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__.sanitizeUrl)(link); + imageElem.attr('xlink:href', '#' + sanitizedLink); +}; +var drawText = function drawText(elem, textData) { + var prevTextHeight = 0, + textHeight = 0; + var lines = textData.text.split(_common_common__WEBPACK_IMPORTED_MODULE_1__["default"].lineBreakRegex); + var textElems = []; + var dy = 0; + + var yfunc = function yfunc() { + return textData.y; + }; + + if (typeof textData.valign !== 'undefined' && typeof textData.textMargin !== 'undefined' && textData.textMargin > 0) { + switch (textData.valign) { + case 'top': + case 'start': + yfunc = function yfunc() { + return Math.round(textData.y + textData.textMargin); + }; + + break; + + case 'middle': + case 'center': + yfunc = function yfunc() { + return Math.round(textData.y + (prevTextHeight + textHeight + textData.textMargin) / 2); + }; + + break; + + case 'bottom': + case 'end': + yfunc = function yfunc() { + return Math.round(textData.y + (prevTextHeight + textHeight + 2 * textData.textMargin) - textData.textMargin); + }; + + break; + } + } + + if (typeof textData.anchor !== 'undefined' && typeof textData.textMargin !== 'undefined' && typeof textData.width !== 'undefined') { + switch (textData.anchor) { + case 'left': + case 'start': + textData.x = Math.round(textData.x + textData.textMargin); + textData.anchor = 'start'; + textData.dominantBaseline = 'text-after-edge'; + textData.alignmentBaseline = 'middle'; + break; + + case 'middle': + case 'center': + textData.x = Math.round(textData.x + textData.width / 2); + textData.anchor = 'middle'; + textData.dominantBaseline = 'middle'; + textData.alignmentBaseline = 'middle'; + break; + + case 'right': + case 'end': + textData.x = Math.round(textData.x + textData.width - textData.textMargin); + textData.anchor = 'end'; + textData.dominantBaseline = 'text-before-edge'; + textData.alignmentBaseline = 'middle'; + break; + } + } + + for (var i = 0; i < lines.length; i++) { + var line = lines[i]; + + if (typeof textData.textMargin !== 'undefined' && textData.textMargin === 0 && typeof textData.fontSize !== 'undefined') { + dy = i * textData.fontSize; + } + + var textElem = elem.append('text'); + textElem.attr('x', textData.x); + textElem.attr('y', yfunc()); + + if (typeof textData.anchor !== 'undefined') { + textElem.attr('text-anchor', textData.anchor).attr('dominant-baseline', textData.dominantBaseline).attr('alignment-baseline', textData.alignmentBaseline); + } + + if (typeof textData.fontFamily !== 'undefined') { + textElem.style('font-family', textData.fontFamily); + } + + if (typeof textData.fontSize !== 'undefined') { + textElem.style('font-size', textData.fontSize); + } + + if (typeof textData.fontWeight !== 'undefined') { + textElem.style('font-weight', textData.fontWeight); + } + + if (typeof textData.fill !== 'undefined') { + textElem.attr('fill', textData.fill); + } + + if (typeof textData.class !== 'undefined') { + textElem.attr('class', textData.class); + } + + if (typeof textData.dy !== 'undefined') { + textElem.attr('dy', textData.dy); + } else if (dy !== 0) { + textElem.attr('dy', dy); + } + + if (textData.tspan) { + var span = textElem.append('tspan'); + span.attr('x', textData.x); + + if (typeof textData.fill !== 'undefined') { + span.attr('fill', textData.fill); + } + + span.text(line); + } else { + textElem.text(line); + } + + if (typeof textData.valign !== 'undefined' && typeof textData.textMargin !== 'undefined' && textData.textMargin > 0) { + textHeight += (textElem._groups || textElem)[0][0].getBBox().height; + prevTextHeight = textHeight; + } + + textElems.push(textElem); + } + + return textElems; +}; +var drawLabel = function drawLabel(elem, txtObject) { + /** + * @param {any} x + * @param {any} y + * @param {any} width + * @param {any} height + * @param {any} cut + * @returns {any} + */ + function genPoints(x, y, width, height, cut) { + return x + ',' + y + ' ' + (x + width) + ',' + y + ' ' + (x + width) + ',' + (y + height - cut) + ' ' + (x + width - cut * 1.2) + ',' + (y + height) + ' ' + x + ',' + (y + height); + } + + var polygon = elem.append('polygon'); + polygon.attr('points', genPoints(txtObject.x, txtObject.y, txtObject.width, txtObject.height, 7)); + polygon.attr('class', 'labelBox'); + txtObject.y = txtObject.y + txtObject.height / 2; + drawText(elem, txtObject); + return polygon; +}; +var drawRels = function drawRels(elem, rels, conf) { + var relsElem = elem.append('g'); + var i = 0; + + var _iterator = _createForOfIteratorHelper(rels), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var rel = _step.value; + var textColor = rel.textColor ? rel.textColor : '#444444'; + var strokeColor = rel.lineColor ? rel.lineColor : '#444444'; + var offsetX = rel.offsetX ? parseInt(rel.offsetX) : 0; + var offsetY = rel.offsetY ? parseInt(rel.offsetY) : 0; + var url = ''; + + if (i === 0) { + var line = relsElem.append('line'); + line.attr('x1', rel.startPoint.x); + line.attr('y1', rel.startPoint.y); + line.attr('x2', rel.endPoint.x); + line.attr('y2', rel.endPoint.y); + line.attr('stroke-width', '1'); + line.attr('stroke', strokeColor); + line.style('fill', 'none'); + if (rel.type !== 'rel_b') line.attr('marker-end', 'url(' + url + '#arrowhead)'); + if (rel.type === 'birel' || rel.type === 'rel_b') line.attr('marker-start', 'url(' + url + '#arrowend)'); + i = -1; + } else { + var _line = relsElem.append('path'); + + _line.attr('fill', 'none').attr('stroke-width', '1').attr('stroke', strokeColor).attr('d', 'Mstartx,starty Qcontrolx,controly stopx,stopy '.replaceAll('startx', rel.startPoint.x).replaceAll('starty', rel.startPoint.y).replaceAll('controlx', rel.startPoint.x + (rel.endPoint.x - rel.startPoint.x) / 2 - (rel.endPoint.x - rel.startPoint.x) / 4).replaceAll('controly', rel.startPoint.y + (rel.endPoint.y - rel.startPoint.y) / 2).replaceAll('stopx', rel.endPoint.x).replaceAll('stopy', rel.endPoint.y)); + + if (rel.type !== 'rel_b') _line.attr('marker-end', 'url(' + url + '#arrowhead)'); + if (rel.type === 'birel' || rel.type === 'rel_b') _line.attr('marker-start', 'url(' + url + '#arrowend)'); + } + + var messageConf = conf.messageFont(); + + _drawTextCandidateFunc(conf)(rel.label.text, relsElem, Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX, Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + offsetY, rel.label.width, rel.label.height, { + fill: textColor + }, messageConf); + + if (rel.techn && rel.techn.text !== '') { + messageConf = conf.messageFont(); + + _drawTextCandidateFunc(conf)('[' + rel.techn.text + ']', relsElem, Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX, Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + conf.messageFontSize + 5 + offsetY, Math.max(rel.label.width, rel.techn.width), rel.techn.height, { + fill: textColor, + 'font-style': 'italic' + }, messageConf); + } + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } +}; +/** + * Draws an boundary in the diagram + * + * @param {any} elem - The diagram we'll draw to. + * @param {any} boundary - The boundary to draw. + * @param {any} conf - DrawText implementation discriminator object + */ + +var drawBoundary = function drawBoundary(elem, boundary, conf) { + var boundaryElem = elem.append('g'); + var fillColor = boundary.bgColor ? boundary.bgColor : 'none'; + var strokeColor = boundary.borderColor ? boundary.borderColor : '#444444'; + var fontColor = boundary.fontColor ? boundary.fontColor : 'black'; + var attrsValue = { + 'stroke-width': 1.0, + 'stroke-dasharray': '7.0,7.0' + }; + if (boundary.nodeType) attrsValue = { + 'stroke-width': 1.0 + }; + var rectData = { + x: boundary.x, + y: boundary.y, + fill: fillColor, + stroke: strokeColor, + width: boundary.width, + height: boundary.height, + rx: 2.5, + ry: 2.5, + attrs: attrsValue + }; + drawRect(boundaryElem, rectData); // draw label + + var boundaryConf = conf.boundaryFont(); + boundaryConf.fontWeight = 'bold'; + boundaryConf.fontSize = boundaryConf.fontSize + 2; + boundaryConf.fontColor = fontColor; + + _drawTextCandidateFunc(conf)(boundary.label.text, boundaryElem, boundary.x, boundary.y + boundary.label.Y, boundary.width, boundary.height, { + fill: '#444444' + }, boundaryConf); // draw type + + + if (boundary.type && boundary.type.text !== '') { + boundaryConf = conf.boundaryFont(); + boundaryConf.fontColor = fontColor; + + _drawTextCandidateFunc(conf)(boundary.type.text, boundaryElem, boundary.x, boundary.y + boundary.type.Y, boundary.width, boundary.height, { + fill: '#444444' + }, boundaryConf); + } // draw descr + + + if (boundary.descr && boundary.descr.text !== '') { + boundaryConf = conf.boundaryFont(); + boundaryConf.fontSize = boundaryConf.fontSize - 2; + boundaryConf.fontColor = fontColor; + + _drawTextCandidateFunc(conf)(boundary.descr.text, boundaryElem, boundary.x, boundary.y + boundary.descr.Y, boundary.width, boundary.height, { + fill: '#444444' + }, boundaryConf); + } +}; + +var drawC4Shape = function drawC4Shape(elem, c4Shape, conf) { + var fillColor = c4Shape.bgColor ? c4Shape.bgColor : conf[c4Shape.typeC4Shape.text + '_bg_color']; + var strokeColor = c4Shape.borderColor ? c4Shape.borderColor : conf[c4Shape.typeC4Shape.text + '_border_color']; + var fontColor = c4Shape.fontColor ? c4Shape.fontColor : '#FFFFFF'; + var personImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31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AOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII='; + break; + + case 'external_person': + personImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII='; + break; + } + + var c4ShapeElem = elem.append('g'); + c4ShapeElem.attr('class', 'person-man'); // + // draw rect of c4Shape + + var rect = getNoteRect(); + + switch (c4Shape.typeC4Shape.text) { + case 'person': + case 'external_person': + case 'system': + case 'external_system': + case 'container': + case 'external_container': + case 'component': + case 'external_component': + rect.x = c4Shape.x; + rect.y = c4Shape.y; + rect.fill = fillColor; + rect.width = c4Shape.width; + rect.height = c4Shape.height; + rect.style = 'stroke:' + strokeColor + ';stroke-width:0.5;'; + rect.rx = 2.5; + rect.ry = 2.5; + drawRect(c4ShapeElem, rect); + break; + + case 'system_db': + case 'external_system_db': + case 'container_db': + case 'external_container_db': + case 'component_db': + case 'external_component_db': + c4ShapeElem.append('path').attr('fill', fillColor).attr('stroke-width', '0.5').attr('stroke', strokeColor).attr('d', 'Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height'.replaceAll('startx', c4Shape.x).replaceAll('starty', c4Shape.y).replaceAll('half', c4Shape.width / 2).replaceAll('height', c4Shape.height)); + c4ShapeElem.append('path').attr('fill', 'none').attr('stroke-width', '0.5').attr('stroke', strokeColor).attr('d', 'Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10'.replaceAll('startx', c4Shape.x).replaceAll('starty', c4Shape.y).replaceAll('half', c4Shape.width / 2)); + break; + + case 'system_queue': + case 'external_system_queue': + case 'container_queue': + case 'external_container_queue': + case 'component_queue': + case 'external_component_queue': + c4ShapeElem.append('path').attr('fill', fillColor).attr('stroke-width', '0.5').attr('stroke', strokeColor).attr('d', 'Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half'.replaceAll('startx', c4Shape.x).replaceAll('starty', c4Shape.y).replaceAll('width', c4Shape.width).replaceAll('half', c4Shape.height / 2)); + c4ShapeElem.append('path').attr('fill', 'none').attr('stroke-width', '0.5').attr('stroke', strokeColor).attr('d', 'Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half'.replaceAll('startx', c4Shape.x + c4Shape.width).replaceAll('starty', c4Shape.y).replaceAll('half', c4Shape.height / 2)); + break; + } // draw type of c4Shape + + + var c4ShapeFontConf = getC4ShapeFont(conf, c4Shape.typeC4Shape.text); + c4ShapeElem.append('text').attr('fill', fontColor).attr('font-family', c4ShapeFontConf.fontFamily).attr('font-size', c4ShapeFontConf.fontSize - 2).attr('font-style', 'italic').attr('lengthAdjust', 'spacing').attr('textLength', c4Shape.typeC4Shape.width).attr('x', c4Shape.x + c4Shape.width / 2 - c4Shape.typeC4Shape.width / 2).attr('y', c4Shape.y + c4Shape.typeC4Shape.Y).text('<<' + c4Shape.typeC4Shape.text + '>>'); // draw image/sprite + + switch (c4Shape.typeC4Shape.text) { + case 'person': + case 'external_person': + drawImage(c4ShapeElem, 48, 48, c4Shape.x + c4Shape.width / 2 - 24, c4Shape.y + c4Shape.image.Y, personImg); + break; + } // draw label + + + var textFontConf = conf[c4Shape.typeC4Shape.text + 'Font'](); + textFontConf.fontWeight = 'bold'; + textFontConf.fontSize = textFontConf.fontSize + 2; + textFontConf.fontColor = fontColor; + + _drawTextCandidateFunc(conf)(c4Shape.label.text, c4ShapeElem, c4Shape.x, c4Shape.y + c4Shape.label.Y, c4Shape.width, c4Shape.height, { + fill: fontColor + }, textFontConf); // draw techn/type + + + textFontConf = conf[c4Shape.typeC4Shape.text + 'Font'](); + textFontConf.fontColor = fontColor; + + if (c4Shape.thchn && c4Shape.thchn.text !== '') { + _drawTextCandidateFunc(conf)(c4Shape.thchn.text, c4ShapeElem, c4Shape.x, c4Shape.y + c4Shape.thchn.Y, c4Shape.width, c4Shape.height, { + fill: fontColor, + 'font-style': 'italic' + }, textFontConf); + } else if (c4Shape.type && c4Shape.type.text !== '') { + _drawTextCandidateFunc(conf)(c4Shape.type.text, c4ShapeElem, c4Shape.x, c4Shape.y + c4Shape.type.Y, c4Shape.width, c4Shape.height, { + fill: fontColor, + 'font-style': 'italic' + }, textFontConf); + } // draw descr + + + if (c4Shape.descr && c4Shape.descr.text !== '') { + textFontConf = conf.personFont(); + textFontConf.fontColor = fontColor; + + _drawTextCandidateFunc(conf)(c4Shape.descr.text, c4ShapeElem, c4Shape.x, c4Shape.y + c4Shape.descr.Y, c4Shape.width, c4Shape.height, { + fill: fontColor + }, textFontConf); + } + + return c4Shape.height; +}; +var insertDatabaseIcon = function insertDatabaseIcon(elem) { + elem.append('defs').append('symbol').attr('id', 'database').attr('fill-rule', 'evenodd').attr('clip-rule', 'evenodd').append('path').attr('transform', 'scale(.5)').attr('d', 'M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z'); +}; +var insertComputerIcon = function insertComputerIcon(elem) { + elem.append('defs').append('symbol').attr('id', 'computer').attr('width', '24').attr('height', '24').append('path').attr('transform', 'scale(.5)').attr('d', 'M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z'); +}; +var insertClockIcon = function insertClockIcon(elem) { + elem.append('defs').append('symbol').attr('id', 'clock').attr('width', '24').attr('height', '24').append('path').attr('transform', 'scale(.5)').attr('d', 'M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z'); +}; +/** + * Setup arrow head and define the marker. The result is appended to the svg. + * + * @param elem + */ + +var insertArrowHead = function insertArrowHead(elem) { + elem.append('defs').append('marker').attr('id', 'arrowhead').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 12).attr('markerHeight', 12).attr('orient', 'auto').append('path').attr('d', 'M 0 0 L 10 5 L 0 10 z'); // this is actual shape for arrowhead +}; +var insertArrowEnd = function insertArrowEnd(elem) { + elem.append('defs').append('marker').attr('id', 'arrowend').attr('refX', 1).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 12).attr('markerHeight', 12).attr('orient', 'auto').append('path').attr('d', 'M 10 0 L 0 5 L 10 10 z'); // this is actual shape for arrowhead +}; +/** + * Setup arrow head and define the marker. The result is appended to the svg. + * + * @param {any} elem + */ + +var insertArrowFilledHead = function insertArrowFilledHead(elem) { + elem.append('defs').append('marker').attr('id', 'filled-head').attr('refX', 18).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z'); +}; +/** + * Setup node number. The result is appended to the svg. + * + * @param {any} elem + */ + +var insertDynamicNumber = function insertDynamicNumber(elem) { + elem.append('defs').append('marker').attr('id', 'sequencenumber').attr('refX', 15).attr('refY', 15).attr('markerWidth', 60).attr('markerHeight', 40).attr('orient', 'auto').append('circle').attr('cx', 15).attr('cy', 15).attr('r', 6); // .style("fill", '#f00'); +}; +/** + * Setup arrow head and define the marker. The result is appended to the svg. + * + * @param {any} elem + */ + +var insertArrowCrossHead = function insertArrowCrossHead(elem) { + var defs = elem.append('defs'); + var marker = defs.append('marker').attr('id', 'crosshead').attr('markerWidth', 15).attr('markerHeight', 8).attr('orient', 'auto').attr('refX', 16).attr('refY', 4); // The arrow + + marker.append('path').attr('fill', 'black').attr('stroke', '#000000').style('stroke-dasharray', '0, 0').attr('stroke-width', '1px').attr('d', 'M 9,2 V 6 L16,4 Z'); // The cross + + marker.append('path').attr('fill', 'none').attr('stroke', '#000000').style('stroke-dasharray', '0, 0').attr('stroke-width', '1px').attr('d', 'M 0,1 L 6,7 M 6,1 L 0,7'); // this is actual shape for arrowhead +}; +var getTextObj = function getTextObj() { + return { + x: 0, + y: 0, + fill: undefined, + anchor: undefined, + style: '#666', + width: undefined, + height: undefined, + textMargin: 0, + rx: 0, + ry: 0, + tspan: true, + valign: undefined + }; +}; +var getNoteRect = function getNoteRect() { + return { + x: 0, + y: 0, + fill: '#EDF2AE', + stroke: '#666', + width: 100, + anchor: 'start', + height: 100, + rx: 0, + ry: 0 + }; +}; + +var getC4ShapeFont = function getC4ShapeFont(cnf, typeC4Shape) { + return { + fontFamily: cnf[typeC4Shape + 'FontFamily'], + fontSize: cnf[typeC4Shape + 'FontSize'], + fontWeight: cnf[typeC4Shape + 'FontWeight'] + }; +}; + +var _drawTextCandidateFunc = function () { + /** + * @param {any} content + * @param {any} g + * @param {any} x + * @param {any} y + * @param {any} width + * @param {any} height + * @param {any} textAttrs + */ + function byText(content, g, x, y, width, height, textAttrs) { + var text = g.append('text').attr('x', x + width / 2).attr('y', y + height / 2 + 5).style('text-anchor', 'middle').text(content); + + _setTextAttrs(text, textAttrs); + } + /** + * @param {any} content + * @param {any} g + * @param {any} x + * @param {any} y + * @param {any} width + * @param {any} height + * @param {any} textAttrs + * @param {any} conf + */ + + + function byTspan(content, g, x, y, width, height, textAttrs, conf) { + var fontSize = conf.fontSize, + fontFamily = conf.fontFamily, + fontWeight = conf.fontWeight; + var lines = content.split(_common_common__WEBPACK_IMPORTED_MODULE_1__["default"].lineBreakRegex); + + for (var i = 0; i < lines.length; i++) { + var dy = i * fontSize - fontSize * (lines.length - 1) / 2; + var text = g.append('text').attr('x', x + width / 2).attr('y', y).style('text-anchor', 'middle').attr('dominant-baseline', 'middle').style('font-size', fontSize).style('font-weight', fontWeight).style('font-family', fontFamily); + text.append('tspan') // .attr('x', x + width / 2) + .attr('dy', dy).text(lines[i]) // .attr('y', y + height / 2) + .attr('alignment-baseline', 'mathematical'); + + _setTextAttrs(text, textAttrs); + } + } + /** + * @param {any} content + * @param {any} g + * @param {any} x + * @param {any} y + * @param {any} width + * @param {any} height + * @param {any} textAttrs + * @param {any} conf + */ + + + function byFo(content, g, x, y, width, height, textAttrs, conf) { + var s = g.append('switch'); + var f = s.append('foreignObject').attr('x', x).attr('y', y).attr('width', width).attr('height', height); + var text = f.append('xhtml:div').style('display', 'table').style('height', '100%').style('width', '100%'); + text.append('div').style('display', 'table-cell').style('text-align', 'center').style('vertical-align', 'middle').text(content); + byTspan(content, s, x, y, width, height, textAttrs, conf); + + _setTextAttrs(text, textAttrs); + } + /** + * @param {any} toText + * @param {any} fromTextAttrsDict + */ + + + function _setTextAttrs(toText, fromTextAttrsDict) { + for (var key in fromTextAttrsDict) { + if (fromTextAttrsDict.hasOwnProperty(key)) { + // eslint-disable-line + toText.attr(key, fromTextAttrsDict[key]); + } + } + } + + return function (conf) { + return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan; + }; +}(); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + drawRect: drawRect, + drawText: drawText, + drawLabel: drawLabel, + drawBoundary: drawBoundary, + drawC4Shape: drawC4Shape, + drawRels: drawRels, + drawImage: drawImage, + drawEmbeddedImage: drawEmbeddedImage, + insertArrowHead: insertArrowHead, + insertArrowEnd: insertArrowEnd, + insertArrowFilledHead: insertArrowFilledHead, + insertDynamicNumber: insertDynamicNumber, + insertArrowCrossHead: insertArrowCrossHead, + insertDatabaseIcon: insertDatabaseIcon, + insertComputerIcon: insertComputerIcon, + insertClockIcon: insertClockIcon, + getTextObj: getTextObj, + getNoteRect: getNoteRect, + sanitizeUrl: _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__.sanitizeUrl +}); + +/***/ }), + +/***/ "./src/diagrams/class/classDb.js": +/*!***************************************!*\ + !*** ./src/diagrams/class/classDb.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "addAnnotation": () => (/* binding */ addAnnotation), +/* harmony export */ "addClass": () => (/* binding */ addClass), +/* harmony export */ "addMember": () => (/* binding */ addMember), +/* harmony export */ "addMembers": () => (/* binding */ addMembers), +/* harmony export */ "addRelation": () => (/* binding */ addRelation), +/* harmony export */ "bindFunctions": () => (/* binding */ bindFunctions), +/* harmony export */ "cleanupLabel": () => (/* binding */ cleanupLabel), +/* harmony export */ "clear": () => (/* binding */ clear), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "getClass": () => (/* binding */ getClass), +/* harmony export */ "getClasses": () => (/* binding */ getClasses), +/* harmony export */ "getRelations": () => (/* binding */ getRelations), +/* harmony export */ "lineType": () => (/* binding */ lineType), +/* harmony export */ "lookUpDomId": () => (/* binding */ lookUpDomId), +/* harmony export */ "parseDirective": () => (/* binding */ parseDirective), +/* harmony export */ "relationType": () => (/* binding */ relationType), +/* harmony export */ "setClickEvent": () => (/* binding */ setClickEvent), +/* harmony export */ "setCssClass": () => (/* binding */ setCssClass), +/* harmony export */ "setLink": () => (/* binding */ setLink) +/* harmony export */ }); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../config */ "./src/config.js"); +/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); +/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js"); +/* harmony import */ var _commonDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../commonDb */ "./src/commonDb.js"); +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + + + + + + + +var MERMAID_DOM_ID_PREFIX = 'classid-'; +var relations = []; +var classes = {}; +var classCounter = 0; +var funs = []; + +var sanitizeText = function sanitizeText(txt) { + return _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(txt, _config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); +}; + +var parseDirective = function parseDirective(statement, context, type) { + _mermaidAPI__WEBPACK_IMPORTED_MODULE_3__["default"].parseDirective(this, statement, context, type); +}; + +var splitClassNameAndType = function splitClassNameAndType(id) { + var genericType = ''; + var className = id; + + if (id.indexOf('~') > 0) { + var split = id.split('~'); + className = split[0]; + genericType = _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(split[1], _config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); + } + + return { + className: className, + type: genericType + }; +}; +/** + * Function called by parser when a node definition has been found. + * + * @param id + * @public + */ + + +var addClass = function addClass(id) { + var classId = splitClassNameAndType(id); // Only add class if not exists + + if (typeof classes[classId.className] !== 'undefined') return; + classes[classId.className] = { + id: classId.className, + type: classId.type, + cssClasses: [], + methods: [], + members: [], + annotations: [], + domId: MERMAID_DOM_ID_PREFIX + classId.className + '-' + classCounter + }; + classCounter++; +}; +/** + * Function to lookup domId from id in the graph definition. + * + * @param id + * @public + */ + +var lookUpDomId = function lookUpDomId(id) { + var classKeys = Object.keys(classes); + + for (var i = 0; i < classKeys.length; i++) { + if (classes[classKeys[i]].id === id) { + return classes[classKeys[i]].domId; + } + } +}; +var clear = function clear() { + relations = []; + classes = {}; + funs = []; + funs.push(setupToolTips); + (0,_commonDb__WEBPACK_IMPORTED_MODULE_4__.clear)(); +}; +var getClass = function getClass(id) { + return classes[id]; +}; +var getClasses = function getClasses() { + return classes; +}; +var getRelations = function getRelations() { + return relations; +}; +var addRelation = function addRelation(relation) { + _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug('Adding relation: ' + JSON.stringify(relation)); + addClass(relation.id1); + addClass(relation.id2); + relation.id1 = splitClassNameAndType(relation.id1).className; + relation.id2 = splitClassNameAndType(relation.id2).className; + relation.relationTitle1 = _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(relation.relationTitle1.trim(), _config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); + relation.relationTitle2 = _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(relation.relationTitle2.trim(), _config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); + relations.push(relation); +}; +/** + * Adds an annotation to the specified class Annotations mark special properties of the given type + * (like 'interface' or 'service') + * + * @param className The class name + * @param annotation The name of the annotation without any brackets + * @public + */ + +var addAnnotation = function addAnnotation(className, annotation) { + var validatedClassName = splitClassNameAndType(className).className; + classes[validatedClassName].annotations.push(annotation); +}; +/** + * Adds a member to the specified class + * + * @param className The class name + * @param member The full name of the member. If the member is enclosed in <> it is + * treated as an annotation If the member is ending with a closing bracket ) it is treated as a + * method Otherwise the member will be treated as a normal property + * @public + */ + +var addMember = function addMember(className, member) { + var validatedClassName = splitClassNameAndType(className).className; + var theClass = classes[validatedClassName]; + + if (typeof member === 'string') { + // Member can contain white spaces, we trim them out + var memberString = member.trim(); + + if (memberString.startsWith('<<') && memberString.endsWith('>>')) { + // Remove leading and trailing brackets + // theClass.annotations.push(memberString.substring(2, memberString.length - 2)); + theClass.annotations.push(sanitizeText(memberString.substring(2, memberString.length - 2))); + } else if (memberString.indexOf(')') > 0) { + theClass.methods.push(sanitizeText(memberString)); + } else if (memberString) { + theClass.members.push(sanitizeText(memberString)); + } + } +}; +var addMembers = function addMembers(className, members) { + if (Array.isArray(members)) { + members.reverse(); + members.forEach(function (member) { + return addMember(className, member); + }); + } +}; +var cleanupLabel = function cleanupLabel(label) { + if (label.substring(0, 1) === ':') { + return _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(label.substr(1).trim(), _config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); + } else { + return sanitizeText(label.trim()); + } +}; +/** + * Called by parser when a special node is found, e.g. a clickable element. + * + * @param ids Comma separated list of ids + * @param className Class to add + */ + +var setCssClass = function setCssClass(ids, className) { + ids.split(',').forEach(function (_id) { + var id = _id; + if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id; + + if (typeof classes[id] !== 'undefined') { + classes[id].cssClasses.push(className); + } + }); +}; +/** + * Called by parser when a tooltip is found, e.g. a clickable element. + * + * @param ids Comma separated list of ids + * @param tooltip Tooltip to add + */ + +var setTooltip = function setTooltip(ids, tooltip) { + var config = _config__WEBPACK_IMPORTED_MODULE_2__.getConfig(); + ids.split(',').forEach(function (id) { + if (typeof tooltip !== 'undefined') { + classes[id].tooltip = _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(tooltip, config); + } + }); +}; +/** + * Called by parser when a link is found. Adds the URL to the vertex data. + * + * @param ids Comma separated list of ids + * @param linkStr URL to create a link for + * @param target Target of the link, _blank by default as originally defined in the svgDraw.js file + */ + + +var setLink = function setLink(ids, linkStr, target) { + var config = _config__WEBPACK_IMPORTED_MODULE_2__.getConfig(); + ids.split(',').forEach(function (_id) { + var id = _id; + if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id; + + if (typeof classes[id] !== 'undefined') { + classes[id].link = _utils__WEBPACK_IMPORTED_MODULE_6__["default"].formatUrl(linkStr, config); + + if (config.securityLevel === 'sandbox') { + classes[id].linkTarget = '_top'; + } else if (typeof target === 'string') { + classes[id].linkTarget = sanitizeText(target); + } else { + classes[id].linkTarget = '_blank'; + } + } + }); + setCssClass(ids, 'clickable'); +}; +/** + * Called by parser when a click definition is found. Registers an event handler. + * + * @param ids Comma separated list of ids + * @param functionName Function to be called on click + * @param functionArgs Function args the function should be called with + */ + +var setClickEvent = function setClickEvent(ids, functionName, functionArgs) { + ids.split(',').forEach(function (id) { + setClickFunc(id, functionName, functionArgs); + classes[id].haveCallback = true; + }); + setCssClass(ids, 'clickable'); +}; + +var setClickFunc = function setClickFunc(domId, functionName, functionArgs) { + var config = _config__WEBPACK_IMPORTED_MODULE_2__.getConfig(); + var id = domId; + var elemId = lookUpDomId(id); + + if (config.securityLevel !== 'loose') { + return; + } + + if (typeof functionName === 'undefined') { + return; + } + + if (typeof classes[id] !== 'undefined') { + var argList = []; + + if (typeof functionArgs === 'string') { + /* Splits functionArgs by ',', ignoring all ',' in double quoted strings */ + argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); + + for (var i = 0; i < argList.length; i++) { + var item = argList[i].trim(); + /* Removes all double quotes at the start and end of an argument */ + + /* This preserves all starting and ending whitespace inside */ + + if (item.charAt(0) === '"' && item.charAt(item.length - 1) === '"') { + item = item.substr(1, item.length - 2); + } + + argList[i] = item; + } + } + /* if no arguments passed into callback, default to passing in id */ + + + if (argList.length === 0) { + argList.push(elemId); + } + + funs.push(function () { + var elem = document.querySelector("[id=\"".concat(elemId, "\"]")); + + if (elem !== null) { + elem.addEventListener('click', function () { + _utils__WEBPACK_IMPORTED_MODULE_6__["default"].runFunc.apply(_utils__WEBPACK_IMPORTED_MODULE_6__["default"], [functionName].concat(_toConsumableArray(argList))); + }, false); + } + }); + } +}; + +var bindFunctions = function bindFunctions(element) { + funs.forEach(function (fun) { + fun(element); + }); +}; +var lineType = { + LINE: 0, + DOTTED_LINE: 1 +}; +var relationType = { + AGGREGATION: 0, + EXTENSION: 1, + COMPOSITION: 2, + DEPENDENCY: 3 +}; + +var setupToolTips = function setupToolTips(element) { + var tooltipElem = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('.mermaidTooltip'); + + if ((tooltipElem._groups || tooltipElem)[0][0] === null) { + tooltipElem = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('body').append('div').attr('class', 'mermaidTooltip').style('opacity', 0); + } + + var svg = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(element).select('svg'); + var nodes = svg.selectAll('g.node'); + nodes.on('mouseover', function () { + var el = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(this); + var title = el.attr('title'); // Dont try to draw a tooltip if no data is provided + + if (title === null) { + return; + } + + var rect = this.getBoundingClientRect(); + tooltipElem.transition().duration(200).style('opacity', '.9'); + tooltipElem.text(el.attr('title')).style('left', window.scrollX + rect.left + (rect.right - rect.left) / 2 + 'px').style('top', window.scrollY + rect.top - 14 + document.body.scrollTop + 'px'); + el.classed('hover', true); + }).on('mouseout', function () { + tooltipElem.transition().duration(500).style('opacity', 0); + var el = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(this); + el.classed('hover', false); + }); +}; + +funs.push(setupToolTips); +var direction = 'TB'; + +var getDirection = function getDirection() { + return direction; +}; + +var setDirection = function setDirection(dir) { + direction = dir; +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + parseDirective: parseDirective, + setAccTitle: _commonDb__WEBPACK_IMPORTED_MODULE_4__.setAccTitle, + getAccTitle: _commonDb__WEBPACK_IMPORTED_MODULE_4__.getAccTitle, + getAccDescription: _commonDb__WEBPACK_IMPORTED_MODULE_4__.getAccDescription, + setAccDescription: _commonDb__WEBPACK_IMPORTED_MODULE_4__.setAccDescription, + getConfig: function getConfig() { + return _config__WEBPACK_IMPORTED_MODULE_2__.getConfig().class; + }, + addClass: addClass, + bindFunctions: bindFunctions, + clear: clear, + getClass: getClass, + getClasses: getClasses, + addAnnotation: addAnnotation, + getRelations: getRelations, + addRelation: addRelation, + getDirection: getDirection, + setDirection: setDirection, + addMember: addMember, + addMembers: addMembers, + cleanupLabel: cleanupLabel, + lineType: lineType, + relationType: relationType, + setClickEvent: setClickEvent, + setCssClass: setCssClass, + setLink: setLink, + setTooltip: setTooltip, + lookUpDomId: lookUpDomId +}); + +/***/ }), + +/***/ "./src/diagrams/class/classRenderer-v2.js": +/*!************************************************!*\ + !*** ./src/diagrams/class/classRenderer-v2.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "addClasses": () => (/* binding */ addClasses), +/* harmony export */ "addRelations": () => (/* binding */ addRelations), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "draw": () => (/* binding */ draw), +/* harmony export */ "setConf": () => (/* binding */ setConf) +/* harmony export */ }); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dagre */ "dagre"); +/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! graphlib */ "graphlib"); +/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); +/* harmony import */ var _classDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./classDb */ "./src/diagrams/class/classDb.js"); +/* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/classDiagram */ "./src/diagrams/class/parser/classDiagram.jison"); +/* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../config */ "./src/config.js"); +/* harmony import */ var _dagre_wrapper_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../dagre-wrapper/index.js */ "./src/dagre-wrapper/index.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); +/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); +/* harmony import */ var _accessibility__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../accessibility */ "./src/accessibility.js"); + + + + + + + + + // import addHtmlLabel from 'dagre-d3/lib/label/add-html-label.js'; + + + + + +_parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.yy = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"]; +var idCache = {}; +var padding = 20; + +var sanitizeText = function sanitizeText(txt) { + return _common_common__WEBPACK_IMPORTED_MODULE_5__["default"].sanitizeText(txt, (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)()); +}; + +var conf = { + dividerMargin: 10, + padding: 5, + textHeight: 10 +}; +/** + * Function that adds the vertices found during parsing to the graph to be rendered. + * + * @param {Object< + * string, + * { cssClasses: string[]; text: string; id: string; type: string; domId: string } + * >} classes + * Object containing the vertices. + * @param {SVGGElement} g The graph that is to be drawn. + */ + +var addClasses = function addClasses(classes, g) { + // const svg = select(`[id="${svgId}"]`); + var keys = Object.keys(classes); + _logger__WEBPACK_IMPORTED_MODULE_7__.log.info('keys:', keys); + _logger__WEBPACK_IMPORTED_MODULE_7__.log.info(classes); // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition + + keys.forEach(function (id) { + var vertex = classes[id]; + /** + * Variable for storing the classes for the vertex + * + * @type {string} + */ + + var cssClassStr = ''; + + if (vertex.cssClasses.length > 0) { + cssClassStr = cssClassStr + ' ' + vertex.cssClasses.join(' '); + } // if (vertex.classes.length > 0) { + // classStr = vertex.classes.join(' '); + // } + + + var styles = { + labelStyle: '' + }; //getStylesFromArray(vertex.styles); + // Use vertex id as text in the box if no text is provided by the graph definition + + var vertexText = vertex.text !== undefined ? vertex.text : vertex.id; // We create a SVG label, either by delegating to addHtmlLabel or manually + // let vertexNode; + // if (evaluate(getConfig().flowchart.htmlLabels)) { + // const node = { + // label: vertexText.replace( + // /fa[lrsb]?:fa-[\w-]+/g, + // s => `` + // ) + // }; + // vertexNode = addHtmlLabel(svg, node).node(); + // vertexNode.parentNode.removeChild(vertexNode); + // } else { + // const svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text'); + // svgLabel.setAttribute('style', styles.labelStyle.replace('color:', 'fill:')); + // const rows = vertexText.split(common.lineBreakRegex); + // for (let j = 0; j < rows.length; j++) { + // const tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); + // tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve'); + // tspan.setAttribute('dy', '1em'); + // tspan.setAttribute('x', '1'); + // tspan.textContent = rows[j]; + // svgLabel.appendChild(tspan); + // } + // vertexNode = svgLabel; + // } + + var radious = 0; + var _shape = ''; // Set the shape based parameters + + switch (vertex.type) { + case 'class': + _shape = 'class_box'; + break; + + default: + _shape = 'class_box'; + } // Add the node + + + g.setNode(vertex.id, { + labelStyle: styles.labelStyle, + shape: _shape, + labelText: sanitizeText(vertexText), + classData: vertex, + rx: radious, + ry: radious, + class: cssClassStr, + style: styles.style, + id: vertex.id, + domId: vertex.domId, + haveCallback: vertex.haveCallback, + link: vertex.link, + width: vertex.type === 'group' ? 500 : undefined, + type: vertex.type, + padding: (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().flowchart.padding + }); + _logger__WEBPACK_IMPORTED_MODULE_7__.log.info('setNode', { + labelStyle: styles.labelStyle, + shape: _shape, + labelText: vertexText, + rx: radious, + ry: radious, + class: cssClassStr, + style: styles.style, + id: vertex.id, + width: vertex.type === 'group' ? 500 : undefined, + type: vertex.type, + padding: (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().flowchart.padding + }); + }); +}; +/** + * Add edges to graph based on parsed graph definition + * + * @param relations + * @param {object} g The graph object + */ + +var addRelations = function addRelations(relations, g) { + var cnt = 0; + var defaultStyle; + var defaultLabelStyle; // if (typeof relations.defaultStyle !== 'undefined') { + // const defaultStyles = getStylesFromArray(relations.defaultStyle); + // defaultStyle = defaultStyles.style; + // defaultLabelStyle = defaultStyles.labelStyle; + // } + + relations.forEach(function (edge) { + cnt++; + var edgeData = {}; //Set relationship style and line type + + edgeData.classes = 'relation'; + edgeData.pattern = edge.relation.lineType == 1 ? 'dashed' : 'solid'; + edgeData.id = 'id' + cnt; // Set link type for rendering + + if (edge.type === 'arrow_open') { + edgeData.arrowhead = 'none'; + } else { + edgeData.arrowhead = 'normal'; + } + + _logger__WEBPACK_IMPORTED_MODULE_7__.log.info(edgeData, edge); //Set edge extra labels + //edgeData.startLabelLeft = edge.relationTitle1; + + edgeData.startLabelRight = edge.relationTitle1 === 'none' ? '' : edge.relationTitle1; + edgeData.endLabelLeft = edge.relationTitle2 === 'none' ? '' : edge.relationTitle2; //edgeData.endLabelRight = edge.relationTitle2; + //Set relation arrow types + + edgeData.arrowTypeStart = getArrowMarker(edge.relation.type1); + edgeData.arrowTypeEnd = getArrowMarker(edge.relation.type2); + var style = ''; + var labelStyle = ''; + + if (typeof edge.style !== 'undefined') { + var styles = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.getStylesFromArray)(edge.style); + style = styles.style; + labelStyle = styles.labelStyle; + } else { + style = 'fill:none'; + + if (typeof defaultStyle !== 'undefined') { + style = defaultStyle; + } + + if (typeof defaultLabelStyle !== 'undefined') { + labelStyle = defaultLabelStyle; + } + } + + edgeData.style = style; + edgeData.labelStyle = labelStyle; + + if (typeof edge.interpolate !== 'undefined') { + edgeData.curve = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.interpolateToCurve)(edge.interpolate, d3__WEBPACK_IMPORTED_MODULE_0__.curveLinear); + } else if (typeof relations.defaultInterpolate !== 'undefined') { + edgeData.curve = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.interpolateToCurve)(relations.defaultInterpolate, d3__WEBPACK_IMPORTED_MODULE_0__.curveLinear); + } else { + edgeData.curve = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.interpolateToCurve)(conf.curve, d3__WEBPACK_IMPORTED_MODULE_0__.curveLinear); + } + + edge.text = edge.title; + + if (typeof edge.text === 'undefined') { + if (typeof edge.style !== 'undefined') { + edgeData.arrowheadStyle = 'fill: #333'; + } + } else { + edgeData.arrowheadStyle = 'fill: #333'; + edgeData.labelpos = 'c'; + + if ((0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().flowchart.htmlLabels) { + // eslint-disable-line + edgeData.labelType = 'html'; + edgeData.label = '' + edge.text + ''; + } else { + edgeData.labelType = 'text'; + edgeData.label = edge.text.replace(_common_common__WEBPACK_IMPORTED_MODULE_5__["default"].lineBreakRegex, '\n'); + + if (typeof edge.style === 'undefined') { + edgeData.style = edgeData.style || 'stroke: #333; stroke-width: 1.5px;fill:none'; + } + + edgeData.labelStyle = edgeData.labelStyle.replace('color:', 'fill:'); + } + } // Add the edge to the graph + + + g.setEdge(edge.id1, edge.id2, edgeData, cnt); + }); +}; +/** + * Gets the ID with the same label as in the cache + * + * @param {string} label The label to look for + * @returns {string} The resulting ID + */ + +var getGraphId = function getGraphId(label) { + var foundEntry = Object.entries(idCache).find(function (entry) { + return entry[1].label === label; + }); + + if (foundEntry) { + return foundEntry[0]; + } +}; +/** + * Merges the value of `conf` with the passed `cnf` + * + * @param {object} cnf Config to merge + */ + + +var setConf = function setConf(cnf) { + var keys = Object.keys(cnf); + keys.forEach(function (key) { + conf[key] = cnf[key]; + }); +}; +/** + * Draws a flowchart in the tag with id: id based on the graph definition in text. + * + * @param {string} text + * @param {string} id + */ + +var draw = function draw(text, id) { + _logger__WEBPACK_IMPORTED_MODULE_7__.log.info('Drawing class - ', id); + _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].clear(); // const parser = classDb.parser; + // parser.yy = classDb; + // Parse the graph definition + // try { + + _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.parse(text); // } catch (err) { + // log.debug('Parsing failed'); + // } + // Fetch the default direction, use TD if none was found + //let dir = 'TD'; + + var conf = (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().flowchart; + var securityLevel = (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().securityLevel; + _logger__WEBPACK_IMPORTED_MODULE_7__.log.info('config:', conf); + var nodeSpacing = conf.nodeSpacing || 50; + var rankSpacing = conf.rankSpacing || 50; // Create the input mermaid.graph + + var g = new (graphlib__WEBPACK_IMPORTED_MODULE_2___default().Graph)({ + multigraph: true, + compound: true + }).setGraph({ + rankdir: _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getDirection(), + nodesep: nodeSpacing, + ranksep: rankSpacing, + marginx: 8, + marginy: 8 + }).setDefaultEdgeLabel(function () { + return {}; + }); // let subG; + // const subGraphs = flowDb.getSubGraphs(); + // log.info('Subgraphs - ', subGraphs); + // for (let i = subGraphs.length - 1; i >= 0; i--) { + // subG = subGraphs[i]; + // log.info('Subgraph - ', subG); + // flowDb.addVertex(subG.id, subG.title, 'group', undefined, subG.classes); + // } + // Fetch the vertices/nodes and edges/links from the parsed graph definition + + var classes = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getClasses(); + var relations = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRelations(); + _logger__WEBPACK_IMPORTED_MODULE_7__.log.info(relations); + addClasses(classes, g, id); + addRelations(relations, g); // Add custom shapes + // flowChartShapes.addToRenderV2(addShape); + // Set up an SVG group so that we can translate the final graph. + + var sandboxElement; + + if (securityLevel === 'sandbox') { + sandboxElement = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('#i' + id); + } + + var root = securityLevel === 'sandbox' ? (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(sandboxElement.nodes()[0].contentDocument.body) : (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('body'); + var svg = root.select("[id=\"".concat(id, "\"]")); + svg.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink'); // Run the renderer. This is what draws the final graph. + + var element = root.select('#' + id + ' g'); + (0,_dagre_wrapper_index_js__WEBPACK_IMPORTED_MODULE_9__.render)(element, g, ['aggregation', 'extension', 'composition', 'dependency'], 'classDiagram', id); + (0,_utils__WEBPACK_IMPORTED_MODULE_8__.setupGraphViewbox)(g, svg, conf.diagramPadding, conf.useMaxWidth); // Add label rects for non html labels + + if (!conf.htmlLabels) { + var doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; + var labels = doc.querySelectorAll('[id="' + id + '"] .edgeLabel .label'); + + for (var k = 0; k < labels.length; k++) { + var label = labels[k]; // Get dimensions of label + + var dim = label.getBBox(); + var rect = doc.createElementNS('http://www.w3.org/2000/svg', 'rect'); + rect.setAttribute('rx', 0); + rect.setAttribute('ry', 0); + rect.setAttribute('width', dim.width); + rect.setAttribute('height', dim.height); // rect.setAttribute('style', 'fill:#e8e8e8;'); + + label.insertBefore(rect, label.firstChild); + } + } + + (0,_accessibility__WEBPACK_IMPORTED_MODULE_10__["default"])(_parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.yy, svg, id); // If node has a link, wrap it in an anchor SVG object. + // const keys = Object.keys(classes); + // keys.forEach(function(key) { + // const vertex = classes[key]; + // if (vertex.link) { + // const node = select('#' + id + ' [id="' + key + '"]'); + // if (node) { + // const link = document.createElementNS('http://www.w3.org/2000/svg', 'a'); + // link.setAttributeNS('http://www.w3.org/2000/svg', 'class', vertex.classes.join(' ')); + // link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link); + // link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener'); + // const linkNode = node.insert(function() { + // return link; + // }, ':first-child'); + // const shape = node.select('.label-container'); + // if (shape) { + // linkNode.append(function() { + // return shape.node(); + // }); + // } + // const label = node.select('.label'); + // if (label) { + // linkNode.append(function() { + // return label.node(); + // }); + // } + // } + // } + // }); +}; +/** + * Gets the arrow marker for a type index + * + * @param {number} type The type to look for + * @returns {'aggregation' | 'extension' | 'composition' | 'dependency'} The arrow marker + */ + +function getArrowMarker(type) { + var marker; + + switch (type) { + case 0: + marker = 'aggregation'; + break; + + case 1: + marker = 'extension'; + break; + + case 2: + marker = 'composition'; + break; + + case 3: + marker = 'dependency'; + break; + + default: + marker = 'none'; + } + + return marker; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + setConf: setConf, + draw: draw +}); + +/***/ }), + +/***/ "./src/diagrams/class/classRenderer.js": +/*!*********************************************!*\ + !*** ./src/diagrams/class/classRenderer.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "draw": () => (/* binding */ draw), +/* harmony export */ "setConf": () => (/* binding */ setConf) +/* harmony export */ }); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dagre */ "dagre"); +/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! graphlib */ "graphlib"); +/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); +/* harmony import */ var _classDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./classDb */ "./src/diagrams/class/classDb.js"); +/* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/classDiagram */ "./src/diagrams/class/parser/classDiagram.jison"); +/* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _svgDraw__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./svgDraw */ "./src/diagrams/class/svgDraw.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../config */ "./src/config.js"); +/* harmony import */ var _accessibility__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../accessibility */ "./src/accessibility.js"); + + + + + + + + + + +_parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.yy = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"]; +var idCache = {}; +var padding = 20; +var conf = { + dividerMargin: 10, + padding: 5, + textHeight: 10 +}; +/** + * Gets the ID with the same label as in the cache + * + * @param {string} label The label to look for + * @returns {string} The resulting ID + */ + +var getGraphId = function getGraphId(label) { + var foundEntry = Object.entries(idCache).find(function (entry) { + return entry[1].label === label; + }); + + if (foundEntry) { + return foundEntry[0]; + } +}; +/** + * Setup arrow head and define the marker. The result is appended to the svg. + * + * @param {SVGSVGElement} elem The SVG element to append to + */ + + +var insertMarkers = function insertMarkers(elem) { + elem.append('defs').append('marker').attr('id', 'extensionStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 1,7 L18,13 V 1 Z'); + elem.append('defs').append('marker').attr('id', 'extensionEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead + + elem.append('defs').append('marker').attr('id', 'compositionStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); + elem.append('defs').append('marker').attr('id', 'compositionEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); + elem.append('defs').append('marker').attr('id', 'aggregationStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); + elem.append('defs').append('marker').attr('id', 'aggregationEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); + elem.append('defs').append('marker').attr('id', 'dependencyStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z'); + elem.append('defs').append('marker').attr('id', 'dependencyEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z'); +}; +/** + * Merges the value of `conf` with the passed `cnf` + * + * @param {object} cnf Config to merge + */ + + +var setConf = function setConf(cnf) { + var keys = Object.keys(cnf); + keys.forEach(function (key) { + conf[key] = cnf[key]; + }); +}; +/** + * Draws a flowchart in the tag with id: id based on the graph definition in text. + * + * @param {string} text + * @param {string} id + */ + +var draw = function draw(text, id) { + idCache = {}; + _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.yy.clear(); + _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.parse(text); + _logger__WEBPACK_IMPORTED_MODULE_5__.log.info('Rendering diagram ' + text); + var securityLevel = (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().securityLevel; // Handle root and Document for when rendering in sanbox mode + + var sandboxElement; + + if (securityLevel === 'sandbox') { + sandboxElement = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('#i' + id); + } + + var root = securityLevel === 'sandbox' ? (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(sandboxElement.nodes()[0].contentDocument.body) : (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('body'); + var doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; // Fetch the default direction, use TD if none was found + + var diagram = root.select("[id='".concat(id, "']")); + diagram.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink'); + insertMarkers(diagram); // Layout graph, Create a new directed graph + + var g = new (graphlib__WEBPACK_IMPORTED_MODULE_2___default().Graph)({ + multigraph: true + }); // Set an object for the graph label + + g.setGraph({ + isMultiGraph: true + }); // Default to assigning a new object as a label for each new edge. + + g.setDefaultEdgeLabel(function () { + return {}; + }); + var classes = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getClasses(); + var keys = Object.keys(classes); + + for (var i = 0; i < keys.length; i++) { + var classDef = classes[keys[i]]; + var node = _svgDraw__WEBPACK_IMPORTED_MODULE_7__["default"].drawClass(diagram, classDef, conf); + idCache[node.id] = node; // Add nodes to the graph. The first argument is the node id. The second is + // metadata about the node. In this case we're going to add labels to each of + // our nodes. + + g.setNode(node.id, node); + _logger__WEBPACK_IMPORTED_MODULE_5__.log.info('Org height: ' + node.height); + } + + var relations = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRelations(); + relations.forEach(function (relation) { + _logger__WEBPACK_IMPORTED_MODULE_5__.log.info('tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation)); + g.setEdge(getGraphId(relation.id1), getGraphId(relation.id2), { + relation: relation + }, relation.title || 'DEFAULT'); + }); + dagre__WEBPACK_IMPORTED_MODULE_1___default().layout(g); + g.nodes().forEach(function (v) { + if (typeof v !== 'undefined' && typeof g.node(v) !== 'undefined') { + _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug('Node ' + v + ': ' + JSON.stringify(g.node(v))); + root.select('#' + (0,_classDb__WEBPACK_IMPORTED_MODULE_4__.lookUpDomId)(v)).attr('transform', 'translate(' + (g.node(v).x - g.node(v).width / 2) + ',' + (g.node(v).y - g.node(v).height / 2) + ' )'); + } + }); + g.edges().forEach(function (e) { + if (typeof e !== 'undefined' && typeof g.edge(e) !== 'undefined') { + _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(g.edge(e))); + _svgDraw__WEBPACK_IMPORTED_MODULE_7__["default"].drawEdge(diagram, g.edge(e), g.edge(e).relation, conf); + } + }); + var svgBounds = diagram.node().getBBox(); + var width = svgBounds.width + padding * 2; + var height = svgBounds.height + padding * 2; + (0,_utils__WEBPACK_IMPORTED_MODULE_8__.configureSvgSize)(diagram, height, width, conf.useMaxWidth); // Ensure the viewBox includes the whole svgBounds area with extra space for padding + + var vBox = "".concat(svgBounds.x - padding, " ").concat(svgBounds.y - padding, " ").concat(width, " ").concat(height); + _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug("viewBox ".concat(vBox)); + diagram.attr('viewBox', vBox); + (0,_accessibility__WEBPACK_IMPORTED_MODULE_9__["default"])(_parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.yy, diagram, id); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + setConf: setConf, + draw: draw +}); + +/***/ }), + +/***/ "./src/diagrams/class/styles.js": +/*!**************************************!*\ + !*** ./src/diagrams/class/styles.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +var getStyles = function getStyles(options) { + return "g.classGroup text {\n fill: ".concat(options.nodeBorder, ";\n fill: ").concat(options.classText, ";\n stroke: none;\n font-family: ").concat(options.fontFamily, ";\n font-size: 10px;\n\n .title {\n font-weight: bolder;\n }\n\n}\n\n.nodeLabel, .edgeLabel {\n color: ").concat(options.classText, ";\n}\n.edgeLabel .label rect {\n fill: ").concat(options.mainBkg, ";\n}\n.label text {\n fill: ").concat(options.classText, ";\n}\n.edgeLabel .label span {\n background: ").concat(options.mainBkg, ";\n}\n\n.classTitle {\n font-weight: bolder;\n}\n.node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1px;\n }\n\n\n.divider {\n stroke: ").concat(options.nodeBorder, ";\n stroke: 1;\n}\n\ng.clickable {\n cursor: pointer;\n}\n\ng.classGroup rect {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n}\n\ng.classGroup line {\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1;\n}\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ").concat(options.mainBkg, ";\n opacity: 0.5;\n}\n\n.classLabel .label {\n fill: ").concat(options.nodeBorder, ";\n font-size: 10px;\n}\n\n.relation {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n fill: none;\n}\n\n.dashed-line{\n stroke-dasharray: 3;\n}\n\n#compositionStart, .composition {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#compositionEnd, .composition {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#extensionStart, .extension {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#extensionEnd, .extension {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#aggregationStart, .aggregation {\n fill: ").concat(options.mainBkg, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#aggregationEnd, .aggregation {\n fill: ").concat(options.mainBkg, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n.edgeTerminals {\n font-size: 11px;\n}\n\n"); +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getStyles); + +/***/ }), + +/***/ "./src/diagrams/class/svgDraw.js": +/*!***************************************!*\ + !*** ./src/diagrams/class/svgDraw.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "drawClass": () => (/* binding */ drawClass), +/* harmony export */ "drawEdge": () => (/* binding */ drawEdge), +/* harmony export */ "parseMember": () => (/* binding */ parseMember) +/* harmony export */ }); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _classDb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./classDb */ "./src/diagrams/class/classDb.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); + + + + +var edgeCount = 0; +var drawEdge = function drawEdge(elem, path, relation, conf) { + var getRelationType = function getRelationType(type) { + switch (type) { + case _classDb__WEBPACK_IMPORTED_MODULE_1__.relationType.AGGREGATION: + return 'aggregation'; + + case _classDb__WEBPACK_IMPORTED_MODULE_1__.relationType.EXTENSION: + return 'extension'; + + case _classDb__WEBPACK_IMPORTED_MODULE_1__.relationType.COMPOSITION: + return 'composition'; + + case _classDb__WEBPACK_IMPORTED_MODULE_1__.relationType.DEPENDENCY: + return 'dependency'; + } + }; + + path.points = path.points.filter(function (p) { + return !Number.isNaN(p.y); + }); // The data for our line + + var lineData = path.points; // This is the accessor function we talked about above + + var lineFunction = (0,d3__WEBPACK_IMPORTED_MODULE_0__.line)().x(function (d) { + return d.x; + }).y(function (d) { + return d.y; + }).curve(d3__WEBPACK_IMPORTED_MODULE_0__.curveBasis); + var svgPath = elem.append('path').attr('d', lineFunction(lineData)).attr('id', 'edge' + edgeCount).attr('class', 'relation'); + var url = ''; + + if (conf.arrowMarkerAbsolute) { + url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search; + url = url.replace(/\(/g, '\\('); + url = url.replace(/\)/g, '\\)'); + } + + if (relation.relation.lineType == 1) { + svgPath.attr('class', 'relation dashed-line'); + } + + if (relation.relation.type1 !== 'none') { + svgPath.attr('marker-start', 'url(' + url + '#' + getRelationType(relation.relation.type1) + 'Start' + ')'); + } + + if (relation.relation.type2 !== 'none') { + svgPath.attr('marker-end', 'url(' + url + '#' + getRelationType(relation.relation.type2) + 'End' + ')'); + } + + var x, y; + var l = path.points.length; // Calculate Label position + + var labelPosition = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].calcLabelPosition(path.points); + x = labelPosition.x; + y = labelPosition.y; + var p1_card_x, p1_card_y; + var p2_card_x, p2_card_y; + + if (l % 2 !== 0 && l > 1) { + var cardinality_1_point = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].calcCardinalityPosition(relation.relation.type1 !== 'none', path.points, path.points[0]); + var cardinality_2_point = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].calcCardinalityPosition(relation.relation.type2 !== 'none', path.points, path.points[l - 1]); + _logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('cardinality_1_point ' + JSON.stringify(cardinality_1_point)); + _logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('cardinality_2_point ' + JSON.stringify(cardinality_2_point)); + p1_card_x = cardinality_1_point.x; + p1_card_y = cardinality_1_point.y; + p2_card_x = cardinality_2_point.x; + p2_card_y = cardinality_2_point.y; + } + + if (typeof relation.title !== 'undefined') { + var g = elem.append('g').attr('class', 'classLabel'); + var label = g.append('text').attr('class', 'label').attr('x', x).attr('y', y).attr('fill', 'red').attr('text-anchor', 'middle').text(relation.title); + window.label = label; + var bounds = label.node().getBBox(); + g.insert('rect', ':first-child').attr('class', 'box').attr('x', bounds.x - conf.padding / 2).attr('y', bounds.y - conf.padding / 2).attr('width', bounds.width + conf.padding).attr('height', bounds.height + conf.padding); + } + + _logger__WEBPACK_IMPORTED_MODULE_3__.log.info('Rendering relation ' + JSON.stringify(relation)); + + if (typeof relation.relationTitle1 !== 'undefined' && relation.relationTitle1 !== 'none') { + var _g = elem.append('g').attr('class', 'cardinality'); + + _g.append('text').attr('class', 'type1').attr('x', p1_card_x).attr('y', p1_card_y).attr('fill', 'black').attr('font-size', '6').text(relation.relationTitle1); + } + + if (typeof relation.relationTitle2 !== 'undefined' && relation.relationTitle2 !== 'none') { + var _g2 = elem.append('g').attr('class', 'cardinality'); + + _g2.append('text').attr('class', 'type2').attr('x', p2_card_x).attr('y', p2_card_y).attr('fill', 'black').attr('font-size', '6').text(relation.relationTitle2); + } + + edgeCount++; +}; +/** + * Renders a class diagram + * + * @param {SVGSVGElement} elem The element to draw it into + * @param classDef + * @param conf + * @todo Add more information in the JSDOC here + */ + +var drawClass = function drawClass(elem, classDef, conf) { + _logger__WEBPACK_IMPORTED_MODULE_3__.log.info('Rendering class ' + classDef); + var id = classDef.id; + var classInfo = { + id: id, + label: classDef.id, + width: 0, + height: 0 + }; // add class group + + var g = elem.append('g').attr('id', (0,_classDb__WEBPACK_IMPORTED_MODULE_1__.lookUpDomId)(id)).attr('class', 'classGroup'); // add title + + var title; + + if (classDef.link) { + title = g.append('svg:a').attr('xlink:href', classDef.link).attr('target', classDef.linkTarget).append('text').attr('y', conf.textHeight + conf.padding).attr('x', 0); + } else { + title = g.append('text').attr('y', conf.textHeight + conf.padding).attr('x', 0); + } // add annotations + + + var isFirst = true; + classDef.annotations.forEach(function (member) { + var titleText2 = title.append('tspan').text('«' + member + '»'); + if (!isFirst) titleText2.attr('dy', conf.textHeight); + isFirst = false; + }); + var classTitleString = classDef.id; + + if (classDef.type !== undefined && classDef.type !== '') { + classTitleString += '<' + classDef.type + '>'; + } + + var classTitle = title.append('tspan').text(classTitleString).attr('class', 'title'); // If class has annotations the title needs to have an offset of the text height + + if (!isFirst) classTitle.attr('dy', conf.textHeight); + var titleHeight = title.node().getBBox().height; + var membersLine = g.append('line') // text label for the x axis + .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin / 2).attr('y2', conf.padding + titleHeight + conf.dividerMargin / 2); + var members = g.append('text') // text label for the x axis + .attr('x', conf.padding).attr('y', titleHeight + conf.dividerMargin + conf.textHeight).attr('fill', 'white').attr('class', 'classText'); + isFirst = true; + classDef.members.forEach(function (member) { + addTspan(members, member, isFirst, conf); + isFirst = false; + }); + var membersBox = members.node().getBBox(); + var methodsLine = g.append('line') // text label for the x axis + .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin + membersBox.height).attr('y2', conf.padding + titleHeight + conf.dividerMargin + membersBox.height); + var methods = g.append('text') // text label for the x axis + .attr('x', conf.padding).attr('y', titleHeight + 2 * conf.dividerMargin + membersBox.height + conf.textHeight).attr('fill', 'white').attr('class', 'classText'); + isFirst = true; + classDef.methods.forEach(function (method) { + addTspan(methods, method, isFirst, conf); + isFirst = false; + }); + var classBox = g.node().getBBox(); + var cssClassStr = ' '; + + if (classDef.cssClasses.length > 0) { + cssClassStr = cssClassStr + classDef.cssClasses.join(' '); + } + + var rect = g.insert('rect', ':first-child').attr('x', 0).attr('y', 0).attr('width', classBox.width + 2 * conf.padding).attr('height', classBox.height + conf.padding + 0.5 * conf.dividerMargin).attr('class', cssClassStr); + var rectWidth = rect.node().getBBox().width; // Center title + // We subtract the width of each text element from the class box width and divide it by 2 + + title.node().childNodes.forEach(function (x) { + x.setAttribute('x', (rectWidth - x.getBBox().width) / 2); + }); + + if (classDef.tooltip) { + title.insert('title').text(classDef.tooltip); + } + + membersLine.attr('x2', rectWidth); + methodsLine.attr('x2', rectWidth); + classInfo.width = rectWidth; + classInfo.height = classBox.height + conf.padding + 0.5 * conf.dividerMargin; + return classInfo; +}; +var parseMember = function parseMember(text) { + var fieldRegEx = /^(\+|-|~|#)?(\w+)(~\w+~|\[\])?\s+(\w+) *(\*|\$)?$/; + var methodRegEx = /^([+|\-|~|#])?(\w+) *\( *(.*)\) *(\*|\$)? *(\w*[~|[\]]*\s*\w*~?)$/; + var fieldMatch = text.match(fieldRegEx); + var methodMatch = text.match(methodRegEx); + + if (fieldMatch && !methodMatch) { + return buildFieldDisplay(fieldMatch); + } else if (methodMatch) { + return buildMethodDisplay(methodMatch); + } else { + return buildLegacyDisplay(text); + } +}; + +var buildFieldDisplay = function buildFieldDisplay(parsedText) { + var cssStyle = ''; + var displayText = ''; + + try { + var visibility = parsedText[1] ? parsedText[1].trim() : ''; + var fieldType = parsedText[2] ? parsedText[2].trim() : ''; + var genericType = parsedText[3] ? parseGenericTypes(parsedText[3].trim()) : ''; + var fieldName = parsedText[4] ? parsedText[4].trim() : ''; + var classifier = parsedText[5] ? parsedText[5].trim() : ''; + displayText = visibility + fieldType + genericType + ' ' + fieldName; + cssStyle = parseClassifier(classifier); + } catch (err) { + displayText = parsedText; + } + + return { + displayText: displayText, + cssStyle: cssStyle + }; +}; + +var buildMethodDisplay = function buildMethodDisplay(parsedText) { + var cssStyle = ''; + var displayText = ''; + + try { + var visibility = parsedText[1] ? parsedText[1].trim() : ''; + var methodName = parsedText[2] ? parsedText[2].trim() : ''; + var parameters = parsedText[3] ? parseGenericTypes(parsedText[3].trim()) : ''; + var classifier = parsedText[4] ? parsedText[4].trim() : ''; + var returnType = parsedText[5] ? ' : ' + parseGenericTypes(parsedText[5]).trim() : ''; + displayText = visibility + methodName + '(' + parameters + ')' + returnType; + cssStyle = parseClassifier(classifier); + } catch (err) { + displayText = parsedText; + } + + return { + displayText: displayText, + cssStyle: cssStyle + }; +}; + +var buildLegacyDisplay = function buildLegacyDisplay(text) { + // if for some reason we dont have any match, use old format to parse text + var displayText = ''; + var cssStyle = ''; + var memberText = ''; + var returnType = ''; + var methodStart = text.indexOf('('); + var methodEnd = text.indexOf(')'); + + if (methodStart > 1 && methodEnd > methodStart && methodEnd <= text.length) { + var visibility = ''; + var methodName = ''; + var firstChar = text.substring(0, 1); + + if (firstChar.match(/\w/)) { + methodName = text.substring(0, methodStart).trim(); + } else { + if (firstChar.match(/\+|-|~|#/)) { + visibility = firstChar; + } + + methodName = text.substring(1, methodStart).trim(); + } + + var parameters = text.substring(methodStart + 1, methodEnd); + var classifier = text.substring(methodEnd + 1, 1); + cssStyle = parseClassifier(classifier); + displayText = visibility + methodName + '(' + parseGenericTypes(parameters.trim()) + ')'; + + if (methodEnd < memberText.length) { + returnType = text.substring(methodEnd + 2).trim(); + + if (returnType !== '') { + returnType = ' : ' + parseGenericTypes(returnType); + } + } + } else { + // finally - if all else fails, just send the text back as written (other than parsing for generic types) + displayText = parseGenericTypes(text); + } + + return { + displayText: displayText, + cssStyle: cssStyle + }; +}; +/** + * Adds a for a member in a diagram + * + * @param {SVGElement} textEl The element to append to + * @param {string} txt The member + * @param {boolean} isFirst + * @param {{ padding: string; textHeight: string }} conf The configuration for the member + */ + + +var addTspan = function addTspan(textEl, txt, isFirst, conf) { + var member = parseMember(txt); + var tSpan = textEl.append('tspan').attr('x', conf.padding).text(member.displayText); + + if (member.cssStyle !== '') { + tSpan.attr('style', member.cssStyle); + } + + if (!isFirst) { + tSpan.attr('dy', conf.textHeight); + } +}; +/** + * Makes generics in typescript syntax + * + * @example Array of array of strings in typescript syntax + * // returns "Array>" + * parseGenericTypes('Array~Array~string~~'); + * + * @param {string} text The text to convert + * @returns {string} The converted string + */ + + +var parseGenericTypes = function parseGenericTypes(text) { + var cleanedText = text; + + if (text.indexOf('~') != -1) { + cleanedText = cleanedText.replace('~', '<'); + cleanedText = cleanedText.replace('~', '>'); + return parseGenericTypes(cleanedText); + } else { + return cleanedText; + } +}; +/** + * Gives the styles for a classifier + * + * @param {'+' | '-' | '#' | '~' | '*' | '$'} classifier The classifier string + * @returns {string} Styling for the classifier + */ + + +var parseClassifier = function parseClassifier(classifier) { + switch (classifier) { + case '*': + return 'font-style:italic;'; + + case '$': + return 'text-decoration:underline;'; + + default: + return ''; + } +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + drawClass: drawClass, + drawEdge: drawEdge, + parseMember: parseMember +}); + +/***/ }), + +/***/ "./src/diagrams/common/common.js": +/*!***************************************!*\ + !*** ./src/diagrams/common/common.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "evaluate": () => (/* binding */ evaluate), +/* harmony export */ "getRows": () => (/* binding */ getRows), +/* harmony export */ "hasBreaks": () => (/* binding */ hasBreaks), +/* harmony export */ "lineBreakRegex": () => (/* binding */ lineBreakRegex), +/* harmony export */ "removeEscapes": () => (/* binding */ removeEscapes), +/* harmony export */ "removeScript": () => (/* binding */ removeScript), +/* harmony export */ "sanitizeText": () => (/* binding */ sanitizeText), +/* harmony export */ "sanitizeTextOrArray": () => (/* binding */ sanitizeTextOrArray), +/* harmony export */ "splitBreaks": () => (/* binding */ splitBreaks) +/* harmony export */ }); +/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dompurify */ "dompurify"); +/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dompurify__WEBPACK_IMPORTED_MODULE_0__); + +/** + * Gets the number of lines in a string + * + * @param {string | undefined} s The string to check the lines for + * @returns {number} The number of lines in that string + */ + +var getRows = function getRows(s) { + if (!s) return 1; + var str = breakToPlaceholder(s); + str = str.replace(/\\n/g, '#br#'); + return str.split('#br#'); +}; +var removeEscapes = function removeEscapes(text) { + var newStr = text.replace(/\\u[\dA-F]{4}/gi, function (match) { + return String.fromCharCode(parseInt(match.replace(/\\u/g, ''), 16)); + }); + newStr = newStr.replace(/\\x([0-9a-f]{2})/gi, function (_, c) { + return String.fromCharCode(parseInt(c, 16)); + }); + newStr = newStr.replace(/\\[\d\d\d]{3}/gi, function (match) { + return String.fromCharCode(parseInt(match.replace(/\\/g, ''), 8)); + }); + newStr = newStr.replace(/\\[\d\d\d]{2}/gi, function (match) { + return String.fromCharCode(parseInt(match.replace(/\\/g, ''), 8)); + }); + return newStr; +}; +/** + * Removes script tags from a text + * + * @param {string} txt The text to sanitize + * @returns {string} The safer text + */ + +var removeScript = function removeScript(txt) { + var rs = ''; + var idx = 0; + + while (idx >= 0) { + idx = txt.indexOf('= 0) { + rs += txt.substr(0, idx); + txt = txt.substr(idx + 1); + idx = txt.indexOf(''); + + if (idx >= 0) { + idx += 9; + txt = txt.substr(idx); + } + } else { + rs += txt; + idx = -1; + break; + } + } + + var decodedText = removeEscapes(rs); + decodedText = decodedText.replaceAll(/script>/gi, '#'); + decodedText = decodedText.replaceAll(/javascript:/gi, '#'); + decodedText = decodedText.replaceAll(/javascript&colon/gi, '#'); + decodedText = decodedText.replaceAll(/onerror=/gi, 'onerror:'); + decodedText = decodedText.replaceAll(/"); + } else { + if (cnf.securityLevel !== 'loose') { + svgCode = dompurify__WEBPACK_IMPORTED_MODULE_2___default().sanitize(svgCode, { + ADD_TAGS: ['foreignobject'], + ADD_ATTR: ['dominant-baseline'] + }); + } + } + + if (typeof cb !== 'undefined') { + switch (graphType) { + case 'flowchart': + case 'flowchart-v2': + cb(svgCode, _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_10__["default"].bindFunctions); + break; + + case 'gantt': + cb(svgCode, _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_15__["default"].bindFunctions); + break; + + case 'class': + case 'classDiagram': + cb(svgCode, _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_17__["default"].bindFunctions); + break; + + default: + cb(svgCode); + } + } else { + _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug('CB = undefined!'); + } + + (0,_interactionDb__WEBPACK_IMPORTED_MODULE_49__.attachFunctions)(); + var tmpElementSelector = cnf.securityLevel === 'sandbox' ? '#i' + id : '#d' + id; + var node = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(tmpElementSelector).node(); + + if (node !== null && typeof node.remove === 'function') { + (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(tmpElementSelector).node().remove(); + } + + return svgCode; +}; + +var currentDirective = {}; + +var parseDirective = function parseDirective(p, statement, context, type) { + try { + if (statement !== undefined) { + statement = statement.trim(); + + switch (context) { + case 'open_directive': + currentDirective = {}; + break; + + case 'type_directive': + currentDirective.type = statement.toLowerCase(); + break; + + case 'arg_directive': + currentDirective.args = JSON.parse(statement); + break; + + case 'close_directive': + handleDirective(p, currentDirective, type); + currentDirective = null; + break; + } + } + } catch (error) { + _logger__WEBPACK_IMPORTED_MODULE_5__.log.error("Error while rendering sequenceDiagram directive: ".concat(statement, " jison context: ").concat(context)); + _logger__WEBPACK_IMPORTED_MODULE_5__.log.error(error.message); + } +}; + +var handleDirective = function handleDirective(p, directive, type) { + _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug("Directive type=".concat(directive.type, " with args:"), directive.args); + + switch (directive.type) { + case 'init': + case 'initialize': + { + ['config'].forEach(function (prop) { + if (typeof directive.args[prop] !== 'undefined') { + if (type === 'flowchart-v2') { + type = 'flowchart'; + } + + directive.args[type] = directive.args[prop]; + delete directive.args[prop]; + } + }); + _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug('sanitize in handleDirective', directive.args); + (0,_utils__WEBPACK_IMPORTED_MODULE_4__.directiveSanitizer)(directive.args); + _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug('sanitize in handleDirective (done)', directive.args); + reinitialize(directive.args); + _config__WEBPACK_IMPORTED_MODULE_3__.addDirective(directive.args); + break; + } + + case 'wrap': + case 'nowrap': + if (p && p['setWrap']) { + p.setWrap(directive.type === 'wrap'); + } + + break; + + case 'themeCss': + _logger__WEBPACK_IMPORTED_MODULE_5__.log.warn('themeCss encountered'); + break; + + default: + _logger__WEBPACK_IMPORTED_MODULE_5__.log.warn("Unhandled directive: source: '%%{".concat(directive.type, ": ").concat(JSON.stringify(directive.args ? directive.args : {}), "}%%"), directive); + break; + } +}; +/** @param {any} conf */ + + +function updateRendererConfigs(conf) { + // Todo remove, all diagrams should get config on demand from the config object, no need for this + // gitGraphRenderer.setConf(conf.git); // Todo Remove all of these + _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_31__["default"].setConf(conf.flowchart); + _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_35__["default"].setConf(conf.flowchart); + + if (typeof conf['sequenceDiagram'] !== 'undefined') { + _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_36__["default"].setConf((0,_utils__WEBPACK_IMPORTED_MODULE_4__.assignWithDepth)(conf.sequence, conf['sequenceDiagram'])); + } + + _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_36__["default"].setConf(conf.sequence); + _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_37__["default"].setConf(conf.gantt); + _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_38__["default"].setConf(conf.class); + _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_40__["default"].setConf(conf.state); + _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_41__["default"].setConf(conf.state); + _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_42__["default"].setConf(conf.class); // pieRenderer.setConf(conf.class); + + _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_45__["default"].setConf(conf.er); + _diagrams_user_journey_journeyRenderer__WEBPACK_IMPORTED_MODULE_46__["default"].setConf(conf.journey); + _diagrams_requirement_requirementRenderer__WEBPACK_IMPORTED_MODULE_47__["default"].setConf(conf.requirement); + _errorRenderer__WEBPACK_IMPORTED_MODULE_48__["default"].setConf(conf.class); +} +/** To be removed */ + + +function reinitialize() {// `mermaidAPI.reinitialize: v${pkg.version}`, + // JSON.stringify(options), + // options.themeVariables.primaryColor; + // // if (options.theme && theme[options.theme]) { + // // options.themeVariables = theme[options.theme].getThemeVariables(options.themeVariables); + // // } + // // Set default options + // const config = + // typeof options === 'object' ? configApi.setConfig(options) : configApi.getSiteConfig(); + // updateRendererConfigs(config); + // setLogLevel(config.logLevel); + // log.debug('mermaidAPI.reinitialize: ', config); +} +/** @param {any} options */ + + +function initialize(options) { + // console.warn(`mermaidAPI.initialize: v${pkg.version} `, options); + // Handle legacy location of font-family configuration + if (options && options.fontFamily) { + if (!options.themeVariables) { + options.themeVariables = { + fontFamily: options.fontFamily + }; + } else { + if (!options.themeVariables.fontFamily) { + options.themeVariables = { + fontFamily: options.fontFamily + }; + } + } + } // Set default options + + + _config__WEBPACK_IMPORTED_MODULE_3__.saveConfigFromInitialize(options); + + if (options && options.theme && _themes__WEBPACK_IMPORTED_MODULE_50__["default"][options.theme]) { + // Todo merge with user options + options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_50__["default"][options.theme].getThemeVariables(options.themeVariables); + } else { + if (options) options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_50__["default"]["default"].getThemeVariables(options.themeVariables); + } + + var config = _typeof(options) === 'object' ? _config__WEBPACK_IMPORTED_MODULE_3__.setSiteConfig(options) : _config__WEBPACK_IMPORTED_MODULE_3__.getSiteConfig(); + updateRendererConfigs(config); + (0,_logger__WEBPACK_IMPORTED_MODULE_5__.setLogLevel)(config.logLevel); // log.debug('mermaidAPI.initialize: ', config); +} + +var mermaidAPI = Object.freeze({ + render: render, + parse: parse, + parseDirective: parseDirective, + initialize: initialize, + reinitialize: reinitialize, + getConfig: _config__WEBPACK_IMPORTED_MODULE_3__.getConfig, + setConfig: _config__WEBPACK_IMPORTED_MODULE_3__.setConfig, + getSiteConfig: _config__WEBPACK_IMPORTED_MODULE_3__.getSiteConfig, + updateSiteConfig: _config__WEBPACK_IMPORTED_MODULE_3__.updateSiteConfig, + reset: function reset() { + // console.warn('reset'); + _config__WEBPACK_IMPORTED_MODULE_3__.reset(); // const siteConfig = configApi.getSiteConfig(); + // updateRendererConfigs(siteConfig); + }, + globalReset: function globalReset() { + _config__WEBPACK_IMPORTED_MODULE_3__.reset(_config__WEBPACK_IMPORTED_MODULE_3__.defaultConfig); + updateRendererConfigs(_config__WEBPACK_IMPORTED_MODULE_3__.getConfig()); + }, + defaultConfig: _config__WEBPACK_IMPORTED_MODULE_3__.defaultConfig +}); +(0,_logger__WEBPACK_IMPORTED_MODULE_5__.setLogLevel)(_config__WEBPACK_IMPORTED_MODULE_3__.getConfig().logLevel); +_config__WEBPACK_IMPORTED_MODULE_3__.reset(_config__WEBPACK_IMPORTED_MODULE_3__.getConfig()); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mermaidAPI); +/** + * ## mermaidAPI configuration defaults + * + * ```html + * + * ``` + */ + +/***/ }), + +/***/ "./src/styles.js": +/*!***********************!*\ + !*** ./src/styles.js ***! + \***********************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "calcThemeVariables": () => (/* binding */ calcThemeVariables), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./diagrams/class/styles */ "./src/diagrams/class/styles.js"); +/* harmony import */ var _diagrams_er_styles__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./diagrams/er/styles */ "./src/diagrams/er/styles.js"); +/* harmony import */ var _diagrams_flowchart_styles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diagrams/flowchart/styles */ "./src/diagrams/flowchart/styles.js"); +/* harmony import */ var _diagrams_gantt_styles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./diagrams/gantt/styles */ "./src/diagrams/gantt/styles.js"); +/* harmony import */ var _diagrams_git_styles__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./diagrams/git/styles */ "./src/diagrams/git/styles.js"); +/* harmony import */ var _diagrams_info_styles__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./diagrams/info/styles */ "./src/diagrams/info/styles.js"); +/* harmony import */ var _diagrams_pie_styles__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./diagrams/pie/styles */ "./src/diagrams/pie/styles.js"); +/* harmony import */ var _diagrams_requirement_styles__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./diagrams/requirement/styles */ "./src/diagrams/requirement/styles.js"); +/* harmony import */ var _diagrams_sequence_styles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./diagrams/sequence/styles */ "./src/diagrams/sequence/styles.js"); +/* harmony import */ var _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./diagrams/state/styles */ "./src/diagrams/state/styles.js"); +/* harmony import */ var _diagrams_user_journey_styles__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./diagrams/user-journey/styles */ "./src/diagrams/user-journey/styles.js"); +/* harmony import */ var _diagrams_c4_styles__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./diagrams/c4/styles */ "./src/diagrams/c4/styles.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./logger */ "./src/logger.js"); + + + + + + + + + + + + + +var themes = { + flowchart: _diagrams_flowchart_styles__WEBPACK_IMPORTED_MODULE_0__["default"], + 'flowchart-v2': _diagrams_flowchart_styles__WEBPACK_IMPORTED_MODULE_0__["default"], + sequence: _diagrams_sequence_styles__WEBPACK_IMPORTED_MODULE_1__["default"], + gantt: _diagrams_gantt_styles__WEBPACK_IMPORTED_MODULE_2__["default"], + classDiagram: _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_3__["default"], + 'classDiagram-v2': _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_3__["default"], + class: _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_3__["default"], + stateDiagram: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_4__["default"], + state: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_4__["default"], + gitGraph: _diagrams_git_styles__WEBPACK_IMPORTED_MODULE_5__["default"], + info: _diagrams_info_styles__WEBPACK_IMPORTED_MODULE_6__["default"], + pie: _diagrams_pie_styles__WEBPACK_IMPORTED_MODULE_7__["default"], + er: _diagrams_er_styles__WEBPACK_IMPORTED_MODULE_8__["default"], + journey: _diagrams_user_journey_styles__WEBPACK_IMPORTED_MODULE_9__["default"], + requirement: _diagrams_requirement_styles__WEBPACK_IMPORTED_MODULE_10__["default"], + c4: _diagrams_c4_styles__WEBPACK_IMPORTED_MODULE_11__["default"] +}; +var calcThemeVariables = function calcThemeVariables(theme, userOverRides) { + _logger__WEBPACK_IMPORTED_MODULE_12__.log.info('userOverides', userOverRides); + return theme.calcColors(userOverRides); +}; + +var getStyles = function getStyles(type, userStyles, options) { + return " {\n font-family: ".concat(options.fontFamily, ";\n font-size: ").concat(options.fontSize, ";\n fill: ").concat(options.textColor, "\n }\n\n /* Classes common for multiple diagrams */\n\n .error-icon {\n fill: ").concat(options.errorBkgColor, ";\n }\n .error-text {\n fill: ").concat(options.errorTextColor, ";\n stroke: ").concat(options.errorTextColor, ";\n }\n\n .edge-thickness-normal {\n stroke-width: 2px;\n }\n .edge-thickness-thick {\n stroke-width: 3.5px\n }\n .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n\n .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n .marker {\n fill: ").concat(options.lineColor, ";\n stroke: ").concat(options.lineColor, ";\n }\n .marker.cross {\n stroke: ").concat(options.lineColor, ";\n }\n\n svg {\n font-family: ").concat(options.fontFamily, ";\n font-size: ").concat(options.fontSize, ";\n }\n\n ").concat(themes[type](options), "\n\n ").concat(userStyles, "\n"); +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getStyles); + +/***/ }), + +/***/ "./src/themes/index.js": +/*!*****************************!*\ + !*** ./src/themes/index.js ***! + \*****************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _theme_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./theme-base */ "./src/themes/theme-base.js"); +/* harmony import */ var _theme_dark__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-dark */ "./src/themes/theme-dark.js"); +/* harmony import */ var _theme_default__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./theme-default */ "./src/themes/theme-default.js"); +/* harmony import */ var _theme_forest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./theme-forest */ "./src/themes/theme-forest.js"); +/* harmony import */ var _theme_neutral__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./theme-neutral */ "./src/themes/theme-neutral.js"); + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + base: { + getThemeVariables: _theme_base__WEBPACK_IMPORTED_MODULE_0__.getThemeVariables + }, + dark: { + getThemeVariables: _theme_dark__WEBPACK_IMPORTED_MODULE_1__.getThemeVariables + }, + default: { + getThemeVariables: _theme_default__WEBPACK_IMPORTED_MODULE_2__.getThemeVariables + }, + forest: { + getThemeVariables: _theme_forest__WEBPACK_IMPORTED_MODULE_3__.getThemeVariables + }, + neutral: { + getThemeVariables: _theme_neutral__WEBPACK_IMPORTED_MODULE_4__.getThemeVariables + } +}); + +/***/ }), + +/***/ "./src/themes/theme-base.js": +/*!**********************************!*\ + !*** ./src/themes/theme-base.js ***! + \**********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "getThemeVariables": () => (/* binding */ getThemeVariables) +/* harmony export */ }); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + + + + +var Theme = /*#__PURE__*/function () { + function Theme() { + _classCallCheck(this, Theme); + + /** # Base variables */ + + /** + * - Background - used to know what the background color is of the diagram. This is used for + * deducing colors for instance line color. Default value is #f4f4f4. + */ + this.background = '#f4f4f4'; + this.darkMode = false; + this.primaryColor = '#fff4dd'; + this.noteBkgColor = '#fff5ad'; + this.noteTextColor = '#333'; // dark + + this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; + this.fontSize = '16px'; + } + + _createClass(Theme, [{ + key: "updateColors", + value: function updateColors() { + // The || is to make sure that if the variable has been defined by a user override that value is to be used + + /* Main */ + this.primaryTextColor = this.primaryTextColor || (this.darkMode ? '#eee' : '#333'); // invert(this.primaryColor); + + this.secondaryColor = this.secondaryColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -120 + }); + this.tertiaryColor = this.tertiaryColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 180, + l: 5 + }); + this.primaryBorderColor = this.primaryBorderColor || (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.primaryColor, this.darkMode); + this.secondaryBorderColor = this.secondaryBorderColor || (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.secondaryColor, this.darkMode); + this.tertiaryBorderColor = this.tertiaryBorderColor || (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.tertiaryColor, this.darkMode); + this.noteBorderColor = this.noteBorderColor || (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.noteBkgColor, this.darkMode); + this.noteBkgColor = this.noteBkgColor || '#fff5ad'; + this.noteTextColor = this.noteTextColor || '#333'; + this.secondaryTextColor = this.secondaryTextColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.secondaryColor); + this.tertiaryTextColor = this.tertiaryTextColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.tertiaryColor); + this.lineColor = this.lineColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); + this.textColor = this.textColor || this.primaryTextColor; + /* Flowchart variables */ + + this.nodeBkg = this.nodeBkg || this.primaryColor; + this.mainBkg = this.mainBkg || this.primaryColor; + this.nodeBorder = this.nodeBorder || this.primaryBorderColor; + this.clusterBkg = this.clusterBkg || this.tertiaryColor; + this.clusterBorder = this.clusterBorder || this.tertiaryBorderColor; + this.defaultLinkColor = this.defaultLinkColor || this.lineColor; + this.titleColor = this.titleColor || this.tertiaryTextColor; + this.edgeLabelBackground = this.edgeLabelBackground || (this.darkMode ? (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.secondaryColor, 30) : this.secondaryColor); + this.nodeTextColor = this.nodeTextColor || this.primaryTextColor; + /* Sequence Diagram variables */ + // this.actorBorder = lighten(this.border1, 0.5); + + this.actorBorder = this.actorBorder || this.primaryBorderColor; + this.actorBkg = this.actorBkg || this.mainBkg; + this.actorTextColor = this.actorTextColor || this.primaryTextColor; + this.actorLineColor = this.actorLineColor || 'grey'; + this.labelBoxBkgColor = this.labelBoxBkgColor || this.actorBkg; + this.signalColor = this.signalColor || this.textColor; + this.signalTextColor = this.signalTextColor || this.textColor; + this.labelBoxBorderColor = this.labelBoxBorderColor || this.actorBorder; + this.labelTextColor = this.labelTextColor || this.actorTextColor; + this.loopTextColor = this.loopTextColor || this.actorTextColor; + this.activationBorderColor = this.activationBorderColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.secondaryColor, 10); + this.activationBkgColor = this.activationBkgColor || this.secondaryColor; + this.sequenceNumberColor = this.sequenceNumberColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.lineColor); + /* Gantt chart variables */ + + this.sectionBkgColor = this.sectionBkgColor || this.tertiaryColor; + this.altSectionBkgColor = this.altSectionBkgColor || 'white'; + this.sectionBkgColor = this.sectionBkgColor || this.secondaryColor; + this.sectionBkgColor2 = this.sectionBkgColor2 || this.primaryColor; + this.excludeBkgColor = this.excludeBkgColor || '#eeeeee'; + this.taskBorderColor = this.taskBorderColor || this.primaryBorderColor; + this.taskBkgColor = this.taskBkgColor || this.primaryColor; + this.activeTaskBorderColor = this.activeTaskBorderColor || this.primaryColor; + this.activeTaskBkgColor = this.activeTaskBkgColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.primaryColor, 23); + this.gridColor = this.gridColor || 'lightgrey'; + this.doneTaskBkgColor = this.doneTaskBkgColor || 'lightgrey'; + this.doneTaskBorderColor = this.doneTaskBorderColor || 'grey'; + this.critBorderColor = this.critBorderColor || '#ff8888'; + this.critBkgColor = this.critBkgColor || 'red'; + this.todayLineColor = this.todayLineColor || 'red'; + this.taskTextColor = this.taskTextColor || this.textColor; + this.taskTextOutsideColor = this.taskTextOutsideColor || this.textColor; + this.taskTextLightColor = this.taskTextLightColor || this.textColor; + this.taskTextColor = this.taskTextColor || this.primaryTextColor; + this.taskTextDarkColor = this.taskTextDarkColor || this.textColor; + this.taskTextClickableColor = this.taskTextClickableColor || '#003163'; + /* Sequence Diagram variables */ + + this.personBorder = this.personBorder || this.primaryBorderColor; + this.personBkg = this.personBkg || this.mainBkg; + /* state colors */ + + this.transitionColor = this.transitionColor || this.lineColor; + this.transitionLabelColor = this.transitionLabelColor || this.textColor; + /* The color of the text tables of the states*/ + + this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; + this.stateBkg = this.stateBkg || this.mainBkg; + this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; + this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; + this.altBackground = this.altBackground || this.tertiaryColor; + this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; + this.compositeBorder = this.compositeBorder || this.nodeBorder; + this.innerEndBackground = this.nodeBorder; + this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; + this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; + this.transitionColor = this.transitionColor || this.lineColor; + this.specialStateColor = this.lineColor; + /* class */ + + this.classText = this.classText || this.textColor; + /* user-journey */ + + this.fillType0 = this.fillType0 || this.primaryColor; + this.fillType1 = this.fillType1 || this.secondaryColor; + this.fillType2 = this.fillType2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 64 + }); + this.fillType3 = this.fillType3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + h: 64 + }); + this.fillType4 = this.fillType4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -64 + }); + this.fillType5 = this.fillType5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + h: -64 + }); + this.fillType6 = this.fillType6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 128 + }); + this.fillType7 = this.fillType7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + h: 128 + }); + /* pie */ + + this.pie1 = this.pie1 || this.primaryColor; + this.pie2 = this.pie2 || this.secondaryColor; + this.pie3 = this.pie3 || this.tertiaryColor; + this.pie4 = this.pie4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + l: -10 + }); + this.pie5 = this.pie5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + l: -10 + }); + this.pie6 = this.pie6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.tertiaryColor, { + l: -10 + }); + this.pie7 = this.pie7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: +60, + l: -10 + }); + this.pie8 = this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -60, + l: -10 + }); + this.pie9 = this.pie9 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 120, + l: 0 + }); + this.pie10 = this.pie10 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: +60, + l: -20 + }); + this.pie11 = this.pie11 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -60, + l: -20 + }); + this.pie12 = this.pie12 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 120, + l: -10 + }); + this.pieTitleTextSize = this.pieTitleTextSize || '25px'; + this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; + this.pieSectionTextSize = this.pieSectionTextSize || '17px'; + this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; + this.pieLegendTextSize = this.pieLegendTextSize || '17px'; + this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; + this.pieStrokeColor = this.pieStrokeColor || 'black'; + this.pieStrokeWidth = this.pieStrokeWidth || '2px'; + this.pieOpacity = this.pieOpacity || '0.7'; + /* requirement-diagram */ + + this.requirementBackground = this.requirementBackground || this.primaryColor; + this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; + this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; + this.relationColor = this.relationColor || this.lineColor; + this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.secondaryColor, 30) : this.secondaryColor); + this.relationLabelColor = this.relationLabelColor || this.actorTextColor; + /* git */ + + this.git0 = this.git0 || this.primaryColor; + this.git1 = this.git1 || this.secondaryColor; + this.git2 = this.git2 || this.tertiaryColor; + this.git3 = this.git3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -30 + }); + this.git4 = this.git4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -60 + }); + this.git5 = this.git5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -90 + }); + this.git6 = this.git6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: +60 + }); + this.git7 = this.git7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: +120 + }); + + if (this.darkMode) { + this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git0, 25); + this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git1, 25); + this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git2, 25); + this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git3, 25); + this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git4, 25); + this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git5, 25); + this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git6, 25); + this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git7, 25); + } else { + this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git0, 25); + this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git1, 25); + this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git2, 25); + this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git3, 25); + this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git4, 25); + this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git5, 25); + this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git6, 25); + this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25); + } + + this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0); + this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1); + this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2); + this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3); + this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4); + this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5); + this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6); + this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7); + this.branchLabelColor = this.branchLabelColor || (this.darkMode ? 'black' : this.labelTextColor); + this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor; + this.gitBranchLabel1 = this.gitBranchLabel1 || this.branchLabelColor; + this.gitBranchLabel2 = this.gitBranchLabel2 || this.branchLabelColor; + this.gitBranchLabel3 = this.gitBranchLabel3 || this.branchLabelColor; + this.gitBranchLabel4 = this.gitBranchLabel4 || this.branchLabelColor; + this.gitBranchLabel5 = this.gitBranchLabel5 || this.branchLabelColor; + this.gitBranchLabel6 = this.gitBranchLabel6 || this.branchLabelColor; + this.gitBranchLabel7 = this.gitBranchLabel7 || this.branchLabelColor; + this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; + this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; + this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; + this.tagLabelFontSize = this.tagLabelFontSize || '10px'; + this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; + this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; + this.commitLabelFontSize = this.commitLabelFontSize || '10px'; + } + }, { + key: "calculate", + value: function calculate(overrides) { + var _this = this; + + if (_typeof(overrides) !== 'object') { + // Calculate colors form base colors + this.updateColors(); + return; + } + + var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); // Calculate colors form base colors + + this.updateColors(); // Copy values from overrides again in case of an override of derived value + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); + } + }]); + + return Theme; +}(); + +var getThemeVariables = function getThemeVariables(userOverrides) { + var theme = new Theme(); + theme.calculate(userOverrides); + return theme; +}; + +/***/ }), + +/***/ "./src/themes/theme-dark.js": +/*!**********************************!*\ + !*** ./src/themes/theme-dark.js ***! + \**********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "getThemeVariables": () => (/* binding */ getThemeVariables) +/* harmony export */ }); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + + + + +var Theme = /*#__PURE__*/function () { + function Theme() { + _classCallCheck(this, Theme); + + this.background = '#333'; + this.primaryColor = '#1f2020'; + this.secondaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.primaryColor, 16); + this.tertiaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -160 + }); + this.primaryBorderColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); + this.secondaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.secondaryColor, this.darkMode); + this.tertiaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.tertiaryColor, this.darkMode); + this.primaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.primaryColor); + this.secondaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.secondaryColor); + this.tertiaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.tertiaryColor); + this.lineColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); + this.textColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); + this.mainBkg = '#1f2020'; + this.secondBkg = 'calculated'; + this.mainContrastColor = 'lightgrey'; + this.darkTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)((0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)('#323D47'), 10); + this.lineColor = 'calculated'; + this.border1 = '#81B1DB'; + this.border2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.rgba)(255, 255, 255, 0.25); + this.arrowheadColor = 'calculated'; + this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; + this.fontSize = '16px'; + this.labelBackground = '#181818'; + this.textColor = '#ccc'; + /* Flowchart variables */ + + this.nodeBkg = 'calculated'; + this.nodeBorder = 'calculated'; + this.clusterBkg = 'calculated'; + this.clusterBorder = 'calculated'; + this.defaultLinkColor = 'calculated'; + this.titleColor = '#F9FFFE'; + this.edgeLabelBackground = 'calculated'; + /* Sequence Diagram variables */ + + this.actorBorder = 'calculated'; + this.actorBkg = 'calculated'; + this.actorTextColor = 'calculated'; + this.actorLineColor = 'calculated'; + this.signalColor = 'calculated'; + this.signalTextColor = 'calculated'; + this.labelBoxBkgColor = 'calculated'; + this.labelBoxBorderColor = 'calculated'; + this.labelTextColor = 'calculated'; + this.loopTextColor = 'calculated'; + this.noteBorderColor = 'calculated'; + this.noteBkgColor = '#fff5ad'; + this.noteTextColor = 'calculated'; + this.activationBorderColor = 'calculated'; + this.activationBkgColor = 'calculated'; + this.sequenceNumberColor = 'black'; + /* Gantt chart variables */ + + this.sectionBkgColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)('#EAE8D9', 30); + this.altSectionBkgColor = 'calculated'; + this.sectionBkgColor2 = '#EAE8D9'; + this.taskBorderColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.rgba)(255, 255, 255, 70); + this.taskBkgColor = 'calculated'; + this.taskTextColor = 'calculated'; + this.taskTextLightColor = 'calculated'; + this.taskTextOutsideColor = 'calculated'; + this.taskTextClickableColor = '#003163'; + this.activeTaskBorderColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.rgba)(255, 255, 255, 50); + this.activeTaskBkgColor = '#81B1DB'; + this.gridColor = 'calculated'; + this.doneTaskBkgColor = 'calculated'; + this.doneTaskBorderColor = 'grey'; + this.critBorderColor = '#E83737'; + this.critBkgColor = '#E83737'; + this.taskTextDarkColor = 'calculated'; + this.todayLineColor = '#DB5757'; + /* C4 Context Diagram variables */ + + this.personBorder = 'calculated'; + this.personBkg = 'calculated'; + /* state colors */ + + this.labelColor = 'calculated'; + this.errorBkgColor = '#a44141'; + this.errorTextColor = '#ddd'; + } + + _createClass(Theme, [{ + key: "updateColors", + value: function updateColors() { + this.secondBkg = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.mainBkg, 16); + this.lineColor = this.mainContrastColor; + this.arrowheadColor = this.mainContrastColor; + /* Flowchart variables */ + + this.nodeBkg = this.mainBkg; + this.nodeBorder = this.border1; + this.clusterBkg = this.secondBkg; + this.clusterBorder = this.border2; + this.defaultLinkColor = this.lineColor; + this.edgeLabelBackground = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.labelBackground, 25); + /* Sequence Diagram variables */ + + this.actorBorder = this.border1; + this.actorBkg = this.mainBkg; + this.actorTextColor = this.mainContrastColor; + this.actorLineColor = this.mainContrastColor; + this.signalColor = this.mainContrastColor; + this.signalTextColor = this.mainContrastColor; + this.labelBoxBkgColor = this.actorBkg; + this.labelBoxBorderColor = this.actorBorder; + this.labelTextColor = this.mainContrastColor; + this.loopTextColor = this.mainContrastColor; + this.noteBorderColor = this.secondaryBorderColor; + this.noteBkgColor = this.secondBkg; + this.noteTextColor = this.secondaryTextColor; + this.activationBorderColor = this.border1; + this.activationBkgColor = this.secondBkg; + /* Gantt chart variables */ + + this.altSectionBkgColor = this.background; + this.taskBkgColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.mainBkg, 23); + this.taskTextColor = this.darkTextColor; + this.taskTextLightColor = this.mainContrastColor; + this.taskTextOutsideColor = this.taskTextLightColor; + this.gridColor = this.mainContrastColor; + this.doneTaskBkgColor = this.mainContrastColor; + this.taskTextDarkColor = this.darkTextColor; + /* state colors */ + + this.transitionColor = this.transitionColor || this.lineColor; + this.transitionLabelColor = this.transitionLabelColor || this.textColor; + this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; + this.stateBkg = this.stateBkg || this.mainBkg; + this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; + this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; + this.altBackground = this.altBackground || '#555'; + this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; + this.compositeBorder = this.compositeBorder || this.nodeBorder; + this.innerEndBackground = this.primaryBorderColor; + this.specialStateColor = '#f4f4f4'; // this.lineColor; + + this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; + this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; + this.fillType0 = this.primaryColor; + this.fillType1 = this.secondaryColor; + this.fillType2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 64 + }); + this.fillType3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + h: 64 + }); + this.fillType4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -64 + }); + this.fillType5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + h: -64 + }); + this.fillType6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 128 + }); + this.fillType7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + h: 128 + }); + /* pie */ + + this.pie1 = this.pie1 || '#0b0000'; + this.pie2 = this.pie2 || '#4d1037'; + this.pie3 = this.pie3 || '#3f5258'; + this.pie4 = this.pie4 || '#4f2f1b'; + this.pie5 = this.pie5 || '#6e0a0a'; + this.pie6 = this.pie6 || '#3b0048'; + this.pie7 = this.pie7 || '#995a01'; + this.pie8 = this.pie8 || '#154706'; + this.pie9 = this.pie9 || '#161722'; + this.pie10 = this.pie10 || '#00296f'; + this.pie11 = this.pie11 || '#01629c'; + this.pie12 = this.pie12 || '#010029'; + this.pieTitleTextSize = this.pieTitleTextSize || '25px'; + this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; + this.pieSectionTextSize = this.pieSectionTextSize || '17px'; + this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; + this.pieLegendTextSize = this.pieLegendTextSize || '17px'; + this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; + this.pieStrokeColor = this.pieStrokeColor || 'black'; + this.pieStrokeWidth = this.pieStrokeWidth || '2px'; + this.pieOpacity = this.pieOpacity || '0.7'; + /* class */ + + this.classText = this.primaryTextColor; + /* requirement-diagram */ + + this.requirementBackground = this.requirementBackground || this.primaryColor; + this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; + this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; + this.relationColor = this.relationColor || this.lineColor; + this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.secondaryColor, 30) : this.secondaryColor); + this.relationLabelColor = this.relationLabelColor || this.actorTextColor; + /* git */ + + this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.secondaryColor, 20); + this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie2 || this.secondaryColor, 20); + this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie3 || this.tertiaryColor, 20); + this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -30 + }), 20); + this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -60 + }), 20); + this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -90 + }), 10); + this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: +60 + }), 10); + this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: +120 + }), 20); + this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0); + this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1); + this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2); + this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3); + this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4); + this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5); + this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6); + this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7); + this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; + this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; + this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; + this.tagLabelFontSize = this.tagLabelFontSize || '10px'; + this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; + this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; + this.commitLabelFontSize = this.commitLabelFontSize || '10px'; + } + }, { + key: "calculate", + value: function calculate(overrides) { + var _this = this; + + if (_typeof(overrides) !== 'object') { + // Calculate colors form base colors + this.updateColors(); + return; + } + + var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); // Calculate colors form base colors + + this.updateColors(); // Copy values from overrides again in case of an override of derived value + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); + } + }]); + + return Theme; +}(); + +var getThemeVariables = function getThemeVariables(userOverrides) { + var theme = new Theme(); + theme.calculate(userOverrides); + return theme; +}; + +/***/ }), + +/***/ "./src/themes/theme-default.js": +/*!*************************************!*\ + !*** ./src/themes/theme-default.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "getThemeVariables": () => (/* binding */ getThemeVariables) +/* harmony export */ }); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + + + + +var Theme = /*#__PURE__*/function () { + function Theme() { + _classCallCheck(this, Theme); + + /* Base variables */ + this.background = '#f4f4f4'; + this.primaryColor = '#ECECFF'; + this.secondaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 120 + }); + this.secondaryColor = '#ffffde'; + this.tertiaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -160 + }); + this.primaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.primaryColor, this.darkMode); + this.secondaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.secondaryColor, this.darkMode); + this.tertiaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.tertiaryColor, this.darkMode); // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode); + + this.primaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.primaryColor); + this.secondaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.secondaryColor); + this.tertiaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.tertiaryColor); + this.lineColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); + this.textColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); + this.background = 'white'; + this.mainBkg = '#ECECFF'; + this.secondBkg = '#ffffde'; + this.lineColor = '#333333'; + this.border1 = '#9370DB'; + this.border2 = '#aaaa33'; + this.arrowheadColor = '#333333'; + this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; + this.fontSize = '16px'; + this.labelBackground = '#e8e8e8'; + this.textColor = '#333'; + /* Flowchart variables */ + + this.nodeBkg = 'calculated'; + this.nodeBorder = 'calculated'; + this.clusterBkg = 'calculated'; + this.clusterBorder = 'calculated'; + this.defaultLinkColor = 'calculated'; + this.titleColor = 'calculated'; + this.edgeLabelBackground = 'calculated'; + /* Sequence Diagram variables */ + + this.actorBorder = 'calculated'; + this.actorBkg = 'calculated'; + this.actorTextColor = 'black'; + this.actorLineColor = 'grey'; + this.signalColor = 'calculated'; + this.signalTextColor = 'calculated'; + this.labelBoxBkgColor = 'calculated'; + this.labelBoxBorderColor = 'calculated'; + this.labelTextColor = 'calculated'; + this.loopTextColor = 'calculated'; + this.noteBorderColor = 'calculated'; + this.noteBkgColor = '#fff5ad'; + this.noteTextColor = 'calculated'; + this.activationBorderColor = '#666'; + this.activationBkgColor = '#f4f4f4'; + this.sequenceNumberColor = 'white'; + /* Gantt chart variables */ + + this.sectionBkgColor = 'calculated'; + this.altSectionBkgColor = 'calculated'; + this.sectionBkgColor2 = 'calculated'; + this.excludeBkgColor = '#eeeeee'; + this.taskBorderColor = 'calculated'; + this.taskBkgColor = 'calculated'; + this.taskTextLightColor = 'calculated'; + this.taskTextColor = this.taskTextLightColor; + this.taskTextDarkColor = 'calculated'; + this.taskTextOutsideColor = this.taskTextDarkColor; + this.taskTextClickableColor = 'calculated'; + this.activeTaskBorderColor = 'calculated'; + this.activeTaskBkgColor = 'calculated'; + this.gridColor = 'calculated'; + this.doneTaskBkgColor = 'calculated'; + this.doneTaskBorderColor = 'calculated'; + this.critBorderColor = 'calculated'; + this.critBkgColor = 'calculated'; + this.todayLineColor = 'calculated'; + this.sectionBkgColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.rgba)(102, 102, 255, 0.49); + this.altSectionBkgColor = 'white'; + this.sectionBkgColor2 = '#fff400'; + this.taskBorderColor = '#534fbc'; + this.taskBkgColor = '#8a90dd'; + this.taskTextLightColor = 'white'; + this.taskTextColor = 'calculated'; + this.taskTextDarkColor = 'black'; + this.taskTextOutsideColor = 'calculated'; + this.taskTextClickableColor = '#003163'; + this.activeTaskBorderColor = '#534fbc'; + this.activeTaskBkgColor = '#bfc7ff'; + this.gridColor = 'lightgrey'; + this.doneTaskBkgColor = 'lightgrey'; + this.doneTaskBorderColor = 'grey'; + this.critBorderColor = '#ff8888'; + this.critBkgColor = 'red'; + this.todayLineColor = 'red'; + /* C4 Context Diagram variables */ + + this.personBorder = 'calculated'; + this.personBkg = 'calculated'; + /* state colors */ + + this.labelColor = 'black'; + this.errorBkgColor = '#552222'; + this.errorTextColor = '#552222'; + this.updateColors(); + } + + _createClass(Theme, [{ + key: "updateColors", + value: function updateColors() { + /* Flowchart variables */ + this.nodeBkg = this.mainBkg; + this.nodeBorder = this.border1; // border 1 + + this.clusterBkg = this.secondBkg; + this.clusterBorder = this.border2; + this.defaultLinkColor = this.lineColor; + this.titleColor = this.textColor; + this.edgeLabelBackground = this.labelBackground; + /* Sequence Diagram variables */ + // this.actorBorder = lighten(this.border1, 0.5); + + this.actorBorder = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.border1, 23); + this.actorBkg = this.mainBkg; + this.labelBoxBkgColor = this.actorBkg; + this.signalColor = this.textColor; + this.signalTextColor = this.textColor; + this.labelBoxBorderColor = this.actorBorder; + this.labelTextColor = this.actorTextColor; + this.loopTextColor = this.actorTextColor; + this.noteBorderColor = this.border2; + this.noteTextColor = this.actorTextColor; + /* Gantt chart variables */ + + this.taskTextColor = this.taskTextLightColor; + this.taskTextOutsideColor = this.taskTextDarkColor; + /* state colors */ + + this.transitionColor = this.transitionColor || this.lineColor; + this.transitionLabelColor = this.transitionLabelColor || this.textColor; + this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; + this.stateBkg = this.stateBkg || this.mainBkg; + this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; + this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; + this.altBackground = this.altBackground || '#f0f0f0'; + this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; + this.compositeBorder = this.compositeBorder || this.nodeBorder; + this.innerEndBackground = this.nodeBorder; + this.specialStateColor = this.lineColor; + this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; + this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; + this.transitionColor = this.transitionColor || this.lineColor; + /* class */ + + this.classText = this.primaryTextColor; + /* journey */ + + this.fillType0 = this.primaryColor; + this.fillType1 = this.secondaryColor; + this.fillType2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 64 + }); + this.fillType3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + h: 64 + }); + this.fillType4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -64 + }); + this.fillType5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + h: -64 + }); + this.fillType6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 128 + }); + this.fillType7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + h: 128 + }); + /* pie */ + + this.pie1 = this.pie1 || this.primaryColor; + this.pie2 = this.pie2 || this.secondaryColor; + this.pie3 = this.pie3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.tertiaryColor, { + l: -40 + }); + this.pie4 = this.pie4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + l: -10 + }); + this.pie5 = this.pie5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + l: -30 + }); + this.pie6 = this.pie6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.tertiaryColor, { + l: -20 + }); + this.pie7 = this.pie7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: +60, + l: -20 + }); + this.pie8 = this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -60, + l: -40 + }); + this.pie9 = this.pie9 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 120, + l: -40 + }); + this.pie10 = this.pie10 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: +60, + l: -40 + }); + this.pie11 = this.pie11 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -90, + l: -40 + }); + this.pie12 = this.pie12 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 120, + l: -30 + }); + this.pieTitleTextSize = this.pieTitleTextSize || '25px'; + this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; + this.pieSectionTextSize = this.pieSectionTextSize || '17px'; + this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; + this.pieLegendTextSize = this.pieLegendTextSize || '17px'; + this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; + this.pieStrokeColor = this.pieStrokeColor || 'black'; + this.pieStrokeWidth = this.pieStrokeWidth || '2px'; + this.pieOpacity = this.pieOpacity || '0.7'; + /* requirement-diagram */ + + this.requirementBackground = this.requirementBackground || this.primaryColor; + this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; + this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; + this.relationColor = this.relationColor || this.lineColor; + this.relationLabelBackground = this.relationLabelBackground || this.labelBackground; + this.relationLabelColor = this.relationLabelColor || this.actorTextColor; + /* git */ + + this.git0 = this.git0 || this.primaryColor; + this.git1 = this.git1 || this.secondaryColor; + this.git2 = this.git2 || this.tertiaryColor; + this.git3 = this.git3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -30 + }); + this.git4 = this.git4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -60 + }); + this.git5 = this.git5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -90 + }); + this.git6 = this.git6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: +60 + }); + this.git7 = this.git7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: +120 + }); + + if (this.darkMode) { + this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git0, 25); + this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git1, 25); + this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git2, 25); + this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git3, 25); + this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git4, 25); + this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git5, 25); + this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git6, 25); + this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git7, 25); + } else { + this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git0, 25); + this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git1, 25); + this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git2, 25); + this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git3, 25); + this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git4, 25); + this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git5, 25); + this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git6, 25); + this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25); + } + + this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)((0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0), 25); + this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1); + this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2); + this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3); + this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4); + this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5); + this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6); + this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7); + this.gitBranchLabel0 = this.gitBranchLabel0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.labelTextColor); + this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor; + this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor; + this.gitBranchLabel3 = this.gitBranchLabel3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.labelTextColor); + this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor; + this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor; + this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor; + this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor; + this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; + this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; + this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; + this.tagLabelFontSize = this.tagLabelFontSize || '10px'; + this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; + this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; + this.commitLabelFontSize = this.commitLabelFontSize || '10px'; + } + }, { + key: "calculate", + value: function calculate(overrides) { + var _this = this; + + if (_typeof(overrides) !== 'object') { + // Calculate colors form base colors + this.updateColors(); + return; + } + + var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); // Calculate colors form base colors + + this.updateColors(); // Copy values from overrides again in case of an override of derived value + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); + } + }]); + + return Theme; +}(); + +var getThemeVariables = function getThemeVariables(userOverrides) { + var theme = new Theme(); + theme.calculate(userOverrides); + return theme; +}; + +/***/ }), + +/***/ "./src/themes/theme-forest.js": +/*!************************************!*\ + !*** ./src/themes/theme-forest.js ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "getThemeVariables": () => (/* binding */ getThemeVariables) +/* harmony export */ }); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + + + + +var Theme = /*#__PURE__*/function () { + function Theme() { + _classCallCheck(this, Theme); + + /* Base vales */ + this.background = '#f4f4f4'; + this.primaryColor = '#cde498'; + this.secondaryColor = '#cdffb2'; + this.background = 'white'; + this.mainBkg = '#cde498'; + this.secondBkg = '#cdffb2'; + this.lineColor = 'green'; + this.border1 = '#13540c'; + this.border2 = '#6eaa49'; + this.arrowheadColor = 'green'; + this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; + this.fontSize = '16px'; + this.tertiaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)('#cde498', 10); + this.primaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.primaryColor, this.darkMode); + this.secondaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.secondaryColor, this.darkMode); + this.tertiaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.tertiaryColor, this.darkMode); + this.primaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.primaryColor); + this.secondaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.secondaryColor); + this.tertiaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.primaryColor); + this.lineColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); + this.textColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); + /* Flowchart variables */ + + this.nodeBkg = 'calculated'; + this.nodeBorder = 'calculated'; + this.clusterBkg = 'calculated'; + this.clusterBorder = 'calculated'; + this.defaultLinkColor = 'calculated'; + this.titleColor = '#333'; + this.edgeLabelBackground = '#e8e8e8'; + /* Sequence Diagram variables */ + + this.actorBorder = 'calculated'; + this.actorBkg = 'calculated'; + this.actorTextColor = 'black'; + this.actorLineColor = 'grey'; + this.signalColor = '#333'; + this.signalTextColor = '#333'; + this.labelBoxBkgColor = 'calculated'; + this.labelBoxBorderColor = '#326932'; + this.labelTextColor = 'calculated'; + this.loopTextColor = 'calculated'; + this.noteBorderColor = 'calculated'; + this.noteBkgColor = '#fff5ad'; + this.noteTextColor = 'calculated'; + this.activationBorderColor = '#666'; + this.activationBkgColor = '#f4f4f4'; + this.sequenceNumberColor = 'white'; + /* Gantt chart variables */ + + this.sectionBkgColor = '#6eaa49'; + this.altSectionBkgColor = 'white'; + this.sectionBkgColor2 = '#6eaa49'; + this.excludeBkgColor = '#eeeeee'; + this.taskBorderColor = 'calculated'; + this.taskBkgColor = '#487e3a'; + this.taskTextLightColor = 'white'; + this.taskTextColor = 'calculated'; + this.taskTextDarkColor = 'black'; + this.taskTextOutsideColor = 'calculated'; + this.taskTextClickableColor = '#003163'; + this.activeTaskBorderColor = 'calculated'; + this.activeTaskBkgColor = 'calculated'; + this.gridColor = 'lightgrey'; + this.doneTaskBkgColor = 'lightgrey'; + this.doneTaskBorderColor = 'grey'; + this.critBorderColor = '#ff8888'; + this.critBkgColor = 'red'; + this.todayLineColor = 'red'; + /* C4 Context Diagram variables */ + + this.personBorder = 'calculated'; + this.personBkg = 'calculated'; + /* state colors */ + + this.labelColor = 'black'; + this.errorBkgColor = '#552222'; + this.errorTextColor = '#552222'; + } + + _createClass(Theme, [{ + key: "updateColors", + value: function updateColors() { + /* Flowchart variables */ + this.nodeBkg = this.mainBkg; + this.nodeBorder = this.border1; + this.clusterBkg = this.secondBkg; + this.clusterBorder = this.border2; + this.defaultLinkColor = this.lineColor; + /* Sequence Diagram variables */ + + this.actorBorder = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.mainBkg, 20); + this.actorBkg = this.mainBkg; + this.labelBoxBkgColor = this.actorBkg; + this.labelTextColor = this.actorTextColor; + this.loopTextColor = this.actorTextColor; + this.noteBorderColor = this.border2; + this.noteTextColor = this.actorTextColor; + /* Gantt chart variables */ + + this.taskBorderColor = this.border1; + this.taskTextColor = this.taskTextLightColor; + this.taskTextOutsideColor = this.taskTextDarkColor; + this.activeTaskBorderColor = this.taskBorderColor; + this.activeTaskBkgColor = this.mainBkg; + /* state colors */ + + this.transitionColor = this.transitionColor || this.lineColor; + this.transitionLabelColor = this.transitionLabelColor || this.textColor; + this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; + this.stateBkg = this.stateBkg || this.mainBkg; + this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; + this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; + this.altBackground = this.altBackground || '#f0f0f0'; + this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; + this.compositeBorder = this.compositeBorder || this.nodeBorder; + this.innerEndBackground = this.primaryBorderColor; + this.specialStateColor = this.lineColor; + this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; + this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; + this.transitionColor = this.transitionColor || this.lineColor; + /* class */ + + this.classText = this.primaryTextColor; + /* journey */ + + this.fillType0 = this.primaryColor; + this.fillType1 = this.secondaryColor; + this.fillType2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 64 + }); + this.fillType3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + h: 64 + }); + this.fillType4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -64 + }); + this.fillType5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + h: -64 + }); + this.fillType6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 128 + }); + this.fillType7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + h: 128 + }); + /* pie */ + + this.pie1 = this.pie1 || this.primaryColor; + this.pie2 = this.pie2 || this.secondaryColor; + this.pie3 = this.pie3 || this.tertiaryColor; + this.pie4 = this.pie4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + l: -30 + }); + this.pie5 = this.pie5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + l: -30 + }); + this.pie6 = this.pie6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.tertiaryColor, { + h: +40, + l: -40 + }); + this.pie7 = this.pie7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: +60, + l: -10 + }); + this.pie8 = this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -60, + l: -10 + }); + this.pie9 = this.pie9 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 120, + l: 0 + }); + this.pie10 = this.pie10 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: +60, + l: -50 + }); + this.pie11 = this.pie11 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -60, + l: -50 + }); + this.pie12 = this.pie12 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 120, + l: -50 + }); + this.pieTitleTextSize = this.pieTitleTextSize || '25px'; + this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; + this.pieSectionTextSize = this.pieSectionTextSize || '17px'; + this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; + this.pieLegendTextSize = this.pieLegendTextSize || '17px'; + this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; + this.pieStrokeColor = this.pieStrokeColor || 'black'; + this.pieStrokeWidth = this.pieStrokeWidth || '2px'; + this.pieOpacity = this.pieOpacity || '0.7'; + /* requirement-diagram */ + + this.requirementBackground = this.requirementBackground || this.primaryColor; + this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; + this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; + this.relationColor = this.relationColor || this.lineColor; + this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground; + this.relationLabelColor = this.relationLabelColor || this.actorTextColor; + /* git */ + + this.git0 = this.git0 || this.primaryColor; + this.git1 = this.git1 || this.secondaryColor; + this.git2 = this.git2 || this.tertiaryColor; + this.git3 = this.git3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -30 + }); + this.git4 = this.git4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -60 + }); + this.git5 = this.git5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -90 + }); + this.git6 = this.git6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: +60 + }); + this.git7 = this.git7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: +120 + }); + + if (this.darkMode) { + this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git0, 25); + this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git1, 25); + this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git2, 25); + this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git3, 25); + this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git4, 25); + this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git5, 25); + this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git6, 25); + this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.git7, 25); + } else { + this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git0, 25); + this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git1, 25); + this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git2, 25); + this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git3, 25); + this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git4, 25); + this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git5, 25); + this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git6, 25); + this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25); + } + + this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0); + this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1); + this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2); + this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3); + this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4); + this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5); + this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6); + this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7); + this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; + this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; + this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; + this.tagLabelFontSize = this.tagLabelFontSize || '10px'; + this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; + this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; + this.commitLabelFontSize = this.commitLabelFontSize || '10px'; + } + }, { + key: "calculate", + value: function calculate(overrides) { + var _this = this; + + if (_typeof(overrides) !== 'object') { + // Calculate colors form base colors + this.updateColors(); + return; + } + + var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); // Calculate colors form base colors + + this.updateColors(); // Copy values from overrides again in case of an override of derived value + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); + } + }]); + + return Theme; +}(); + +var getThemeVariables = function getThemeVariables(userOverrides) { + var theme = new Theme(); + theme.calculate(userOverrides); + return theme; +}; + +/***/ }), + +/***/ "./src/themes/theme-helpers.js": +/*!*************************************!*\ + !*** ./src/themes/theme-helpers.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "mkBorder": () => (/* binding */ mkBorder) +/* harmony export */ }); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); + +var mkBorder = function mkBorder(col, darkMode) { + return darkMode ? (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(col, { + s: -40, + l: 10 + }) : (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(col, { + s: -40, + l: -10 + }); +}; + +/***/ }), + +/***/ "./src/themes/theme-neutral.js": +/*!*************************************!*\ + !*** ./src/themes/theme-neutral.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "getThemeVariables": () => (/* binding */ getThemeVariables) +/* harmony export */ }); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(khroma__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + + + // const Color = require ( 'khroma/dist/color' ).default +// Color.format.hex.stringify(Color.parse('hsl(210, 66.6666666667%, 95%)')); // => "#EAF2FB" + +var Theme = /*#__PURE__*/function () { + function Theme() { + _classCallCheck(this, Theme); + + this.primaryColor = '#eee'; + this.contrast = '#707070'; + this.secondaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.contrast, 55); + this.background = '#ffffff'; // this.secondaryColor = adjust(this.primaryColor, { h: 120 }); + + this.tertiaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -160 + }); + this.primaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.primaryColor, this.darkMode); + this.secondaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.secondaryColor, this.darkMode); + this.tertiaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.tertiaryColor, this.darkMode); // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode); + + this.primaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.primaryColor); + this.secondaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.secondaryColor); + this.tertiaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.tertiaryColor); + this.lineColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); + this.textColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background); // this.altBackground = lighten(this.contrast, 55); + + this.mainBkg = '#eee'; + this.secondBkg = 'calculated'; + this.lineColor = '#666'; + this.border1 = '#999'; + this.border2 = 'calculated'; + this.note = '#ffa'; + this.text = '#333'; + this.critical = '#d42'; + this.done = '#bbb'; + this.arrowheadColor = '#333333'; + this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; + this.fontSize = '16px'; + /* Flowchart variables */ + + this.nodeBkg = 'calculated'; + this.nodeBorder = 'calculated'; + this.clusterBkg = 'calculated'; + this.clusterBorder = 'calculated'; + this.defaultLinkColor = 'calculated'; + this.titleColor = 'calculated'; + this.edgeLabelBackground = 'white'; + /* Sequence Diagram variables */ + + this.actorBorder = 'calculated'; + this.actorBkg = 'calculated'; + this.actorTextColor = 'calculated'; + this.actorLineColor = 'calculated'; + this.signalColor = 'calculated'; + this.signalTextColor = 'calculated'; + this.labelBoxBkgColor = 'calculated'; + this.labelBoxBorderColor = 'calculated'; + this.labelTextColor = 'calculated'; + this.loopTextColor = 'calculated'; + this.noteBorderColor = 'calculated'; + this.noteBkgColor = 'calculated'; + this.noteTextColor = 'calculated'; + this.activationBorderColor = '#666'; + this.activationBkgColor = '#f4f4f4'; + this.sequenceNumberColor = 'white'; + /* Gantt chart variables */ + + this.sectionBkgColor = 'calculated'; + this.altSectionBkgColor = 'white'; + this.sectionBkgColor2 = 'calculated'; + this.excludeBkgColor = '#eeeeee'; + this.taskBorderColor = 'calculated'; + this.taskBkgColor = 'calculated'; + this.taskTextLightColor = 'white'; + this.taskTextColor = 'calculated'; + this.taskTextDarkColor = 'calculated'; + this.taskTextOutsideColor = 'calculated'; + this.taskTextClickableColor = '#003163'; + this.activeTaskBorderColor = 'calculated'; + this.activeTaskBkgColor = 'calculated'; + this.gridColor = 'calculated'; + this.doneTaskBkgColor = 'calculated'; + this.doneTaskBorderColor = 'calculated'; + this.critBkgColor = 'calculated'; + this.critBorderColor = 'calculated'; + this.todayLineColor = 'calculated'; + /* C4 Context Diagram variables */ + + this.personBorder = 'calculated'; + this.personBkg = 'calculated'; + /* state colors */ + + this.labelColor = 'black'; + this.errorBkgColor = '#552222'; + this.errorTextColor = '#552222'; + } + + _createClass(Theme, [{ + key: "updateColors", + value: function updateColors() { + this.secondBkg = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.contrast, 55); + this.border2 = this.contrast; + /* Flowchart variables */ + + this.nodeBkg = this.mainBkg; + this.nodeBorder = this.border1; + this.clusterBkg = this.secondBkg; + this.clusterBorder = this.border2; + this.defaultLinkColor = this.lineColor; + this.titleColor = this.text; + /* Sequence Diagram variables */ + + this.actorBorder = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.border1, 23); + this.actorBkg = this.mainBkg; + this.actorTextColor = this.text; + this.actorLineColor = this.lineColor; + this.signalColor = this.text; + this.signalTextColor = this.text; + this.labelBoxBkgColor = this.actorBkg; + this.labelBoxBorderColor = this.actorBorder; + this.labelTextColor = this.text; + this.loopTextColor = this.text; + this.noteBorderColor = '#999'; + this.noteBkgColor = '#666'; + this.noteTextColor = '#fff'; + /* Gantt chart variables */ + + this.sectionBkgColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.contrast, 30); + this.sectionBkgColor2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.contrast, 30); + this.taskBorderColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.contrast, 10); + this.taskBkgColor = this.contrast; + this.taskTextColor = this.taskTextLightColor; + this.taskTextDarkColor = this.text; + this.taskTextOutsideColor = this.taskTextDarkColor; + this.activeTaskBorderColor = this.taskBorderColor; + this.activeTaskBkgColor = this.mainBkg; + this.gridColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.border1, 30); + this.doneTaskBkgColor = this.done; + this.doneTaskBorderColor = this.lineColor; + this.critBkgColor = this.critical; + this.critBorderColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.critBkgColor, 10); + this.todayLineColor = this.critBkgColor; + /* state colors */ + + this.transitionColor = this.transitionColor || '#000'; + this.transitionLabelColor = this.transitionLabelColor || this.textColor; + this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; + this.stateBkg = this.stateBkg || this.mainBkg; + this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; + this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; + this.altBackground = this.altBackground || '#f4f4f4'; + this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; + this.stateBorder = this.stateBorder || '#000'; + this.innerEndBackground = this.primaryBorderColor; + this.specialStateColor = '#222'; + this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; + this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; + /* class */ + + this.classText = this.primaryTextColor; + /* journey */ + + this.fillType0 = this.primaryColor; + this.fillType1 = this.secondaryColor; + this.fillType2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 64 + }); + this.fillType3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + h: 64 + }); + this.fillType4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -64 + }); + this.fillType5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + h: -64 + }); + this.fillType6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: 128 + }); + this.fillType7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.secondaryColor, { + h: 128 + }); // /* pie */ + + this.pie1 = this.pie1 || '#F4F4F4'; + this.pie2 = this.pie2 || '#555'; + this.pie3 = this.pie3 || '#BBB'; + this.pie4 = this.pie4 || '#777'; + this.pie5 = this.pie5 || '#999'; + this.pie6 = this.pie6 || '#DDD'; + this.pie7 = this.pie7 || '#FFF'; + this.pie8 = this.pie8 || '#DDD'; + this.pie9 = this.pie9 || '#BBB'; + this.pie10 = this.pie10 || '#999'; + this.pie11 = this.pie11 || '#777'; + this.pie12 = this.pie12 || '#555'; + this.pieTitleTextSize = this.pieTitleTextSize || '25px'; + this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; + this.pieSectionTextSize = this.pieSectionTextSize || '17px'; + this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; + this.pieLegendTextSize = this.pieLegendTextSize || '17px'; + this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; + this.pieStrokeColor = this.pieStrokeColor || 'black'; + this.pieStrokeWidth = this.pieStrokeWidth || '2px'; + this.pieOpacity = this.pieOpacity || '0.7'; // this.pie1 = this.pie1 || '#212529'; + // this.pie2 = this.pie2 || '#343A40'; + // this.pie3 = this.pie3 || '#495057'; + // this.pie4 = this.pie4 || '#6C757D'; + // this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -10 }); + // this.pie6 = this.pie6 || adjust(this.tertiaryColor, { l: -10 }); + // this.pie7 = this.pie7 || adjust(this.primaryColor, { h: +60, l: -10 }); + // this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -10 }); + // this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: 0 }); + // this.pie10 = this.pie10 || adjust(this.primaryColor, { h: +60, l: -20 }); + // this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -60, l: -20 }); + // this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -10 }); + + /* requirement-diagram */ + + this.requirementBackground = this.requirementBackground || this.primaryColor; + this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; + this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; + this.relationColor = this.relationColor || this.lineColor; + this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground; + this.relationLabelColor = this.relationLabelColor || this.actorTextColor; + /* git */ + + this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.pie1, 25) || this.primaryColor; + this.git1 = this.pie2 || this.secondaryColor; + this.git2 = this.pie3 || this.tertiaryColor; + this.git3 = this.pie4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -30 + }); + this.git4 = this.pie5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -60 + }); + this.git5 = this.pie6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: -90 + }); + this.git6 = this.pie7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: +60 + }); + this.git7 = this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, { + h: +120 + }); + this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0); + this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1); + this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2); + this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3); + this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4); + this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5); + this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6); + this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7); + this.branchLabelColor = this.branchLabelColor || this.labelTextColor; + this.gitBranchLabel0 = this.branchLabelColor; + this.gitBranchLabel1 = 'white'; + this.gitBranchLabel2 = this.branchLabelColor; + this.gitBranchLabel3 = 'white'; + this.gitBranchLabel4 = this.branchLabelColor; + this.gitBranchLabel5 = this.branchLabelColor; + this.gitBranchLabel6 = this.branchLabelColor; + this.gitBranchLabel7 = this.branchLabelColor; + this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; + this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; + this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; + this.tagLabelFontSize = this.tagLabelFontSize || '10px'; + this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; + this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; + this.commitLabelFontSize = this.commitLabelFontSize || '10px'; + } + }, { + key: "calculate", + value: function calculate(overrides) { + var _this = this; + + if (_typeof(overrides) !== 'object') { + // Calculate colors form base colors + this.updateColors(); + return; + } + + var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); // Calculate colors form base colors + + this.updateColors(); // Copy values from overrides again in case of an override of derived value + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); + } + }]); + + return Theme; +}(); + +var getThemeVariables = function getThemeVariables(userOverrides) { + var theme = new Theme(); + theme.calculate(userOverrides); + return theme; +}; + +/***/ }), + +/***/ "./src/utils.js": +/*!**********************!*\ + !*** ./src/utils.js ***! + \**********************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "assignWithDepth": () => (/* binding */ assignWithDepth), +/* harmony export */ "calculateSvgSizeAttrs": () => (/* binding */ calculateSvgSizeAttrs), +/* harmony export */ "calculateTextDimensions": () => (/* binding */ calculateTextDimensions), +/* harmony export */ "calculateTextHeight": () => (/* binding */ calculateTextHeight), +/* harmony export */ "calculateTextWidth": () => (/* binding */ calculateTextWidth), +/* harmony export */ "configureSvgSize": () => (/* binding */ configureSvgSize), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "detectDirective": () => (/* binding */ detectDirective), +/* harmony export */ "detectInit": () => (/* binding */ detectInit), +/* harmony export */ "detectType": () => (/* binding */ detectType), +/* harmony export */ "directiveSanitizer": () => (/* binding */ directiveSanitizer), +/* harmony export */ "drawSimpleText": () => (/* binding */ drawSimpleText), +/* harmony export */ "entityDecode": () => (/* binding */ entityDecode), +/* harmony export */ "formatUrl": () => (/* binding */ formatUrl), +/* harmony export */ "generateId": () => (/* binding */ generateId), +/* harmony export */ "getStylesFromArray": () => (/* binding */ getStylesFromArray), +/* harmony export */ "getTextObj": () => (/* binding */ getTextObj), +/* harmony export */ "initIdGenerator": () => (/* binding */ initIdGenerator), +/* harmony export */ "interpolateToCurve": () => (/* binding */ interpolateToCurve), +/* harmony export */ "isSubstringInArray": () => (/* binding */ isSubstringInArray), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "runFunc": () => (/* binding */ runFunc), +/* harmony export */ "sanitizeCss": () => (/* binding */ sanitizeCss), +/* harmony export */ "setupGraphViewbox": () => (/* binding */ setupGraphViewbox), +/* harmony export */ "wrapLabel": () => (/* binding */ wrapLabel) +/* harmony export */ }); +/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @braintree/sanitize-url */ "@braintree/sanitize-url"); +/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3 */ "d3"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./diagrams/common/common */ "./src/diagrams/common/common.js"); +/* harmony import */ var _defaultConfig__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defaultConfig */ "./src/defaultConfig.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./logger */ "./src/logger.js"); +var _this = undefined; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } + +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + + + + + // Effectively an enum of the supported curve types, accessible by name + +var d3CurveTypes = { + curveBasis: d3__WEBPACK_IMPORTED_MODULE_1__.curveBasis, + curveBasisClosed: d3__WEBPACK_IMPORTED_MODULE_1__.curveBasisClosed, + curveBasisOpen: d3__WEBPACK_IMPORTED_MODULE_1__.curveBasisOpen, + curveLinear: d3__WEBPACK_IMPORTED_MODULE_1__.curveLinear, + curveLinearClosed: d3__WEBPACK_IMPORTED_MODULE_1__.curveLinearClosed, + curveMonotoneX: d3__WEBPACK_IMPORTED_MODULE_1__.curveMonotoneX, + curveMonotoneY: d3__WEBPACK_IMPORTED_MODULE_1__.curveMonotoneY, + curveNatural: d3__WEBPACK_IMPORTED_MODULE_1__.curveNatural, + curveStep: d3__WEBPACK_IMPORTED_MODULE_1__.curveStep, + curveStepAfter: d3__WEBPACK_IMPORTED_MODULE_1__.curveStepAfter, + curveStepBefore: d3__WEBPACK_IMPORTED_MODULE_1__.curveStepBefore +}; +var directive = /[%]{2}[{]\s*(?:(?:(\w+)\s*:|(\w+))\s*(?:(?:(\w+))|((?:(?![}][%]{2}).|\r?\n)*))?\s*)(?:[}][%]{2})?/gi; +var directiveWithoutOpen = /\s*(?:(?:(\w+)(?=:):|(\w+))\s*(?:(?:(\w+))|((?:(?![}][%]{2}).|\r?\n)*))?\s*)(?:[}][%]{2})?/gi; +var anyComment = /\s*%%.*\n/gm; +/** + * @function detectInit Detects the init config object from the text + * + * ```mermaid + * %%{init: {"theme": "debug", "logLevel": 1 }}%% + * graph LR + * a-->b + * b-->c + * c-->d + * d-->e + * e-->f + * f-->g + * g-->h + * ``` + * + * Or + * + * ```mermaid + * %%{initialize: {"theme": "dark", logLevel: "debug" }}%% + * graph LR + * a-->b + * b-->c + * c-->d + * d-->e + * e-->f + * f-->g + * g-->h + * ``` + * @param {string} text The text defining the graph + * @param {any} cnf + * @returns {object} The json object representing the init passed to mermaid.initialize() + */ + +var detectInit = function detectInit(text, cnf) { + var inits = detectDirective(text, /(?:init\b)|(?:initialize\b)/); + var results = {}; + + if (Array.isArray(inits)) { + var args = inits.map(function (init) { + return init.args; + }); + directiveSanitizer(args); + results = assignWithDepth(results, _toConsumableArray(args)); + } else { + results = inits.args; + } + + if (results) { + var type = detectType(text, cnf); + ['config'].forEach(function (prop) { + if (typeof results[prop] !== 'undefined') { + if (type === 'flowchart-v2') { + type = 'flowchart'; + } + + results[type] = results[prop]; + delete results[prop]; + } + }); + } // Todo: refactor this, these results are never used + + + return results; +}; +/** + * @function detectDirective Detects the directive from the text. Text can be single line or + * multiline. If type is null or omitted the first directive encountered in text will be returned + * + * ```mermaid + * graph LR + * %%{somedirective}%% + * a-->b + * b-->c + * c-->d + * d-->e + * e-->f + * f-->g + * g-->h + * ``` + * @param {string} text The text defining the graph + * @param {string | RegExp} type The directive to return (default: null) + * @returns {object | Array} An object or Array representing the directive(s): { type: string, args: + * object|null } matched by the input type if a single directive was found, that directive object + * will be returned. + */ + +var detectDirective = function detectDirective(text) { + var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + try { + var commentWithoutDirectives = new RegExp("[%]{2}(?![{]".concat(directiveWithoutOpen.source, ")(?=[}][%]{2}).*\n"), 'ig'); + text = text.trim().replace(commentWithoutDirectives, '').replace(/'/gm, '"'); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug("Detecting diagram directive".concat(type !== null ? ' type:' + type : '', " based on the text:").concat(text)); + var match, + result = []; + + while ((match = directive.exec(text)) !== null) { + // This is necessary to avoid infinite loops with zero-width matches + if (match.index === directive.lastIndex) { + directive.lastIndex++; + } + + if (match && !type || type && match[1] && match[1].match(type) || type && match[2] && match[2].match(type)) { + var _type = match[1] ? match[1] : match[2]; + + var args = match[3] ? match[3].trim() : match[4] ? JSON.parse(match[4].trim()) : null; + result.push({ + type: _type, + args: args + }); + } + } + + if (result.length === 0) { + result.push({ + type: text, + args: null + }); + } + + return result.length === 1 ? result[0] : result; + } catch (error) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.error("ERROR: ".concat(error.message, " - Unable to parse directive\n ").concat(type !== null ? ' type:' + type : '', " based on the text:").concat(text)); + return { + type: null, + args: null + }; + } +}; +/** + * @function detectType Detects the type of the graph text. Takes into consideration the possible + * existence of an %%init directive + * + * ```mermaid + * %%{initialize: {"startOnLoad": true, logLevel: "fatal" }}%% + * graph LR + * a-->b + * b-->c + * c-->d + * d-->e + * e-->f + * f-->g + * g-->h + * ``` + * @param {string} text The text defining the graph + * @param {{ + * class: { defaultRenderer: string } | undefined; + * state: { defaultRenderer: string } | undefined; + * flowchart: { defaultRenderer: string } | undefined; + * }} [cnf] + * @returns {string} A graph definition key + */ + +var detectType = function detectType(text, cnf) { + text = text.replace(directive, '').replace(anyComment, '\n'); + + if (text.match(/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/)) { + return 'c4'; + } + + if (text.match(/^\s*sequenceDiagram/)) { + return 'sequence'; + } + + if (text.match(/^\s*gantt/)) { + return 'gantt'; + } + + if (text.match(/^\s*classDiagram-v2/)) { + return 'classDiagram'; + } + + if (text.match(/^\s*classDiagram/)) { + if (cnf && cnf.class && cnf.class.defaultRenderer === 'dagre-wrapper') return 'classDiagram'; + return 'class'; + } + + if (text.match(/^\s*stateDiagram-v2/)) { + return 'stateDiagram'; + } + + if (text.match(/^\s*stateDiagram/)) { + if (cnf && cnf.class && cnf.state.defaultRenderer === 'dagre-wrapper') return 'stateDiagram'; + return 'state'; + } + + if (text.match(/^\s*gitGraph/)) { + return 'gitGraph'; + } + + if (text.match(/^\s*flowchart/)) { + return 'flowchart-v2'; + } + + if (text.match(/^\s*info/)) { + return 'info'; + } + + if (text.match(/^\s*pie/)) { + return 'pie'; + } + + if (text.match(/^\s*erDiagram/)) { + return 'er'; + } + + if (text.match(/^\s*journey/)) { + return 'journey'; + } + + if (text.match(/^\s*requirement/) || text.match(/^\s*requirementDiagram/)) { + return 'requirement'; + } + + if (cnf && cnf.flowchart && cnf.flowchart.defaultRenderer === 'dagre-wrapper') return 'flowchart-v2'; + return 'flowchart'; +}; +/** + * Caches results of functions based on input + * + * @param {Function} fn Function to run + * @param {Function} resolver Function that resolves to an ID given arguments the `fn` takes + * @returns {Function} An optimized caching function + */ + +var memoize = function memoize(fn, resolver) { + var cache = {}; + return function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var n = resolver ? resolver.apply(_this, args) : args[0]; + + if (n in cache) { + return cache[n]; + } else { + var result = fn.apply(void 0, args); + cache[n] = result; + return result; + } + }; +}; +/** + * @function isSubstringInArray Detects whether a substring in present in a given array + * @param {string} str The substring to detect + * @param {Array} arr The array to search + * @returns {number} The array index containing the substring or -1 if not present + */ + + +var isSubstringInArray = function isSubstringInArray(str, arr) { + for (var i = 0; i < arr.length; i++) { + if (arr[i].match(str)) return i; + } + + return -1; +}; +/** + * Returns a d3 curve given a curve name + * + * @param {string | undefined} interpolate The interpolation name + * @param {any} defaultCurve The default curve to return + * @returns {import('d3-shape').CurveFactory} The curve factory to use + */ + +var interpolateToCurve = function interpolateToCurve(interpolate, defaultCurve) { + if (!interpolate) { + return defaultCurve; + } + + var curveName = "curve".concat(interpolate.charAt(0).toUpperCase() + interpolate.slice(1)); + return d3CurveTypes[curveName] || defaultCurve; +}; +/** + * Formats a URL string + * + * @param {string} linkStr String of the URL + * @param {{ securityLevel: string }} config Configuration passed to MermaidJS + * @returns {string | undefined} The formatted URL + */ + +var formatUrl = function formatUrl(linkStr, config) { + var url = linkStr.trim(); + + if (url) { + if (config.securityLevel !== 'loose') { + return (0,_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__.sanitizeUrl)(url); + } + + return url; + } +}; +/** + * Runs a function + * + * @param {string} functionName A dot seperated path to the function relative to the `window` + * @param {...any} params Parameters to pass to the function + */ + +var runFunc = function runFunc(functionName) { + var _obj; + + var arrPaths = functionName.split('.'); + var len = arrPaths.length - 1; + var fnName = arrPaths[len]; + var obj = window; + + for (var i = 0; i < len; i++) { + obj = obj[arrPaths[i]]; + if (!obj) return; + } + + for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + params[_key2 - 1] = arguments[_key2]; + } + + (_obj = obj)[fnName].apply(_obj, params); +}; +/** + * @typedef {object} Point A (x, y) point + * @property {number} x The x value + * @property {number} y The y value + */ + +/** + * Finds the distance between two points using the Distance Formula + * + * @param {Point} p1 The first point + * @param {Point} p2 The second point + * @returns {number} The distance + */ + +var distance = function distance(p1, p2) { + return p1 && p2 ? Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)) : 0; +}; +/** + * @param {Point[]} points List of points + * @returns {Point} + * @todo Give this a description + */ + + +var traverseEdge = function traverseEdge(points) { + var prevPoint; + var totalDistance = 0; + points.forEach(function (point) { + totalDistance += distance(point, prevPoint); + prevPoint = point; + }); // Traverse half of total distance along points + + var remainingDistance = totalDistance / 2; + var center = undefined; + prevPoint = undefined; + points.forEach(function (point) { + if (prevPoint && !center) { + var vectorDistance = distance(point, prevPoint); + + if (vectorDistance < remainingDistance) { + remainingDistance -= vectorDistance; + } else { + // The point is remainingDistance from prevPoint in the vector between prevPoint and point + // Calculate the coordinates + var distanceRatio = remainingDistance / vectorDistance; + if (distanceRatio <= 0) center = prevPoint; + if (distanceRatio >= 1) center = { + x: point.x, + y: point.y + }; + + if (distanceRatio > 0 && distanceRatio < 1) { + center = { + x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, + y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y + }; + } + } + } + + prevPoint = point; + }); + return center; +}; +/** + * Alias for `traverseEdge` + * + * @param {Point[]} points List of points + * @returns {Point} Return result of `transverseEdge` + */ + + +var calcLabelPosition = function calcLabelPosition(points) { + if (points.length === 1) { + return points[0]; + } + + return traverseEdge(points); +}; + +var calcCardinalityPosition = function calcCardinalityPosition(isRelationTypePresent, points, initialPosition) { + var prevPoint; + var totalDistance = 0; // eslint-disable-line + + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('our points', points); + + if (points[0] !== initialPosition) { + points = points.reverse(); + } + + points.forEach(function (point) { + totalDistance += distance(point, prevPoint); + prevPoint = point; + }); // Traverse only 25 total distance along points to find cardinality point + + var distanceToCardinalityPoint = 25; + var remainingDistance = distanceToCardinalityPoint; + var center; + prevPoint = undefined; + points.forEach(function (point) { + if (prevPoint && !center) { + var vectorDistance = distance(point, prevPoint); + + if (vectorDistance < remainingDistance) { + remainingDistance -= vectorDistance; + } else { + // The point is remainingDistance from prevPoint in the vector between prevPoint and point + // Calculate the coordinates + var distanceRatio = remainingDistance / vectorDistance; + if (distanceRatio <= 0) center = prevPoint; + if (distanceRatio >= 1) center = { + x: point.x, + y: point.y + }; + + if (distanceRatio > 0 && distanceRatio < 1) { + center = { + x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, + y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y + }; + } + } + } + + prevPoint = point; + }); // if relation is present (Arrows will be added), change cardinality point off-set distance (d) + + var d = isRelationTypePresent ? 10 : 5; //Calculate Angle for x and y axis + + var angle = Math.atan2(points[0].y - center.y, points[0].x - center.x); + var cardinalityPosition = { + x: 0, + y: 0 + }; //Calculation cardinality position using angle, center point on the line/curve but pendicular and with offset-distance + + cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2; + cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2; + return cardinalityPosition; +}; +/** + * Position ['start_left', 'start_right', 'end_left', 'end_right'] + * + * @param {any} terminalMarkerSize + * @param {any} position + * @param {any} _points + * @returns {any} + */ + + +var calcTerminalLabelPosition = function calcTerminalLabelPosition(terminalMarkerSize, position, _points) { + // Todo looking to faster cloning method + var points = JSON.parse(JSON.stringify(_points)); + var prevPoint; + var totalDistance = 0; // eslint-disable-line + + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('our points', points); + + if (position !== 'start_left' && position !== 'start_right') { + points = points.reverse(); + } + + points.forEach(function (point) { + totalDistance += distance(point, prevPoint); + prevPoint = point; + }); // Traverse only 25 total distance along points to find cardinality point + + var distanceToCardinalityPoint = 25 + terminalMarkerSize; + var remainingDistance = distanceToCardinalityPoint; + var center; + prevPoint = undefined; + points.forEach(function (point) { + if (prevPoint && !center) { + var vectorDistance = distance(point, prevPoint); + + if (vectorDistance < remainingDistance) { + remainingDistance -= vectorDistance; + } else { + // The point is remainingDistance from prevPoint in the vector between prevPoint and point + // Calculate the coordinates + var distanceRatio = remainingDistance / vectorDistance; + if (distanceRatio <= 0) center = prevPoint; + if (distanceRatio >= 1) center = { + x: point.x, + y: point.y + }; + + if (distanceRatio > 0 && distanceRatio < 1) { + center = { + x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, + y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y + }; + } + } + } + + prevPoint = point; + }); // if relation is present (Arrows will be added), change cardinality point off-set distance (d) + + var d = 10 + terminalMarkerSize * 0.5; //Calculate Angle for x and y axis + + var angle = Math.atan2(points[0].y - center.y, points[0].x - center.x); + var cardinalityPosition = { + x: 0, + y: 0 + }; //Calculation cardinality position using angle, center point on the line/curve but pendicular and with offset-distance + + cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2; + cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2; + + if (position === 'start_left') { + cardinalityPosition.x = Math.sin(angle + Math.PI) * d + (points[0].x + center.x) / 2; + cardinalityPosition.y = -Math.cos(angle + Math.PI) * d + (points[0].y + center.y) / 2; + } + + if (position === 'end_right') { + cardinalityPosition.x = Math.sin(angle - Math.PI) * d + (points[0].x + center.x) / 2 - 5; + cardinalityPosition.y = -Math.cos(angle - Math.PI) * d + (points[0].y + center.y) / 2 - 5; + } + + if (position === 'end_left') { + cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2 - 5; + cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2 - 5; + } + + return cardinalityPosition; +}; +/** + * Gets styles from an array of declarations + * + * @param {string[]} arr Declarations + * @returns {{ style: string; labelStyle: string }} The styles grouped as strings + */ + + +var getStylesFromArray = function getStylesFromArray(arr) { + var style = ''; + var labelStyle = ''; + + for (var i = 0; i < arr.length; i++) { + if (typeof arr[i] !== 'undefined') { + // add text properties to label style definition + if (arr[i].startsWith('color:') || arr[i].startsWith('text-align:')) { + labelStyle = labelStyle + arr[i] + ';'; + } else { + style = style + arr[i] + ';'; + } + } + } + + return { + style: style, + labelStyle: labelStyle + }; +}; +var cnt = 0; +var generateId = function generateId() { + cnt++; + return 'id-' + Math.random().toString(36).substr(2, 12) + '-' + cnt; +}; +/** + * @param {any} length + * @returns {any} + */ + +function makeid(length) { + var result = ''; + var characters = '0123456789abcdef'; + var charactersLength = characters.length; + + for (var i = 0; i < length; i++) { + result += characters.charAt(Math.floor(Math.random() * charactersLength)); + } + + return result; +} + +var random = function random(options) { + return makeid(options.length); +}; +/** + * @function assignWithDepth Extends the functionality of {@link ObjectConstructor.assign} with the + * ability to merge arbitrary-depth objects For each key in src with path `k` (recursively) + * performs an Object.assign(dst[`k`], src[`k`]) with a slight change from the typical handling of + * undefined for dst[`k`]: instead of raising an error, dst[`k`] is auto-initialized to {} and + * effectively merged with src[`k`]

Additionally, dissimilar types will not clobber unless the + * config.clobber parameter === true. Example: + * + * ```js + * let config_0 = { foo: { bar: 'bar' }, bar: 'foo' }; + * let config_1 = { foo: 'foo', bar: 'bar' }; + * let result = assignWithDepth(config_0, config_1); + * console.log(result); + * //-> result: { foo: { bar: 'bar' }, bar: 'bar' } + * ``` + * + * Traditional Object.assign would have clobbered foo in config_0 with foo in config_1. If src is a + * destructured array of objects and dst is not an array, assignWithDepth will apply each element + * of src to dst in order. + * @param dst + * @param src + * @param config + * @param dst + * @param src + * @param config + * @param dst + * @param src + * @param config + * @param {any} dst - The destination of the merge + * @param {any} src - The source object(s) to merge into destination + * @param {{ depth: number; clobber: boolean }} [config={ depth: 2, clobber: false }] - Depth: depth + * to traverse within src and dst for merging - clobber: should dissimilar types clobber (default: + * { depth: 2, clobber: false }). Default is `{ depth: 2, clobber: false }` + * @returns {any} + */ + +var assignWithDepth = function assignWithDepth(dst, src, config) { + var _Object$assign = Object.assign({ + depth: 2, + clobber: false + }, config), + depth = _Object$assign.depth, + clobber = _Object$assign.clobber; + + if (Array.isArray(src) && !Array.isArray(dst)) { + src.forEach(function (s) { + return assignWithDepth(dst, s, config); + }); + return dst; + } else if (Array.isArray(src) && Array.isArray(dst)) { + src.forEach(function (s) { + if (dst.indexOf(s) === -1) { + dst.push(s); + } + }); + return dst; + } + + if (typeof dst === 'undefined' || depth <= 0) { + if (dst !== undefined && dst !== null && _typeof(dst) === 'object' && _typeof(src) === 'object') { + return Object.assign(dst, src); + } else { + return src; + } + } + + if (typeof src !== 'undefined' && _typeof(dst) === 'object' && _typeof(src) === 'object') { + Object.keys(src).forEach(function (key) { + if (_typeof(src[key]) === 'object' && (dst[key] === undefined || _typeof(dst[key]) === 'object')) { + if (dst[key] === undefined) { + dst[key] = Array.isArray(src[key]) ? [] : {}; + } + + dst[key] = assignWithDepth(dst[key], src[key], { + depth: depth - 1, + clobber: clobber + }); + } else if (clobber || _typeof(dst[key]) !== 'object' && _typeof(src[key]) !== 'object') { + dst[key] = src[key]; + } + }); + } + + return dst; +}; +var getTextObj = function getTextObj() { + return { + x: 0, + y: 0, + fill: undefined, + anchor: 'start', + style: '#666', + width: 100, + height: 100, + textMargin: 0, + rx: 0, + ry: 0, + valign: undefined + }; +}; +/** + * Adds text to an element + * + * @param {SVGElement} elem Element to add text to + * @param {{ + * text: string; + * x: number; + * y: number; + * anchor: 'start' | 'middle' | 'end'; + * fontFamily: string; + * fontSize: string | number; + * fontWeight: string | number; + * fill: string; + * class: string | undefined; + * textMargin: number; + * }} textData + * @returns {SVGTextElement} Text element with given styling and content + */ + +var drawSimpleText = function drawSimpleText(elem, textData) { + // Remove and ignore br:s + var nText = textData.text.replace(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__["default"].lineBreakRegex, ' '); + var textElem = elem.append('text'); + textElem.attr('x', textData.x); + textElem.attr('y', textData.y); + textElem.style('text-anchor', textData.anchor); + textElem.style('font-family', textData.fontFamily); + textElem.style('font-size', textData.fontSize); + textElem.style('font-weight', textData.fontWeight); + textElem.attr('fill', textData.fill); + + if (typeof textData.class !== 'undefined') { + textElem.attr('class', textData.class); + } + + var span = textElem.append('tspan'); + span.attr('x', textData.x + textData.textMargin * 2); + span.attr('fill', textData.fill); + span.text(nText); + return textElem; +}; +var wrapLabel = memoize(function (label, maxWidth, config) { + if (!label) { + return label; + } + + config = Object.assign({ + fontSize: 12, + fontWeight: 400, + fontFamily: 'Arial', + joinWith: '
' + }, config); + + if (_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__["default"].lineBreakRegex.test(label)) { + return label; + } + + var words = label.split(' '); + var completedLines = []; + var nextLine = ''; + words.forEach(function (word, index) { + var wordLength = calculateTextWidth("".concat(word, " "), config); + var nextLineLength = calculateTextWidth(nextLine, config); + + if (wordLength > maxWidth) { + var _breakString = breakString(word, maxWidth, '-', config), + hyphenatedStrings = _breakString.hyphenatedStrings, + remainingWord = _breakString.remainingWord; + + completedLines.push.apply(completedLines, [nextLine].concat(_toConsumableArray(hyphenatedStrings))); + nextLine = remainingWord; + } else if (nextLineLength + wordLength >= maxWidth) { + completedLines.push(nextLine); + nextLine = word; + } else { + nextLine = [nextLine, word].filter(Boolean).join(' '); + } + + var currentWord = index + 1; + var isLastWord = currentWord === words.length; + + if (isLastWord) { + completedLines.push(nextLine); + } + }); + return completedLines.filter(function (line) { + return line !== ''; + }).join(config.joinWith); +}, function (label, maxWidth, config) { + return "".concat(label, "-").concat(maxWidth, "-").concat(config.fontSize, "-").concat(config.fontWeight, "-").concat(config.fontFamily, "-").concat(config.joinWith); +}); +var breakString = memoize(function (word, maxWidth) { + var hyphenCharacter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '-'; + var config = arguments.length > 3 ? arguments[3] : undefined; + config = Object.assign({ + fontSize: 12, + fontWeight: 400, + fontFamily: 'Arial', + margin: 0 + }, config); + var characters = word.split(''); + var lines = []; + var currentLine = ''; + characters.forEach(function (character, index) { + var nextLine = "".concat(currentLine).concat(character); + var lineWidth = calculateTextWidth(nextLine, config); + + if (lineWidth >= maxWidth) { + var currentCharacter = index + 1; + var isLastLine = characters.length === currentCharacter; + var hyphenatedNextLine = "".concat(nextLine).concat(hyphenCharacter); + lines.push(isLastLine ? nextLine : hyphenatedNextLine); + currentLine = ''; + } else { + currentLine = nextLine; + } + }); + return { + hyphenatedStrings: lines, + remainingWord: currentLine + }; +}, function (word, maxWidth) { + var hyphenCharacter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '-'; + var config = arguments.length > 3 ? arguments[3] : undefined; + return "".concat(word, "-").concat(maxWidth, "-").concat(hyphenCharacter, "-").concat(config.fontSize, "-").concat(config.fontWeight, "-").concat(config.fontFamily); +}); +/** + * This calculates the text's height, taking into account the wrap breaks and both the statically + * configured height, width, and the length of the text (in pixels). + * + * If the wrapped text text has greater height, we extend the height, so it's value won't overflow. + * + * @param {any} text The text to measure + * @param {any} config - The config for fontSize, fontFamily, and fontWeight all impacting the resulting size + * @returns {any} - The height for the given text + */ + +var calculateTextHeight = function calculateTextHeight(text, config) { + config = Object.assign({ + fontSize: 12, + fontWeight: 400, + fontFamily: 'Arial', + margin: 15 + }, config); + return calculateTextDimensions(text, config).height; +}; +/** + * This calculates the width of the given text, font size and family. + * + * @param {any} text - The text to calculate the width of + * @param {any} config - The config for fontSize, fontFamily, and fontWeight all impacting the resulting size + * @returns {any} - The width for the given text + */ + +var calculateTextWidth = function calculateTextWidth(text, config) { + config = Object.assign({ + fontSize: 12, + fontWeight: 400, + fontFamily: 'Arial' + }, config); + return calculateTextDimensions(text, config).width; +}; +/** + * This calculates the dimensions of the given text, font size, font family, font weight, and margins. + * + * @param {any} text - The text to calculate the width of + * @param {any} config - The config for fontSize, fontFamily, fontWeight, and margin all impacting + * the resulting size + * @returns - The width for the given text + */ + +var calculateTextDimensions = memoize(function (text, config) { + config = Object.assign({ + fontSize: 12, + fontWeight: 400, + fontFamily: 'Arial' + }, config); + var _config = config, + fontSize = _config.fontSize, + fontFamily = _config.fontFamily, + fontWeight = _config.fontWeight; + + if (!text) { + return { + width: 0, + height: 0 + }; + } // We can't really know if the user supplied font family will render on the user agent; + // thus, we'll take the max width between the user supplied font family, and a default + // of sans-serif. + + + var fontFamilies = ['sans-serif', fontFamily]; + var lines = text.split(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__["default"].lineBreakRegex); + var dims = []; + var body = (0,d3__WEBPACK_IMPORTED_MODULE_1__.select)('body'); // We don't want to leak DOM elements - if a removal operation isn't available + // for any reason, do not continue. + + if (!body.remove) { + return { + width: 0, + height: 0, + lineHeight: 0 + }; + } + + var g = body.append('svg'); + + for (var _i = 0, _fontFamilies = fontFamilies; _i < _fontFamilies.length; _i++) { + var _fontFamily = _fontFamilies[_i]; + var cheight = 0; + var dim = { + width: 0, + height: 0, + lineHeight: 0 + }; + + var _iterator = _createForOfIteratorHelper(lines), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var line = _step.value; + var textObj = getTextObj(); + textObj.text = line; + var textElem = drawSimpleText(g, textObj).style('font-size', fontSize).style('font-weight', fontWeight).style('font-family', _fontFamily); + var bBox = (textElem._groups || textElem)[0][0].getBBox(); + dim.width = Math.round(Math.max(dim.width, bBox.width)); + cheight = Math.round(bBox.height); + dim.height += cheight; + dim.lineHeight = Math.round(Math.max(dim.lineHeight, cheight)); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + + dims.push(dim); + } + + g.remove(); + var index = isNaN(dims[1].height) || isNaN(dims[1].width) || isNaN(dims[1].lineHeight) || dims[0].height > dims[1].height && dims[0].width > dims[1].width && dims[0].lineHeight > dims[1].lineHeight ? 0 : 1; + return dims[index]; +}, function (text, config) { + return "".concat(text, "-").concat(config.fontSize, "-").concat(config.fontWeight, "-").concat(config.fontFamily); +}); +/** + * Applys d3 attributes + * + * @param {any} d3Elem D3 Element to apply the attributes onto + * @param {[string, string][]} attrs Object.keys equivalent format of key to value mapping of attributes + */ + +var d3Attrs = function d3Attrs(d3Elem, attrs) { + var _iterator2 = _createForOfIteratorHelper(attrs), + _step2; + + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + var attr = _step2.value; + d3Elem.attr(attr[0], attr[1]); + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } +}; +/** + * Gives attributes for an SVG's size given arguments + * + * @param {number} height The height of the SVG + * @param {number} width The width of the SVG + * @param {boolean} useMaxWidth Whether or not to use max-width and set width to 100% + * @returns {Map<'height' | 'width' | 'style', string>} Attributes for the SVG + */ + + +var calculateSvgSizeAttrs = function calculateSvgSizeAttrs(height, width, useMaxWidth) { + var attrs = new Map(); + attrs.set('height', height); + + if (useMaxWidth) { + attrs.set('width', '100%'); + attrs.set('style', "max-width: ".concat(width, "px;")); + } else { + attrs.set('width', width); + } + + return attrs; +}; +/** + * Applies attributes from `calculateSvgSizeAttrs` + * + * @param {SVGSVGElement} svgElem The SVG Element to configure + * @param {number} height The height of the SVG + * @param {number} width The width of the SVG + * @param {boolean} useMaxWidth Whether or not to use max-width and set width to 100% + */ + +var configureSvgSize = function configureSvgSize(svgElem, height, width, useMaxWidth) { + var attrs = calculateSvgSizeAttrs(height, width, useMaxWidth); + d3Attrs(svgElem, attrs); +}; +var setupGraphViewbox = function setupGraphViewbox(graph, svgElem, padding, useMaxWidth) { + var svgBounds = svgElem.node().getBBox(); + var sWidth = svgBounds.width; + var sHeight = svgBounds.height; + var width = graph._label.width; + var height = graph._label.height; + var tx = 0; + var ty = 0; + + if (sWidth > width) { + tx = (sWidth - width) / 2 + padding; + width = sWidth + padding * 2; + } else { + if (Math.abs(sWidth - width) >= 2 * padding + 1) { + width = width - padding; + } + } + + if (sHeight > height) { + ty = (sHeight - height) / 2 + padding; + height = sHeight + padding * 2; + } + + configureSvgSize(svgElem, height, width, useMaxWidth); // Ensure the viewBox includes the whole svgBounds area with extra space for padding + + var vBox = "0 0 ".concat(width, " ").concat(height); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('Graph.label', graph._label, 'swidth', sWidth, 'sheight', sHeight, 'width', width, 'height', height, 'tx', tx, 'ty', ty, 'vBox', vBox); + svgElem.attr('viewBox', vBox); + svgElem.select('g').attr('transform', "translate(".concat(tx, ", ").concat(ty, ")")); +}; +var initIdGenerator = /*#__PURE__*/function () { + function iterator(deterministic, seed) { + _classCallCheck(this, iterator); + + this.deterministic = deterministic; + this.seed = seed; + this.count = seed ? seed.length : 0; + } + + _createClass(iterator, [{ + key: "next", + value: function next() { + if (!this.deterministic) return Date.now(); + return this.count++; + } + }]); + + return iterator; +}(); +var decoder; +/** + * Decodes HTML, source: {@link https://github.com/shrpne/entity-decode/blob/v2.0.1/browser.js} + * + * @param {string} html HTML as a string + * @returns Unescaped HTML + */ + +var entityDecode = function entityDecode(html) { + decoder = decoder || document.createElement('div'); // Escape HTML before decoding for HTML Entities + + html = escape(html).replace(/%26/g, '&').replace(/%23/g, '#').replace(/%3B/g, ';'); // decoding + + decoder.innerHTML = html; + return unescape(decoder.textContent); +}; +/** + * Sanitizes directive objects + * + * @param {object} args Directive's JSON + */ + +var directiveSanitizer = function directiveSanitizer(args) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('directiveSanitizer called with', args); + + if (_typeof(args) === 'object') { + // check for array + if (args.length) { + args.forEach(function (arg) { + return directiveSanitizer(arg); + }); + } else { + // This is an object + Object.keys(args).forEach(function (key) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('Checking key', key); + + if (key.indexOf('__') === 0) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitize deleting __ option', key); + delete args[key]; + } + + if (key.indexOf('proto') >= 0) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitize deleting proto option', key); + delete args[key]; + } + + if (key.indexOf('constr') >= 0) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitize deleting constr option', key); + delete args[key]; + } + + if (key.indexOf('themeCSS') >= 0) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitizing themeCss option'); + args[key] = sanitizeCss(args[key]); + } + + if (key.indexOf('fontFamily') >= 0) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitizing fontFamily option'); + args[key] = sanitizeCss(args[key]); + } + + if (key.indexOf('altFontFamily') >= 0) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitizing altFontFamily option'); + args[key] = sanitizeCss(args[key]); + } + + if (_defaultConfig__WEBPACK_IMPORTED_MODULE_4__.configKeys.indexOf(key) < 0) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitize deleting option', key); + delete args[key]; + } else { + if (_typeof(args[key]) === 'object') { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitize deleting object', key); + directiveSanitizer(args[key]); + } + } + }); + } + } + + if (args.themeVariables) { + var kArr = Object.keys(args.themeVariables); + + for (var i = 0; i < kArr.length; i++) { + var k = kArr[i]; + var val = args.themeVariables[k]; + + if (val && val.match && !val.match(/^[a-zA-Z0-9#,";()%. ]+$/)) { + args.themeVariables[k] = ''; + } + } + } + + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('After sanitization', args); +}; +var sanitizeCss = function sanitizeCss(str) { + var startCnt = 0; + var endCnt = 0; + + for (var i = 0; i < str.length; i++) { + if (startCnt < endCnt) { + return '{ /* ERROR: Unbalanced CSS */ }'; + } + + if (str[i] === '{') { + startCnt++; + } else if (str[i] === '}') { + endCnt++; + } + } + + if (startCnt !== endCnt) { + return '{ /* ERROR: Unbalanced CSS */ }'; + } // Todo add more checks here + + + return str; +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + assignWithDepth: assignWithDepth, + wrapLabel: wrapLabel, + calculateTextHeight: calculateTextHeight, + calculateTextWidth: calculateTextWidth, + calculateTextDimensions: calculateTextDimensions, + calculateSvgSizeAttrs: calculateSvgSizeAttrs, + configureSvgSize: configureSvgSize, + setupGraphViewbox: setupGraphViewbox, + detectInit: detectInit, + detectDirective: detectDirective, + detectType: detectType, + isSubstringInArray: isSubstringInArray, + interpolateToCurve: interpolateToCurve, + calcLabelPosition: calcLabelPosition, + calcCardinalityPosition: calcCardinalityPosition, + calcTerminalLabelPosition: calcTerminalLabelPosition, + formatUrl: formatUrl, + getStylesFromArray: getStylesFromArray, + generateId: generateId, + random: random, + memoize: memoize, + runFunc: runFunc, + entityDecode: entityDecode, + initIdGenerator: initIdGenerator, + directiveSanitizer: directiveSanitizer, + sanitizeCss: sanitizeCss +}); + +/***/ }), + +/***/ "./node_modules/path-browserify/index.js": +/*!***********************************************!*\ + !*** ./node_modules/path-browserify/index.js ***! + \***********************************************/ +/***/ ((module) => { + +"use strict"; +// 'path' module extracted from Node.js v8.11.1 (only the posix part) +// transplited with Babel + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +function assertPath(path) { + if (typeof path !== 'string') { + throw new TypeError('Path must be a string. Received ' + JSON.stringify(path)); + } +} + +// Resolves . and .. elements in a path with directory names +function normalizeStringPosix(path, allowAboveRoot) { + var res = ''; + var lastSegmentLength = 0; + var lastSlash = -1; + var dots = 0; + var code; + for (var i = 0; i <= path.length; ++i) { + if (i < path.length) + code = path.charCodeAt(i); + else if (code === 47 /*/*/) + break; + else + code = 47 /*/*/; + if (code === 47 /*/*/) { + if (lastSlash === i - 1 || dots === 1) { + // NOOP + } else if (lastSlash !== i - 1 && dots === 2) { + if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) { + if (res.length > 2) { + var lastSlashIndex = res.lastIndexOf('/'); + if (lastSlashIndex !== res.length - 1) { + if (lastSlashIndex === -1) { + res = ''; + lastSegmentLength = 0; + } else { + res = res.slice(0, lastSlashIndex); + lastSegmentLength = res.length - 1 - res.lastIndexOf('/'); + } + lastSlash = i; + dots = 0; + continue; + } + } else if (res.length === 2 || res.length === 1) { + res = ''; + lastSegmentLength = 0; + lastSlash = i; + dots = 0; + continue; + } + } + if (allowAboveRoot) { + if (res.length > 0) + res += '/..'; + else + res = '..'; + lastSegmentLength = 2; + } + } else { + if (res.length > 0) + res += '/' + path.slice(lastSlash + 1, i); + else + res = path.slice(lastSlash + 1, i); + lastSegmentLength = i - lastSlash - 1; + } + lastSlash = i; + dots = 0; + } else if (code === 46 /*.*/ && dots !== -1) { + ++dots; + } else { + dots = -1; + } + } + return res; +} + +function _format(sep, pathObject) { + var dir = pathObject.dir || pathObject.root; + var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || ''); + if (!dir) { + return base; + } + if (dir === pathObject.root) { + return dir + base; + } + return dir + sep + base; +} + +var posix = { + // path.resolve([from ...], to) + resolve: function resolve() { + var resolvedPath = ''; + var resolvedAbsolute = false; + var cwd; + + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path; + if (i >= 0) + path = arguments[i]; + else { + if (cwd === undefined) + cwd = process.cwd(); + path = cwd; + } + + assertPath(path); + + // Skip empty entries + if (path.length === 0) { + continue; + } + + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/; + } + + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) + + // Normalize the path + resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute); + + if (resolvedAbsolute) { + if (resolvedPath.length > 0) + return '/' + resolvedPath; + else + return '/'; + } else if (resolvedPath.length > 0) { + return resolvedPath; + } else { + return '.'; + } + }, + + normalize: function normalize(path) { + assertPath(path); + + if (path.length === 0) return '.'; + + var isAbsolute = path.charCodeAt(0) === 47 /*/*/; + var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/; + + // Normalize the path + path = normalizeStringPosix(path, !isAbsolute); + + if (path.length === 0 && !isAbsolute) path = '.'; + if (path.length > 0 && trailingSeparator) path += '/'; + + if (isAbsolute) return '/' + path; + return path; + }, + + isAbsolute: function isAbsolute(path) { + assertPath(path); + return path.length > 0 && path.charCodeAt(0) === 47 /*/*/; + }, + + join: function join() { + if (arguments.length === 0) + return '.'; + var joined; + for (var i = 0; i < arguments.length; ++i) { + var arg = arguments[i]; + assertPath(arg); + if (arg.length > 0) { + if (joined === undefined) + joined = arg; + else + joined += '/' + arg; + } + } + if (joined === undefined) + return '.'; + return posix.normalize(joined); + }, + + relative: function relative(from, to) { + assertPath(from); + assertPath(to); + + if (from === to) return ''; + + from = posix.resolve(from); + to = posix.resolve(to); + + if (from === to) return ''; + + // Trim any leading backslashes + var fromStart = 1; + for (; fromStart < from.length; ++fromStart) { + if (from.charCodeAt(fromStart) !== 47 /*/*/) + break; + } + var fromEnd = from.length; + var fromLen = fromEnd - fromStart; + + // Trim any leading backslashes + var toStart = 1; + for (; toStart < to.length; ++toStart) { + if (to.charCodeAt(toStart) !== 47 /*/*/) + break; + } + var toEnd = to.length; + var toLen = toEnd - toStart; + + // Compare paths to find the longest common path from root + var length = fromLen < toLen ? fromLen : toLen; + var lastCommonSep = -1; + var i = 0; + for (; i <= length; ++i) { + if (i === length) { + if (toLen > length) { + if (to.charCodeAt(toStart + i) === 47 /*/*/) { + // We get here if `from` is the exact base path for `to`. + // For example: from='/foo/bar'; to='/foo/bar/baz' + return to.slice(toStart + i + 1); + } else if (i === 0) { + // We get here if `from` is the root + // For example: from='/'; to='/foo' + return to.slice(toStart + i); + } + } else if (fromLen > length) { + if (from.charCodeAt(fromStart + i) === 47 /*/*/) { + // We get here if `to` is the exact base path for `from`. + // For example: from='/foo/bar/baz'; to='/foo/bar' + lastCommonSep = i; + } else if (i === 0) { + // We get here if `to` is the root. + // For example: from='/foo'; to='/' + lastCommonSep = 0; + } + } + break; + } + var fromCode = from.charCodeAt(fromStart + i); + var toCode = to.charCodeAt(toStart + i); + if (fromCode !== toCode) + break; + else if (fromCode === 47 /*/*/) + lastCommonSep = i; + } + + var out = ''; + // Generate the relative path based on the path difference between `to` + // and `from` + for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) { + if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) { + if (out.length === 0) + out += '..'; + else + out += '/..'; + } + } + + // Lastly, append the rest of the destination (`to`) path that comes after + // the common path parts + if (out.length > 0) + return out + to.slice(toStart + lastCommonSep); + else { + toStart += lastCommonSep; + if (to.charCodeAt(toStart) === 47 /*/*/) + ++toStart; + return to.slice(toStart); + } + }, + + _makeLong: function _makeLong(path) { + return path; + }, + + dirname: function dirname(path) { + assertPath(path); + if (path.length === 0) return '.'; + var code = path.charCodeAt(0); + var hasRoot = code === 47 /*/*/; + var end = -1; + var matchedSlash = true; + for (var i = path.length - 1; i >= 1; --i) { + code = path.charCodeAt(i); + if (code === 47 /*/*/) { + if (!matchedSlash) { + end = i; + break; + } + } else { + // We saw the first non-path separator + matchedSlash = false; + } + } + + if (end === -1) return hasRoot ? '/' : '.'; + if (hasRoot && end === 1) return '//'; + return path.slice(0, end); + }, + + basename: function basename(path, ext) { + if (ext !== undefined && typeof ext !== 'string') throw new TypeError('"ext" argument must be a string'); + assertPath(path); + + var start = 0; + var end = -1; + var matchedSlash = true; + var i; + + if (ext !== undefined && ext.length > 0 && ext.length <= path.length) { + if (ext.length === path.length && ext === path) return ''; + var extIdx = ext.length - 1; + var firstNonSlashEnd = -1; + for (i = path.length - 1; i >= 0; --i) { + var code = path.charCodeAt(i); + if (code === 47 /*/*/) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + start = i + 1; + break; + } + } else { + if (firstNonSlashEnd === -1) { + // We saw the first non-path separator, remember this index in case + // we need it if the extension ends up not matching + matchedSlash = false; + firstNonSlashEnd = i + 1; + } + if (extIdx >= 0) { + // Try to match the explicit extension + if (code === ext.charCodeAt(extIdx)) { + if (--extIdx === -1) { + // We matched the extension, so mark this as the end of our path + // component + end = i; + } + } else { + // Extension does not match, so our result is the entire path + // component + extIdx = -1; + end = firstNonSlashEnd; + } + } + } + } + + if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length; + return path.slice(start, end); + } else { + for (i = path.length - 1; i >= 0; --i) { + if (path.charCodeAt(i) === 47 /*/*/) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + start = i + 1; + break; + } + } else if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // path component + matchedSlash = false; + end = i + 1; + } + } + + if (end === -1) return ''; + return path.slice(start, end); + } + }, + + extname: function extname(path) { + assertPath(path); + var startDot = -1; + var startPart = 0; + var end = -1; + var matchedSlash = true; + // Track the state of characters (if any) we see before our first dot and + // after any path separator we find + var preDotState = 0; + for (var i = path.length - 1; i >= 0; --i) { + var code = path.charCodeAt(i); + if (code === 47 /*/*/) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // extension + matchedSlash = false; + end = i + 1; + } + if (code === 46 /*.*/) { + // If this is our first dot, mark it as the start of our extension + if (startDot === -1) + startDot = i; + else if (preDotState !== 1) + preDotState = 1; + } else if (startDot !== -1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension + preDotState = -1; + } + } + + if (startDot === -1 || end === -1 || + // We saw a non-dot character immediately before the dot + preDotState === 0 || + // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + return ''; + } + return path.slice(startDot, end); + }, + + format: function format(pathObject) { + if (pathObject === null || typeof pathObject !== 'object') { + throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject); + } + return _format('/', pathObject); + }, + + parse: function parse(path) { + assertPath(path); + + var ret = { root: '', dir: '', base: '', ext: '', name: '' }; + if (path.length === 0) return ret; + var code = path.charCodeAt(0); + var isAbsolute = code === 47 /*/*/; + var start; + if (isAbsolute) { + ret.root = '/'; + start = 1; + } else { + start = 0; + } + var startDot = -1; + var startPart = 0; + var end = -1; + var matchedSlash = true; + var i = path.length - 1; + + // Track the state of characters (if any) we see before our first dot and + // after any path separator we find + var preDotState = 0; + + // Get non-dir info + for (; i >= start; --i) { + code = path.charCodeAt(i); + if (code === 47 /*/*/) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // extension + matchedSlash = false; + end = i + 1; + } + if (code === 46 /*.*/) { + // If this is our first dot, mark it as the start of our extension + if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1; + } else if (startDot !== -1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension + preDotState = -1; + } + } + + if (startDot === -1 || end === -1 || + // We saw a non-dot character immediately before the dot + preDotState === 0 || + // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + if (end !== -1) { + if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end); + } + } else { + if (startPart === 0 && isAbsolute) { + ret.name = path.slice(1, startDot); + ret.base = path.slice(1, end); + } else { + ret.name = path.slice(startPart, startDot); + ret.base = path.slice(startPart, end); + } + ret.ext = path.slice(startDot, end); + } + + if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/'; + + return ret; + }, + + sep: '/', + delimiter: ':', + win32: null, + posix: null +}; + +posix.posix = posix; + +module.exports = posix; + + +/***/ }), + +/***/ "@braintree/sanitize-url": +/*!******************************************!*\ + !*** external "@braintree/sanitize-url" ***! + \******************************************/ +/***/ ((module) => { + +"use strict"; +module.exports = require("@braintree/sanitize-url"); + +/***/ }), + +/***/ "d3": +/*!*********************!*\ + !*** external "d3" ***! + \*********************/ +/***/ ((module) => { + +"use strict"; +module.exports = require("d3"); + +/***/ }), + +/***/ "dagre": +/*!************************!*\ + !*** external "dagre" ***! + \************************/ +/***/ ((module) => { + +"use strict"; +module.exports = require("dagre"); + +/***/ }), + +/***/ "dagre-d3": +/*!***************************!*\ + !*** external "dagre-d3" ***! + \***************************/ +/***/ ((module) => { + +"use strict"; +module.exports = require("dagre-d3"); + +/***/ }), + +/***/ "dagre-d3/lib/label/add-html-label.js": +/*!*******************************************************!*\ + !*** external "dagre-d3/lib/label/add-html-label.js" ***! + \*******************************************************/ +/***/ ((module) => { + +"use strict"; +module.exports = require("dagre-d3/lib/label/add-html-label.js"); + +/***/ }), + +/***/ "dompurify": +/*!****************************!*\ + !*** external "dompurify" ***! + \****************************/ +/***/ ((module) => { + +"use strict"; +module.exports = require("dompurify"); + +/***/ }), + +/***/ "graphlib": +/*!***************************!*\ + !*** external "graphlib" ***! + \***************************/ +/***/ ((module) => { + +"use strict"; +module.exports = require("graphlib"); + +/***/ }), + +/***/ "khroma": +/*!*************************!*\ + !*** external "khroma" ***! + \*************************/ +/***/ ((module) => { + +"use strict"; +module.exports = require("khroma"); + +/***/ }), + +/***/ "moment-mini": +/*!******************************!*\ + !*** external "moment-mini" ***! + \******************************/ +/***/ ((module) => { + +"use strict"; +module.exports = require("moment-mini"); + +/***/ }), + +/***/ "stylis": +/*!*************************!*\ + !*** external "stylis" ***! + \*************************/ +/***/ ((module) => { + +"use strict"; +module.exports = require("stylis"); + +/***/ }), + +/***/ "?1da1": +/*!********************!*\ + !*** fs (ignored) ***! + \********************/ +/***/ (() => { + +/* (ignored) */ + +/***/ }), + +/***/ "?35ed": +/*!********************!*\ + !*** fs (ignored) ***! + \********************/ +/***/ (() => { + +/* (ignored) */ + +/***/ }), + +/***/ "?3c87": +/*!********************!*\ + !*** fs (ignored) ***! + \********************/ +/***/ (() => { + +/* (ignored) */ + +/***/ }), + +/***/ "?dbae": +/*!********************!*\ + !*** fs (ignored) ***! + \********************/ +/***/ (() => { + +/* (ignored) */ + +/***/ }), + +/***/ "?8ed1": +/*!********************!*\ + !*** fs (ignored) ***! + \********************/ +/***/ (() => { + +/* (ignored) */ + +/***/ }), + +/***/ "?2b40": +/*!********************!*\ + !*** fs (ignored) ***! + \********************/ +/***/ (() => { + +/* (ignored) */ + +/***/ }), + +/***/ "?c5f1": +/*!********************!*\ + !*** fs (ignored) ***! + \********************/ +/***/ (() => { + +/* (ignored) */ + +/***/ }), + +/***/ "?a3fa": +/*!********************!*\ + !*** fs (ignored) ***! + \********************/ +/***/ (() => { + +/* (ignored) */ + +/***/ }), + +/***/ "?ebf4": +/*!********************!*\ + !*** fs (ignored) ***! + \********************/ +/***/ (() => { + +/* (ignored) */ + +/***/ }), + +/***/ "?e940": +/*!********************!*\ + !*** fs (ignored) ***! + \********************/ +/***/ (() => { + +/* (ignored) */ + +/***/ }), + +/***/ "?a3b8": +/*!********************!*\ + !*** fs (ignored) ***! + \********************/ +/***/ (() => { + +/* (ignored) */ + +/***/ }), + +/***/ "?0f62": +/*!********************!*\ + !*** fs (ignored) ***! + \********************/ +/***/ (() => { + +/* (ignored) */ + +/***/ }), + +/***/ "./package.json": +/*!**********************!*\ + !*** ./package.json ***! + \**********************/ +/***/ ((module) => { + +"use strict"; +module.exports = JSON.parse('{"name":"mermaid","version":"9.1.3","description":"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.","main":"dist/mermaid.core.js","module":"dist/mermaid.esm.min.mjs","exports":{".":{"require":"./dist/mermaid.core.js","import":"./dist/mermaid.esm.min.mjs"},"./*":"./*"},"keywords":["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph"],"scripts":{"build:development":"webpack --mode development --progress --color","build:production":"webpack --mode production --progress --color","build":"concurrently \\"yarn build:development\\" \\"yarn build:production\\"","postbuild":"documentation build src/mermaidAPI.js src/config.js src/defaultConfig.js --shallow -f md --markdown-toc false > docs/Setup.md","build:watch":"yarn build:development --watch","release":"yarn build","lint":"eslint ./ --ext .js,.json,.html,.md","lint:fix":"yarn lint --fix","e2e:depr":"yarn lint && jest e2e --config e2e/jest.config.js","cypress":"cypress run","e2e":"start-server-and-test dev http://localhost:9000/ cypress","e2e-upd":"yarn lint && jest e2e -u --config e2e/jest.config.js","dev":"webpack serve --config ./.webpack/webpack.config.e2e.babel.js","ci":"jest src/.*","test":"yarn lint && jest src/.*","test:watch":"jest --watch src","prepublishOnly":"yarn build && yarn test","prepare":"husky install && yarn build","pre-commit":"lint-staged"},"repository":{"type":"git","url":"https://github.com/knsv/mermaid"},"author":"Knut Sveidqvist","license":"MIT","standard":{"ignore":["**/parser/*.js","dist/**/*.js","cypress/**/*.js"],"globals":["page"]},"dependencies":{"@braintree/sanitize-url":"^6.0.0","d3":"^7.0.0","dagre":"^0.8.5","dagre-d3":"^0.6.4","dompurify":"2.3.8","graphlib":"^2.1.8","khroma":"^2.0.0","moment-mini":"^2.24.0","stylis":"^4.0.10"},"devDependencies":{"@applitools/eyes-cypress":"^3.25.7","@babel/core":"^7.14.6","@babel/eslint-parser":"^7.14.7","@babel/preset-env":"^7.14.7","@babel/register":"^7.14.5","@commitlint/cli":"^17.0.0","@commitlint/config-conventional":"^17.0.0","babel-jest":"^28.0.3","babel-loader":"^8.2.2","concurrently":"^7.0.0","coveralls":"^3.0.2","css-to-string-loader":"^0.1.3","cypress":"10.2.0","cypress-image-snapshot":"^4.0.1","documentation":"13.2.0","eslint":"^8.4.1","eslint-config-prettier":"^8.3.0","eslint-plugin-cypress":"^2.12.1","eslint-plugin-html":"^6.2.0","eslint-plugin-jest":"^26.0.0","eslint-plugin-jsdoc":"^39.1.0","eslint-plugin-json":"^3.1.0","eslint-plugin-markdown":"^2.2.1","eslint-plugin-prettier":"^4.0.0","husky":"^8.0.0","identity-obj-proxy":"^3.0.0","jest":"^28.0.3","jest-environment-jsdom":"^28.0.2","jison":"^0.4.18","js-base64":"3.7.2","lint-staged":"^13.0.0","moment":"^2.23.0","path-browserify":"^1.0.1","prettier":"^2.3.2","prettier-plugin-jsdoc":"^0.3.30","start-server-and-test":"^1.12.6","terser-webpack-plugin":"^5.2.4","webpack":"^5.53.0","webpack-cli":"^4.7.2","webpack-dev-server":"^4.3.0","webpack-merge":"^5.8.0","webpack-node-externals":"^3.0.0"},"resolutions":{"d3":"^7.0.0"},"files":["dist"],"sideEffects":["**/*.css","**/*.scss"]}'); + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ id: moduleId, +/******/ loaded: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = __webpack_module_cache__; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/node module decorator */ +/******/ (() => { +/******/ __webpack_require__.nmd = (module) => { +/******/ module.paths = []; +/******/ if (!module.children) module.children = []; +/******/ return module; +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +/******/ +/******/ // module cache are used so entry inlining is disabled +/******/ // startup +/******/ // Load entry module and return exports +/******/ var __webpack_exports__ = __webpack_require__(__webpack_require__.s = "./src/mermaid.js"); +/******/ __webpack_exports__ = __webpack_exports__["default"]; +/******/ +/******/ return __webpack_exports__; +/******/ })() +; +}); +//# sourceMappingURL=mermaid.core.js.map \ No newline at end of file diff --git a/web/_static/mermaid-js/mermaid.core.js.map b/web/_static/mermaid-js/mermaid.core.js.map new file mode 100644 index 0000000..6331d3c --- /dev/null +++ b/web/_static/mermaid-js/mermaid.core.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mermaid.core.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;ACVA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,8gDAA8gD;AACzhD,aAAa,ioCAAioC;AAC9oC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,sBAAsB;AAChE;AACA;AACA;AACA;AACA;AACA,4CAA4C,wCAAwC;AACpF;AACA;AACA,2CAA2C,oBAAoB;AAC/D;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA,2CAA2C;AAC3C;AACA;AACA,sBAAsB;AACtB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,8CAA8C,mCAAmC,yCAAyC;AAC1H;AACA;AACA,8CAA8C,yCAAyC;AACvF;AACA;AACA,8CAA8C,kCAAkC,oCAAoC;AACpH;AACA;AACA,8CAA8C,yCAAyC;AACvF;AACA;AACA,8CAA8C,0CAA0C;AACxF;AACA;AACA,8CAA8C,0CAA0C;AACxF;AACA;AACA;AACA;AACA;AACA,8CAA8C,2CAA2C;AACzF;AACA;AACA,8CAA8C,oDAAoD;AAClG;AACA;AACA,8CAA8C,2CAA2C;AACzF;AACA;AACA,8CAA8C,8CAA8C;AAC5F;AACA;AACA,8CAA8C,iDAAiD;AAC/F;AACA;AACA,8CAA8C,oDAAoD;AAClG;AACA;AACA,8CAA8C,uDAAuD;AACrG;AACA;AACA,8CAA8C,0DAA0D;AACxG;AACA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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,WAAW;AACX;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;A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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,sBAAsB;AACtB;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,iDAAiD,wBAAwB;AACzE;AACA;AACA,sBAAsB,mCAAmC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA,kCAAkC;AAClC;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB,qCAAqC;AACvD;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB,+BAA+B;AACjD;AACA;AACA,kBAAkB,uCAAuC;AACzD;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB,+CAA+C;AACjE;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,SAAS,yEAAyE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,0EAA0E,EAAE,QAAQ,sDAAsD,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,uBAAuB,oBAAoB,4NAA4N,EAAE,UAAU,E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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,WAAW;AACX;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,0BAA0B;AAC1B;AACA,iCAAiC;AACjC;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iCAAiC;AAChE;AACA;AACA;AACA;AACA;AACA,wCAAwC,mBAAmB;AAC3D;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iBAAiB,yIAAyI,8BAA8B,mBAAmB,yBAAyB,0JAA0J,cAAc,aAAa,yFAAyF,oBAAoB,WAAW,yBAAyB,0fAA0f,EAAE,MAAM,YAAY,EAAE;AAC1jC,aAAa,uBAAuB,kCAAkC,cAAc,+BAA+B,cAAc,+BAA+B,kBAAkB,gCAAgC,mBAAmB,gCAAgC,mBAAmB,8BAA8B,kBAAkB,kCAAkC,kBAAkB,qCAAqC,SAAS,kCAAkC,WAAW,2CAA2C,YAAY,kCAAkC,aAAa,kCAAkC,WAAW,kCAAkC,YAAY;AACxpB,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;AC14BA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,k0BAAk0B;AAC70B,aAAa,8eAA8e;AAC3f;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uEAAuE;AACvE;AACA;AACA;;AAEA,4CAA4C;AAC5C;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,kBAAkB,mCAAmC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,YAAY;AACZ;AACA;AACA,YAAY;AACZ;AACA;AACA,YAAY;AACZ;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB;AACnB,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA;AACA,CAAC;AACD,SAAS,0BAA0B,EAAE,MAAM,cAAc,IAAI,GAAG,0BAA0B,EAAE,cAAc,EAAE,UAAU,EAAE,iGAAiG,EAAE,QAAQ,EAAE,uBAAuB,gCAAgC,QAAQ,gBAAgB,gEAAgE,uDAAuD,kDAAkD,GAAG,UAAU,EAAE,UAAU,EAAE,UAAU,6BAA6B,UAAU,GAAG,UAAU,EAAE,gBAAgB,EAAE,UAAU,eAAe,aAAa,EAAE,mCAAmC,EAAE,0BAA0B,oGAAoG,aAAa,eAAe,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,gBAAgB,mCAAmC,EAAE,gBAAgB,EAAE,UAAU,EAAE,kCAAkC,4CAA4C,UAAU,EAAE,0BAA0B,gBAAgB,UAAU,eAAe,6BAA6B,2BAA2B,UAAU,uEAAuE,aAAa;AACxuC,iBAAiB,mEAAmE;AACpF;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;AACA;AACA,gCAAgC;AAChC;AACA,yBAAyB;AACzB;AACA,gCAAgC;AAChC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,0BAA0B,iBAAiB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,0HA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AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA,2BAA2B;AAC3B;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,6CAA6C,8CAA8C,WAAW;AACtG;AACA;AACA,+CAA+C,gDAAgD,WAAW;AAC1G;AACA;AACA,iCAAiC,aAAa;AAC9C;AACA;AACA,gCAAgC,aAAa;AAC7C;AACA;AACA,iCAAiC;AACjC;AACA;AACA,mCAAmC,qDAAqD;AACxF;AACA;AACA,oBAAoB;AACpB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,+BAA+B,kBAAkB;AACjD;AACA;AACA,uBAAuB;AACvB;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,6CAA6C,UAAU;AACvD;AACA;AACA,kCAAkC,UAAU;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB,qCAAqC;AACvD;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB,+CAA+C;AACjE;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB,+BAA+B;AACjD;AACA;AACA,kBAAkB;AAClB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AAoS,2BAA2B,OAAO,kBAAkB,uGAAuG,kBAAkB,sJAAsJ,kBAAkB,sJAAsJ,GAAG,gSAAgS,EAAE,gVAAgV,EAAE,sHAAsH,EAAE,sHAAsH,6CAA6C,SAAS,kBAAkB,SAAS;AACr/nB,iBAAiB,mCAAmC;AACpD;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,WAAW;AACX;AACA;AACA;AACA,sCAAsC;AACtC;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA,yBAAyB;AACzB;AACA,gCAAgC;AAChC;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iBAAiB,iBAAiB,8BAA8B,mBAAmB,yBAAyB,mBAAmB,0HAA0H,cAAc,aAAa,mxBAAmxB,21JAA21J,UAAU;AAC54L,aAAa,mBAAmB,6BAA6B,kBAAkB,gCAAgC,mBAAmB,gCAAgC,mBAAmB,8BAA8B,iBAAiB,kCAAkC,iBAAiB,qCAAqC,SAAS,kCAAkC,UAAU,kCAAkC,WAAW,6BAA6B,QAAQ,6DAA6D,wBAAwB,kCAAkC,cAAc,+BAA+B,cAAc,8BAA8B,WAAW,kCAAkC,YAAY;AAC5sB,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;AC7hCA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,opBAAopB;AAC/pB,aAAa,ycAAyc;AACtd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,aAAa;AACb;AACA;AACA,oCAAoC;AACpC;AACA;AACA,iCAAiC;AACjC;AACA;AACA,iCAAiC;AACjC;AACA;AACA,qCAAqC;AACrC;AACA;AACA,qCAAqC;AACrC;AACA;AACA,sBAAsB;AACtB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,gCAAgC;AAChC;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB;AAClB;AACA;AACA,kBAAkB,2CAA2C;AAC7D;AACA;AACA,kBAAkB,+CAA+C;AACjE;AACA;AACA,kBAAkB,yCAAyC;AAC3D;AACA;AACA,kBAAkB,6CAA6C;AAC/D;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA;AACA,CAAC;AACD,SAAS,0BAA0B,EAAE,MAAM,EAAE,0BAA0B,cAAc,IAAI,GAAG,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,gKAAgK,EAAE,uBAAuB,gCAAgC,QAAQ,gBAAgB,+HAA+H,2IAA2I,UAAU,EAAE,UAAU,4CAA4C,UAAU,gBAAgB,oBAAoB,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,sEAAsE,oBAAoB,gBAAgB,UAAU,iBAAiB,aAAa,EAAE,UAAU,eAAe,UAAU,8BAA8B,UAAU,GAAG,UAAU;AACngC,iBAAiB,qCAAqC;AACtD;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;AACA;AACA,sCAAsC;AACtC;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA,gCAAgC;AAChC;AACA,yBAAyB;AACzB;AACA,gCAAgC;AAChC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iBAAiB,kBAAkB,gCAAgC,oBAAoB,gIAAgI,eAAe,cAAc,kBAAkB,qBAAqB,8TAA8T,2EAA2E,2BAA2B,2BAA2B,6BAA6B,qDAAqD,iCAAiC,2BAA2B,kBAAkB,kBAAkB;AAC54B,aAAa,uBAAuB,kCAAkC,cAAc,8BAA8B,cAAc,8BAA8B,oBAAoB,6BAA6B,kBAAkB,gCAAgC,mBAAmB,gCAAgC,mBAAmB,8BAA8B,iBAAiB,kCAAkC,iBAAiB,qCAAqC,SAAS,kCAAkC,UAAU,kCAAkC,YAAY;AACjjB,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;ACnxBA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,8uBAA8uB,0BAA0B;AACnxB,aAAa,idAAid,EAAE;AAChe;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA;AACA,CAAC;AACD,SAAS,kDAAkD,EAAE,MAAM,EAAE,mDAAmD,EAAE,mDAAmD,EAAE,2CAA2C,+CAA+C,gBAAgB,EAAE,WAAW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AgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,GAAG,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,4BAA4B,EAAE,WAAW,EAAE,4BAA4B,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,4BAA4B,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,4BAA4B,EAAE,WAAW,EAAE,4BAA4B,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,4BAA4B;AACxmH,iBAAiB,kEAAkE;AACnF;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;AACA;AACA,sCAAsC;AACtC;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA,gCAAgC;AAChC;AACA,yBAAyB;AACzB;AACA,gCAAgC;AAChC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,wBAAwB,WAAW;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA,+BAA+B;AAC/B;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iBAAiB,kBAAkB,gCAAgC,oBAAoB,gIAAgI,eAAe,cAAc;AACpP,aAAa,uBAAuB,kCAAkC,cAAc,8BAA8B,cAAc,8BAA8B,oBAAoB,6BAA6B,kBAAkB,gCAAgC,mBAAmB,gCAAgC,mBAAmB,8BAA8B,YAAY,kCAAkC,WAAW,kCAAkC,YAAY;AAC5c,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;AC57BA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,mHAAmH;AAC9H,aAAa,gDAAgD;AAC7D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,SAAS,YAAY,EAAE,MAAM,cAAc,IAAI,GAAG,iCAAiC,EAAE,QAAQ;AAC7F,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,aAAa,WAAW;AACxB,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;AC7mBA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,0WAA0W,mHAAmH;AACxe,aAAa,4NAA4N,2FAA2F;AACpU;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,gCAAgC;AAChC;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA;AACA,CAAC;AACD,SAAS,mDAAmD,EAAE,MAAM,EAAE,oDAAoD,EAAE,oDAAoD,YAAY,cAAc,6CAA6C,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,YAAY,8EAA8E,aAAa,KAAK,GAAG,uBAAuB,iCAAiC,0BAA0B,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,sDAAsD,8EAA8E,iBAAiB,gBAAgB,oFAAoF,aAAa,EAAE,UAAU;AAC1yB,iBAAiB,qCAAqC;AACtD;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;AACA;AACA,sCAAsC;AACtC;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA,4BAA4B,kBAAkB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,0BAA0B;AAC1B;AACA,iCAAiC;AACjC;AACA,0BAA0B;AAC1B;AACA,iCAAiC;AACjC;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iBAAiB,kBAAkB,gCAAgC,oBAAoB,0BAA0B,oBAAoB,sNAAsN,eAAe,cAAc;AACxX,aAAa,uBAAuB,kCAAkC,cAAc,+BAA+B,cAAc,+BAA+B,oBAAoB,6BAA6B,kBAAkB,gCAAgC,mBAAmB,gCAAgC,mBAAmB,8BAA8B,UAAU,+BAA+B,WAAW,kCAAkC,YAAY;AACzc,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;AC3qBA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,opCAAopC;AAC/pC,aAAa,gyBAAgyB;AAC7yB;AACA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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S,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,gDAAgD,EAAE,gDAAgD,EAAE,gDAAgD,EAAE,gDAAgD,EAAE,kCAAkC,EAAE,kCAAkC;AACn7F,iBAAiB,iRAAiR;AAClS;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;AACA;AACA,sCAAsC;AACtC;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA,yBAAyB;AACzB;AACA,gCAAgC;AAChC;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA,CAAC;AACD,iBAAiB,kBAAkB,gCAAgC,oBAAoB,gCAAgC,wHAAwH,eAAe,cAAc,iHAAiH,WAAW,qoBAAqoB;AAC7gC,aAAa,uBAAuB,kCAAkC,cAAc,8BAA8B,cAAc,8BAA8B,oBAAoB,6BAA6B,kBAAkB,gCAAgC,mBAAmB,gCAAgC,mBAAmB,8BAA8B,cAAc,6BAA6B,UAAU,6BAA6B,WAAW,kCAAkC,YAAY;AAChf,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;ACrzBA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,wrCAAwrC;AACnsC,aAAa,kxBAAkxB;AAC/xB;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gDAAgD;AAC/E;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,yBAAyB,gDAAgD;AACzE;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,UAAU;AACV;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,UAAU;AACV;AACA;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;AACA,wCAAwC;AACxC;AACA;AACA,wCAAwC;AACxC;AACA;AACA,sBAAsB;AACtB;AACA;AACA,sBAAsB;AACtB;AACA;;AAEA,oBAAoB,0FAA0F;AAC9G,iBAAiB,qEAAqE;AACtF;AACA;AACA;;AAEA,oBAAoB,wFAAwF;AAC5G,iBAAiB,oFAAoF;AACrG;AACA;AACA;;AAEA,oBAAoB,uFAAuF;AAC3G,iBAAiB,mFAAmF;AACpG;AACA;AACA;;AAEA;AACA,oBAAoB,uFAAuF;AAC3G;AACA;AACA,iBAAiB,gDAAgD;AACjE;AACA;AACA;;AAEA;AACA,oBAAoB,uFAAuF;AAC3G;AACA;AACA,iBAAiB,gDAAgD;AACjE;AACA;AACA;;AAEA;AACA,oBAAoB,sGAAsG;AAC1H;AACA;AACA,iBAAiB,0DAA0D;AAC3E;AACA;AACA;;AAEA,oBAAoB,6FAA6F;AACjH,iBAAiB,uFAAuF;AACxG;AACA;AACA;AACA,4BAA4B,8FAA8F;AAC1H;AACA;AACA,4BAA4B,gFAAgF;AAC5G;AACA;AACA,4BAA4B,kFAAkF;AAC9G;AACA;;AAEA,uBAAuB,sEAAsE;AAC7F;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,qFAAqF;AAC5G;AACA;;AAEA,uBAAuB,mDAAmD;AAC1E;AACA;AACA;;AAEA,uBAAuB,mDAAmD;AAC1E;AACA;AACA;;AAEA,uBAAuB,wDAAwD;AAC/E;AACA;AACA;;AAEA,uBAAuB,qDAAqD;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,4FAA4F;AAC1H,gBAAgB;AAChB;AACA;AACA;AACA,8BAA8B,4FAA4F;AAC1H,eAAe;AACf;AACA;AACA;AACA,8BAA8B,4FAA4F;AAC1H;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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AE,cAAc,EAAE,qBAAqB,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,wEAAwE,WAAW,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,sDAAsD,aAAa,aAAa,aAAa,aAAa,aAAa,GAAG,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;AAC9rJ,iBAAiB,oOAAoO;AACrP;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;AACA;AACA,sCAAsC;AACtC;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA,2BAA2B;AAC3B;AACA,yCAAyC,qBAAqB;AAC9D;AACA,0BAA0B,iBAAiB,oBAAoB;AAC/D;AACA,0BAA0B,iBAAiB;AAC3C;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,6BAA6B;AAC7B;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,0BAA0B;AAC1B;AACA,iCAAiC;AACjC;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iBAAiB,kBAAkB,gCAAgC,oBAAoB,uFAAuF,oBAAoB,2FAA2F,iCAAiC,0NAA0N,uNAAuN,yBAAyB,wHAAwH,eAAe,cAAc,mFAAmF,qBAAqB,yCAAyC,4IAA4I;AAC1rC,aAAa,uBAAuB,kCAAkC,cAAc,+BAA+B,cAAc,+BAA+B,mBAAmB,gCAAgC,mBAAmB,kCAAkC,kBAAkB,kCAAkC,OAAO,mCAAmC,UAAU,sCAAsC,SAAS,mCAAmC,YAAY;AAC9c,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;ACp7BA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,ynBAAynB,qJAAqJ;AACzxB,aAAa,wbAAwb,6HAA6H;AAClkB;AACA;AACA;;AAEA;AACA;AACA;AACA,yCAAyC,yBAAyB;AAClE;AACA;AACA;AACA;AACA;;AAEA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,WAAW;AACvD;AACA;AACA,6DAA6D,WAAW;AACxE;AACA;;AAEA,2CAA2C,iCAAiC;AAC5E,iBAAiB,4BAA4B,+DAA+D,WAAW;AACvH;AACA;AACA;;AAEA,sEAAsE;AACtE,iBAAiB,4BAA4B,+DAA+D,WAAW,8DAA8D;AACrL;AACA;AACA;;AAEA,2EAA2E;AAC3E,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;;AAEA,2GAA2G;AAC3G,kBAAkB;AAClB;AACA;AACA;;AAEA,iBAAiB;AACjB;AACA;AACA;;AAEA,iBAAiB;AACjB;AACA;AACA;;AAEA,iBAAiB;AACjB;AACA;AACA;;AAEA,iBAAiB;AACjB;AACA;AACA;;AAEA,6GAA6G;AAC7G,iBAAiB,0CAA0C;AAC3D;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA,wBAAwB,QAAQ;AAChC;AACA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA;AACA,CAAC;AACD,SAAS,sCAAsC,EAAE,MAAM,EAAE,sCAAsC,EAAE,sCAAsC,EAAE,uCAAuC,yEAAyE,KAAK,GAAG,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,0LAA0L,EAAE,uBAAuB,iCAAiC,iKAAiK,yCAAyC,oBAAoB,iBAAiB,UAAU,eAAe,UAAU,GAAG,UAAU,0DAA0D,oCAAoC,8BAA8B,UAAU,EAAE,UAAU,kHAAkH,gBAAgB,2CAA2C,oBAAoB,0BAA0B,KAAK,GAAG,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,8BAA8B,aAAa,EAAE,UAAU,eAAe,UAAU,GAAG,4LAA4L,eAAe,UAAU,GAAG,UAAU,EAAE,UAAU,sDAAsD,KAAK,+BAA+B,4LAA4L;AACt1D,iBAAiB,gEAAgE;AACjF;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA,6BAA6B,kCAAkC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,wCAAwC;AAC1E;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,0BAA0B;AAC1B;AACA,iCAAiC;AACjC;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE;AAChE;AACA,wBAAwB,0CAA0C,yCAAyC;AAC3G;AACA,wBAAwB,yCAAyC,yCAAyC;AAC1G;AACA,wBAAwB,0CAA0C,yCAAyC;AAC3G;AACA,wBAAwB,yCAAyC,yCAAyC;AAC1G;AACA,wBAAwB,yCAAyC,yCAAyC;AAC1G;AACA,wBAAwB,0CAA0C,yCAAy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AC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;ACx1BA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA,eAAe,kCAAkC;AACjD,iBAAiB,kCAAkC;AACnD;AACA;AACA;AACA,qBAAqB,IAAI;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oJAAoJ;AACpJ,SAAS;;AAET;AACA;AACA,qBAAqB,+BAA+B;AACpD;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW,YAAY,IAAI,WAAW,SAAS;AACvE,cAAc,4BAA4B;AAC1C,MAAM;AACN,WAAW,qcAAqc;AAChd,aAAa,uSAAuS;AACpT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA,sBAAsB;AACtB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,gCAAgC;AAChC;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA;AACA,CAAC;AACD,SAAS,0BAA0B,EAAE,MAAM,cAAc,IAAI,GAAG,0BAA0B,EAAE,cAAc,EAAE,UAAU,EAAE,kGAAkG,EAAE,QAAQ,EAAE,uBAAuB,gCAAgC,QAAQ,gBAAgB,iEAAiE,0CAA0C,UAAU,EAAE,UAAU,8BAA8B,UAAU,gBAAgB,UAAU,EAAE,gBAAgB,EAAE,UAAU,sEAAsE,aAAa,EAAE,UAAU,EAAE,UAAU;AACjoB,iBAAiB,qCAAqC;AACtD;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,kCAAkC;AAClC,sBAAsB;AACtB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL,sDAAsD;AACtD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;AACL,UAAU,wBAAwB;AAClC;AACA;AACA;AACA,sCAAsC;AACtC;AACA,sCAAsC;AACtC;AACA,yBAAyB,6BAA6B;AACtD;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,0BAA0B;AAC1B;AACA,iCAAiC;AACjC;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iBAAiB,kBAAkB,gCAAgC,oBAAoB,yBAAyB,oBAAoB,2FAA2F,wHAAwH,eAAe,cAAc,2BAA2B,kBAAkB,kBAAkB;AACnb,aAAa,kBAAkB,8BAA8B,mBAAmB,gCAAgC,kBAAkB,gCAAgC,wBAAwB,kCAAkC,cAAc,+BAA+B,cAAc,+BAA+B,YAAY;AAClU,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,CAAC;;;AAGD,IAAI,IAAgE;AACpE,cAAc;AACd,cAAc;AACd,aAAa,iBAAiB;AAC9B,YAAY;AACZ;AACA;AACA;AACA;AACA,iBAAiB,qDAA0B,CAAC,sFAAyB;AACrE;AACA;AACA,IAAI,KAA6B,IAAI,4CAAY;AACjD;AACA;AACA;;;;;;;;;;;;;;;AClrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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W,eAAX,EAA4B,aAA5B,EAA2C,aAA3C,CAxFK;;EA0Fb;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE8a,gBAAgB,EAAE,KAtGL;;EAwGb;AACF;AACA;AACA;AACA;EACEC,mBAAmB,EAAEvZ,SA7GR;;EA+Gb;EACAG,SAAS,EAAE;IACT;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIqZ,cAAc,EAAE,CAbP;;IAeT;AACJ;AACA;AACA;AACA;AACA;AACA;IACIpZ,UAAU,EAAE,IAtBH;;IAwBT;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIqZ,WAAW,EAAE,EApCJ;;IAsCT;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIC,WAAW,EAAE,EAlDJ;;IAoDT;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIpQ,KAAK,EAAE,OA7DE;IA8DT;IACA;IACA3I,OAAO,EAAE,EAhEA;;IAkET;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIgZ,WAAW,EAAE,IA9EJ;;IAgFT;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIC,eAAe,EAAE;EA5FR,CAhHE;;EA+Mb;EACAC,QAAQ,EAAE;IACRC,sBAAsB,EAAE,KADhB;;IAER;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,eAAe,EAAE,EATT;;IAWR;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,cAAc,EAAE,EAlBR;;IAoBR;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,cAAc,EAAE,EA3BR;;IA6BR;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,WAAW,EAAE,EApCL;;IAsCR;AACJ;AACA;AACA;AACA;AACA;AACA;IACIzZ,KAAK,EAAE,GA7CC;;IA+CR;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,MAAM,EAAE,EAtDA;;IAwDR;AACJ;AACA;AACA;AACA;AACA;AACA;IACIyZ,SAAS,EAAE,EA/DH;;IAiER;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,aAAa,EAAE,CAxEP;;IA0ER;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,UAAU,EAAE,EAjFJ;;IAmFR;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,aAAa,EAAE,EA1FP;;IA4FR;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,YAAY,EAAE,QAnGN;;IAqGR;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,YAAY,EAAE,IA5GN;;IA8GR;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIC,UAAU,EAAE,KAvHJ;;IAyHR;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIC,eAAe,EAAE,CApIT;;IAsIR;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIf,WAAW,EAAE,IAhJL;;IAkJR;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIgB,WAAW,EAAE,KA7JL;;IA+JR;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,mBAAmB,EAAE,KAtKb;;IAwKR;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,aAAa,EAAE,EA/KP;;IAiLR;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,eAAe,EAAE,yBAxLT;;IA0LR;AACJ;AACA;AACA;AACA;IACIC,eAAe,EAAE,GA/LT;;IAiMR;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,YAAY,EAAE,EAxMN;;IA0MR;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,cAAc,EAAE,4CAjNR;;IAmNR;AACJ;AACA;AACA;AACA;IACIC,cAAc,EAAE,GAxNR;;IA0NR;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC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AACA;IACIC,YAAY,EAAE,EA9CT;;IAgDL;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,WAAW,EAAE,EAvDR;;IAyDL;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,oBAAoB,EAAE,EAhEjB;;IAkEL;AACJ;AACA;AACA;AACA;AACA;AACA;IACIX,QAAQ,EAAE,EAzEL;;IA2EL;AACJ;AACA;AACA;AACA;AACA;AACA;IACIY,eAAe,EAAE,EAlFZ;;IAoFL;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,mBAAmB,EAAE,CA3FhB;;IA6FL;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIC,UAAU,EAAE,UAxGP;;IA0GL;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACI/C,WAAW,EAAE,IAtHR;;IAwHL;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIgD,OAAO,EAAE,KAjIJ;IAmILC,QAAQ,EAAE5c;EAnIL,CAhgBM;;EAsoBb;EACA6c,OAAO,EAAE;IACP;AACJ;AACA;AACA;AACA;AACA;AACA;IACI7C,cAAc,EAAE,EART;;IAUP;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,cAAc,EAAE,EAjBT;;IAmBP;AACJ;AACA;AACA;AACA;AACA;AACA;IACI6C,UAAU,EAAE,GA1BL;;IA4BP;AACJ;AACA;AACA;AACA;AACA;AACA;IACIrc,KAAK,EAAE,GAnCA;;IAqCP;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,MAAM,EAAE,EA5CD;;IA8CP;AACJ;AACA;AACA;AACA;AACA;AACA;IACIyZ,SAAS,EAAE,EArDJ;;IAuDP;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,aAAa,EAAE,CA9DR;;IAgEP;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,UAAU,EAAE,EAvEL;;IAyEP;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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LC,UAAU,EAAE,CARP;IASL;IACAC,WAAW,EAAE,CAVR;IAWL;IACA;IACAC,cAAc,EAAE,IAbX;IAcLjC,QAAQ,EAAE,EAdL;IAeLkC,WAAW,EAAE,EAfR;IAgBLC,gBAAgB,EAAE,IAhBb;IAiBLC,iBAAiB,EAAE,EAjBd;IAkBLC,MAAM,EAAE,CAlBH;;IAmBL;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACItE,WAAW,EAAE,IA/BR;;IAgCL;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIC,eAAe,EAAE;EA5CZ,CAxzBM;;EAu2Bb;EACAsE,EAAE,EAAE;IACF;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACI1E,cAAc,EAAE,EAbd;;IAeF;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACI2E,eAAe,EAAE,IA5Bf;;IA8BF;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,cAAc,EAAE,GArCd;;IAuCF;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,eAAe,EAAE,EA9Cf;;IAgDF;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIC,aAAa,EAAE,EA5Db;;IA8DF;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,MAAM,EAAE,MArEN;;IAuEF;AACJ;AACA;AACA;AACA;AACA;AACA;IACIC,IAAI,EAAE,UA9EJ;;IAgFF;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACI5C,QAAQ,EAAE,EAzFR;;IA2FF;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACIjC,WAAW,EAAE;EAvGX,CAx2BS;;EAk9Bb;EACA8E,GAAG,EAAE;IACH7B,QAAQ,EAAE5c,SADP;;IAGH;AACJ;AACA;AACA;AACA;AACA;AACA;A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jBA,iBARa;EASb8qC,UAAU,EAAVA,UATa;EAUb4J,eAAe,EAAfA,eAVa;EAWblH,UAAU,EAAVA,UAXa;EAYbn+B,kBAAkB,EAAlBA,kBAZa;EAabvP,kBAAkB,EAAlBA,kBAba;EAcbr4B,iBAAiB,EAAjBA,iBAda;EAebs7B,uBAAuB,EAAvBA,uBAfa;EAgBbr7B,yBAAyB,EAAzBA,yBAhBa;EAiBbg2B,SAAS,EAATA,SAjBa;EAkBbqC,kBAAkB,EAAlBA,kBAlBa;EAmBbihC,UAAU,EAAVA,UAnBa;EAoBb1f,MAAM,EAANA,MApBa;EAqBbyzB,OAAO,EAAPA,OArBa;EAsBb12C,OAAO,EAAPA,OAtBa;EAuBbwsC,YAAY,EAAZA,YAvBa;EAwBbF,eAAe,EAAEA,eAxBJ;EAyBbuC,kBAAkB,EAAlBA,kBAzBa;EA0BbC,WAAW,EAAXA;AA1Ba,CAAf;;;;;;;;;;;AC/jCA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kBAAkB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,uCAAuC,8BAA8B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,oBAAoB,sBAAsB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,qBAAqB;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA,YAAY;AACZ;AACA,sCAAsC;AACtC;AACA;AACA,UAAU;AACV;AACA;AACA,iDAAiD;AACjD;AACA,YAAY;AACZ;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA4C,cAAc;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gDAAgD;AAChD;AACA,MAAM;AACN,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,WAAW,YAAY;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oFAAoF;AACpF;AACA,MAAM;AACN;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA,8DAA8D;;AAE9D;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AChhBA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;;;;WC5BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;WACA;WACA;WACA;WACA;;;;;UEJA;UACA;UACA;UACA","sources":["webpack://mermaid/webpack/universalModuleDefinition","webpack://mermaid/./src/diagrams/c4/parser/c4Diagram.jison","webpack://mermaid/./src/diagrams/class/parser/classDiagram.jison","webpack://mermaid/./src/diagrams/er/parser/erDiagram.jison","webpack://mermaid/./src/diagrams/flowchart/parser/flow.jison","webpack://mermaid/./src/diagrams/gantt/parser/gantt.jison","webpack://mermaid/./src/diagrams/git/parser/gitGraph.jison","webpack://mermaid/./src/diagrams/info/parser/info.jison","webpack://mermaid/./src/diagrams/pie/parser/pie.jison","webpack://mermaid/./src/diagrams/requirement/parser/requirementDiagram.jison","webpack://mermaid/./src/diagrams/sequence/parser/sequenceDiagram.jison","webpack://mermaid/./src/diagrams/state/parser/stateDiagram.jison","webpack://mermaid/./src/diagrams/user-journey/parser/journey.jison","webpack://mermaid/./src/accessibility.js","webpack://mermaid/./src/commonDb.js","webpack://mermaid/./src/config.js","webpack://mermaid/./src/dagre-wrapper/clusters.js","webpack://mermaid/./src/dagre-wrapper/createLabel.js","webpack://mermaid/./src/dagre-wrapper/edges.js","webpack://mermaid/./src/dagre-wrapper/index.js","webpack://mermaid/./src/dagre-wrapper/intersect/index.js","webpack://mermaid/./src/dagre-wrapper/intersect/intersect-circle.js","webpack://mermaid/./src/dagre-wrapper/intersect/intersect-ellipse.js","webpack://mermaid/./src/dagre-wrapper/intersect/intersect-line.js","webpack://mermaid/./src/dagre-wrapper/intersect/intersect-node.js","webpack://mermaid/./src/dagre-wrapper/intersect/intersect-polygon.js","webpack://mermaid/./src/dagre-wrapper/intersect/intersect-rect.js","webpack://mermaid/./src/dagre-wrapper/markers.js","webpack://mermaid/./src/dagre-wrapper/mermaid-graphlib.js","webpack://mermaid/./src/dagre-wrapper/nodes.js","webpack://mermaid/./src/dagre-wrapper/shapes/note.js","webpack://mermaid/./src/dagre-wrapper/shapes/util.js","webpack://mermaid/./src/defaultConfig.js","webpack://mermaid/./src/diagrams/c4/c4Db.js","webpack://mermaid/./src/diagrams/c4/c4Renderer.js","webpack://mermaid/./src/diagrams/c4/styles.js","webpack://mermaid/./src/diagrams/c4/svgDraw.js","webpack://mermaid/./src/diagrams/class/classDb.js","webpack://mermaid/./src/diagrams/class/classRenderer-v2.js","webpack://mermaid/./src/diagrams/class/classRenderer.js","webpack://mermaid/./src/diagrams/class/styles.js","webpack://mermaid/./src/diagrams/class/svgDraw.js","webpack://mermaid/./src/diagrams/common/common.js","webpack://mermaid/./src/diagrams/er/erDb.js","webpack://mermaid/./src/diagrams/er/erMarkers.js","webpack://mermaid/./src/diagrams/er/erRenderer.js","webpack://mermaid/./src/diagrams/er/styles.js","webpack://mermaid/./src/diagrams/flowchart/flowChartShapes.js","webpack://mermaid/./src/diagrams/flowchart/flowDb.js","webpack://mermaid/./src/diagrams/flowchart/flowRenderer-v2.js","webpack://mermaid/./src/diagrams/flowchart/flowRenderer.js","webpack://mermaid/./src/diagrams/flowchart/styles.js","webpack://mermaid/./src/diagrams/gantt/ganttDb.js","webpack://mermaid/./src/diagrams/gantt/ganttRenderer.js","webpack://mermaid/./src/diagrams/gantt/styles.js","webpack://mermaid/./src/diagrams/git/gitGraphAst.js","webpack://mermaid/./src/diagrams/git/gitGraphRenderer.js","webpack://mermaid/./src/diagrams/git/styles.js","webpack://mermaid/./src/diagrams/info/infoDb.js","webpack://mermaid/./src/diagrams/info/infoRenderer.js","webpack://mermaid/./src/diagrams/info/styles.js","webpack://mermaid/./src/diagrams/pie/pieDb.js","webpack://mermaid/./src/diagrams/pie/pieRenderer.js","webpack://mermaid/./src/diagrams/pie/styles.js","webpack://mermaid/./src/diagrams/requirement/requirementDb.js","webpack://mermaid/./src/diagrams/requirement/requirementMarkers.js","webpack://mermaid/./src/diagrams/requirement/requirementRenderer.js","webpack://mermaid/./src/diagrams/requirement/styles.js","webpack://mermaid/./src/diagrams/sequence/sequenceDb.js","webpack://mermaid/./src/diagrams/sequence/sequenceRenderer.js","webpack://mermaid/./src/diagrams/sequence/styles.js","webpack://mermaid/./src/diagrams/sequence/svgDraw.js","webpack://mermaid/./src/diagrams/state/id-cache.js","webpack://mermaid/./src/diagrams/state/shapes.js","webpack://mermaid/./src/diagrams/state/stateDb.js","webpack://mermaid/./src/diagrams/state/stateRenderer-v2.js","webpack://mermaid/./src/diagrams/state/stateRenderer.js","webpack://mermaid/./src/diagrams/state/styles.js","webpack://mermaid/./src/diagrams/user-journey/journeyDb.js","webpack://mermaid/./src/diagrams/user-journey/journeyRenderer.js","webpack://mermaid/./src/diagrams/user-journey/styles.js","webpack://mermaid/./src/diagrams/user-journey/svgDraw.js","webpack://mermaid/./src/errorRenderer.js","webpack://mermaid/./src/interactionDb.js","webpack://mermaid/./src/logger.js","webpack://mermaid/./src/mermaid.js","webpack://mermaid/./src/mermaidAPI.js","webpack://mermaid/./src/styles.js","webpack://mermaid/./src/themes/index.js","webpack://mermaid/./src/themes/theme-base.js","webpack://mermaid/./src/themes/theme-dark.js","webpack://mermaid/./src/themes/theme-default.js","webpack://mermaid/./src/themes/theme-forest.js","webpack://mermaid/./src/themes/theme-helpers.js","webpack://mermaid/./src/themes/theme-neutral.js","webpack://mermaid/./src/utils.js","webpack://mermaid/./node_modules/path-browserify/index.js","webpack://mermaid/external commonjs \"@braintree/sanitize-url\"","webpack://mermaid/external commonjs \"d3\"","webpack://mermaid/external commonjs \"dagre\"","webpack://mermaid/external commonjs \"dagre-d3\"","webpack://mermaid/external commonjs \"dagre-d3/lib/label/add-html-label.js\"","webpack://mermaid/external commonjs \"dompurify\"","webpack://mermaid/external commonjs \"graphlib\"","webpack://mermaid/external commonjs \"khroma\"","webpack://mermaid/external commonjs \"moment-mini\"","webpack://mermaid/external commonjs \"stylis\"","webpack://mermaid/ignored|/Users/ashishj/projects/mermaid/src/diagrams/c4/parser|fs","webpack://mermaid/ignored|/Users/ashishj/projects/mermaid/src/diagrams/class/parser|fs","webpack://mermaid/ignored|/Users/ashishj/projects/mermaid/src/diagrams/er/parser|fs","webpack://mermaid/ignored|/Users/ashishj/projects/mermaid/src/diagrams/flowchart/parser|fs","webpack://mermaid/ignored|/Users/ashishj/projects/mermaid/src/diagrams/gantt/parser|fs","webpack://mermaid/ignored|/Users/ashishj/projects/mermaid/src/diagrams/git/parser|fs","webpack://mermaid/ignored|/Users/ashishj/projects/mermaid/src/diagrams/info/parser|fs","webpack://mermaid/ignored|/Users/ashishj/projects/mermaid/src/diagrams/pie/parser|fs","webpack://mermaid/ignored|/Users/ashishj/projects/mermaid/src/diagrams/requirement/parser|fs","webpack://mermaid/ignored|/Users/ashishj/projects/mermaid/src/diagrams/sequence/parser|fs","webpack://mermaid/ignored|/Users/ashishj/projects/mermaid/src/diagrams/state/parser|fs","webpack://mermaid/ignored|/Users/ashishj/projects/mermaid/src/diagrams/user-journey/parser|fs","webpack://mermaid/webpack/bootstrap","webpack://mermaid/webpack/runtime/compat get default export","webpack://mermaid/webpack/runtime/define property getters","webpack://mermaid/webpack/runtime/hasOwnProperty shorthand","webpack://mermaid/webpack/runtime/make namespace object","webpack://mermaid/webpack/runtime/node module decorator","webpack://mermaid/webpack/before-startup","webpack://mermaid/webpack/startup","webpack://mermaid/webpack/after-startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"mermaid\"] = factory();\n\telse\n\t\troot[\"mermaid\"] = factory();\n})(typeof self !== \"undefined\" ? self : this, () => {\nreturn ","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,6],$V1=[1,7],$V2=[1,8],$V3=[1,9],$V4=[1,16],$V5=[1,11],$V6=[1,12],$V7=[1,13],$V8=[1,14],$V9=[1,15],$Va=[1,27],$Vb=[1,33],$Vc=[1,34],$Vd=[1,35],$Ve=[1,36],$Vf=[1,37],$Vg=[1,72],$Vh=[1,73],$Vi=[1,74],$Vj=[1,75],$Vk=[1,76],$Vl=[1,77],$Vm=[1,78],$Vn=[1,38],$Vo=[1,39],$Vp=[1,40],$Vq=[1,41],$Vr=[1,42],$Vs=[1,43],$Vt=[1,44],$Vu=[1,45],$Vv=[1,46],$Vw=[1,47],$Vx=[1,48],$Vy=[1,49],$Vz=[1,50],$VA=[1,51],$VB=[1,52],$VC=[1,53],$VD=[1,54],$VE=[1,55],$VF=[1,56],$VG=[1,57],$VH=[1,59],$VI=[1,60],$VJ=[1,61],$VK=[1,62],$VL=[1,63],$VM=[1,64],$VN=[1,65],$VO=[1,66],$VP=[1,67],$VQ=[1,68],$VR=[1,69],$VS=[24,52],$VT=[24,44,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],$VU=[15,24,44,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],$VV=[1,94],$VW=[1,95],$VX=[1,96],$VY=[1,97],$VZ=[15,24,52],$V_=[7,8,9,10,18,22,25,26,27,28],$V$=[15,24,43,52],$V01=[15,24,43,52,86,87,89,90],$V11=[15,43],$V21=[44,46,47,48,49,50,51,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"mermaidDoc\":4,\"direction\":5,\"directive\":6,\"direction_tb\":7,\"direction_bt\":8,\"direction_rl\":9,\"direction_lr\":10,\"graphConfig\":11,\"openDirective\":12,\"typeDirective\":13,\"closeDirective\":14,\"NEWLINE\":15,\":\":16,\"argDirective\":17,\"open_directive\":18,\"type_directive\":19,\"arg_directive\":20,\"close_directive\":21,\"C4_CONTEXT\":22,\"statements\":23,\"EOF\":24,\"C4_CONTAINER\":25,\"C4_COMPONENT\":26,\"C4_DYNAMIC\":27,\"C4_DEPLOYMENT\":28,\"otherStatements\":29,\"diagramStatements\":30,\"otherStatement\":31,\"title\":32,\"accDescription\":33,\"acc_title\":34,\"acc_title_value\":35,\"acc_descr\":36,\"acc_descr_value\":37,\"acc_descr_multiline_value\":38,\"boundaryStatement\":39,\"boundaryStartStatement\":40,\"boundaryStopStatement\":41,\"boundaryStart\":42,\"LBRACE\":43,\"ENTERPRISE_BOUNDARY\":44,\"attributes\":45,\"SYSTEM_BOUNDARY\":46,\"BOUNDARY\":47,\"CONTAINER_BOUNDARY\":48,\"NODE\":49,\"NODE_L\":50,\"NODE_R\":51,\"RBRACE\":52,\"diagramStatement\":53,\"PERSON\":54,\"PERSON_EXT\":55,\"SYSTEM\":56,\"SYSTEM_DB\":57,\"SYSTEM_QUEUE\":58,\"SYSTEM_EXT\":59,\"SYSTEM_EXT_DB\":60,\"SYSTEM_EXT_QUEUE\":61,\"CONTAINER\":62,\"CONTAINER_DB\":63,\"CONTAINER_QUEUE\":64,\"CONTAINER_EXT\":65,\"CONTAINER_EXT_DB\":66,\"CONTAINER_EXT_QUEUE\":67,\"COMPONENT\":68,\"COMPONENT_DB\":69,\"COMPONENT_QUEUE\":70,\"COMPONENT_EXT\":71,\"COMPONENT_EXT_DB\":72,\"COMPONENT_EXT_QUEUE\":73,\"REL\":74,\"BIREL\":75,\"REL_U\":76,\"REL_D\":77,\"REL_L\":78,\"REL_R\":79,\"REL_B\":80,\"REL_INDEX\":81,\"UPDATE_EL_STYLE\":82,\"UPDATE_REL_STYLE\":83,\"UPDATE_LAYOUT_CONFIG\":84,\"attribute\":85,\"STR\":86,\"STR_KEY\":87,\"STR_VALUE\":88,\"ATTRIBUTE\":89,\"ATTRIBUTE_EMPTY\":90,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",7:\"direction_tb\",8:\"direction_bt\",9:\"direction_rl\",10:\"direction_lr\",15:\"NEWLINE\",16:\":\",18:\"open_directive\",19:\"type_directive\",20:\"arg_directive\",21:\"close_directive\",22:\"C4_CONTEXT\",24:\"EOF\",25:\"C4_CONTAINER\",26:\"C4_COMPONENT\",27:\"C4_DYNAMIC\",28:\"C4_DEPLOYMENT\",32:\"title\",33:\"accDescription\",34:\"acc_title\",35:\"acc_title_value\",36:\"acc_descr\",37:\"acc_descr_value\",38:\"acc_descr_multiline_value\",43:\"LBRACE\",44:\"ENTERPRISE_BOUNDARY\",46:\"SYSTEM_BOUNDARY\",47:\"BOUNDARY\",48:\"CONTAINER_BOUNDARY\",49:\"NODE\",50:\"NODE_L\",51:\"NODE_R\",52:\"RBRACE\",54:\"PERSON\",55:\"PERSON_EXT\",56:\"SYSTEM\",57:\"SYSTEM_DB\",58:\"SYSTEM_QUEUE\",59:\"SYSTEM_EXT\",60:\"SYSTEM_EXT_DB\",61:\"SYSTEM_EXT_QUEUE\",62:\"CONTAINER\",63:\"CONTAINER_DB\",64:\"CONTAINER_QUEUE\",65:\"CONTAINER_EXT\",66:\"CONTAINER_EXT_DB\",67:\"CONTAINER_EXT_QUEUE\",68:\"COMPONENT\",69:\"COMPONENT_DB\",70:\"COMPONENT_QUEUE\",71:\"COMPONENT_EXT\",72:\"COMPONENT_EXT_DB\",73:\"COMPONENT_EXT_QUEUE\",74:\"REL\",75:\"BIREL\",76:\"REL_U\",77:\"REL_D\",78:\"REL_L\",79:\"REL_R\",80:\"REL_B\",81:\"REL_INDEX\",82:\"UPDATE_EL_STYLE\",83:\"UPDATE_REL_STYLE\",84:\"UPDATE_LAYOUT_CONFIG\",86:\"STR\",87:\"STR_KEY\",88:\"STR_VALUE\",89:\"ATTRIBUTE\",90:\"ATTRIBUTE_EMPTY\"},\nproductions_: [0,[3,1],[3,1],[3,2],[5,1],[5,1],[5,1],[5,1],[4,1],[6,4],[6,6],[12,1],[13,1],[17,1],[14,1],[11,4],[11,4],[11,4],[11,4],[11,4],[23,1],[23,1],[23,2],[29,1],[29,2],[29,3],[31,1],[31,1],[31,2],[31,2],[31,1],[39,3],[40,3],[40,3],[40,4],[42,2],[42,2],[42,2],[42,2],[42,2],[42,2],[42,2],[41,1],[30,1],[30,2],[30,3],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,1],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[45,1],[45,2],[85,1],[85,2],[85,1],[85,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 4:\n yy.setDirection('TB');\nbreak;\ncase 5:\n yy.setDirection('BT');\nbreak;\ncase 6:\n yy.setDirection('RL');\nbreak;\ncase 7:\n yy.setDirection('LR');\nbreak;\ncase 11:\n console.log(\"open_directive: \", $$[$0]); yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 12:\n \nbreak;\ncase 13:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); console.log(\"arg_directive: \", $$[$0]); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 14:\n console.log(\"close_directive: \", $$[$0]); yy.parseDirective('}%%', 'close_directive', 'c4Context'); \nbreak;\ncase 15: case 16: case 17: case 18: case 19:\nyy.setC4Type($$[$0-3])\nbreak;\ncase 26:\nyy.setTitle($$[$0].substring(6));this.$=$$[$0].substring(6);\nbreak;\ncase 27:\nyy.setAccDescription($$[$0].substring(15));this.$=$$[$0].substring(15);\nbreak;\ncase 28:\n this.$=$$[$0].trim();yy.setTitle(this.$); \nbreak;\ncase 29: case 30:\n this.$=$$[$0].trim();yy.setAccDescription(this.$); \nbreak;\ncase 35: case 36:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); $$[$0].splice(2, 0, 'ENTERPRISE'); yy.addPersonOrSystemBoundary(...$$[$0]); this.$=$$[$0];\nbreak;\ncase 37:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystemBoundary(...$$[$0]); this.$=$$[$0];\nbreak;\ncase 38:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); $$[$0].splice(2, 0, 'CONTAINER'); yy.addContainerBoundary(...$$[$0]); this.$=$$[$0];\nbreak;\ncase 39:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addDeploymentNode('node', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 40:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addDeploymentNode('nodeL', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 41:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addDeploymentNode('nodeR', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 42:\n yy.popBoundaryParseStack() \nbreak;\ncase 46:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('person', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 47:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('external_person', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 48:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('system', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 49:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('system_db', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 50:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('system_queue', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 51:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('external_system', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 52:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('external_system_db', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 53:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('external_system_queue', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 54:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('container', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 55:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('container_db', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 56:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('container_queue', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 57:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('external_container', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 58:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('external_container_db', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 59:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('external_container_queue', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 60:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('component', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 61:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('component_db', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 62:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('component_queue', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 63:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('external_component', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 64:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('external_component_db', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 65:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('external_component_queue', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 67:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 68:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('birel', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 69:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel_u', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 70:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel_d', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 71:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel_l', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 72:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel_r', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 73:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel_b', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 74:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); $$[$0].splice(0, 1); yy.addRel('rel', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 75:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.updateElStyle('update_el_style', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 76:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.updateRelStyle('update_rel_style', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 77:\nconsole.log($$[$0-1],JSON.stringify($$[$0])); yy.updateLayoutConfig('update_layout_config', ...$$[$0]); this.$=$$[$0];\nbreak;\ncase 78:\n console.log('PUSH ATTRIBUTE: ', $$[$0]); this.$ = [$$[$0]]; \nbreak;\ncase 79:\n console.log('PUSH ATTRIBUTE: ', $$[$0-1]); $$[$0].unshift($$[$0-1]); this.$=$$[$0];\nbreak;\ncase 80: case 82:\n this.$ = $$[$0].trim(); \nbreak;\ncase 81:\n console.log('kv: ', $$[$0-1], $$[$0]); let kv={}; kv[$$[$0-1].trim()]=$$[$0].trim(); this.$=kv; \nbreak;\ncase 83:\n this.$ = \"\"; \nbreak;\n}\n},\ntable: [{3:1,4:2,5:3,6:4,7:$V0,8:$V1,9:$V2,10:$V3,11:5,12:10,18:$V4,22:$V5,25:$V6,26:$V7,27:$V8,28:$V9},{1:[3]},{1:[2,1]},{1:[2,2]},{3:17,4:2,5:3,6:4,7:$V0,8:$V1,9:$V2,10:$V3,11:5,12:10,18:$V4,22:$V5,25:$V6,26:$V7,27:$V8,28:$V9},{1:[2,8]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{1:[2,7]},{13:18,19:[1,19]},{15:[1,20]},{15:[1,21]},{15:[1,22]},{15:[1,23]},{15:[1,24]},{19:[2,11]},{1:[2,3]},{14:25,16:[1,26],21:$Va},o([16,21],[2,12]),{23:28,29:29,30:30,31:31,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{23:79,29:29,30:30,31:31,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{23:80,29:29,30:30,31:31,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{23:81,29:29,30:30,31:31,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{23:82,29:29,30:30,31:31,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{15:[1,83]},{17:84,20:[1,85]},{15:[2,14]},{24:[1,86]},o($VS,[2,20],{53:32,39:58,40:70,42:71,30:87,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR}),o($VS,[2,21]),o($VT,[2,23],{15:[1,88]}),o($VS,[2,43],{15:[1,89]}),o($VU,[2,26]),o($VU,[2,27]),{35:[1,90]},{37:[1,91]},o($VU,[2,30]),{45:92,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:98,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:99,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:100,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:101,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:102,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:103,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:104,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:105,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:106,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:107,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:108,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:109,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:110,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:111,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:112,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:113,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:114,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:115,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:116,85:93,86:$VV,87:$VW,89:$VX,90:$VY},o($VZ,[2,66]),{45:117,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:118,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:119,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:120,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:121,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:122,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:123,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:124,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:125,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:126,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:127,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{30:128,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{15:[1,130],43:[1,129]},{45:131,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:132,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:133,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:134,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:135,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:136,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:137,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{24:[1,138]},{24:[1,139]},{24:[1,140]},{24:[1,141]},o($V_,[2,9]),{14:142,21:$Va},{21:[2,13]},{1:[2,15]},o($VS,[2,22]),o($VT,[2,24],{31:31,29:143,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf}),o($VS,[2,44],{29:29,30:30,31:31,53:32,39:58,40:70,42:71,23:144,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR}),o($VU,[2,28]),o($VU,[2,29]),o($VZ,[2,46]),o($V$,[2,78],{85:93,45:145,86:$VV,87:$VW,89:$VX,90:$VY}),o($V01,[2,80]),{88:[1,146]},o($V01,[2,82]),o($V01,[2,83]),o($VZ,[2,47]),o($VZ,[2,48]),o($VZ,[2,49]),o($VZ,[2,50]),o($VZ,[2,51]),o($VZ,[2,52]),o($VZ,[2,53]),o($VZ,[2,54]),o($VZ,[2,55]),o($VZ,[2,56]),o($VZ,[2,57]),o($VZ,[2,58]),o($VZ,[2,59]),o($VZ,[2,60]),o($VZ,[2,61]),o($VZ,[2,62]),o($VZ,[2,63]),o($VZ,[2,64]),o($VZ,[2,65]),o($VZ,[2,67]),o($VZ,[2,68]),o($VZ,[2,69]),o($VZ,[2,70]),o($VZ,[2,71]),o($VZ,[2,72]),o($VZ,[2,73]),o($VZ,[2,74]),o($VZ,[2,75]),o($VZ,[2,76]),o($VZ,[2,77]),{41:147,52:[1,148]},{15:[1,149]},{43:[1,150]},o($V11,[2,35]),o($V11,[2,36]),o($V11,[2,37]),o($V11,[2,38]),o($V11,[2,39]),o($V11,[2,40]),o($V11,[2,41]),{1:[2,16]},{1:[2,17]},{1:[2,18]},{1:[2,19]},{15:[1,151]},o($VT,[2,25]),o($VS,[2,45]),o($V$,[2,79]),o($V01,[2,81]),o($VZ,[2,31]),o($VZ,[2,42]),o($V21,[2,32]),o($V21,[2,33],{15:[1,152]}),o($V_,[2,10]),o($V21,[2,34])],\ndefaultActions: {2:[2,1],3:[2,2],5:[2,8],6:[2,4],7:[2,5],8:[2,6],9:[2,7],16:[2,11],17:[2,3],27:[2,14],85:[2,13],86:[2,15],138:[2,16],139:[2,17],140:[2,18],141:[2,19]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin('open_directive'); return 18; \nbreak;\ncase 1:return 7;\nbreak;\ncase 2:return 8;\nbreak;\ncase 3:return 9;\nbreak;\ncase 4:return 10;\nbreak;\ncase 5: this.begin('type_directive'); return 19; \nbreak;\ncase 6: this.popState(); this.begin('arg_directive'); return 16; \nbreak;\ncase 7: this.popState(); this.popState(); return 21; \nbreak;\ncase 8:return 20;\nbreak;\ncase 9:return 32;\nbreak;\ncase 10:return 33;\nbreak;\ncase 11: this.begin(\"acc_title\");return 34; \nbreak;\ncase 12: this.popState(); return \"acc_title_value\"; \nbreak;\ncase 13: this.begin(\"acc_descr\");return 36; \nbreak;\ncase 14: this.popState(); return \"acc_descr_value\"; \nbreak;\ncase 15: this.begin(\"acc_descr_multiline\");\nbreak;\ncase 16: this.popState(); \nbreak;\ncase 17:return \"acc_descr_multiline_value\";\nbreak;\ncase 18:/* skip comments */\nbreak;\ncase 19:c /* skip comments */\nbreak;\ncase 20:return 15;\nbreak;\ncase 21:/* skip whitespace */\nbreak;\ncase 22:return 22;\nbreak;\ncase 23:return 25;\nbreak;\ncase 24:return 26;\nbreak;\ncase 25:return 27;\nbreak;\ncase 26:return 28;\nbreak;\ncase 27: this.begin(\"person_ext\"); console.log('begin person_ext'); return 55;\nbreak;\ncase 28: this.begin(\"person\"); console.log('begin person'); return 54;\nbreak;\ncase 29: this.begin(\"system_ext_queue\"); console.log('begin system_ext_queue'); return 61;\nbreak;\ncase 30: this.begin(\"system_ext_db\"); console.log('begin system_ext_db'); return 60;\nbreak;\ncase 31: this.begin(\"system_ext\"); console.log('begin system_ext'); return 59;\nbreak;\ncase 32: this.begin(\"system_queue\"); console.log('begin system_queue'); return 58;\nbreak;\ncase 33: this.begin(\"system_db\"); console.log('begin system_db'); return 57;\nbreak;\ncase 34: this.begin(\"system\"); console.log('begin system'); return 56;\nbreak;\ncase 35: this.begin(\"boundary\"); console.log('begin boundary'); return 47;\nbreak;\ncase 36: this.begin(\"enterprise_boundary\"); console.log('begin enterprise_boundary'); return 44;\nbreak;\ncase 37: this.begin(\"system_boundary\"); console.log('begin system_boundary'); return 46;\nbreak;\ncase 38: this.begin(\"container_ext_queue\"); console.log('begin container_ext_queue'); return 67;\nbreak;\ncase 39: this.begin(\"container_ext_db\"); console.log('begin container_ext_db'); return 66;\nbreak;\ncase 40: this.begin(\"container_ext\"); console.log('begin container_ext'); return 65;\nbreak;\ncase 41: this.begin(\"container_queue\"); console.log('begin container_queue'); return 64;\nbreak;\ncase 42: this.begin(\"container_db\"); console.log('begin container_db'); return 63;\nbreak;\ncase 43: this.begin(\"container\"); console.log('begin container'); return 62;\nbreak;\ncase 44: this.begin(\"container_boundary\"); console.log('begin container_boundary'); return 48;\nbreak;\ncase 45: this.begin(\"component_ext_queue\"); console.log('begin component_ext_queue'); return 73;\nbreak;\ncase 46: this.begin(\"component_ext_db\"); console.log('begin component_ext_db'); return 72;\nbreak;\ncase 47: this.begin(\"component_ext\"); console.log('begin component_ext'); return 71;\nbreak;\ncase 48: this.begin(\"component_queue\"); console.log('begin component_queue'); return 70;\nbreak;\ncase 49: this.begin(\"component_db\"); console.log('begin component_db'); return 69;\nbreak;\ncase 50: this.begin(\"component\"); console.log('begin component'); return 68;\nbreak;\ncase 51: this.begin(\"node\"); console.log('begin node'); return 49;\nbreak;\ncase 52: this.begin(\"node\"); console.log('begin node'); return 49;\nbreak;\ncase 53: this.begin(\"node_l\"); console.log('begin node_l'); return 50;\nbreak;\ncase 54: this.begin(\"node_r\"); console.log('begin node_r'); return 51;\nbreak;\ncase 55: this.begin(\"rel\"); console.log('begin rel'); return 74;\nbreak;\ncase 56: this.begin(\"birel\"); console.log('begin birel'); return 75;\nbreak;\ncase 57: this.begin(\"rel_u\"); console.log('begin rel_u'); return 76;\nbreak;\ncase 58: this.begin(\"rel_u\"); console.log('begin rel_u'); return 76;\nbreak;\ncase 59: this.begin(\"rel_d\"); console.log('begin rel_d'); return 77;\nbreak;\ncase 60: this.begin(\"rel_d\"); console.log('begin rel_d'); return 77;\nbreak;\ncase 61: this.begin(\"rel_l\"); console.log('begin rel_l'); return 78;\nbreak;\ncase 62: this.begin(\"rel_l\"); console.log('begin rel_l'); return 78;\nbreak;\ncase 63: this.begin(\"rel_r\"); console.log('begin rel_r'); return 79;\nbreak;\ncase 64: this.begin(\"rel_r\"); console.log('begin rel_r'); return 79;\nbreak;\ncase 65: this.begin(\"rel_b\"); console.log('begin rel_b'); return 80;\nbreak;\ncase 66: this.begin(\"rel_index\"); console.log('begin rel_index'); return 81;\nbreak;\ncase 67: this.begin(\"update_el_style\"); console.log('begin update_el_style'); return 82;\nbreak;\ncase 68: this.begin(\"update_rel_style\"); console.log('begin update_rel_style'); return 83;\nbreak;\ncase 69: this.begin(\"update_layout_config\"); console.log('begin update_layout_config'); return 84;\nbreak;\ncase 70:return \"EOF_IN_STRUCT\";\nbreak;\ncase 71: console.log('begin attribute with ATTRIBUTE_EMPTY'); this.begin(\"attribute\"); return \"ATTRIBUTE_EMPTY\";\nbreak;\ncase 72: console.log('begin attribute'); this.begin(\"attribute\"); \nbreak;\ncase 73: console.log('STOP attribute'); this.popState();console.log('STOP diagram'); this.popState();\nbreak;\ncase 74: console.log(',,'); return 90;\nbreak;\ncase 75: console.log(','); \nbreak;\ncase 76: console.log('ATTRIBUTE_EMPTY'); return 90;\nbreak;\ncase 77: console.log('begin string'); this.begin(\"string\");\nbreak;\ncase 78: console.log('STOP string'); this.popState(); \nbreak;\ncase 79: console.log('STR'); return \"STR\";\nbreak;\ncase 80: console.log('begin string_kv'); this.begin(\"string_kv\");\nbreak;\ncase 81: console.log('STR_KEY'); this.begin(\"string_kv_key\"); return \"STR_KEY\";\nbreak;\ncase 82: console.log('begin string_kv_value'); this.popState(); this.begin(\"string_kv_value\"); \nbreak;\ncase 83: console.log('STR_VALUE'); return \"STR_VALUE\";\nbreak;\ncase 84: console.log('STOP string_kv_value'); this.popState(); this.popState(); \nbreak;\ncase 85: console.log('not STR'); return \"STR\";\nbreak;\ncase 86: /* this.begin(\"lbrace\"); */ console.log('begin boundary block'); return \"LBRACE\";\nbreak;\ncase 87: /* this.popState(); */ console.log('STOP boundary block'); return \"RBRACE\";\nbreak;\ncase 88:return 'SPACE';\nbreak;\ncase 89:return 'EOL';\nbreak;\ncase 90:return 24;\nbreak;\n}\n},\nrules: [/^(?:%%\\{)/,/^(?:.*direction\\s+TB[^\\n]*)/,/^(?:.*direction\\s+BT[^\\n]*)/,/^(?:.*direction\\s+RL[^\\n]*)/,/^(?:.*direction\\s+LR[^\\n]*)/,/^(?:((?:(?!\\}%%)[^:.])*))/,/^(?::)/,/^(?:\\}%%)/,/^(?:((?:(?!\\}%%).|\\n)*))/,/^(?:title\\s[^#\\n;]+)/,/^(?:accDescription\\s[^#\\n;]+)/,/^(?:accTitle\\s*:\\s*)/,/^(?:(?!\\n||)*[^\\n]*)/,/^(?:accDescr\\s*:\\s*)/,/^(?:(?!\\n||)*[^\\n]*)/,/^(?:accDescr\\s*\\{\\s*)/,/^(?:[\\}])/,/^(?:[^\\}]*)/,/^(?:%%(?!\\{)*[^\\n]*(\\r?\\n?)+)/,/^(?:%%[^\\n]*(\\r?\\n)*)/,/^(?:\\s*(\\r?\\n)+)/,/^(?:\\s+)/,/^(?:C4Context\\b)/,/^(?:C4Container\\b)/,/^(?:C4Component\\b)/,/^(?:C4Dynamic\\b)/,/^(?:C4Deployment\\b)/,/^(?:Person_Ext\\b)/,/^(?:Person\\b)/,/^(?:SystemQueue_Ext\\b)/,/^(?:SystemDb_Ext\\b)/,/^(?:System_Ext\\b)/,/^(?:SystemQueue\\b)/,/^(?:SystemDb\\b)/,/^(?:System\\b)/,/^(?:Boundary\\b)/,/^(?:Enterprise_Boundary\\b)/,/^(?:System_Boundary\\b)/,/^(?:ContainerQueue_Ext\\b)/,/^(?:ContainerDb_Ext\\b)/,/^(?:Container_Ext\\b)/,/^(?:ContainerQueue\\b)/,/^(?:ContainerDb\\b)/,/^(?:Container\\b)/,/^(?:Container_Boundary\\b)/,/^(?:ComponentQueue_Ext\\b)/,/^(?:ComponentDb_Ext\\b)/,/^(?:Component_Ext\\b)/,/^(?:ComponentQueue\\b)/,/^(?:ComponentDb\\b)/,/^(?:Component\\b)/,/^(?:Deployment_Node\\b)/,/^(?:Node\\b)/,/^(?:Node_L\\b)/,/^(?:Node_R\\b)/,/^(?:Rel\\b)/,/^(?:BiRel\\b)/,/^(?:Rel_Up\\b)/,/^(?:Rel_U\\b)/,/^(?:Rel_Down\\b)/,/^(?:Rel_D\\b)/,/^(?:Rel_Left\\b)/,/^(?:Rel_L\\b)/,/^(?:Rel_Right\\b)/,/^(?:Rel_R\\b)/,/^(?:Rel_Back\\b)/,/^(?:RelIndex\\b)/,/^(?:UpdateElementStyle\\b)/,/^(?:UpdateRelStyle\\b)/,/^(?:UpdateLayoutConfig\\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*[\"][\"])/,/^(?:[ ]*[\"])/,/^(?:[\"])/,/^(?:[^\"]*)/,/^(?:[ ]*[\\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*[\"])/,/^(?:[^\"]+)/,/^(?:[\"])/,/^(?:[^,]+)/,/^(?:\\{)/,/^(?:\\})/,/^(?:[\\s]+)/,/^(?:[\\n\\r]+)/,/^(?:$)/],\nconditions: {\"acc_descr_multiline\":{\"rules\":[16,17],\"inclusive\":false},\"acc_descr\":{\"rules\":[14],\"inclusive\":false},\"acc_title\":{\"rules\":[12],\"inclusive\":false},\"close_directive\":{\"rules\":[],\"inclusive\":false},\"arg_directive\":{\"rules\":[7,8],\"inclusive\":false},\"type_directive\":{\"rules\":[6,7],\"inclusive\":false},\"open_directive\":{\"rules\":[5],\"inclusive\":false},\"string_kv_value\":{\"rules\":[83,84],\"inclusive\":false},\"string_kv_key\":{\"rules\":[82],\"inclusive\":false},\"string_kv\":{\"rules\":[81],\"inclusive\":false},\"string\":{\"rules\":[78,79],\"inclusive\":false},\"attribute\":{\"rules\":[73,74,75,76,77,80,85],\"inclusive\":false},\"update_layout_config\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"update_rel_style\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"update_el_style\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"rel_b\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"rel_r\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"rel_l\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"rel_d\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"rel_u\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"rel_bi\":{\"rules\":[],\"inclusive\":false},\"rel\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"node_r\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"node_l\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"node\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"index\":{\"rules\":[],\"inclusive\":false},\"rel_index\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"component_ext_queue\":{\"rules\":[],\"inclusive\":false},\"component_ext_db\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"component_ext\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"component_queue\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"component_db\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"component\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"container_boundary\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"container_ext_queue\":{\"rules\":[],\"inclusive\":false},\"container_ext_db\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"container_ext\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"container_queue\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"container_db\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"container\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"birel\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"system_boundary\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"enterprise_boundary\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"boundary\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"system_ext_queue\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"system_ext_db\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"system_ext\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"system_queue\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"system_db\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"system\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"person_ext\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"person\":{\"rules\":[70,71,72,73],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,1,2,3,4,9,10,11,13,15,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,86,87,88,89,90],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,7],$V2=[1,8],$V3=[1,9],$V4=[1,10],$V5=[1,13],$V6=[1,12],$V7=[1,16,25],$V8=[1,20],$V9=[1,31],$Va=[1,32],$Vb=[1,33],$Vc=[1,35],$Vd=[1,38],$Ve=[1,36],$Vf=[1,37],$Vg=[1,39],$Vh=[1,40],$Vi=[1,41],$Vj=[1,42],$Vk=[1,45],$Vl=[1,46],$Vm=[1,47],$Vn=[1,48],$Vo=[16,25],$Vp=[1,62],$Vq=[1,63],$Vr=[1,64],$Vs=[1,65],$Vt=[1,66],$Vu=[1,67],$Vv=[16,25,32,44,45,53,56,57,58,59,60,61,66,68],$Vw=[16,25,30,32,44,45,49,53,56,57,58,59,60,61,66,68,83,84,85,86],$Vx=[5,8,9,10,11,16,19,23,25],$Vy=[53,83,84,85,86],$Vz=[53,60,61,83,84,85,86],$VA=[53,56,57,58,59,83,84,85,86],$VB=[16,25,32],$VC=[1,99];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"mermaidDoc\":4,\"statments\":5,\"direction\":6,\"directive\":7,\"direction_tb\":8,\"direction_bt\":9,\"direction_rl\":10,\"direction_lr\":11,\"graphConfig\":12,\"openDirective\":13,\"typeDirective\":14,\"closeDirective\":15,\"NEWLINE\":16,\":\":17,\"argDirective\":18,\"open_directive\":19,\"type_directive\":20,\"arg_directive\":21,\"close_directive\":22,\"CLASS_DIAGRAM\":23,\"statements\":24,\"EOF\":25,\"statement\":26,\"className\":27,\"alphaNumToken\":28,\"classLiteralName\":29,\"GENERICTYPE\":30,\"relationStatement\":31,\"LABEL\":32,\"classStatement\":33,\"methodStatement\":34,\"annotationStatement\":35,\"clickStatement\":36,\"cssClassStatement\":37,\"acc_title\":38,\"acc_title_value\":39,\"acc_descr\":40,\"acc_descr_value\":41,\"acc_descr_multiline_value\":42,\"CLASS\":43,\"STYLE_SEPARATOR\":44,\"STRUCT_START\":45,\"members\":46,\"STRUCT_STOP\":47,\"ANNOTATION_START\":48,\"ANNOTATION_END\":49,\"MEMBER\":50,\"SEPARATOR\":51,\"relation\":52,\"STR\":53,\"relationType\":54,\"lineType\":55,\"AGGREGATION\":56,\"EXTENSION\":57,\"COMPOSITION\":58,\"DEPENDENCY\":59,\"LINE\":60,\"DOTTED_LINE\":61,\"CALLBACK\":62,\"LINK\":63,\"LINK_TARGET\":64,\"CLICK\":65,\"CALLBACK_NAME\":66,\"CALLBACK_ARGS\":67,\"HREF\":68,\"CSSCLASS\":69,\"commentToken\":70,\"textToken\":71,\"graphCodeTokens\":72,\"textNoTagsToken\":73,\"TAGSTART\":74,\"TAGEND\":75,\"==\":76,\"--\":77,\"PCT\":78,\"DEFAULT\":79,\"SPACE\":80,\"MINUS\":81,\"keywords\":82,\"UNICODE_TEXT\":83,\"NUM\":84,\"ALPHA\":85,\"BQUOTE_STR\":86,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",5:\"statments\",8:\"direction_tb\",9:\"direction_bt\",10:\"direction_rl\",11:\"direction_lr\",16:\"NEWLINE\",17:\":\",19:\"open_directive\",20:\"type_directive\",21:\"arg_directive\",22:\"close_directive\",23:\"CLASS_DIAGRAM\",25:\"EOF\",30:\"GENERICTYPE\",32:\"LABEL\",38:\"acc_title\",39:\"acc_title_value\",40:\"acc_descr\",41:\"acc_descr_value\",42:\"acc_descr_multiline_value\",43:\"CLASS\",44:\"STYLE_SEPARATOR\",45:\"STRUCT_START\",47:\"STRUCT_STOP\",48:\"ANNOTATION_START\",49:\"ANNOTATION_END\",50:\"MEMBER\",51:\"SEPARATOR\",53:\"STR\",56:\"AGGREGATION\",57:\"EXTENSION\",58:\"COMPOSITION\",59:\"DEPENDENCY\",60:\"LINE\",61:\"DOTTED_LINE\",62:\"CALLBACK\",63:\"LINK\",64:\"LINK_TARGET\",65:\"CLICK\",66:\"CALLBACK_NAME\",67:\"CALLBACK_ARGS\",68:\"HREF\",69:\"CSSCLASS\",72:\"graphCodeTokens\",74:\"TAGSTART\",75:\"TAGEND\",76:\"==\",77:\"--\",78:\"PCT\",79:\"DEFAULT\",80:\"SPACE\",81:\"MINUS\",82:\"keywords\",83:\"UNICODE_TEXT\",84:\"NUM\",85:\"ALPHA\",86:\"BQUOTE_STR\"},\nproductions_: [0,[3,1],[3,1],[3,1],[3,2],[6,1],[6,1],[6,1],[6,1],[4,1],[7,4],[7,6],[13,1],[14,1],[18,1],[15,1],[12,4],[24,1],[24,2],[24,3],[27,1],[27,1],[27,2],[27,2],[27,2],[26,1],[26,2],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,2],[26,2],[26,1],[33,2],[33,4],[33,5],[33,7],[35,4],[46,1],[46,2],[34,1],[34,2],[34,1],[34,1],[31,3],[31,4],[31,4],[31,5],[52,3],[52,2],[52,2],[52,1],[54,1],[54,1],[54,1],[54,1],[55,1],[55,1],[36,3],[36,4],[36,3],[36,4],[36,4],[36,5],[36,3],[36,4],[36,4],[36,5],[36,3],[36,4],[36,4],[36,5],[37,3],[70,1],[70,1],[71,1],[71,1],[71,1],[71,1],[71,1],[71,1],[71,1],[73,1],[73,1],[73,1],[73,1],[28,1],[28,1],[28,1],[29,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 5:\n yy.setDirection('TB');\nbreak;\ncase 6:\n yy.setDirection('BT');\nbreak;\ncase 7:\n yy.setDirection('RL');\nbreak;\ncase 8:\n yy.setDirection('LR');\nbreak;\ncase 12:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 13:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 14:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 15:\n yy.parseDirective('}%%', 'close_directive', 'class'); \nbreak;\ncase 20: case 21:\n this.$=$$[$0]; \nbreak;\ncase 22:\n this.$=$$[$0-1]+$$[$0]; \nbreak;\ncase 23: case 24:\n this.$=$$[$0-1]+'~'+$$[$0]; \nbreak;\ncase 25:\n yy.addRelation($$[$0]); \nbreak;\ncase 26:\n $$[$0-1].title = yy.cleanupLabel($$[$0]); yy.addRelation($$[$0-1]); \nbreak;\ncase 34:\n this.$=$$[$0].trim();yy.setAccTitle(this.$); \nbreak;\ncase 35: case 36:\n this.$=$$[$0].trim();yy.setAccDescription(this.$); \nbreak;\ncase 37:\nyy.addClass($$[$0]);\nbreak;\ncase 38:\nyy.addClass($$[$0-2]);yy.setCssClass($$[$0-2], $$[$0]);\nbreak;\ncase 39:\n/*console.log($$[$0-3],JSON.stringify($$[$0-1]));*/yy.addClass($$[$0-3]);yy.addMembers($$[$0-3],$$[$0-1]);\nbreak;\ncase 40:\nyy.addClass($$[$0-5]);yy.setCssClass($$[$0-5], $$[$0-3]);yy.addMembers($$[$0-5],$$[$0-1]);\nbreak;\ncase 41:\n yy.addAnnotation($$[$0],$$[$0-2]); \nbreak;\ncase 42:\n this.$ = [$$[$0]]; \nbreak;\ncase 43:\n $$[$0].push($$[$0-1]);this.$=$$[$0];\nbreak;\ncase 44:\n/*console.log('Rel found',$$[$0]);*/\nbreak;\ncase 45:\nyy.addMember($$[$0-1],yy.cleanupLabel($$[$0]));\nbreak;\ncase 46:\n/*console.warn('Member',$$[$0]);*/\nbreak;\ncase 47:\n/*console.log('sep found',$$[$0]);*/\nbreak;\ncase 48:\n this.$ = {'id1':$$[$0-2],'id2':$$[$0], relation:$$[$0-1], relationTitle1:'none', relationTitle2:'none'}; \nbreak;\ncase 49:\n this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-1], relationTitle1:$$[$0-2], relationTitle2:'none'}\nbreak;\ncase 50:\n this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-2], relationTitle1:'none', relationTitle2:$$[$0-1]}; \nbreak;\ncase 51:\n this.$ = {id1:$$[$0-4], id2:$$[$0], relation:$$[$0-2], relationTitle1:$$[$0-3], relationTitle2:$$[$0-1]} \nbreak;\ncase 52:\n this.$={type1:$$[$0-2],type2:$$[$0],lineType:$$[$0-1]}; \nbreak;\ncase 53:\n this.$={type1:'none',type2:$$[$0],lineType:$$[$0-1]}; \nbreak;\ncase 54:\n this.$={type1:$$[$0-1],type2:'none',lineType:$$[$0]}; \nbreak;\ncase 55:\n this.$={type1:'none',type2:'none',lineType:$$[$0]}; \nbreak;\ncase 56:\n this.$=yy.relationType.AGGREGATION;\nbreak;\ncase 57:\n this.$=yy.relationType.EXTENSION;\nbreak;\ncase 58:\n this.$=yy.relationType.COMPOSITION;\nbreak;\ncase 59:\n this.$=yy.relationType.DEPENDENCY;\nbreak;\ncase 60:\nthis.$=yy.lineType.LINE;\nbreak;\ncase 61:\nthis.$=yy.lineType.DOTTED_LINE;\nbreak;\ncase 62: case 68:\nthis.$ = $$[$0-2];yy.setClickEvent($$[$0-1], $$[$0]);\nbreak;\ncase 63: case 69:\nthis.$ = $$[$0-3];yy.setClickEvent($$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-2], $$[$0]);\nbreak;\ncase 64: case 72:\nthis.$ = $$[$0-2];yy.setLink($$[$0-1], $$[$0]);\nbreak;\ncase 65:\nthis.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1],$$[$0]);\nbreak;\ncase 66: case 74:\nthis.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-2], $$[$0]);\nbreak;\ncase 67: case 75:\nthis.$ = $$[$0-4];yy.setLink($$[$0-3], $$[$0-2], $$[$0]);yy.setTooltip($$[$0-3], $$[$0-1]);\nbreak;\ncase 70:\nthis.$ = $$[$0-3];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]);\nbreak;\ncase 71:\nthis.$ = $$[$0-4];yy.setClickEvent($$[$0-3], $$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-3], $$[$0]);\nbreak;\ncase 73:\nthis.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1], $$[$0]);\nbreak;\ncase 76:\nyy.setCssClass($$[$0-1], $$[$0]);\nbreak;\n}\n},\ntable: [{3:1,4:2,5:$V0,6:4,7:5,8:$V1,9:$V2,10:$V3,11:$V4,12:6,13:11,19:$V5,23:$V6},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{3:14,4:2,5:$V0,6:4,7:5,8:$V1,9:$V2,10:$V3,11:$V4,12:6,13:11,19:$V5,23:$V6},{1:[2,9]},o($V7,[2,5]),o($V7,[2,6]),o($V7,[2,7]),o($V7,[2,8]),{14:15,20:[1,16]},{16:[1,17]},{20:[2,12]},{1:[2,4]},{15:18,17:[1,19],22:$V8},o([17,22],[2,13]),{6:30,7:29,8:$V1,9:$V2,10:$V3,11:$V4,13:11,19:$V5,24:21,26:22,27:34,28:43,29:44,31:23,33:24,34:25,35:26,36:27,37:28,38:$V9,40:$Va,42:$Vb,43:$Vc,48:$Vd,50:$Ve,51:$Vf,62:$Vg,63:$Vh,65:$Vi,69:$Vj,83:$Vk,84:$Vl,85:$Vm,86:$Vn},{16:[1,49]},{18:50,21:[1,51]},{16:[2,15]},{25:[1,52]},{16:[1,53],25:[2,17]},o($Vo,[2,25],{32:[1,54]}),o($Vo,[2,27]),o($Vo,[2,28]),o($Vo,[2,29]),o($Vo,[2,30]),o($Vo,[2,31]),o($Vo,[2,32]),o($Vo,[2,33]),{39:[1,55]},{41:[1,56]},o($Vo,[2,36]),o($Vo,[2,44],{52:57,54:60,55:61,32:[1,59],53:[1,58],56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu}),{27:68,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},o($Vo,[2,46]),o($Vo,[2,47]),{28:69,83:$Vk,84:$Vl,85:$Vm},{27:70,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},{27:71,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},{27:72,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},{53:[1,73]},o($Vv,[2,20],{28:43,29:44,27:74,30:[1,75],83:$Vk,84:$Vl,85:$Vm,86:$Vn}),o($Vv,[2,21],{30:[1,76]}),o($Vw,[2,90]),o($Vw,[2,91]),o($Vw,[2,92]),o([16,25,30,32,44,45,53,56,57,58,59,60,61,66,68],[2,93]),o($Vx,[2,10]),{15:77,22:$V8},{22:[2,14]},{1:[2,16]},{6:30,7:29,8:$V1,9:$V2,10:$V3,11:$V4,13:11,19:$V5,24:78,25:[2,18],26:22,27:34,28:43,29:44,31:23,33:24,34:25,35:26,36:27,37:28,38:$V9,40:$Va,42:$Vb,43:$Vc,48:$Vd,50:$Ve,51:$Vf,62:$Vg,63:$Vh,65:$Vi,69:$Vj,83:$Vk,84:$Vl,85:$Vm,86:$Vn},o($Vo,[2,26]),o($Vo,[2,34]),o($Vo,[2,35]),{27:79,28:43,29:44,53:[1,80],83:$Vk,84:$Vl,85:$Vm,86:$Vn},{52:81,54:60,55:61,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu},o($Vo,[2,45]),{55:82,60:$Vt,61:$Vu},o($Vy,[2,55],{54:83,56:$Vp,57:$Vq,58:$Vr,59:$Vs}),o($Vz,[2,56]),o($Vz,[2,57]),o($Vz,[2,58]),o($Vz,[2,59]),o($VA,[2,60]),o($VA,[2,61]),o($Vo,[2,37],{44:[1,84],45:[1,85]}),{49:[1,86]},{53:[1,87]},{53:[1,88]},{66:[1,89],68:[1,90]},{28:91,83:$Vk,84:$Vl,85:$Vm},o($Vv,[2,22]),o($Vv,[2,23]),o($Vv,[2,24]),{16:[1,92]},{25:[2,19]},o($VB,[2,48]),{27:93,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},{27:94,28:43,29:44,53:[1,95],83:$Vk,84:$Vl,85:$Vm,86:$Vn},o($Vy,[2,54],{54:96,56:$Vp,57:$Vq,58:$Vr,59:$Vs}),o($Vy,[2,53]),{28:97,83:$Vk,84:$Vl,85:$Vm},{46:98,50:$VC},{27:100,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},o($Vo,[2,62],{53:[1,101]}),o($Vo,[2,64],{53:[1,103],64:[1,102]}),o($Vo,[2,68],{53:[1,104],67:[1,105]}),o($Vo,[2,72],{53:[1,107],64:[1,106]}),o($Vo,[2,76]),o($Vx,[2,11]),o($VB,[2,50]),o($VB,[2,49]),{27:108,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},o($Vy,[2,52]),o($Vo,[2,38],{45:[1,109]}),{47:[1,110]},{46:111,47:[2,42],50:$VC},o($Vo,[2,41]),o($Vo,[2,63]),o($Vo,[2,65]),o($Vo,[2,66],{64:[1,112]}),o($Vo,[2,69]),o($Vo,[2,70],{53:[1,113]}),o($Vo,[2,73]),o($Vo,[2,74],{64:[1,114]}),o($VB,[2,51]),{46:115,50:$VC},o($Vo,[2,39]),{47:[2,43]},o($Vo,[2,67]),o($Vo,[2,71]),o($Vo,[2,75]),{47:[1,116]},o($Vo,[2,40])],\ndefaultActions: {2:[2,1],3:[2,2],4:[2,3],6:[2,9],13:[2,12],14:[2,4],20:[2,15],51:[2,14],52:[2,16],78:[2,19],111:[2,43]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin('open_directive'); return 19; \nbreak;\ncase 1:return 8;\nbreak;\ncase 2:return 9;\nbreak;\ncase 3:return 10;\nbreak;\ncase 4:return 11;\nbreak;\ncase 5: this.begin('type_directive'); return 20; \nbreak;\ncase 6: this.popState(); this.begin('arg_directive'); return 17; \nbreak;\ncase 7: this.popState(); this.popState(); return 22; \nbreak;\ncase 8:return 21;\nbreak;\ncase 9:/* skip comments */\nbreak;\ncase 10:/* skip comments */\nbreak;\ncase 11: this.begin(\"acc_title\");return 38; \nbreak;\ncase 12: this.popState(); return \"acc_title_value\"; \nbreak;\ncase 13: this.begin(\"acc_descr\");return 40; \nbreak;\ncase 14: this.popState(); return \"acc_descr_value\"; \nbreak;\ncase 15: this.begin(\"acc_descr_multiline\");\nbreak;\ncase 16: this.popState(); \nbreak;\ncase 17:return \"acc_descr_multiline_value\";\nbreak;\ncase 18:return 16;\nbreak;\ncase 19:/* skip whitespace */\nbreak;\ncase 20:return 23;\nbreak;\ncase 21:return 23;\nbreak;\ncase 22: this.begin(\"struct\"); /*console.log('Starting struct');*/ return 45;\nbreak;\ncase 23:return \"EOF_IN_STRUCT\";\nbreak;\ncase 24:return \"OPEN_IN_STRUCT\";\nbreak;\ncase 25: /*console.log('Ending struct');*/this.popState(); return 47;\nbreak;\ncase 26:/* nothing */\nbreak;\ncase 27: /*console.log('lex-member: ' + yy_.yytext);*/ return \"MEMBER\";\nbreak;\ncase 28:return 43;\nbreak;\ncase 29:return 69;\nbreak;\ncase 30:return 62;\nbreak;\ncase 31:return 63;\nbreak;\ncase 32:return 65;\nbreak;\ncase 33:return 48;\nbreak;\ncase 34:return 49;\nbreak;\ncase 35:this.begin(\"generic\");\nbreak;\ncase 36:this.popState();\nbreak;\ncase 37:return \"GENERICTYPE\";\nbreak;\ncase 38:this.begin(\"string\");\nbreak;\ncase 39:this.popState();\nbreak;\ncase 40:return \"STR\";\nbreak;\ncase 41:this.begin(\"bqstring\");\nbreak;\ncase 42:this.popState();\nbreak;\ncase 43:return \"BQUOTE_STR\";\nbreak;\ncase 44:this.begin(\"href\");\nbreak;\ncase 45:this.popState();\nbreak;\ncase 46:return 68;\nbreak;\ncase 47:this.begin(\"callback_name\");\nbreak;\ncase 48:this.popState();\nbreak;\ncase 49:this.popState(); this.begin(\"callback_args\");\nbreak;\ncase 50:return 66;\nbreak;\ncase 51:this.popState();\nbreak;\ncase 52:return 67;\nbreak;\ncase 53:return 64;\nbreak;\ncase 54:return 64;\nbreak;\ncase 55:return 64;\nbreak;\ncase 56:return 64;\nbreak;\ncase 57:return 57;\nbreak;\ncase 58:return 57;\nbreak;\ncase 59:return 59;\nbreak;\ncase 60:return 59;\nbreak;\ncase 61:return 58;\nbreak;\ncase 62:return 56;\nbreak;\ncase 63:return 60;\nbreak;\ncase 64:return 61;\nbreak;\ncase 65:return 32;\nbreak;\ncase 66:return 44;\nbreak;\ncase 67:return 81;\nbreak;\ncase 68:return 'DOT';\nbreak;\ncase 69:return 'PLUS';\nbreak;\ncase 70:return 78;\nbreak;\ncase 71:return 'EQUALS';\nbreak;\ncase 72:return 'EQUALS';\nbreak;\ncase 73:return 85;\nbreak;\ncase 74:return 'PUNCTUATION';\nbreak;\ncase 75:return 84;\nbreak;\ncase 76:return 83;\nbreak;\ncase 77:return 80;\nbreak;\ncase 78:return 25;\nbreak;\n}\n},\nrules: [/^(?:%%\\{)/,/^(?:.*direction\\s+TB[^\\n]*)/,/^(?:.*direction\\s+BT[^\\n]*)/,/^(?:.*direction\\s+RL[^\\n]*)/,/^(?:.*direction\\s+LR[^\\n]*)/,/^(?:((?:(?!\\}%%)[^:.])*))/,/^(?::)/,/^(?:\\}%%)/,/^(?:((?:(?!\\}%%).|\\n)*))/,/^(?:%%(?!\\{)*[^\\n]*(\\r?\\n?)+)/,/^(?:%%[^\\n]*(\\r?\\n)*)/,/^(?:accTitle\\s*:\\s*)/,/^(?:(?!\\n||)*[^\\n]*)/,/^(?:accDescr\\s*:\\s*)/,/^(?:(?!\\n||)*[^\\n]*)/,/^(?:accDescr\\s*\\{\\s*)/,/^(?:[\\}])/,/^(?:[^\\}]*)/,/^(?:\\s*(\\r?\\n)+)/,/^(?:\\s+)/,/^(?:classDiagram-v2\\b)/,/^(?:classDiagram\\b)/,/^(?:[{])/,/^(?:$)/,/^(?:[{])/,/^(?:[}])/,/^(?:[\\n])/,/^(?:[^{}\\n]*)/,/^(?:class\\b)/,/^(?:cssClass\\b)/,/^(?:callback\\b)/,/^(?:link\\b)/,/^(?:click\\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:[~])/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:[\"])/,/^(?:[\"])/,/^(?:[^\"]*)/,/^(?:[`])/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:href[\\s]+[\"])/,/^(?:[\"])/,/^(?:[^\"]*)/,/^(?:call[\\s]+)/,/^(?:\\([\\s]*\\))/,/^(?:\\()/,/^(?:[^(]*)/,/^(?:\\))/,/^(?:[^)]*)/,/^(?:_self\\b)/,/^(?:_blank\\b)/,/^(?:_parent\\b)/,/^(?:_top\\b)/,/^(?:\\s*<\\|)/,/^(?:\\s*\\|>)/,/^(?:\\s*>)/,/^(?:\\s*<)/,/^(?:\\s*\\*)/,/^(?:\\s*o\\b)/,/^(?:--)/,/^(?:\\.\\.)/,/^(?::{1}[^:\\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\\.)/,/^(?:\\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\\w+)/,/^(?:[!\"#$%&'*+,-.`?\\\\/])/,/^(?:[0-9]+)/,/^(?:[\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6]|[\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377]|[\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5]|[\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA]|[\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE]|[\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA]|[\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0]|[\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977]|[\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2]|[\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A]|[\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39]|[\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8]|[\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C]|[\\u0B0F\\u0B10\\u0B13-\\u0B28\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\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0]|[\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310]|[\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C]|[\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711]|[\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7]|[\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C]|[\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16]|[\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF]|[\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC]|[\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D]|[\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D]|[\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3]|[\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F]|[\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128]|[\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184]|[\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3]|[\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6]|[\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE]|[\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C]|[\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D]|[\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC]|[\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B]|[\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788]|[\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805]|[\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB]|[\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28]|[\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5]|[\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4]|[\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E]|[\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D]|[\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36]|[\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D]|[\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC]|[\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF]|[\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC])/,/^(?:\\s)/,/^(?:$)/],\nconditions: {\"acc_descr_multiline\":{\"rules\":[16,17],\"inclusive\":false},\"acc_descr\":{\"rules\":[14],\"inclusive\":false},\"acc_title\":{\"rules\":[12],\"inclusive\":false},\"arg_directive\":{\"rules\":[7,8],\"inclusive\":false},\"type_directive\":{\"rules\":[6,7],\"inclusive\":false},\"open_directive\":{\"rules\":[5],\"inclusive\":false},\"callback_args\":{\"rules\":[51,52],\"inclusive\":false},\"callback_name\":{\"rules\":[48,49,50],\"inclusive\":false},\"href\":{\"rules\":[45,46],\"inclusive\":false},\"struct\":{\"rules\":[23,24,25,26,27],\"inclusive\":false},\"generic\":{\"rules\":[36,37],\"inclusive\":false},\"bqstring\":{\"rules\":[42,43],\"inclusive\":false},\"string\":{\"rules\":[39,40],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,1,2,3,4,9,10,11,13,15,18,19,20,21,22,28,29,30,31,32,33,34,35,38,41,44,47,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,5],$V2=[6,9,11,23,25,27,29,30,49],$V3=[1,17],$V4=[1,18],$V5=[1,19],$V6=[1,20],$V7=[1,21],$V8=[1,24],$V9=[1,29],$Va=[1,30],$Vb=[1,31],$Vc=[1,32],$Vd=[6,9,11,15,20,23,25,27,29,30,42,43,44,45,49],$Ve=[1,45],$Vf=[30,46,47],$Vg=[4,6,9,11,23,25,27,29,30,49],$Vh=[42,43,44,45],$Vi=[22,37],$Vj=[1,64];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"ER_DIAGRAM\":4,\"document\":5,\"EOF\":6,\"directive\":7,\"line\":8,\"SPACE\":9,\"statement\":10,\"NEWLINE\":11,\"openDirective\":12,\"typeDirective\":13,\"closeDirective\":14,\":\":15,\"argDirective\":16,\"entityName\":17,\"relSpec\":18,\"role\":19,\"BLOCK_START\":20,\"attributes\":21,\"BLOCK_STOP\":22,\"title\":23,\"title_value\":24,\"acc_title\":25,\"acc_title_value\":26,\"acc_descr\":27,\"acc_descr_value\":28,\"acc_descr_multiline_value\":29,\"ALPHANUM\":30,\".\":31,\"attribute\":32,\"attributeType\":33,\"attributeName\":34,\"attributeKeyType\":35,\"attributeComment\":36,\"ATTRIBUTE_WORD\":37,\"ATTRIBUTE_KEY\":38,\"COMMENT\":39,\"cardinality\":40,\"relType\":41,\"ZERO_OR_ONE\":42,\"ZERO_OR_MORE\":43,\"ONE_OR_MORE\":44,\"ONLY_ONE\":45,\"NON_IDENTIFYING\":46,\"IDENTIFYING\":47,\"WORD\":48,\"open_directive\":49,\"type_directive\":50,\"arg_directive\":51,\"close_directive\":52,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",4:\"ER_DIAGRAM\",6:\"EOF\",9:\"SPACE\",11:\"NEWLINE\",15:\":\",20:\"BLOCK_START\",22:\"BLOCK_STOP\",23:\"title\",24:\"title_value\",25:\"acc_title\",26:\"acc_title_value\",27:\"acc_descr\",28:\"acc_descr_value\",29:\"acc_descr_multiline_value\",30:\"ALPHANUM\",31:\".\",37:\"ATTRIBUTE_WORD\",38:\"ATTRIBUTE_KEY\",39:\"COMMENT\",42:\"ZERO_OR_ONE\",43:\"ZERO_OR_MORE\",44:\"ONE_OR_MORE\",45:\"ONLY_ONE\",46:\"NON_IDENTIFYING\",47:\"IDENTIFYING\",48:\"WORD\",49:\"open_directive\",50:\"type_directive\",51:\"arg_directive\",52:\"close_directive\"},\nproductions_: [0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,5],[10,4],[10,3],[10,1],[10,2],[10,2],[10,2],[10,1],[17,1],[17,3],[21,1],[21,2],[32,2],[32,3],[32,3],[32,4],[33,1],[34,1],[35,1],[36,1],[18,3],[40,1],[40,1],[40,1],[40,1],[41,1],[41,1],[19,1],[19,1],[12,1],[13,1],[16,1],[14,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 1:\n /*console.log('finished parsing');*/ \nbreak;\ncase 3:\n this.$ = [] \nbreak;\ncase 4:\n$$[$0-1].push($$[$0]);this.$ = $$[$0-1]\nbreak;\ncase 5: case 6:\n this.$ = $$[$0] \nbreak;\ncase 7: case 8:\n this.$=[];\nbreak;\ncase 12:\n\n yy.addEntity($$[$0-4]);\n yy.addEntity($$[$0-2]);\n yy.addRelationship($$[$0-4], $$[$0], $$[$0-2], $$[$0-3]);\n /*console.log($$[$0-4] + $$[$0-3] + $$[$0-2] + ':' + $$[$0]);*/\n \nbreak;\ncase 13:\n\n /* console.log('detected block'); */\n yy.addEntity($$[$0-3]);\n yy.addAttributes($$[$0-3], $$[$0-1]);\n /* console.log('handled block'); */\n \nbreak;\ncase 14:\n yy.addEntity($$[$0-2]); \nbreak;\ncase 15:\n yy.addEntity($$[$0]); \nbreak;\ncase 16: case 17:\n this.$=$$[$0].trim();yy.setAccTitle(this.$); \nbreak;\ncase 18: case 19:\n this.$=$$[$0].trim();yy.setAccDescription(this.$); \nbreak;\ncase 20:\n this.$ = $$[$0]; /*console.log('Entity: ' + $$[$0]);*/ \nbreak;\ncase 21:\n this.$ = $$[$0-2] + $$[$0-1] + $$[$0]; \nbreak;\ncase 22:\n this.$ = [$$[$0]]; \nbreak;\ncase 23:\n $$[$0].push($$[$0-1]); this.$=$$[$0]; \nbreak;\ncase 24:\n this.$ = { attributeType: $$[$0-1], attributeName: $$[$0] }; \nbreak;\ncase 25:\n this.$ = { attributeType: $$[$0-2], attributeName: $$[$0-1], attributeKeyType: $$[$0] }; \nbreak;\ncase 26:\n this.$ = { attributeType: $$[$0-2], attributeName: $$[$0-1], attributeComment: $$[$0] }; \nbreak;\ncase 27:\n this.$ = { attributeType: $$[$0-3], attributeName: $$[$0-2], attributeKeyType: $$[$0-1], attributeComment: $$[$0] }; \nbreak;\ncase 28: case 29: case 30:\n this.$=$$[$0]; \nbreak;\ncase 31:\n this.$=$$[$0].replace(/\"/g, ''); \nbreak;\ncase 32:\n\n this.$ = { cardA: $$[$0], relType: $$[$0-1], cardB: $$[$0-2] };\n /*console.log('relSpec: ' + $$[$0] + $$[$0-1] + $$[$0-2]);*/\n \nbreak;\ncase 33:\n this.$ = yy.Cardinality.ZERO_OR_ONE; \nbreak;\ncase 34:\n this.$ = yy.Cardinality.ZERO_OR_MORE; \nbreak;\ncase 35:\n this.$ = yy.Cardinality.ONE_OR_MORE; \nbreak;\ncase 36:\n this.$ = yy.Cardinality.ONLY_ONE; \nbreak;\ncase 37:\n this.$ = yy.Identification.NON_IDENTIFYING; \nbreak;\ncase 38:\n this.$ = yy.Identification.IDENTIFYING; \nbreak;\ncase 39:\n this.$ = $$[$0].replace(/\"/g, ''); \nbreak;\ncase 40:\n this.$ = $$[$0]; \nbreak;\ncase 41:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 42:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 43:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 44:\n yy.parseDirective('}%%', 'close_directive', 'er'); \nbreak;\n}\n},\ntable: [{3:1,4:$V0,7:3,12:4,49:$V1},{1:[3]},o($V2,[2,3],{5:6}),{3:7,4:$V0,7:3,12:4,49:$V1},{13:8,50:[1,9]},{50:[2,41]},{6:[1,10],7:15,8:11,9:[1,12],10:13,11:[1,14],12:4,17:16,23:$V3,25:$V4,27:$V5,29:$V6,30:$V7,49:$V1},{1:[2,2]},{14:22,15:[1,23],52:$V8},o([15,52],[2,42]),o($V2,[2,8],{1:[2,1]}),o($V2,[2,4]),{7:15,10:25,12:4,17:16,23:$V3,25:$V4,27:$V5,29:$V6,30:$V7,49:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,11]),o($V2,[2,15],{18:26,40:28,20:[1,27],42:$V9,43:$Va,44:$Vb,45:$Vc}),{24:[1,33]},{26:[1,34]},{28:[1,35]},o($V2,[2,19]),o($Vd,[2,20],{31:[1,36]}),{11:[1,37]},{16:38,51:[1,39]},{11:[2,44]},o($V2,[2,5]),{17:40,30:$V7},{21:41,22:[1,42],32:43,33:44,37:$Ve},{41:46,46:[1,47],47:[1,48]},o($Vf,[2,33]),o($Vf,[2,34]),o($Vf,[2,35]),o($Vf,[2,36]),o($V2,[2,16]),o($V2,[2,17]),o($V2,[2,18]),{17:49,30:$V7},o($Vg,[2,9]),{14:50,52:$V8},{52:[2,43]},{15:[1,51]},{22:[1,52]},o($V2,[2,14]),{21:53,22:[2,22],32:43,33:44,37:$Ve},{34:54,37:[1,55]},{37:[2,28]},{40:56,42:$V9,43:$Va,44:$Vb,45:$Vc},o($Vh,[2,37]),o($Vh,[2,38]),o($Vd,[2,21]),{11:[1,57]},{19:58,30:[1,60],48:[1,59]},o($V2,[2,13]),{22:[2,23]},o($Vi,[2,24],{35:61,36:62,38:[1,63],39:$Vj}),o([22,37,38,39],[2,29]),{30:[2,32]},o($Vg,[2,10]),o($V2,[2,12]),o($V2,[2,39]),o($V2,[2,40]),o($Vi,[2,25],{36:65,39:$Vj}),o($Vi,[2,26]),o([22,37,39],[2,30]),o($Vi,[2,31]),o($Vi,[2,27])],\ndefaultActions: {5:[2,41],7:[2,2],24:[2,44],39:[2,43],45:[2,28],53:[2,23],56:[2,32]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin(\"acc_title\");return 25; \nbreak;\ncase 1: this.popState(); return \"acc_title_value\"; \nbreak;\ncase 2: this.begin(\"acc_descr\");return 27; \nbreak;\ncase 3: this.popState(); return \"acc_descr_value\"; \nbreak;\ncase 4: this.begin(\"acc_descr_multiline\");\nbreak;\ncase 5: this.popState(); \nbreak;\ncase 6:return \"acc_descr_multiline_value\";\nbreak;\ncase 7: this.begin('open_directive'); return 49; \nbreak;\ncase 8: this.begin('type_directive'); return 50; \nbreak;\ncase 9: this.popState(); this.begin('arg_directive'); return 15; \nbreak;\ncase 10: this.popState(); this.popState(); return 52; \nbreak;\ncase 11:return 51;\nbreak;\ncase 12:/* skip comments */\nbreak;\ncase 13:/* skip comments */\nbreak;\ncase 14:return 11;\nbreak;\ncase 15:/* skip whitespace */\nbreak;\ncase 16:return 9;\nbreak;\ncase 17:return 48;\nbreak;\ncase 18:return 4;\nbreak;\ncase 19: this.begin(\"block\"); return 20; \nbreak;\ncase 20:/* skip whitespace in block */\nbreak;\ncase 21:return 38\nbreak;\ncase 22:return 37\nbreak;\ncase 23:return 39;\nbreak;\ncase 24:/* nothing */\nbreak;\ncase 25: this.popState(); return 22; \nbreak;\ncase 26:return yy_.yytext[0];\nbreak;\ncase 27:return 42;\nbreak;\ncase 28:return 43;\nbreak;\ncase 29:return 44;\nbreak;\ncase 30:return 45;\nbreak;\ncase 31:return 42;\nbreak;\ncase 32:return 43;\nbreak;\ncase 33:return 44;\nbreak;\ncase 34:return 46;\nbreak;\ncase 35:return 47;\nbreak;\ncase 36:return 46;\nbreak;\ncase 37:return 46;\nbreak;\ncase 38:return 30;\nbreak;\ncase 39:return yy_.yytext[0];\nbreak;\ncase 40:return 6;\nbreak;\n}\n},\nrules: [/^(?:accTitle\\s*:\\s*)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:accDescr\\s*:\\s*)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:accDescr\\s*\\{\\s*)/i,/^(?:[\\}])/i,/^(?:[^\\}]*)/i,/^(?:%%\\{)/i,/^(?:((?:(?!\\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\\}%%)/i,/^(?:((?:(?!\\}%%).|\\n)*))/i,/^(?:%(?!\\{)[^\\n]*)/i,/^(?:[^\\}]%%[^\\n]*)/i,/^(?:[\\n]+)/i,/^(?:\\s+)/i,/^(?:[\\s]+)/i,/^(?:\"[^\"]*\")/i,/^(?:erDiagram\\b)/i,/^(?:\\{)/i,/^(?:\\s+)/i,/^(?:\\b((?:PK)|(?:FK))\\b)/i,/^(?:[A-Za-z][A-Za-z0-9\\-_]*)/i,/^(?:\"[^\"]*\")/i,/^(?:[\\n]+)/i,/^(?:\\})/i,/^(?:.)/i,/^(?:\\|o\\b)/i,/^(?:\\}o\\b)/i,/^(?:\\}\\|)/i,/^(?:\\|\\|)/i,/^(?:o\\|)/i,/^(?:o\\{)/i,/^(?:\\|\\{)/i,/^(?:\\.\\.)/i,/^(?:--)/i,/^(?:\\.-)/i,/^(?:-\\.)/i,/^(?:[A-Za-z][A-Za-z0-9\\-_]*)/i,/^(?:.)/i,/^(?:$)/i],\nconditions: {\"acc_descr_multiline\":{\"rules\":[5,6],\"inclusive\":false},\"acc_descr\":{\"rules\":[3],\"inclusive\":false},\"acc_title\":{\"rules\":[1],\"inclusive\":false},\"open_directive\":{\"rules\":[8],\"inclusive\":false},\"type_directive\":{\"rules\":[9,10],\"inclusive\":false},\"arg_directive\":{\"rules\":[10,11],\"inclusive\":false},\"block\":{\"rules\":[20,21,22,23,24,25,26],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,2,4,7,12,13,14,15,16,17,18,19,27,28,29,30,31,32,33,34,35,36,37,38,39,40],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,9],$V1=[1,7],$V2=[1,6],$V3=[1,8],$V4=[1,20,21,22,23,38,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],$V5=[2,10],$V6=[1,20],$V7=[1,21],$V8=[1,22],$V9=[1,23],$Va=[1,30],$Vb=[1,32],$Vc=[1,33],$Vd=[1,34],$Ve=[1,62],$Vf=[1,48],$Vg=[1,52],$Vh=[1,36],$Vi=[1,37],$Vj=[1,38],$Vk=[1,39],$Vl=[1,40],$Vm=[1,56],$Vn=[1,63],$Vo=[1,51],$Vp=[1,53],$Vq=[1,55],$Vr=[1,59],$Vs=[1,60],$Vt=[1,41],$Vu=[1,42],$Vv=[1,43],$Vw=[1,44],$Vx=[1,61],$Vy=[1,50],$Vz=[1,54],$VA=[1,57],$VB=[1,58],$VC=[1,49],$VD=[1,66],$VE=[1,71],$VF=[1,20,21,22,23,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],$VG=[1,75],$VH=[1,74],$VI=[1,76],$VJ=[20,21,23,81,82],$VK=[1,99],$VL=[1,104],$VM=[1,107],$VN=[1,108],$VO=[1,101],$VP=[1,106],$VQ=[1,109],$VR=[1,102],$VS=[1,114],$VT=[1,113],$VU=[1,103],$VV=[1,105],$VW=[1,110],$VX=[1,111],$VY=[1,112],$VZ=[1,115],$V_=[20,21,22,23,81,82],$V$=[20,21,22,23,53,81,82],$V01=[20,21,22,23,40,52,53,55,57,59,61,63,65,66,67,69,71,73,74,76,81,82,91,95,105,106,109,111,112,122,123,124,125,126,127],$V11=[20,21,23],$V21=[20,21,23,52,66,67,81,82,91,95,105,106,109,111,112,122,123,124,125,126,127],$V31=[1,12,20,21,22,23,24,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],$V41=[52,66,67,91,95,105,106,109,111,112,122,123,124,125,126,127],$V51=[1,149],$V61=[1,157],$V71=[1,158],$V81=[1,159],$V91=[1,160],$Va1=[1,144],$Vb1=[1,145],$Vc1=[1,141],$Vd1=[1,152],$Ve1=[1,153],$Vf1=[1,154],$Vg1=[1,155],$Vh1=[1,156],$Vi1=[1,161],$Vj1=[1,162],$Vk1=[1,147],$Vl1=[1,150],$Vm1=[1,146],$Vn1=[1,143],$Vo1=[20,21,22,23,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],$Vp1=[1,165],$Vq1=[20,21,22,23,26,52,66,67,91,105,106,109,111,112,122,123,124,125,126,127],$Vr1=[20,21,22,23,24,26,38,40,41,42,52,56,58,60,62,64,66,67,68,70,72,73,75,77,81,82,86,87,88,89,90,91,92,95,105,106,109,111,112,113,114,122,123,124,125,126,127],$Vs1=[12,21,22,24],$Vt1=[22,106],$Vu1=[1,250],$Vv1=[1,245],$Vw1=[1,246],$Vx1=[1,254],$Vy1=[1,251],$Vz1=[1,248],$VA1=[1,247],$VB1=[1,249],$VC1=[1,252],$VD1=[1,253],$VE1=[1,255],$VF1=[1,273],$VG1=[20,21,23,106],$VH1=[20,21,22,23,66,67,86,102,105,106,109,110,111,112,113];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"mermaidDoc\":4,\"directive\":5,\"openDirective\":6,\"typeDirective\":7,\"closeDirective\":8,\"separator\":9,\":\":10,\"argDirective\":11,\"open_directive\":12,\"type_directive\":13,\"arg_directive\":14,\"close_directive\":15,\"graphConfig\":16,\"document\":17,\"line\":18,\"statement\":19,\"SEMI\":20,\"NEWLINE\":21,\"SPACE\":22,\"EOF\":23,\"GRAPH\":24,\"NODIR\":25,\"DIR\":26,\"FirstStmtSeperator\":27,\"ending\":28,\"endToken\":29,\"spaceList\":30,\"spaceListNewline\":31,\"verticeStatement\":32,\"styleStatement\":33,\"linkStyleStatement\":34,\"classDefStatement\":35,\"classStatement\":36,\"clickStatement\":37,\"subgraph\":38,\"text\":39,\"SQS\":40,\"SQE\":41,\"end\":42,\"direction\":43,\"acc_title\":44,\"acc_title_value\":45,\"acc_descr\":46,\"acc_descr_value\":47,\"acc_descr_multiline_value\":48,\"link\":49,\"node\":50,\"vertex\":51,\"AMP\":52,\"STYLE_SEPARATOR\":53,\"idString\":54,\"DOUBLECIRCLESTART\":55,\"DOUBLECIRCLEEND\":56,\"PS\":57,\"PE\":58,\"(-\":59,\"-)\":60,\"STADIUMSTART\":61,\"STADIUMEND\":62,\"SUBROUTINESTART\":63,\"SUBROUTINEEND\":64,\"VERTEX_WITH_PROPS_START\":65,\"ALPHA\":66,\"COLON\":67,\"PIPE\":68,\"CYLINDERSTART\":69,\"CYLINDEREND\":70,\"DIAMOND_START\":71,\"DIAMOND_STOP\":72,\"TAGEND\":73,\"TRAPSTART\":74,\"TRAPEND\":75,\"INVTRAPSTART\":76,\"INVTRAPEND\":77,\"linkStatement\":78,\"arrowText\":79,\"TESTSTR\":80,\"START_LINK\":81,\"LINK\":82,\"textToken\":83,\"STR\":84,\"keywords\":85,\"STYLE\":86,\"LINKSTYLE\":87,\"CLASSDEF\":88,\"CLASS\":89,\"CLICK\":90,\"DOWN\":91,\"UP\":92,\"textNoTags\":93,\"textNoTagsToken\":94,\"DEFAULT\":95,\"stylesOpt\":96,\"alphaNum\":97,\"CALLBACKNAME\":98,\"CALLBACKARGS\":99,\"HREF\":100,\"LINK_TARGET\":101,\"HEX\":102,\"numList\":103,\"INTERPOLATE\":104,\"NUM\":105,\"COMMA\":106,\"style\":107,\"styleComponent\":108,\"MINUS\":109,\"UNIT\":110,\"BRKT\":111,\"DOT\":112,\"PCT\":113,\"TAGSTART\":114,\"alphaNumToken\":115,\"idStringToken\":116,\"alphaNumStatement\":117,\"direction_tb\":118,\"direction_bt\":119,\"direction_rl\":120,\"direction_lr\":121,\"PUNCTUATION\":122,\"UNICODE_TEXT\":123,\"PLUS\":124,\"EQUALS\":125,\"MULT\":126,\"UNDERSCORE\":127,\"graphCodeTokens\":128,\"ARROW_CROSS\":129,\"ARROW_POINT\":130,\"ARROW_CIRCLE\":131,\"ARROW_OPEN\":132,\"QUOTE\":133,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",10:\":\",12:\"open_directive\",13:\"type_directive\",14:\"arg_directive\",15:\"close_directive\",20:\"SEMI\",21:\"NEWLINE\",22:\"SPACE\",23:\"EOF\",24:\"GRAPH\",25:\"NODIR\",26:\"DIR\",38:\"subgraph\",40:\"SQS\",41:\"SQE\",42:\"end\",44:\"acc_title\",45:\"acc_title_value\",46:\"acc_descr\",47:\"acc_descr_value\",48:\"acc_descr_multiline_value\",52:\"AMP\",53:\"STYLE_SEPARATOR\",55:\"DOUBLECIRCLESTART\",56:\"DOUBLECIRCLEEND\",57:\"PS\",58:\"PE\",59:\"(-\",60:\"-)\",61:\"STADIUMSTART\",62:\"STADIUMEND\",63:\"SUBROUTINESTART\",64:\"SUBROUTINEEND\",65:\"VERTEX_WITH_PROPS_START\",66:\"ALPHA\",67:\"COLON\",68:\"PIPE\",69:\"CYLINDERSTART\",70:\"CYLINDEREND\",71:\"DIAMOND_START\",72:\"DIAMOND_STOP\",73:\"TAGEND\",74:\"TRAPSTART\",75:\"TRAPEND\",76:\"INVTRAPSTART\",77:\"INVTRAPEND\",80:\"TESTSTR\",81:\"START_LINK\",82:\"LINK\",84:\"STR\",86:\"STYLE\",87:\"LINKSTYLE\",88:\"CLASSDEF\",89:\"CLASS\",90:\"CLICK\",91:\"DOWN\",92:\"UP\",95:\"DEFAULT\",98:\"CALLBACKNAME\",99:\"CALLBACKARGS\",100:\"HREF\",101:\"LINK_TARGET\",102:\"HEX\",104:\"INTERPOLATE\",105:\"NUM\",106:\"COMMA\",109:\"MINUS\",110:\"UNIT\",111:\"BRKT\",112:\"DOT\",113:\"PCT\",114:\"TAGSTART\",118:\"direction_tb\",119:\"direction_bt\",120:\"direction_rl\",121:\"direction_lr\",122:\"PUNCTUATION\",123:\"UNICODE_TEXT\",124:\"PLUS\",125:\"EQUALS\",126:\"MULT\",127:\"UNDERSCORE\",129:\"ARROW_CROSS\",130:\"ARROW_POINT\",131:\"ARROW_CIRCLE\",132:\"ARROW_OPEN\",133:\"QUOTE\"},\nproductions_: [0,[3,1],[3,2],[5,4],[5,6],[6,1],[7,1],[11,1],[8,1],[4,2],[17,0],[17,2],[18,1],[18,1],[18,1],[18,1],[18,1],[16,2],[16,2],[16,2],[16,3],[28,2],[28,1],[29,1],[29,1],[29,1],[27,1],[27,1],[27,2],[31,2],[31,2],[31,1],[31,1],[30,2],[30,1],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,9],[19,6],[19,4],[19,1],[19,2],[19,2],[19,1],[9,1],[9,1],[9,1],[32,3],[32,4],[32,2],[32,1],[50,1],[50,5],[50,3],[51,4],[51,4],[51,6],[51,4],[51,4],[51,4],[51,8],[51,4],[51,4],[51,4],[51,6],[51,4],[51,4],[51,4],[51,4],[51,4],[51,1],[49,2],[49,3],[49,3],[49,1],[49,3],[78,1],[79,3],[39,1],[39,2],[39,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[93,1],[93,2],[35,5],[35,5],[36,5],[37,2],[37,4],[37,3],[37,5],[37,2],[37,4],[37,4],[37,6],[37,2],[37,4],[37,2],[37,4],[37,4],[37,6],[33,5],[33,5],[34,5],[34,5],[34,9],[34,9],[34,7],[34,7],[103,1],[103,3],[96,1],[96,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[94,1],[94,1],[94,1],[94,1],[54,1],[54,2],[97,1],[97,2],[117,1],[117,1],[117,1],[117,1],[43,1],[43,1],[43,1],[43,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 5:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 6:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 7:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 8:\n yy.parseDirective('}%%', 'close_directive', 'flowchart'); \nbreak;\ncase 10:\n this.$ = [];\nbreak;\ncase 11:\n\n\t if($$[$0] !== []){\n\t $$[$0-1].push($$[$0]);\n\t }\n\t this.$=$$[$0-1];\nbreak;\ncase 12: case 82: case 84: case 96: case 152: case 154: case 155:\nthis.$=$$[$0];\nbreak;\ncase 19:\n yy.setDirection('TB');this.$ = 'TB';\nbreak;\ncase 20:\n yy.setDirection($$[$0-1]);this.$ = $$[$0-1];\nbreak;\ncase 35:\n /* console.warn('finat vs', $$[$0-1].nodes); */ this.$=$$[$0-1].nodes\nbreak;\ncase 36: case 37: case 38: case 39: case 40:\nthis.$=[];\nbreak;\ncase 41:\nthis.$=yy.addSubGraph($$[$0-6],$$[$0-1],$$[$0-4]);\nbreak;\ncase 42:\nthis.$=yy.addSubGraph($$[$0-3],$$[$0-1],$$[$0-3]);\nbreak;\ncase 43:\nthis.$=yy.addSubGraph(undefined,$$[$0-1],undefined);\nbreak;\ncase 45:\n this.$=$$[$0].trim();yy.setAccTitle(this.$); \nbreak;\ncase 46: case 47:\n this.$=$$[$0].trim();yy.setAccDescription(this.$); \nbreak;\ncase 51:\n /* console.warn('vs',$$[$0-2].stmt,$$[$0]); */ yy.addLink($$[$0-2].stmt,$$[$0],$$[$0-1]); this.$ = { stmt: $$[$0], nodes: $$[$0].concat($$[$0-2].nodes) } \nbreak;\ncase 52:\n /* console.warn('vs',$$[$0-3].stmt,$$[$0-1]); */ yy.addLink($$[$0-3].stmt,$$[$0-1],$$[$0-2]); this.$ = { stmt: $$[$0-1], nodes: $$[$0-1].concat($$[$0-3].nodes) } \nbreak;\ncase 53:\n/*console.warn('noda', $$[$0-1]);*/ this.$ = {stmt: $$[$0-1], nodes:$$[$0-1] }\nbreak;\ncase 54:\n /*console.warn('noda', $$[$0]);*/ this.$ = {stmt: $$[$0], nodes:$$[$0] }\nbreak;\ncase 55:\n /* console.warn('nod', $$[$0]); */ this.$ = [$$[$0]];\nbreak;\ncase 56:\n this.$ = $$[$0-4].concat($$[$0]); /* console.warn('pip', $$[$0-4][0], $$[$0], this.$); */ \nbreak;\ncase 57:\nthis.$ = [$$[$0-2]];yy.setClass($$[$0-2],$$[$0])\nbreak;\ncase 58:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'square');\nbreak;\ncase 59:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'doublecircle');\nbreak;\ncase 60:\nthis.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'circle');\nbreak;\ncase 61:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'ellipse');\nbreak;\ncase 62:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'stadium');\nbreak;\ncase 63:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'subroutine');\nbreak;\ncase 64:\nthis.$ = $$[$0-7];yy.addVertex($$[$0-7],$$[$0-1],'rect',undefined,undefined,undefined, Object.fromEntries([[$$[$0-5], $$[$0-3]]]));\nbreak;\ncase 65:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'cylinder');\nbreak;\ncase 66:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'round');\nbreak;\ncase 67:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'diamond');\nbreak;\ncase 68:\nthis.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'hexagon');\nbreak;\ncase 69:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'odd');\nbreak;\ncase 70:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'trapezoid');\nbreak;\ncase 71:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'inv_trapezoid');\nbreak;\ncase 72:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_right');\nbreak;\ncase 73:\nthis.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_left');\nbreak;\ncase 74:\n /*console.warn('h: ', $$[$0]);*/this.$ = $$[$0];yy.addVertex($$[$0]);\nbreak;\ncase 75:\n$$[$0-1].text = $$[$0];this.$ = $$[$0-1];\nbreak;\ncase 76: case 77:\n$$[$0-2].text = $$[$0-1];this.$ = $$[$0-2];\nbreak;\ncase 78:\nthis.$ = $$[$0];\nbreak;\ncase 79:\nvar inf = yy.destructLink($$[$0], $$[$0-2]); this.$ = {\"type\":inf.type,\"stroke\":inf.stroke,\"length\":inf.length,\"text\":$$[$0-1]};\nbreak;\ncase 80:\nvar inf = yy.destructLink($$[$0]);this.$ = {\"type\":inf.type,\"stroke\":inf.stroke,\"length\":inf.length};\nbreak;\ncase 81:\nthis.$ = $$[$0-1];\nbreak;\ncase 83: case 97: case 153:\nthis.$=$$[$0-1]+''+$$[$0];\nbreak;\ncase 98: case 99:\nthis.$ = $$[$0-4];yy.addClass($$[$0-2],$$[$0]);\nbreak;\ncase 100:\nthis.$ = $$[$0-4];yy.setClass($$[$0-2], $$[$0]);\nbreak;\ncase 101: case 109:\nthis.$ = $$[$0-1];yy.setClickEvent($$[$0-1], $$[$0]);\nbreak;\ncase 102: case 110:\nthis.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-3], $$[$0]);\nbreak;\ncase 103:\nthis.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]);\nbreak;\ncase 104:\nthis.$ = $$[$0-4];yy.setClickEvent($$[$0-4], $$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-4], $$[$0]);\nbreak;\ncase 105: case 111:\nthis.$ = $$[$0-1];yy.setLink($$[$0-1], $$[$0]);\nbreak;\ncase 106: case 112:\nthis.$ = $$[$0-3];yy.setLink($$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-3], $$[$0]);\nbreak;\ncase 107: case 113:\nthis.$ = $$[$0-3];yy.setLink($$[$0-3], $$[$0-2], $$[$0]);\nbreak;\ncase 108: case 114:\nthis.$ = $$[$0-5];yy.setLink($$[$0-5], $$[$0-4], $$[$0]);yy.setTooltip($$[$0-5], $$[$0-2]);\nbreak;\ncase 115:\nthis.$ = $$[$0-4];yy.addVertex($$[$0-2],undefined,undefined,$$[$0]);\nbreak;\ncase 116: case 118:\nthis.$ = $$[$0-4];yy.updateLink($$[$0-2],$$[$0]);\nbreak;\ncase 117:\nthis.$ = $$[$0-4];yy.updateLink([$$[$0-2]],$$[$0]);\nbreak;\ncase 119:\nthis.$ = $$[$0-8];yy.updateLinkInterpolate([$$[$0-6]],$$[$0-2]);yy.updateLink([$$[$0-6]],$$[$0]);\nbreak;\ncase 120:\nthis.$ = $$[$0-8];yy.updateLinkInterpolate($$[$0-6],$$[$0-2]);yy.updateLink($$[$0-6],$$[$0]);\nbreak;\ncase 121:\nthis.$ = $$[$0-6];yy.updateLinkInterpolate([$$[$0-4]],$$[$0]);\nbreak;\ncase 122:\nthis.$ = $$[$0-6];yy.updateLinkInterpolate($$[$0-4],$$[$0]);\nbreak;\ncase 123: case 125:\nthis.$ = [$$[$0]]\nbreak;\ncase 124: case 126:\n$$[$0-2].push($$[$0]);this.$ = $$[$0-2];\nbreak;\ncase 128:\nthis.$ = $$[$0-1] + $$[$0];\nbreak;\ncase 150:\nthis.$=$$[$0]\nbreak;\ncase 151:\nthis.$=$$[$0-1]+''+$$[$0]\nbreak;\ncase 156:\nthis.$='v';\nbreak;\ncase 157:\nthis.$='-';\nbreak;\ncase 158:\n this.$={stmt:'dir', value:'TB'};\nbreak;\ncase 159:\n this.$={stmt:'dir', value:'BT'};\nbreak;\ncase 160:\n this.$={stmt:'dir', value:'RL'};\nbreak;\ncase 161:\n this.$={stmt:'dir', value:'LR'};\nbreak;\n}\n},\ntable: [{3:1,4:2,5:3,6:5,12:$V0,16:4,21:$V1,22:$V2,24:$V3},{1:[3]},{1:[2,1]},{3:10,4:2,5:3,6:5,12:$V0,16:4,21:$V1,22:$V2,24:$V3},o($V4,$V5,{17:11}),{7:12,13:[1,13]},{16:14,21:$V1,22:$V2,24:$V3},{16:15,21:$V1,22:$V2,24:$V3},{25:[1,16],26:[1,17]},{13:[2,5]},{1:[2,2]},{1:[2,9],18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,43:31,44:$Vb,46:$Vc,48:$Vd,50:35,51:45,52:$Ve,54:46,66:$Vf,67:$Vg,86:$Vh,87:$Vi,88:$Vj,89:$Vk,90:$Vl,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,118:$Vt,119:$Vu,120:$Vv,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},{8:64,10:[1,65],15:$VD},o([10,15],[2,6]),o($V4,[2,17]),o($V4,[2,18]),o($V4,[2,19]),{20:[1,68],21:[1,69],22:$VE,27:67,30:70},o($VF,[2,11]),o($VF,[2,12]),o($VF,[2,13]),o($VF,[2,14]),o($VF,[2,15]),o($VF,[2,16]),{9:72,20:$VG,21:$VH,23:$VI,49:73,78:77,81:[1,78],82:[1,79]},{9:80,20:$VG,21:$VH,23:$VI},{9:81,20:$VG,21:$VH,23:$VI},{9:82,20:$VG,21:$VH,23:$VI},{9:83,20:$VG,21:$VH,23:$VI},{9:84,20:$VG,21:$VH,23:$VI},{9:86,20:$VG,21:$VH,22:[1,85],23:$VI},o($VF,[2,44]),{45:[1,87]},{47:[1,88]},o($VF,[2,47]),o($VJ,[2,54],{30:89,22:$VE}),{22:[1,90]},{22:[1,91]},{22:[1,92]},{22:[1,93]},{26:$VK,52:$VL,66:$VM,67:$VN,84:[1,97],91:$VO,97:96,98:[1,94],100:[1,95],105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($VF,[2,158]),o($VF,[2,159]),o($VF,[2,160]),o($VF,[2,161]),o($V_,[2,55],{53:[1,116]}),o($V$,[2,74],{116:129,40:[1,117],52:$Ve,55:[1,118],57:[1,119],59:[1,120],61:[1,121],63:[1,122],65:[1,123],66:$Vf,67:$Vg,69:[1,124],71:[1,125],73:[1,126],74:[1,127],76:[1,128],91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC}),o($V01,[2,150]),o($V01,[2,175]),o($V01,[2,176]),o($V01,[2,177]),o($V01,[2,178]),o($V01,[2,179]),o($V01,[2,180]),o($V01,[2,181]),o($V01,[2,182]),o($V01,[2,183]),o($V01,[2,184]),o($V01,[2,185]),o($V01,[2,186]),o($V01,[2,187]),o($V01,[2,188]),o($V01,[2,189]),o($V01,[2,190]),{9:130,20:$VG,21:$VH,23:$VI},{11:131,14:[1,132]},o($V11,[2,8]),o($V4,[2,20]),o($V4,[2,26]),o($V4,[2,27]),{21:[1,133]},o($V21,[2,34],{30:134,22:$VE}),o($VF,[2,35]),{50:135,51:45,52:$Ve,54:46,66:$Vf,67:$Vg,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},o($V31,[2,48]),o($V31,[2,49]),o($V31,[2,50]),o($V41,[2,78],{79:136,68:[1,138],80:[1,137]}),{22:$V51,24:$V61,26:$V71,38:$V81,39:139,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o([52,66,67,68,80,91,95,105,106,109,111,112,122,123,124,125,126,127],[2,80]),o($VF,[2,36]),o($VF,[2,37]),o($VF,[2,38]),o($VF,[2,39]),o($VF,[2,40]),{22:$V51,24:$V61,26:$V71,38:$V81,39:163,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($Vo1,$V5,{17:164}),o($VF,[2,45]),o($VF,[2,46]),o($VJ,[2,53],{52:$Vp1}),{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,97:166,102:[1,167],105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{95:[1,168],103:169,105:[1,170]},{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,95:[1,171],97:172,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,97:173,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V11,[2,101],{22:[1,174],99:[1,175]}),o($V11,[2,105],{22:[1,176]}),o($V11,[2,109],{115:100,117:178,22:[1,177],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ}),o($V11,[2,111],{22:[1,179]}),o($Vq1,[2,152]),o($Vq1,[2,154]),o($Vq1,[2,155]),o($Vq1,[2,156]),o($Vq1,[2,157]),o($Vr1,[2,162]),o($Vr1,[2,163]),o($Vr1,[2,164]),o($Vr1,[2,165]),o($Vr1,[2,166]),o($Vr1,[2,167]),o($Vr1,[2,168]),o($Vr1,[2,169]),o($Vr1,[2,170]),o($Vr1,[2,171]),o($Vr1,[2,172]),o($Vr1,[2,173]),o($Vr1,[2,174]),{52:$Ve,54:180,66:$Vf,67:$Vg,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},{22:$V51,24:$V61,26:$V71,38:$V81,39:181,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:182,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:184,42:$V91,52:$VL,57:[1,183],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:185,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:186,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:187,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{66:[1,188]},{22:$V51,24:$V61,26:$V71,38:$V81,39:189,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:190,42:$V91,52:$VL,66:$VM,67:$VN,71:[1,191],73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:192,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:193,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:194,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V01,[2,151]),o($Vs1,[2,3]),{8:195,15:$VD},{15:[2,7]},o($V4,[2,28]),o($V21,[2,33]),o($VJ,[2,51],{30:196,22:$VE}),o($V41,[2,75],{22:[1,197]}),{22:[1,198]},{22:$V51,24:$V61,26:$V71,38:$V81,39:199,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,82:[1,200],83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($Vr1,[2,82]),o($Vr1,[2,84]),o($Vr1,[2,140]),o($Vr1,[2,141]),o($Vr1,[2,142]),o($Vr1,[2,143]),o($Vr1,[2,144]),o($Vr1,[2,145]),o($Vr1,[2,146]),o($Vr1,[2,147]),o($Vr1,[2,148]),o($Vr1,[2,149]),o($Vr1,[2,85]),o($Vr1,[2,86]),o($Vr1,[2,87]),o($Vr1,[2,88]),o($Vr1,[2,89]),o($Vr1,[2,90]),o($Vr1,[2,91]),o($Vr1,[2,92]),o($Vr1,[2,93]),o($Vr1,[2,94]),o($Vr1,[2,95]),{9:203,20:$VG,21:$VH,22:$V51,23:$VI,24:$V61,26:$V71,38:$V81,40:[1,202],42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,204],43:31,44:$Vb,46:$Vc,48:$Vd,50:35,51:45,52:$Ve,54:46,66:$Vf,67:$Vg,86:$Vh,87:$Vi,88:$Vj,89:$Vk,90:$Vl,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,118:$Vt,119:$Vu,120:$Vv,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},{22:$VE,30:205},{22:[1,206],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:178,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:[1,207]},{22:[1,208]},{22:[1,209],106:[1,210]},o($Vt1,[2,123]),{22:[1,211]},{22:[1,212],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:178,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:[1,213],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:178,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{84:[1,214]},o($V11,[2,103],{22:[1,215]}),{84:[1,216],101:[1,217]},{84:[1,218]},o($Vq1,[2,153]),{84:[1,219],101:[1,220]},o($V_,[2,57],{116:129,52:$Ve,66:$Vf,67:$Vg,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC}),{22:$V51,24:$V61,26:$V71,38:$V81,41:[1,221],42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,56:[1,222],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:223,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,58:[1,224],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,60:[1,225],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,62:[1,226],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,64:[1,227],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{67:[1,228]},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,70:[1,229],73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,72:[1,230],73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:231,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,41:[1,232],42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,75:[1,233],77:[1,234],81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,75:[1,236],77:[1,235],81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{9:237,20:$VG,21:$VH,23:$VI},o($VJ,[2,52],{52:$Vp1}),o($V41,[2,77]),o($V41,[2,76]),{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,68:[1,238],73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V41,[2,79]),o($Vr1,[2,83]),{22:$V51,24:$V61,26:$V71,38:$V81,39:239,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($Vo1,$V5,{17:240}),o($VF,[2,43]),{51:241,52:$Ve,54:46,66:$Vf,67:$Vg,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:242,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:256,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:257,102:$Vy1,104:[1,258],105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:259,102:$Vy1,104:[1,260],105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{105:[1,261]},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:262,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:263,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,97:264,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V11,[2,102]),{84:[1,265]},o($V11,[2,106],{22:[1,266]}),o($V11,[2,107]),o($V11,[2,110]),o($V11,[2,112],{22:[1,267]}),o($V11,[2,113]),o($V$,[2,58]),o($V$,[2,59]),{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,58:[1,268],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V$,[2,66]),o($V$,[2,61]),o($V$,[2,62]),o($V$,[2,63]),{66:[1,269]},o($V$,[2,65]),o($V$,[2,67]),{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,72:[1,270],73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V$,[2,69]),o($V$,[2,70]),o($V$,[2,72]),o($V$,[2,71]),o($V$,[2,73]),o($Vs1,[2,4]),o([22,52,66,67,91,95,105,106,109,111,112,122,123,124,125,126,127],[2,81]),{22:$V51,24:$V61,26:$V71,38:$V81,41:[1,271],42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,272],43:31,44:$Vb,46:$Vc,48:$Vd,50:35,51:45,52:$Ve,54:46,66:$Vf,67:$Vg,86:$Vh,87:$Vi,88:$Vj,89:$Vk,90:$Vl,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,118:$Vt,119:$Vu,120:$Vv,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},o($V_,[2,56]),o($V11,[2,115],{106:$VF1}),o($VG1,[2,125],{108:274,22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,102:$Vy1,105:$Vz1,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1}),o($VH1,[2,127]),o($VH1,[2,129]),o($VH1,[2,130]),o($VH1,[2,131]),o($VH1,[2,132]),o($VH1,[2,133]),o($VH1,[2,134]),o($VH1,[2,135]),o($VH1,[2,136]),o($VH1,[2,137]),o($VH1,[2,138]),o($VH1,[2,139]),o($V11,[2,116],{106:$VF1}),o($V11,[2,117],{106:$VF1}),{22:[1,275]},o($V11,[2,118],{106:$VF1}),{22:[1,276]},o($Vt1,[2,124]),o($V11,[2,98],{106:$VF1}),o($V11,[2,99],{106:$VF1}),o($V11,[2,100],{115:100,117:178,26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ}),o($V11,[2,104]),{101:[1,277]},{101:[1,278]},{58:[1,279]},{68:[1,280]},{72:[1,281]},{9:282,20:$VG,21:$VH,23:$VI},o($VF,[2,42]),{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,102:$Vy1,105:$Vz1,107:283,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},o($VH1,[2,128]),{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,97:284,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,97:285,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V11,[2,108]),o($V11,[2,114]),o($V$,[2,60]),{22:$V51,24:$V61,26:$V71,38:$V81,39:286,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V$,[2,68]),o($Vo1,$V5,{17:287}),o($VG1,[2,126],{108:274,22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,102:$Vy1,105:$Vz1,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1}),o($V11,[2,121],{115:100,117:178,22:[1,288],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ}),o($V11,[2,122],{115:100,117:178,22:[1,289],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ}),{22:$V51,24:$V61,26:$V71,38:$V81,41:[1,290],42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,291],43:31,44:$Vb,46:$Vc,48:$Vd,50:35,51:45,52:$Ve,54:46,66:$Vf,67:$Vg,86:$Vh,87:$Vi,88:$Vj,89:$Vk,90:$Vl,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,118:$Vt,119:$Vu,120:$Vv,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:292,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:293,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},o($V$,[2,64]),o($VF,[2,41]),o($V11,[2,119],{106:$VF1}),o($V11,[2,120],{106:$VF1})],\ndefaultActions: {2:[2,1],9:[2,5],10:[2,2],132:[2,7]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin('open_directive'); return 12; \nbreak;\ncase 1: this.begin('type_directive'); return 13; \nbreak;\ncase 2: this.popState(); this.begin('arg_directive'); return 10; \nbreak;\ncase 3: this.popState(); this.popState(); return 15; \nbreak;\ncase 4:return 14;\nbreak;\ncase 5:/* skip comments */\nbreak;\ncase 6:/* skip comments */\nbreak;\ncase 7: this.begin(\"acc_title\");return 44; \nbreak;\ncase 8: this.popState(); return \"acc_title_value\"; \nbreak;\ncase 9: this.begin(\"acc_descr\");return 46; \nbreak;\ncase 10: this.popState(); return \"acc_descr_value\"; \nbreak;\ncase 11: this.begin(\"acc_descr_multiline\");\nbreak;\ncase 12: this.popState(); \nbreak;\ncase 13:return \"acc_descr_multiline_value\";\nbreak;\ncase 14:this.begin(\"string\");\nbreak;\ncase 15:this.popState();\nbreak;\ncase 16:return \"STR\";\nbreak;\ncase 17:return 86;\nbreak;\ncase 18:return 95;\nbreak;\ncase 19:return 87;\nbreak;\ncase 20:return 104;\nbreak;\ncase 21:return 88;\nbreak;\ncase 22:return 89;\nbreak;\ncase 23:this.begin(\"href\");\nbreak;\ncase 24:this.popState();\nbreak;\ncase 25:return 100;\nbreak;\ncase 26:this.begin(\"callbackname\");\nbreak;\ncase 27:this.popState();\nbreak;\ncase 28:this.popState(); this.begin(\"callbackargs\");\nbreak;\ncase 29:return 98;\nbreak;\ncase 30:this.popState();\nbreak;\ncase 31:return 99;\nbreak;\ncase 32:this.begin(\"click\");\nbreak;\ncase 33:this.popState();\nbreak;\ncase 34:return 90;\nbreak;\ncase 35:if(yy.lex.firstGraph()){this.begin(\"dir\");} return 24;\nbreak;\ncase 36:if(yy.lex.firstGraph()){this.begin(\"dir\");} return 24;\nbreak;\ncase 37:return 38;\nbreak;\ncase 38:return 42;\nbreak;\ncase 39:return 101;\nbreak;\ncase 40:return 101;\nbreak;\ncase 41:return 101;\nbreak;\ncase 42:return 101;\nbreak;\ncase 43: this.popState(); return 25; \nbreak;\ncase 44: this.popState(); return 26; \nbreak;\ncase 45: this.popState(); return 26; \nbreak;\ncase 46: this.popState(); return 26; \nbreak;\ncase 47: this.popState(); return 26; \nbreak;\ncase 48: this.popState(); return 26; \nbreak;\ncase 49: this.popState(); return 26; \nbreak;\ncase 50: this.popState(); return 26; \nbreak;\ncase 51: this.popState(); return 26; \nbreak;\ncase 52: this.popState(); return 26; \nbreak;\ncase 53: this.popState(); return 26; \nbreak;\ncase 54:return 118;\nbreak;\ncase 55:return 119;\nbreak;\ncase 56:return 120;\nbreak;\ncase 57:return 121;\nbreak;\ncase 58: return 105;\nbreak;\ncase 59:return 111;\nbreak;\ncase 60:return 53;\nbreak;\ncase 61:return 67;\nbreak;\ncase 62:return 52;\nbreak;\ncase 63:return 20;\nbreak;\ncase 64:return 106;\nbreak;\ncase 65:return 126;\nbreak;\ncase 66:return 82;\nbreak;\ncase 67:return 82;\nbreak;\ncase 68:return 82;\nbreak;\ncase 69:return 81;\nbreak;\ncase 70:return 81;\nbreak;\ncase 71:return 81;\nbreak;\ncase 72:return 59;\nbreak;\ncase 73:return 60;\nbreak;\ncase 74:return 61;\nbreak;\ncase 75:return 62;\nbreak;\ncase 76:return 63;\nbreak;\ncase 77:return 64;\nbreak;\ncase 78:return 65;\nbreak;\ncase 79:return 69;\nbreak;\ncase 80:return 70;\nbreak;\ncase 81:return 55;\nbreak;\ncase 82:return 56;\nbreak;\ncase 83:return 109;\nbreak;\ncase 84:return 112;\nbreak;\ncase 85:return 127;\nbreak;\ncase 86:return 124;\nbreak;\ncase 87:return 113;\nbreak;\ncase 88:return 125;\nbreak;\ncase 89:return 125;\nbreak;\ncase 90:return 114;\nbreak;\ncase 91:return 73;\nbreak;\ncase 92:return 92;\nbreak;\ncase 93:return 'SEP';\nbreak;\ncase 94:return 91;\nbreak;\ncase 95:return 66;\nbreak;\ncase 96:return 75;\nbreak;\ncase 97:return 74;\nbreak;\ncase 98:return 77;\nbreak;\ncase 99:return 76;\nbreak;\ncase 100:return 122;\nbreak;\ncase 101:return 123;\nbreak;\ncase 102:return 68;\nbreak;\ncase 103:return 57;\nbreak;\ncase 104:return 58;\nbreak;\ncase 105:return 40;\nbreak;\ncase 106:return 41;\nbreak;\ncase 107:return 71\nbreak;\ncase 108:return 72\nbreak;\ncase 109:return 133;\nbreak;\ncase 110:return 21;\nbreak;\ncase 111:return 22;\nbreak;\ncase 112:return 23;\nbreak;\n}\n},\nrules: [/^(?:%%\\{)/,/^(?:((?:(?!\\}%%)[^:.])*))/,/^(?::)/,/^(?:\\}%%)/,/^(?:((?:(?!\\}%%).|\\n)*))/,/^(?:%%(?!\\{)[^\\n]*)/,/^(?:[^\\}]%%[^\\n]*)/,/^(?:accTitle\\s*:\\s*)/,/^(?:(?!\\n||)*[^\\n]*)/,/^(?:accDescr\\s*:\\s*)/,/^(?:(?!\\n||)*[^\\n]*)/,/^(?:accDescr\\s*\\{\\s*)/,/^(?:[\\}])/,/^(?:[^\\}]*)/,/^(?:[\"])/,/^(?:[\"])/,/^(?:[^\"]*)/,/^(?:style\\b)/,/^(?:default\\b)/,/^(?:linkStyle\\b)/,/^(?:interpolate\\b)/,/^(?:classDef\\b)/,/^(?:class\\b)/,/^(?:href[\\s]+[\"])/,/^(?:[\"])/,/^(?:[^\"]*)/,/^(?:call[\\s]+)/,/^(?:\\([\\s]*\\))/,/^(?:\\()/,/^(?:[^(]*)/,/^(?:\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)/,/^(?:\\/\\])/,/^(?:\\[\\\\)/,/^(?:[!\"#$%&'*+,-.`?\\\\_/])/,/^(?:[\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6]|[\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377]|[\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5]|[\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA]|[\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE]|[\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA]|[\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0]|[\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977]|[\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2]|[\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A]|[\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39]|[\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8]|[\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C]|[\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32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125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0]|[\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310]|[\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C]|[\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711]|[\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7]|[\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C]|[\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16]|[\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF]|[\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC]|[\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D]|[\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D]|[\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3]|[\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F]|[\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128]|[\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184]|[\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3]|[\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6]|[\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE]|[\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C]|[\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D]|[\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC]|[\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B]|[\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788]|[\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805]|[\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB]|[\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28]|[\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5]|[\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4]|[\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E]|[\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D]|[\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36]|[\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D]|[\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC]|[\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF]|[\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC])/,/^(?:\\|)/,/^(?:\\()/,/^(?:\\))/,/^(?:\\[)/,/^(?:\\])/,/^(?:\\{)/,/^(?:\\})/,/^(?:\")/,/^(?:(\\r?\\n)+)/,/^(?:\\s)/,/^(?:$)/],\nconditions: {\"close_directive\":{\"rules\":[],\"inclusive\":false},\"arg_directive\":{\"rules\":[3,4],\"inclusive\":false},\"type_directive\":{\"rules\":[2,3],\"inclusive\":false},\"open_directive\":{\"rules\":[1],\"inclusive\":false},\"callbackargs\":{\"rules\":[30,31],\"inclusive\":false},\"callbackname\":{\"rules\":[27,28,29],\"inclusive\":false},\"href\":{\"rules\":[24,25],\"inclusive\":false},\"click\":{\"rules\":[33,34],\"inclusive\":false},\"vertex\":{\"rules\":[],\"inclusive\":false},\"dir\":{\"rules\":[43,44,45,46,47,48,49,50,51,52,53],\"inclusive\":false},\"acc_descr_multiline\":{\"rules\":[12,13],\"inclusive\":false},\"acc_descr\":{\"rules\":[10],\"inclusive\":false},\"acc_title\":{\"rules\":[8],\"inclusive\":false},\"string\":{\"rules\":[15,16],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,5,6,7,9,11,14,17,18,19,20,21,22,23,26,32,35,36,37,38,39,40,41,42,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,5],$V2=[7,9,11,12,13,14,15,16,17,18,19,20,22,24,25,27,34,39],$V3=[1,15],$V4=[1,16],$V5=[1,17],$V6=[1,18],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,23],$Vc=[1,24],$Vd=[1,25],$Ve=[1,26],$Vf=[1,28],$Vg=[1,30],$Vh=[1,33],$Vi=[5,7,9,11,12,13,14,15,16,17,18,19,20,22,24,25,27,34,39];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"directive\":4,\"gantt\":5,\"document\":6,\"EOF\":7,\"line\":8,\"SPACE\":9,\"statement\":10,\"NL\":11,\"dateFormat\":12,\"inclusiveEndDates\":13,\"topAxis\":14,\"axisFormat\":15,\"excludes\":16,\"includes\":17,\"todayMarker\":18,\"title\":19,\"acc_title\":20,\"acc_title_value\":21,\"acc_descr\":22,\"acc_descr_value\":23,\"acc_descr_multiline_value\":24,\"section\":25,\"clickStatement\":26,\"taskTxt\":27,\"taskData\":28,\"openDirective\":29,\"typeDirective\":30,\"closeDirective\":31,\":\":32,\"argDirective\":33,\"click\":34,\"callbackname\":35,\"callbackargs\":36,\"href\":37,\"clickStatementDebug\":38,\"open_directive\":39,\"type_directive\":40,\"arg_directive\":41,\"close_directive\":42,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",5:\"gantt\",7:\"EOF\",9:\"SPACE\",11:\"NL\",12:\"dateFormat\",13:\"inclusiveEndDates\",14:\"topAxis\",15:\"axisFormat\",16:\"excludes\",17:\"includes\",18:\"todayMarker\",19:\"title\",20:\"acc_title\",21:\"acc_title_value\",22:\"acc_descr\",23:\"acc_descr_value\",24:\"acc_descr_multiline_value\",25:\"section\",27:\"taskTxt\",28:\"taskData\",32:\":\",34:\"click\",35:\"callbackname\",36:\"callbackargs\",37:\"href\",39:\"open_directive\",40:\"type_directive\",41:\"arg_directive\",42:\"close_directive\"},\nproductions_: [0,[3,2],[3,3],[6,0],[6,2],[8,2],[8,1],[8,1],[8,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[10,1],[10,1],[10,2],[10,1],[4,4],[4,6],[26,2],[26,3],[26,3],[26,4],[26,3],[26,4],[26,2],[38,2],[38,3],[38,3],[38,4],[38,3],[38,4],[38,2],[29,1],[30,1],[33,1],[31,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 2:\n return $$[$0-1]; \nbreak;\ncase 3:\n this.$ = [] \nbreak;\ncase 4:\n$$[$0-1].push($$[$0]);this.$ = $$[$0-1]\nbreak;\ncase 5: case 6:\n this.$ = $$[$0] \nbreak;\ncase 7: case 8:\n this.$=[];\nbreak;\ncase 9:\nyy.setDateFormat($$[$0].substr(11));this.$=$$[$0].substr(11);\nbreak;\ncase 10:\nyy.enableInclusiveEndDates();this.$=$$[$0].substr(18);\nbreak;\ncase 11:\nyy.TopAxis();this.$=$$[$0].substr(8);\nbreak;\ncase 12:\nyy.setAxisFormat($$[$0].substr(11));this.$=$$[$0].substr(11);\nbreak;\ncase 13:\nyy.setExcludes($$[$0].substr(9));this.$=$$[$0].substr(9);\nbreak;\ncase 14:\nyy.setIncludes($$[$0].substr(9));this.$=$$[$0].substr(9);\nbreak;\ncase 15:\nyy.setTodayMarker($$[$0].substr(12));this.$=$$[$0].substr(12);\nbreak;\ncase 16:\nyy.setDiagramTitle($$[$0].substr(6));this.$=$$[$0].substr(6);\nbreak;\ncase 17:\n this.$=$$[$0].trim();yy.setAccTitle(this.$); \nbreak;\ncase 18: case 19:\n this.$=$$[$0].trim();yy.setAccDescription(this.$); \nbreak;\ncase 20:\nyy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8);\nbreak;\ncase 22:\nyy.addTask($$[$0-1],$$[$0]);this.$='task';\nbreak;\ncase 26:\nthis.$ = $$[$0-1];yy.setClickEvent($$[$0-1], $$[$0], null);\nbreak;\ncase 27:\nthis.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]);\nbreak;\ncase 28:\nthis.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], null);yy.setLink($$[$0-2],$$[$0]);\nbreak;\ncase 29:\nthis.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-2], $$[$0-1]);yy.setLink($$[$0-3],$$[$0]);\nbreak;\ncase 30:\nthis.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0], null);yy.setLink($$[$0-2],$$[$0-1]);\nbreak;\ncase 31:\nthis.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-1], $$[$0]);yy.setLink($$[$0-3],$$[$0-2]);\nbreak;\ncase 32:\nthis.$ = $$[$0-1];yy.setLink($$[$0-1], $$[$0]);\nbreak;\ncase 33: case 39:\nthis.$=$$[$0-1] + ' ' + $$[$0];\nbreak;\ncase 34: case 35: case 37:\nthis.$=$$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0];\nbreak;\ncase 36: case 38:\nthis.$=$$[$0-3] + ' ' + $$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0];\nbreak;\ncase 40:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 41:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 42:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 43:\n yy.parseDirective('}%%', 'close_directive', 'gantt'); \nbreak;\n}\n},\ntable: [{3:1,4:2,5:$V0,29:4,39:$V1},{1:[3]},{3:6,4:2,5:$V0,29:4,39:$V1},o($V2,[2,3],{6:7}),{30:8,40:[1,9]},{40:[2,40]},{1:[2,1]},{4:29,7:[1,10],8:11,9:[1,12],10:13,11:[1,14],12:$V3,13:$V4,14:$V5,15:$V6,16:$V7,17:$V8,18:$V9,19:$Va,20:$Vb,22:$Vc,24:$Vd,25:$Ve,26:27,27:$Vf,29:4,34:$Vg,39:$V1},{31:31,32:[1,32],42:$Vh},o([32,42],[2,41]),o($V2,[2,8],{1:[2,2]}),o($V2,[2,4]),{4:29,10:34,12:$V3,13:$V4,14:$V5,15:$V6,16:$V7,17:$V8,18:$V9,19:$Va,20:$Vb,22:$Vc,24:$Vd,25:$Ve,26:27,27:$Vf,29:4,34:$Vg,39:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,9]),o($V2,[2,10]),o($V2,[2,11]),o($V2,[2,12]),o($V2,[2,13]),o($V2,[2,14]),o($V2,[2,15]),o($V2,[2,16]),{21:[1,35]},{23:[1,36]},o($V2,[2,19]),o($V2,[2,20]),o($V2,[2,21]),{28:[1,37]},o($V2,[2,23]),{35:[1,38],37:[1,39]},{11:[1,40]},{33:41,41:[1,42]},{11:[2,43]},o($V2,[2,5]),o($V2,[2,17]),o($V2,[2,18]),o($V2,[2,22]),o($V2,[2,26],{36:[1,43],37:[1,44]}),o($V2,[2,32],{35:[1,45]}),o($Vi,[2,24]),{31:46,42:$Vh},{42:[2,42]},o($V2,[2,27],{37:[1,47]}),o($V2,[2,28]),o($V2,[2,30],{36:[1,48]}),{11:[1,49]},o($V2,[2,29]),o($V2,[2,31]),o($Vi,[2,25])],\ndefaultActions: {5:[2,40],6:[2,1],33:[2,43],42:[2,42]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin('open_directive'); return 39; \nbreak;\ncase 1: this.begin('type_directive'); return 40; \nbreak;\ncase 2: this.popState(); this.begin('arg_directive'); return 32; \nbreak;\ncase 3: this.popState(); this.popState(); return 42; \nbreak;\ncase 4:return 41;\nbreak;\ncase 5: this.begin(\"acc_title\");return 20; \nbreak;\ncase 6: this.popState(); return \"acc_title_value\"; \nbreak;\ncase 7: this.begin(\"acc_descr\");return 22; \nbreak;\ncase 8: this.popState(); return \"acc_descr_value\"; \nbreak;\ncase 9: this.begin(\"acc_descr_multiline\");\nbreak;\ncase 10: this.popState(); \nbreak;\ncase 11:return \"acc_descr_multiline_value\";\nbreak;\ncase 12:/* skip comments */\nbreak;\ncase 13:/* skip comments */\nbreak;\ncase 14:/* do nothing */\nbreak;\ncase 15:return 11;\nbreak;\ncase 16:/* skip whitespace */\nbreak;\ncase 17:/* skip comments */\nbreak;\ncase 18:/* skip comments */\nbreak;\ncase 19:this.begin(\"href\");\nbreak;\ncase 20:this.popState();\nbreak;\ncase 21:return 37;\nbreak;\ncase 22:this.begin(\"callbackname\");\nbreak;\ncase 23:this.popState();\nbreak;\ncase 24:this.popState(); this.begin(\"callbackargs\");\nbreak;\ncase 25:return 35;\nbreak;\ncase 26:this.popState();\nbreak;\ncase 27:return 36;\nbreak;\ncase 28:this.begin(\"click\");\nbreak;\ncase 29:this.popState();\nbreak;\ncase 30:return 34;\nbreak;\ncase 31:return 5;\nbreak;\ncase 32:return 12;\nbreak;\ncase 33:return 13;\nbreak;\ncase 34:return 14;\nbreak;\ncase 35:return 15;\nbreak;\ncase 36:return 17;\nbreak;\ncase 37:return 16;\nbreak;\ncase 38:return 18;\nbreak;\ncase 39:return 'date';\nbreak;\ncase 40:return 19;\nbreak;\ncase 41:return 'accDescription'\nbreak;\ncase 42:return 25;\nbreak;\ncase 43:return 27;\nbreak;\ncase 44:return 28;\nbreak;\ncase 45:return 32;\nbreak;\ncase 46:return 7;\nbreak;\ncase 47:return 'INVALID';\nbreak;\n}\n},\nrules: [/^(?:%%\\{)/i,/^(?:((?:(?!\\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\\}%%)/i,/^(?:((?:(?!\\}%%).|\\n)*))/i,/^(?:accTitle\\s*:\\s*)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:accDescr\\s*:\\s*)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:accDescr\\s*\\{\\s*)/i,/^(?:[\\}])/i,/^(?:[^\\}]*)/i,/^(?:%%(?!\\{)*[^\\n]*)/i,/^(?:[^\\}]%%*[^\\n]*)/i,/^(?:%%*[^\\n]*[\\n]*)/i,/^(?:[\\n]+)/i,/^(?:\\s+)/i,/^(?:#[^\\n]*)/i,/^(?:%[^\\n]*)/i,/^(?:href[\\s]+[\"])/i,/^(?:[\"])/i,/^(?:[^\"]*)/i,/^(?:call[\\s]+)/i,/^(?:\\([\\s]*\\))/i,/^(?:\\()/i,/^(?:[^(]*)/i,/^(?:\\))/i,/^(?:[^)]*)/i,/^(?:click[\\s]+)/i,/^(?:[\\s\\n])/i,/^(?:[^\\s\\n]*)/i,/^(?:gantt\\b)/i,/^(?:dateFormat\\s[^#\\n;]+)/i,/^(?:inclusiveEndDates\\b)/i,/^(?:topAxis\\b)/i,/^(?:axisFormat\\s[^#\\n;]+)/i,/^(?:includes\\s[^#\\n;]+)/i,/^(?:excludes\\s[^#\\n;]+)/i,/^(?:todayMarker\\s[^\\n;]+)/i,/^(?:\\d\\d\\d\\d-\\d\\d-\\d\\d\\b)/i,/^(?:title\\s[^#\\n;]+)/i,/^(?:accDescription\\s[^#\\n;]+)/i,/^(?:section\\s[^#:\\n;]+)/i,/^(?:[^#:\\n;]+)/i,/^(?::[^#\\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],\nconditions: {\"acc_descr_multiline\":{\"rules\":[10,11],\"inclusive\":false},\"acc_descr\":{\"rules\":[8],\"inclusive\":false},\"acc_title\":{\"rules\":[6],\"inclusive\":false},\"close_directive\":{\"rules\":[],\"inclusive\":false},\"arg_directive\":{\"rules\":[3,4],\"inclusive\":false},\"type_directive\":{\"rules\":[2,3],\"inclusive\":false},\"open_directive\":{\"rules\":[1],\"inclusive\":false},\"callbackargs\":{\"rules\":[26,27],\"inclusive\":false},\"callbackname\":{\"rules\":[23,24,25],\"inclusive\":false},\"href\":{\"rules\":[20,21],\"inclusive\":false},\"click\":{\"rules\":[29,30],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,5,7,9,12,13,14,15,16,17,18,19,22,28,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,7],$V2=[1,5],$V3=[1,9],$V4=[1,6],$V5=[2,6],$V6=[1,16],$V7=[6,8,14,20,22,24,25,27,29,32,35,37,49,53],$V8=[8,14,20,22,24,25,27,29,32,35,37],$V9=[8,13,14,20,22,24,25,27,29,32,35,37],$Va=[1,26],$Vb=[6,8,14,49,53],$Vc=[8,14,53],$Vd=[1,64],$Ve=[1,65],$Vf=[1,66],$Vg=[8,14,33,36,41,53];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"eol\":4,\"directive\":5,\"GG\":6,\"document\":7,\"EOF\":8,\":\":9,\"DIR\":10,\"options\":11,\"body\":12,\"OPT\":13,\"NL\":14,\"line\":15,\"statement\":16,\"commitStatement\":17,\"mergeStatement\":18,\"cherryPickStatement\":19,\"acc_title\":20,\"acc_title_value\":21,\"acc_descr\":22,\"acc_descr_value\":23,\"acc_descr_multiline_value\":24,\"section\":25,\"branchStatement\":26,\"CHECKOUT\":27,\"ID\":28,\"BRANCH\":29,\"ORDER\":30,\"NUM\":31,\"CHERRY_PICK\":32,\"COMMIT_ID\":33,\"STR\":34,\"MERGE\":35,\"COMMIT_TAG\":36,\"COMMIT\":37,\"commit_arg\":38,\"COMMIT_TYPE\":39,\"commitType\":40,\"COMMIT_MSG\":41,\"NORMAL\":42,\"REVERSE\":43,\"HIGHLIGHT\":44,\"openDirective\":45,\"typeDirective\":46,\"closeDirective\":47,\"argDirective\":48,\"open_directive\":49,\"type_directive\":50,\"arg_directive\":51,\"close_directive\":52,\";\":53,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",6:\"GG\",8:\"EOF\",9:\":\",10:\"DIR\",13:\"OPT\",14:\"NL\",20:\"acc_title\",21:\"acc_title_value\",22:\"acc_descr\",23:\"acc_descr_value\",24:\"acc_descr_multiline_value\",25:\"section\",27:\"CHECKOUT\",28:\"ID\",29:\"BRANCH\",30:\"ORDER\",31:\"NUM\",32:\"CHERRY_PICK\",33:\"COMMIT_ID\",34:\"STR\",35:\"MERGE\",36:\"COMMIT_TAG\",37:\"COMMIT\",39:\"COMMIT_TYPE\",41:\"COMMIT_MSG\",42:\"NORMAL\",43:\"REVERSE\",44:\"HIGHLIGHT\",49:\"open_directive\",50:\"type_directive\",51:\"arg_directive\",52:\"close_directive\",53:\";\"},\nproductions_: [0,[3,2],[3,2],[3,3],[3,4],[3,5],[7,0],[7,2],[11,2],[11,1],[12,0],[12,2],[15,2],[15,1],[16,1],[16,1],[16,1],[16,2],[16,2],[16,1],[16,1],[16,1],[16,2],[26,2],[26,4],[19,3],[18,2],[18,4],[17,2],[17,3],[17,3],[17,5],[17,5],[17,3],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,3],[17,5],[17,5],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[38,0],[38,1],[40,1],[40,1],[40,1],[5,3],[5,5],[45,1],[46,1],[48,1],[47,1],[4,1],[4,1],[4,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 3:\n return $$[$0]; \nbreak;\ncase 4:\n return $$[$0-1]; \nbreak;\ncase 5:\nyy.setDirection($$[$0-3]); return $$[$0-1];\nbreak;\ncase 7:\n yy.setOptions($$[$0-1]); this.$ = $$[$0]\nbreak;\ncase 8:\n$$[$0-1] +=$$[$0]; this.$=$$[$0-1]\nbreak;\ncase 10:\nthis.$ = []\nbreak;\ncase 11:\n$$[$0-1].push($$[$0]); this.$=$$[$0-1];\nbreak;\ncase 12:\nthis.$ =$$[$0-1]\nbreak;\ncase 17:\n this.$=$$[$0].trim();yy.setAccTitle(this.$); \nbreak;\ncase 18: case 19:\n this.$=$$[$0].trim();yy.setAccDescription(this.$); \nbreak;\ncase 20:\nyy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8);\nbreak;\ncase 22:\nyy.checkout($$[$0])\nbreak;\ncase 23:\nyy.branch($$[$0])\nbreak;\ncase 24:\nyy.branch($$[$0-2], $$[$0])\nbreak;\ncase 25:\nyy.cherryPick($$[$0])\nbreak;\ncase 26:\nyy.merge($$[$0])\nbreak;\ncase 27:\nyy.merge($$[$0-2], $$[$0])\nbreak;\ncase 28:\nyy.commit($$[$0])\nbreak;\ncase 29:\nyy.commit('','',yy.commitType.NORMAL,$$[$0])\nbreak;\ncase 30:\nyy.commit('','',$$[$0],'')\nbreak;\ncase 31:\nyy.commit('','',$$[$0],$$[$0-2])\nbreak;\ncase 32:\nyy.commit('','',$$[$0-2],$$[$0])\nbreak;\ncase 33:\nyy.commit('',$$[$0],yy.commitType.NORMAL,'')\nbreak;\ncase 34:\nyy.commit('',$$[$0-2],yy.commitType.NORMAL,$$[$0])\nbreak;\ncase 35:\nyy.commit('',$$[$0],yy.commitType.NORMAL,$$[$0-2])\nbreak;\ncase 36:\nyy.commit('',$$[$0-2],$$[$0],'')\nbreak;\ncase 37:\nyy.commit('',$$[$0],$$[$0-2],'')\nbreak;\ncase 38:\nyy.commit('',$$[$0-4],$$[$0-2],$$[$0])\nbreak;\ncase 39:\nyy.commit('',$$[$0-4],$$[$0],$$[$0-2])\nbreak;\ncase 40:\nyy.commit('',$$[$0-2],$$[$0-4],$$[$0])\nbreak;\ncase 41:\nyy.commit('',$$[$0],$$[$0-4],$$[$0-2])\nbreak;\ncase 42:\nyy.commit('',$$[$0],$$[$0-2],$$[$0-4])\nbreak;\ncase 43:\nyy.commit('',$$[$0-2],$$[$0],$$[$0-4])\nbreak;\ncase 44:\nyy.commit($$[$0],'',yy.commitType.NORMAL,'')\nbreak;\ncase 45:\nyy.commit($$[$0],'',yy.commitType.NORMAL,$$[$0-2])\nbreak;\ncase 46:\nyy.commit($$[$0-2],'',yy.commitType.NORMAL,$$[$0])\nbreak;\ncase 47:\nyy.commit($$[$0-2],'',$$[$0],'')\nbreak;\ncase 48:\nyy.commit($$[$0],'',$$[$0-2],'')\nbreak;\ncase 49:\nyy.commit($$[$0],$$[$0-2],yy.commitType.NORMAL,'')\nbreak;\ncase 50:\nyy.commit($$[$0-2],$$[$0],yy.commitType.NORMAL,'')\nbreak;\ncase 51:\nyy.commit($$[$0-4],'',$$[$0-2],$$[$0])\nbreak;\ncase 52:\nyy.commit($$[$0-4],'',$$[$0],$$[$0-2])\nbreak;\ncase 53:\nyy.commit($$[$0-2],'',$$[$0-4],$$[$0])\nbreak;\ncase 54:\nyy.commit($$[$0],'',$$[$0-4],$$[$0-2])\nbreak;\ncase 55:\nyy.commit($$[$0],'',$$[$0-2],$$[$0-4])\nbreak;\ncase 56:\nyy.commit($$[$0-2],'',$$[$0],$$[$0-4])\nbreak;\ncase 57:\nyy.commit($$[$0-4],$$[$0],$$[$0-2],'')\nbreak;\ncase 58:\nyy.commit($$[$0-4],$$[$0-2],$$[$0],'')\nbreak;\ncase 59:\nyy.commit($$[$0-2],$$[$0],$$[$0-4],'')\nbreak;\ncase 60:\nyy.commit($$[$0],$$[$0-2],$$[$0-4],'')\nbreak;\ncase 61:\nyy.commit($$[$0],$$[$0-4],$$[$0-2],'')\nbreak;\ncase 62:\nyy.commit($$[$0-2],$$[$0-4],$$[$0],'')\nbreak;\ncase 63:\nyy.commit($$[$0-4],$$[$0],yy.commitType.NORMAL,$$[$0-2])\nbreak;\ncase 64:\nyy.commit($$[$0-4],$$[$0-2],yy.commitType.NORMAL,$$[$0])\nbreak;\ncase 65:\nyy.commit($$[$0-2],$$[$0],yy.commitType.NORMAL,$$[$0-4])\nbreak;\ncase 66:\nyy.commit($$[$0],$$[$0-2],yy.commitType.NORMAL,$$[$0-4])\nbreak;\ncase 67:\nyy.commit($$[$0],$$[$0-4],yy.commitType.NORMAL,$$[$0-2])\nbreak;\ncase 68:\nyy.commit($$[$0-2],$$[$0-4],yy.commitType.NORMAL,$$[$0])\nbreak;\ncase 69:\nyy.commit($$[$0-6],$$[$0-4],$$[$0-2],$$[$0])\nbreak;\ncase 70:\nyy.commit($$[$0-6],$$[$0-4],$$[$0],$$[$0-2])\nbreak;\ncase 71:\nyy.commit($$[$0-6],$$[$0-2],$$[$0-4],$$[$0])\nbreak;\ncase 72:\nyy.commit($$[$0-6],$$[$0],$$[$0-4],$$[$0-2])\nbreak;\ncase 73:\nyy.commit($$[$0-6],$$[$0-2],$$[$0],$$[$0-4])\nbreak;\ncase 74:\nyy.commit($$[$0-6],$$[$0],$$[$0-2],$$[$0-4])\nbreak;\ncase 75:\nyy.commit($$[$0-4],$$[$0-6],$$[$0-2],$$[$0])\nbreak;\ncase 76:\nyy.commit($$[$0-4],$$[$0-6],$$[$0],$$[$0-2])\nbreak;\ncase 77:\nyy.commit($$[$0-2],$$[$0-6],$$[$0-4],$$[$0])\nbreak;\ncase 78:\nyy.commit($$[$0],$$[$0-6],$$[$0-4],$$[$0-2])\nbreak;\ncase 79:\nyy.commit($$[$0-2],$$[$0-6],$$[$0],$$[$0-4])\nbreak;\ncase 80:\nyy.commit($$[$0],$$[$0-6],$$[$0-2],$$[$0-4])\nbreak;\ncase 81:\nyy.commit($$[$0],$$[$0-4],$$[$0-2],$$[$0-6])\nbreak;\ncase 82:\nyy.commit($$[$0-2],$$[$0-4],$$[$0],$$[$0-6])\nbreak;\ncase 83:\nyy.commit($$[$0],$$[$0-2],$$[$0-4],$$[$0-6])\nbreak;\ncase 84:\nyy.commit($$[$0-2],$$[$0],$$[$0-4],$$[$0-6])\nbreak;\ncase 85:\nyy.commit($$[$0-4],$$[$0-2],$$[$0],$$[$0-6])\nbreak;\ncase 86:\nyy.commit($$[$0-4],$$[$0],$$[$0-2],$$[$0-6])\nbreak;\ncase 87:\nyy.commit($$[$0-2],$$[$0-4],$$[$0-6],$$[$0])\nbreak;\ncase 88:\nyy.commit($$[$0],$$[$0-4],$$[$0-6],$$[$0-2])\nbreak;\ncase 89:\nyy.commit($$[$0-2],$$[$0],$$[$0-6],$$[$0-4])\nbreak;\ncase 90:\nyy.commit($$[$0],$$[$0-2],$$[$0-6],$$[$0-4])\nbreak;\ncase 91:\nyy.commit($$[$0-4],$$[$0-2],$$[$0-6],$$[$0])\nbreak;\ncase 92:\nyy.commit($$[$0-4],$$[$0],$$[$0-6],$$[$0-2])\nbreak;\ncase 93:\nthis.$ = \"\"\nbreak;\ncase 94:\nthis.$=$$[$0]\nbreak;\ncase 95:\n this.$=yy.commitType.NORMAL;\nbreak;\ncase 96:\n this.$=yy.commitType.REVERSE;\nbreak;\ncase 97:\n this.$=yy.commitType.HIGHLIGHT;\nbreak;\ncase 100:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 101:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 102:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 103:\n yy.parseDirective('}%%', 'close_directive', 'gitGraph'); \nbreak;\n}\n},\ntable: [{3:1,4:2,5:3,6:$V0,8:$V1,14:$V2,45:8,49:$V3,53:$V4},{1:[3]},{3:10,4:2,5:3,6:$V0,8:$V1,14:$V2,45:8,49:$V3,53:$V4},{3:11,4:2,5:3,6:$V0,8:$V1,14:$V2,45:8,49:$V3,53:$V4},{7:12,8:$V5,9:[1,13],10:[1,14],11:15,14:$V6},o($V7,[2,104]),o($V7,[2,105]),o($V7,[2,106]),{46:17,50:[1,18]},{50:[2,100]},{1:[2,1]},{1:[2,2]},{8:[1,19]},{7:20,8:$V5,11:15,14:$V6},{9:[1,21]},o($V8,[2,10],{12:22,13:[1,23]}),o($V9,[2,9]),{9:[1,25],47:24,52:$Va},o([9,52],[2,101]),{1:[2,3]},{8:[1,27]},{7:28,8:$V5,11:15,14:$V6},{8:[2,7],14:[1,31],15:29,16:30,17:32,18:33,19:34,20:[1,35],22:[1,36],24:[1,37],25:[1,38],26:39,27:[1,40],29:[1,44],32:[1,43],35:[1,42],37:[1,41]},o($V9,[2,8]),o($Vb,[2,98]),{48:45,51:[1,46]},o($Vb,[2,103]),{1:[2,4]},{8:[1,47]},o($V8,[2,11]),{4:48,8:$V1,14:$V2,53:$V4},o($V8,[2,13]),o($Vc,[2,14]),o($Vc,[2,15]),o($Vc,[2,16]),{21:[1,49]},{23:[1,50]},o($Vc,[2,19]),o($Vc,[2,20]),o($Vc,[2,21]),{28:[1,51]},o($Vc,[2,93],{38:52,33:[1,55],34:[1,57],36:[1,53],39:[1,54],41:[1,56]}),{28:[1,58]},{33:[1,59]},{28:[1,60]},{47:61,52:$Va},{52:[2,102]},{1:[2,5]},o($V8,[2,12]),o($Vc,[2,17]),o($Vc,[2,18]),o($Vc,[2,22]),o($Vc,[2,28]),{34:[1,62]},{40:63,42:$Vd,43:$Ve,44:$Vf},{34:[1,67]},{34:[1,68]},o($Vc,[2,94]),o($Vc,[2,26],{36:[1,69]}),{34:[1,70]},o($Vc,[2,23],{30:[1,71]}),o($Vb,[2,99]),o($Vc,[2,29],{33:[1,73],39:[1,72],41:[1,74]}),o($Vc,[2,30],{33:[1,76],36:[1,75],41:[1,77]}),o($Vg,[2,95]),o($Vg,[2,96]),o($Vg,[2,97]),o($Vc,[2,33],{36:[1,78],39:[1,79],41:[1,80]}),o($Vc,[2,44],{33:[1,83],36:[1,81],39:[1,82]}),{34:[1,84]},o($Vc,[2,25]),{31:[1,85]},{40:86,42:$Vd,43:$Ve,44:$Vf},{34:[1,87]},{34:[1,88]},{34:[1,89]},{34:[1,90]},{34:[1,91]},{34:[1,92]},{40:93,42:$Vd,43:$Ve,44:$Vf},{34:[1,94]},{34:[1,95]},{40:96,42:$Vd,43:$Ve,44:$Vf},{34:[1,97]},o($Vc,[2,27]),o($Vc,[2,24]),o($Vc,[2,31],{33:[1,98],41:[1,99]}),o($Vc,[2,35],{39:[1,100],41:[1,101]}),o($Vc,[2,45],{33:[1,103],39:[1,102]}),o($Vc,[2,32],{33:[1,104],41:[1,105]}),o($Vc,[2,37],{36:[1,106],41:[1,107]}),o($Vc,[2,48],{33:[1,109],36:[1,108]}),o($Vc,[2,34],{39:[1,110],41:[1,111]}),o($Vc,[2,36],{36:[1,112],41:[1,113]}),o($Vc,[2,49],{36:[1,115],39:[1,114]}),o($Vc,[2,46],{33:[1,117],39:[1,116]}),o($Vc,[2,47],{33:[1,119],36:[1,118]}),o($Vc,[2,50],{36:[1,121],39:[1,120]}),{34:[1,122]},{34:[1,123]},{40:124,42:$Vd,43:$Ve,44:$Vf},{34:[1,125]},{40:126,42:$Vd,43:$Ve,44:$Vf},{34:[1,127]},{34:[1,128]},{34:[1,129]},{34:[1,130]},{34:[1,131]},{34:[1,132]},{34:[1,133]},{40:134,42:$Vd,43:$Ve,44:$Vf},{34:[1,135]},{34:[1,136]},{34:[1,137]},{40:138,42:$Vd,43:$Ve,44:$Vf},{34:[1,139]},{40:140,42:$Vd,43:$Ve,44:$Vf},{34:[1,141]},{34:[1,142]},{34:[1,143]},{40:144,42:$Vd,43:$Ve,44:$Vf},{34:[1,145]},o($Vc,[2,42],{41:[1,146]}),o($Vc,[2,55],{33:[1,147]}),o($Vc,[2,43],{41:[1,148]}),o($Vc,[2,66],{39:[1,149]}),o($Vc,[2,56],{33:[1,150]}),o($Vc,[2,65],{39:[1,151]}),o($Vc,[2,41],{41:[1,152]}),o($Vc,[2,54],{33:[1,153]}),o($Vc,[2,40],{41:[1,154]}),o($Vc,[2,60],{36:[1,155]}),o($Vc,[2,53],{33:[1,156]}),o($Vc,[2,59],{36:[1,157]}),o($Vc,[2,39],{41:[1,158]}),o($Vc,[2,67],{39:[1,159]}),o($Vc,[2,38],{41:[1,160]}),o($Vc,[2,61],{36:[1,161]}),o($Vc,[2,62],{36:[1,162]}),o($Vc,[2,68],{39:[1,163]}),o($Vc,[2,52],{33:[1,164]}),o($Vc,[2,63],{39:[1,165]}),o($Vc,[2,51],{33:[1,166]}),o($Vc,[2,57],{36:[1,167]}),o($Vc,[2,58],{36:[1,168]}),o($Vc,[2,64],{39:[1,169]}),{34:[1,170]},{34:[1,171]},{34:[1,172]},{40:173,42:$Vd,43:$Ve,44:$Vf},{34:[1,174]},{40:175,42:$Vd,43:$Ve,44:$Vf},{34:[1,176]},{34:[1,177]},{34:[1,178]},{34:[1,179]},{34:[1,180]},{34:[1,181]},{34:[1,182]},{40:183,42:$Vd,43:$Ve,44:$Vf},{34:[1,184]},{34:[1,185]},{34:[1,186]},{40:187,42:$Vd,43:$Ve,44:$Vf},{34:[1,188]},{40:189,42:$Vd,43:$Ve,44:$Vf},{34:[1,190]},{34:[1,191]},{34:[1,192]},{40:193,42:$Vd,43:$Ve,44:$Vf},o($Vc,[2,83]),o($Vc,[2,84]),o($Vc,[2,81]),o($Vc,[2,82]),o($Vc,[2,86]),o($Vc,[2,85]),o($Vc,[2,90]),o($Vc,[2,89]),o($Vc,[2,88]),o($Vc,[2,87]),o($Vc,[2,92]),o($Vc,[2,91]),o($Vc,[2,80]),o($Vc,[2,79]),o($Vc,[2,78]),o($Vc,[2,77]),o($Vc,[2,75]),o($Vc,[2,76]),o($Vc,[2,74]),o($Vc,[2,73]),o($Vc,[2,72]),o($Vc,[2,71]),o($Vc,[2,69]),o($Vc,[2,70])],\ndefaultActions: {9:[2,100],10:[2,1],11:[2,2],19:[2,3],27:[2,4],46:[2,102],47:[2,5]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin('open_directive'); return 49; \nbreak;\ncase 1: this.begin('type_directive'); return 50; \nbreak;\ncase 2: this.popState(); this.begin('arg_directive'); return 9; \nbreak;\ncase 3: this.popState(); this.popState(); return 52; \nbreak;\ncase 4:return 51;\nbreak;\ncase 5: this.begin(\"acc_title\");return 20; \nbreak;\ncase 6: this.popState(); return \"acc_title_value\"; \nbreak;\ncase 7: this.begin(\"acc_descr\");return 22; \nbreak;\ncase 8: this.popState(); return \"acc_descr_value\"; \nbreak;\ncase 9: this.begin(\"acc_descr_multiline\");\nbreak;\ncase 10: this.popState(); \nbreak;\ncase 11:return \"acc_descr_multiline_value\";\nbreak;\ncase 12:/*{console.log('New line');return 14;}*/ return 14;\nbreak;\ncase 13:/* skip all whitespace */\nbreak;\ncase 14:/* skip comments */\nbreak;\ncase 15:/* skip comments */\nbreak;\ncase 16:return 6;\nbreak;\ncase 17:return 37;\nbreak;\ncase 18:return 33;\nbreak;\ncase 19:return 39;\nbreak;\ncase 20:return 41;\nbreak;\ncase 21:return 42;\nbreak;\ncase 22:return 43;\nbreak;\ncase 23:return 44;\nbreak;\ncase 24:return 36;\nbreak;\ncase 25:return 29;\nbreak;\ncase 26:return 30;\nbreak;\ncase 27:return 35;\nbreak;\ncase 28:return 32;\nbreak;\ncase 29:return 27;\nbreak;\ncase 30:return 10;\nbreak;\ncase 31:return 10;\nbreak;\ncase 32:return 9;\nbreak;\ncase 33:return 'CARET'\nbreak;\ncase 34:this.begin(\"options\"); //\nbreak;\ncase 35:this.popState(); // not used anymore in the renderer, fixed for backward compatibility\nbreak;\ncase 36:return 13; //\nbreak;\ncase 37:this.begin(\"string\");\nbreak;\ncase 38:this.popState();\nbreak;\ncase 39:return 34;\nbreak;\ncase 40:return 31;\nbreak;\ncase 41:return 28;\nbreak;\ncase 42:return 8;\nbreak;\n}\n},\nrules: [/^(?:%%\\{)/i,/^(?:((?:(?!\\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\\}%%)/i,/^(?:((?:(?!\\}%%).|\\n)*))/i,/^(?:accTitle\\s*:\\s*)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:accDescr\\s*:\\s*)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:accDescr\\s*\\{\\s*)/i,/^(?:[\\}])/i,/^(?:[^\\}]*)/i,/^(?:(\\r?\\n)+)/i,/^(?:\\s+)/i,/^(?:#[^\\n]*)/i,/^(?:%[^\\n]*)/i,/^(?:gitGraph\\b)/i,/^(?:commit\\b)/i,/^(?:id:)/i,/^(?:type:)/i,/^(?:msg:)/i,/^(?:NORMAL\\b)/i,/^(?:REVERSE\\b)/i,/^(?:HIGHLIGHT\\b)/i,/^(?:tag:)/i,/^(?:branch\\b)/i,/^(?:order:)/i,/^(?:merge\\b)/i,/^(?:cherry-pick\\b)/i,/^(?:checkout\\b)/i,/^(?:LR\\b)/i,/^(?:BT\\b)/i,/^(?::)/i,/^(?:\\^)/i,/^(?:options\\r?\\n)/i,/^(?:[ \\r\\n\\t]+end\\b)/i,/^(?:[\\s\\S]+(?=[ \\r\\n\\t]+end))/i,/^(?:[\"])/i,/^(?:[\"])/i,/^(?:[^\"]*)/i,/^(?:[0-9]+)/i,/^(?:[a-zA-Z][-_\\./a-zA-Z0-9]*[-_a-zA-Z0-9])/i,/^(?:$)/i],\nconditions: {\"acc_descr_multiline\":{\"rules\":[10,11],\"inclusive\":false},\"acc_descr\":{\"rules\":[8],\"inclusive\":false},\"acc_title\":{\"rules\":[6],\"inclusive\":false},\"close_directive\":{\"rules\":[],\"inclusive\":false},\"arg_directive\":{\"rules\":[3,4],\"inclusive\":false},\"type_directive\":{\"rules\":[2,3],\"inclusive\":false},\"open_directive\":{\"rules\":[1],\"inclusive\":false},\"options\":{\"rules\":[35,36],\"inclusive\":false},\"string\":{\"rules\":[38,39],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,5,7,9,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,37,40,41,42],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,9,10];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"info\":4,\"document\":5,\"EOF\":6,\"line\":7,\"statement\":8,\"NL\":9,\"showInfo\":10,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",4:\"info\",6:\"EOF\",9:\"NL\",10:\"showInfo\"},\nproductions_: [0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 1:\n return yy; \nbreak;\ncase 4:\n \nbreak;\ncase 6:\n yy.setInfo(true); \nbreak;\n}\n},\ntable: [{3:1,4:[1,2]},{1:[3]},o($V0,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8]},{1:[2,1]},o($V0,[2,3]),o($V0,[2,4]),o($V0,[2,5]),o($V0,[2,6])],\ndefaultActions: {4:[2,1]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\r\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\r\n\t// Pre-lexer code can go here\r\n\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0:return 4 ;\nbreak;\ncase 1:return 9 ;\nbreak;\ncase 2:return 'space';\nbreak;\ncase 3:return 10;\nbreak;\ncase 4:return 6 ;\nbreak;\ncase 5:return 'TXT' ;\nbreak;\n}\n},\nrules: [/^(?:info\\b)/i,/^(?:[\\s\\n\\r]+)/i,/^(?:[\\s]+)/i,/^(?:showInfo\\b)/i,/^(?:$)/i,/^(?:.)/i],\nconditions: {\"INITIAL\":{\"rules\":[0,1,2,3,4,5],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,5],$V2=[1,6],$V3=[1,7],$V4=[1,9],$V5=[1,11,13,15,17,19,20,26,27,28,29],$V6=[2,5],$V7=[1,6,11,13,15,17,19,20,26,27,28,29],$V8=[26,27,28],$V9=[2,8],$Va=[1,18],$Vb=[1,19],$Vc=[1,20],$Vd=[1,21],$Ve=[1,22],$Vf=[1,23],$Vg=[1,28],$Vh=[6,26,27,28,29];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"eol\":4,\"directive\":5,\"PIE\":6,\"document\":7,\"showData\":8,\"line\":9,\"statement\":10,\"txt\":11,\"value\":12,\"title\":13,\"title_value\":14,\"acc_title\":15,\"acc_title_value\":16,\"acc_descr\":17,\"acc_descr_value\":18,\"acc_descr_multiline_value\":19,\"section\":20,\"openDirective\":21,\"typeDirective\":22,\"closeDirective\":23,\":\":24,\"argDirective\":25,\"NEWLINE\":26,\";\":27,\"EOF\":28,\"open_directive\":29,\"type_directive\":30,\"arg_directive\":31,\"close_directive\":32,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",6:\"PIE\",8:\"showData\",11:\"txt\",12:\"value\",13:\"title\",14:\"title_value\",15:\"acc_title\",16:\"acc_title_value\",17:\"acc_descr\",18:\"acc_descr_value\",19:\"acc_descr_multiline_value\",20:\"section\",24:\":\",26:\"NEWLINE\",27:\";\",28:\"EOF\",29:\"open_directive\",30:\"type_directive\",31:\"arg_directive\",32:\"close_directive\"},\nproductions_: [0,[3,2],[3,2],[3,2],[3,3],[7,0],[7,2],[9,2],[10,0],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,1],[5,3],[5,5],[4,1],[4,1],[4,1],[21,1],[22,1],[25,1],[23,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 4:\nyy.setShowData(true);\nbreak;\ncase 7:\n this.$ = $$[$0-1] \nbreak;\ncase 9:\n yy.addSection($$[$0-1],yy.cleanupValue($$[$0])); \nbreak;\ncase 10:\n this.$=$$[$0].trim();yy.setDiagramTitle(this.$); \nbreak;\ncase 11:\n this.$=$$[$0].trim();yy.setAccTitle(this.$); \nbreak;\ncase 12: case 13:\n this.$=$$[$0].trim();yy.setAccDescription(this.$); \nbreak;\ncase 14:\nyy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8);\nbreak;\ncase 21:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 22:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 23:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 24:\n yy.parseDirective('}%%', 'close_directive', 'pie'); \nbreak;\n}\n},\ntable: [{3:1,4:2,5:3,6:$V0,21:8,26:$V1,27:$V2,28:$V3,29:$V4},{1:[3]},{3:10,4:2,5:3,6:$V0,21:8,26:$V1,27:$V2,28:$V3,29:$V4},{3:11,4:2,5:3,6:$V0,21:8,26:$V1,27:$V2,28:$V3,29:$V4},o($V5,$V6,{7:12,8:[1,13]}),o($V7,[2,18]),o($V7,[2,19]),o($V7,[2,20]),{22:14,30:[1,15]},{30:[2,21]},{1:[2,1]},{1:[2,2]},o($V8,$V9,{21:8,9:16,10:17,5:24,1:[2,3],11:$Va,13:$Vb,15:$Vc,17:$Vd,19:$Ve,20:$Vf,29:$V4}),o($V5,$V6,{7:25}),{23:26,24:[1,27],32:$Vg},o([24,32],[2,22]),o($V5,[2,6]),{4:29,26:$V1,27:$V2,28:$V3},{12:[1,30]},{14:[1,31]},{16:[1,32]},{18:[1,33]},o($V8,[2,13]),o($V8,[2,14]),o($V8,[2,15]),o($V8,$V9,{21:8,9:16,10:17,5:24,1:[2,4],11:$Va,13:$Vb,15:$Vc,17:$Vd,19:$Ve,20:$Vf,29:$V4}),o($Vh,[2,16]),{25:34,31:[1,35]},o($Vh,[2,24]),o($V5,[2,7]),o($V8,[2,9]),o($V8,[2,10]),o($V8,[2,11]),o($V8,[2,12]),{23:36,32:$Vg},{32:[2,23]},o($Vh,[2,17])],\ndefaultActions: {9:[2,21],10:[2,1],11:[2,2],35:[2,23]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin('open_directive'); return 29; \nbreak;\ncase 1: this.begin('type_directive'); return 30; \nbreak;\ncase 2: this.popState(); this.begin('arg_directive'); return 24; \nbreak;\ncase 3: this.popState(); this.popState(); return 32; \nbreak;\ncase 4:return 31;\nbreak;\ncase 5:/* skip comments */\nbreak;\ncase 6:/* skip comments */{ /*console.log('');*/ }\nbreak;\ncase 7:return 26;\nbreak;\ncase 8:/* do nothing */\nbreak;\ncase 9:/* ignore */\nbreak;\ncase 10: this.begin(\"title\");return 13; \nbreak;\ncase 11: this.popState(); return \"title_value\"; \nbreak;\ncase 12: this.begin(\"acc_title\");return 15; \nbreak;\ncase 13: this.popState(); return \"acc_title_value\"; \nbreak;\ncase 14: this.begin(\"acc_descr\");return 17; \nbreak;\ncase 15: this.popState(); return \"acc_descr_value\"; \nbreak;\ncase 16: this.begin(\"acc_descr_multiline\");\nbreak;\ncase 17: this.popState(); \nbreak;\ncase 18:return \"acc_descr_multiline_value\";\nbreak;\ncase 19: this.begin(\"string\"); \nbreak;\ncase 20: this.popState(); \nbreak;\ncase 21: return \"txt\"; \nbreak;\ncase 22:return 6;\nbreak;\ncase 23:return 8;\nbreak;\ncase 24:return \"value\";\nbreak;\ncase 25:return 28;\nbreak;\n}\n},\nrules: [/^(?:%%\\{)/i,/^(?:((?:(?!\\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\\}%%)/i,/^(?:((?:(?!\\}%%).|\\n)*))/i,/^(?:%%(?!\\{)[^\\n]*)/i,/^(?:[^\\}]%%[^\\n]*)/i,/^(?:[\\n\\r]+)/i,/^(?:%%[^\\n]*)/i,/^(?:[\\s]+)/i,/^(?:title\\b)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:accTitle\\s*:\\s*)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:accDescr\\s*:\\s*)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:accDescr\\s*\\{\\s*)/i,/^(?:[\\}])/i,/^(?:[^\\}]*)/i,/^(?:[\"])/i,/^(?:[\"])/i,/^(?:[^\"]*)/i,/^(?:pie\\b)/i,/^(?:showData\\b)/i,/^(?::[\\s]*[\\d]+(?:\\.[\\d]+)?)/i,/^(?:$)/i],\nconditions: {\"acc_descr_multiline\":{\"rules\":[17,18],\"inclusive\":false},\"acc_descr\":{\"rules\":[15],\"inclusive\":false},\"acc_title\":{\"rules\":[13],\"inclusive\":false},\"close_directive\":{\"rules\":[],\"inclusive\":false},\"arg_directive\":{\"rules\":[3,4],\"inclusive\":false},\"type_directive\":{\"rules\":[2,3],\"inclusive\":false},\"open_directive\":{\"rules\":[1],\"inclusive\":false},\"title\":{\"rules\":[11],\"inclusive\":false},\"string\":{\"rules\":[20,21],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,5,6,7,8,9,10,12,14,16,19,22,23,24,25],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,5],$V2=[1,6],$V3=[1,7],$V4=[1,8],$V5=[5,6,8,14,16,18,19,40,41,42,43,44,45,53,71,72],$V6=[1,22],$V7=[2,13],$V8=[1,26],$V9=[1,27],$Va=[1,28],$Vb=[1,29],$Vc=[1,30],$Vd=[1,31],$Ve=[1,24],$Vf=[1,32],$Vg=[1,33],$Vh=[1,36],$Vi=[71,72],$Vj=[5,8,14,16,18,19,40,41,42,43,44,45,53,60,62,71,72],$Vk=[1,56],$Vl=[1,57],$Vm=[1,58],$Vn=[1,59],$Vo=[1,60],$Vp=[1,61],$Vq=[1,62],$Vr=[62,63],$Vs=[1,74],$Vt=[1,70],$Vu=[1,71],$Vv=[1,72],$Vw=[1,73],$Vx=[1,75],$Vy=[1,79],$Vz=[1,80],$VA=[1,77],$VB=[1,78],$VC=[5,8,14,16,18,19,40,41,42,43,44,45,53,71,72];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"directive\":4,\"NEWLINE\":5,\"RD\":6,\"diagram\":7,\"EOF\":8,\"openDirective\":9,\"typeDirective\":10,\"closeDirective\":11,\":\":12,\"argDirective\":13,\"acc_title\":14,\"acc_title_value\":15,\"acc_descr\":16,\"acc_descr_value\":17,\"acc_descr_multiline_value\":18,\"open_directive\":19,\"type_directive\":20,\"arg_directive\":21,\"close_directive\":22,\"requirementDef\":23,\"elementDef\":24,\"relationshipDef\":25,\"requirementType\":26,\"requirementName\":27,\"STRUCT_START\":28,\"requirementBody\":29,\"ID\":30,\"COLONSEP\":31,\"id\":32,\"TEXT\":33,\"text\":34,\"RISK\":35,\"riskLevel\":36,\"VERIFYMTHD\":37,\"verifyType\":38,\"STRUCT_STOP\":39,\"REQUIREMENT\":40,\"FUNCTIONAL_REQUIREMENT\":41,\"INTERFACE_REQUIREMENT\":42,\"PERFORMANCE_REQUIREMENT\":43,\"PHYSICAL_REQUIREMENT\":44,\"DESIGN_CONSTRAINT\":45,\"LOW_RISK\":46,\"MED_RISK\":47,\"HIGH_RISK\":48,\"VERIFY_ANALYSIS\":49,\"VERIFY_DEMONSTRATION\":50,\"VERIFY_INSPECTION\":51,\"VERIFY_TEST\":52,\"ELEMENT\":53,\"elementName\":54,\"elementBody\":55,\"TYPE\":56,\"type\":57,\"DOCREF\":58,\"ref\":59,\"END_ARROW_L\":60,\"relationship\":61,\"LINE\":62,\"END_ARROW_R\":63,\"CONTAINS\":64,\"COPIES\":65,\"DERIVES\":66,\"SATISFIES\":67,\"VERIFIES\":68,\"REFINES\":69,\"TRACES\":70,\"unqString\":71,\"qString\":72,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",5:\"NEWLINE\",6:\"RD\",8:\"EOF\",12:\":\",14:\"acc_title\",15:\"acc_title_value\",16:\"acc_descr\",17:\"acc_descr_value\",18:\"acc_descr_multiline_value\",19:\"open_directive\",20:\"type_directive\",21:\"arg_directive\",22:\"close_directive\",28:\"STRUCT_START\",30:\"ID\",31:\"COLONSEP\",33:\"TEXT\",35:\"RISK\",37:\"VERIFYMTHD\",39:\"STRUCT_STOP\",40:\"REQUIREMENT\",41:\"FUNCTIONAL_REQUIREMENT\",42:\"INTERFACE_REQUIREMENT\",43:\"PERFORMANCE_REQUIREMENT\",44:\"PHYSICAL_REQUIREMENT\",45:\"DESIGN_CONSTRAINT\",46:\"LOW_RISK\",47:\"MED_RISK\",48:\"HIGH_RISK\",49:\"VERIFY_ANALYSIS\",50:\"VERIFY_DEMONSTRATION\",51:\"VERIFY_INSPECTION\",52:\"VERIFY_TEST\",53:\"ELEMENT\",56:\"TYPE\",58:\"DOCREF\",60:\"END_ARROW_L\",62:\"LINE\",63:\"END_ARROW_R\",64:\"CONTAINS\",65:\"COPIES\",66:\"DERIVES\",67:\"SATISFIES\",68:\"VERIFIES\",69:\"REFINES\",70:\"TRACES\",71:\"unqString\",72:\"qString\"},\nproductions_: [0,[3,3],[3,2],[3,4],[4,3],[4,5],[4,2],[4,2],[4,1],[9,1],[10,1],[13,1],[11,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[23,5],[29,5],[29,5],[29,5],[29,5],[29,2],[29,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[36,1],[36,1],[36,1],[38,1],[38,1],[38,1],[38,1],[24,5],[55,5],[55,5],[55,2],[55,1],[25,5],[25,5],[61,1],[61,1],[61,1],[61,1],[61,1],[61,1],[61,1],[27,1],[27,1],[32,1],[32,1],[34,1],[34,1],[54,1],[54,1],[57,1],[57,1],[59,1],[59,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 6:\n this.$=$$[$0].trim();yy.setAccTitle(this.$); \nbreak;\ncase 7: case 8:\n this.$=$$[$0].trim();yy.setAccDescription(this.$); \nbreak;\ncase 9:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 10:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 11:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 12:\n yy.parseDirective('}%%', 'close_directive', 'pie'); \nbreak;\ncase 13:\n this.$ = [] \nbreak;\ncase 19:\n yy.addRequirement($$[$0-3], $$[$0-4]) \nbreak;\ncase 20:\n yy.setNewReqId($$[$0-2]); \nbreak;\ncase 21:\n yy.setNewReqText($$[$0-2]); \nbreak;\ncase 22:\n yy.setNewReqRisk($$[$0-2]); \nbreak;\ncase 23:\n yy.setNewReqVerifyMethod($$[$0-2]); \nbreak;\ncase 26:\n this.$=yy.RequirementType.REQUIREMENT;\nbreak;\ncase 27:\n this.$=yy.RequirementType.FUNCTIONAL_REQUIREMENT;\nbreak;\ncase 28:\n this.$=yy.RequirementType.INTERFACE_REQUIREMENT;\nbreak;\ncase 29:\n this.$=yy.RequirementType.PERFORMANCE_REQUIREMENT;\nbreak;\ncase 30:\n this.$=yy.RequirementType.PHYSICAL_REQUIREMENT;\nbreak;\ncase 31:\n this.$=yy.RequirementType.DESIGN_CONSTRAINT;\nbreak;\ncase 32:\n this.$=yy.RiskLevel.LOW_RISK;\nbreak;\ncase 33:\n this.$=yy.RiskLevel.MED_RISK;\nbreak;\ncase 34:\n this.$=yy.RiskLevel.HIGH_RISK;\nbreak;\ncase 35:\n this.$=yy.VerifyType.VERIFY_ANALYSIS;\nbreak;\ncase 36:\n this.$=yy.VerifyType.VERIFY_DEMONSTRATION;\nbreak;\ncase 37:\n this.$=yy.VerifyType.VERIFY_INSPECTION;\nbreak;\ncase 38:\n this.$=yy.VerifyType.VERIFY_TEST;\nbreak;\ncase 39:\n yy.addElement($$[$0-3]) \nbreak;\ncase 40:\n yy.setNewElementType($$[$0-2]); \nbreak;\ncase 41:\n yy.setNewElementDocRef($$[$0-2]); \nbreak;\ncase 44:\n yy.addRelationship($$[$0-2], $$[$0], $$[$0-4]) \nbreak;\ncase 45:\n yy.addRelationship($$[$0-2], $$[$0-4], $$[$0]) \nbreak;\ncase 46:\n this.$=yy.Relationships.CONTAINS;\nbreak;\ncase 47:\n this.$=yy.Relationships.COPIES;\nbreak;\ncase 48:\n this.$=yy.Relationships.DERIVES;\nbreak;\ncase 49:\n this.$=yy.Relationships.SATISFIES;\nbreak;\ncase 50:\n this.$=yy.Relationships.VERIFIES;\nbreak;\ncase 51:\n this.$=yy.Relationships.REFINES;\nbreak;\ncase 52:\n this.$=yy.Relationships.TRACES;\nbreak;\n}\n},\ntable: [{3:1,4:2,6:$V0,9:4,14:$V1,16:$V2,18:$V3,19:$V4},{1:[3]},{3:10,4:2,5:[1,9],6:$V0,9:4,14:$V1,16:$V2,18:$V3,19:$V4},{5:[1,11]},{10:12,20:[1,13]},{15:[1,14]},{17:[1,15]},o($V5,[2,8]),{20:[2,9]},{3:16,4:2,6:$V0,9:4,14:$V1,16:$V2,18:$V3,19:$V4},{1:[2,2]},{4:21,5:$V6,7:17,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{11:34,12:[1,35],22:$Vh},o([12,22],[2,10]),o($V5,[2,6]),o($V5,[2,7]),{1:[2,1]},{8:[1,37]},{4:21,5:$V6,7:38,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{4:21,5:$V6,7:39,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{4:21,5:$V6,7:40,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{4:21,5:$V6,7:41,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{4:21,5:$V6,7:42,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{27:43,71:[1,44],72:[1,45]},{54:46,71:[1,47],72:[1,48]},{60:[1,49],62:[1,50]},o($Vi,[2,26]),o($Vi,[2,27]),o($Vi,[2,28]),o($Vi,[2,29]),o($Vi,[2,30]),o($Vi,[2,31]),o($Vj,[2,55]),o($Vj,[2,56]),o($V5,[2,4]),{13:51,21:[1,52]},o($V5,[2,12]),{1:[2,3]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{8:[2,17]},{8:[2,18]},{28:[1,53]},{28:[2,53]},{28:[2,54]},{28:[1,54]},{28:[2,59]},{28:[2,60]},{61:55,64:$Vk,65:$Vl,66:$Vm,67:$Vn,68:$Vo,69:$Vp,70:$Vq},{61:63,64:$Vk,65:$Vl,66:$Vm,67:$Vn,68:$Vo,69:$Vp,70:$Vq},{11:64,22:$Vh},{22:[2,11]},{5:[1,65]},{5:[1,66]},{62:[1,67]},o($Vr,[2,46]),o($Vr,[2,47]),o($Vr,[2,48]),o($Vr,[2,49]),o($Vr,[2,50]),o($Vr,[2,51]),o($Vr,[2,52]),{63:[1,68]},o($V5,[2,5]),{5:$Vs,29:69,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},{5:$Vy,39:$Vz,55:76,56:$VA,58:$VB},{32:81,71:$Vf,72:$Vg},{32:82,71:$Vf,72:$Vg},o($VC,[2,19]),{31:[1,83]},{31:[1,84]},{31:[1,85]},{31:[1,86]},{5:$Vs,29:87,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},o($VC,[2,25]),o($VC,[2,39]),{31:[1,88]},{31:[1,89]},{5:$Vy,39:$Vz,55:90,56:$VA,58:$VB},o($VC,[2,43]),o($VC,[2,44]),o($VC,[2,45]),{32:91,71:$Vf,72:$Vg},{34:92,71:[1,93],72:[1,94]},{36:95,46:[1,96],47:[1,97],48:[1,98]},{38:99,49:[1,100],50:[1,101],51:[1,102],52:[1,103]},o($VC,[2,24]),{57:104,71:[1,105],72:[1,106]},{59:107,71:[1,108],72:[1,109]},o($VC,[2,42]),{5:[1,110]},{5:[1,111]},{5:[2,57]},{5:[2,58]},{5:[1,112]},{5:[2,32]},{5:[2,33]},{5:[2,34]},{5:[1,113]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[2,38]},{5:[1,114]},{5:[2,61]},{5:[2,62]},{5:[1,115]},{5:[2,63]},{5:[2,64]},{5:$Vs,29:116,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},{5:$Vs,29:117,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},{5:$Vs,29:118,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},{5:$Vs,29:119,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},{5:$Vy,39:$Vz,55:120,56:$VA,58:$VB},{5:$Vy,39:$Vz,55:121,56:$VA,58:$VB},o($VC,[2,20]),o($VC,[2,21]),o($VC,[2,22]),o($VC,[2,23]),o($VC,[2,40]),o($VC,[2,41])],\ndefaultActions: {8:[2,9],10:[2,2],16:[2,1],37:[2,3],38:[2,14],39:[2,15],40:[2,16],41:[2,17],42:[2,18],44:[2,53],45:[2,54],47:[2,59],48:[2,60],52:[2,11],93:[2,57],94:[2,58],96:[2,32],97:[2,33],98:[2,34],100:[2,35],101:[2,36],102:[2,37],103:[2,38],105:[2,61],106:[2,62],108:[2,63],109:[2,64]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin('open_directive'); return 19; \nbreak;\ncase 1: this.begin('type_directive'); return 20; \nbreak;\ncase 2: this.popState(); this.begin('arg_directive'); return 12; \nbreak;\ncase 3: this.popState(); this.popState(); return 22; \nbreak;\ncase 4:return 21;\nbreak;\ncase 5:return 'title';\nbreak;\ncase 6: this.begin(\"acc_title\");return 14; \nbreak;\ncase 7: this.popState(); return \"acc_title_value\"; \nbreak;\ncase 8: this.begin(\"acc_descr\");return 16; \nbreak;\ncase 9: this.popState(); return \"acc_descr_value\"; \nbreak;\ncase 10: this.begin(\"acc_descr_multiline\");\nbreak;\ncase 11: this.popState(); \nbreak;\ncase 12:return \"acc_descr_multiline_value\";\nbreak;\ncase 13:return 5;\nbreak;\ncase 14:/* skip all whitespace */\nbreak;\ncase 15:/* skip comments */\nbreak;\ncase 16:/* skip comments */\nbreak;\ncase 17:return 8;\nbreak;\ncase 18:return 6;\nbreak;\ncase 19:return 28;\nbreak;\ncase 20:return 39;\nbreak;\ncase 21:return 31;\nbreak;\ncase 22:return 30;\nbreak;\ncase 23:return 33;\nbreak;\ncase 24:return 35;\nbreak;\ncase 25:return 37;\nbreak;\ncase 26:return 40;\nbreak;\ncase 27:return 41;\nbreak;\ncase 28:return 42;\nbreak;\ncase 29:return 43;\nbreak;\ncase 30:return 44;\nbreak;\ncase 31:return 45;\nbreak;\ncase 32:return 46;\nbreak;\ncase 33:return 47;\nbreak;\ncase 34:return 48;\nbreak;\ncase 35:return 49;\nbreak;\ncase 36:return 50;\nbreak;\ncase 37:return 51;\nbreak;\ncase 38:return 52;\nbreak;\ncase 39:return 53;\nbreak;\ncase 40:return 64;\nbreak;\ncase 41:return 65;\nbreak;\ncase 42:return 66;\nbreak;\ncase 43:return 67;\nbreak;\ncase 44:return 68;\nbreak;\ncase 45:return 69;\nbreak;\ncase 46:return 70;\nbreak;\ncase 47:return 56;\nbreak;\ncase 48:return 58;\nbreak;\ncase 49:return 60;\nbreak;\ncase 50:return 63;\nbreak;\ncase 51:return 62;\nbreak;\ncase 52: this.begin(\"string\"); \nbreak;\ncase 53: this.popState(); \nbreak;\ncase 54: return \"qString\"; \nbreak;\ncase 55: yy_.yytext = yy_.yytext.trim(); return 71;\nbreak;\n}\n},\nrules: [/^(?:%%\\{)/i,/^(?:((?:(?!\\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\\}%%)/i,/^(?:((?:(?!\\}%%).|\\n)*))/i,/^(?:title\\s[^#\\n;]+)/i,/^(?:accTitle\\s*:\\s*)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:accDescr\\s*:\\s*)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:accDescr\\s*\\{\\s*)/i,/^(?:[\\}])/i,/^(?:[^\\}]*)/i,/^(?:(\\r?\\n)+)/i,/^(?:\\s+)/i,/^(?:#[^\\n]*)/i,/^(?:%[^\\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\\b)/i,/^(?:\\{)/i,/^(?:\\})/i,/^(?::)/i,/^(?:id\\b)/i,/^(?:text\\b)/i,/^(?:risk\\b)/i,/^(?:verifyMethod\\b)/i,/^(?:requirement\\b)/i,/^(?:functionalRequirement\\b)/i,/^(?:interfaceRequirement\\b)/i,/^(?:performanceRequirement\\b)/i,/^(?:physicalRequirement\\b)/i,/^(?:designConstraint\\b)/i,/^(?:low\\b)/i,/^(?:medium\\b)/i,/^(?:high\\b)/i,/^(?:analysis\\b)/i,/^(?:demonstration\\b)/i,/^(?:inspection\\b)/i,/^(?:test\\b)/i,/^(?:element\\b)/i,/^(?:contains\\b)/i,/^(?:copies\\b)/i,/^(?:derives\\b)/i,/^(?:satisfies\\b)/i,/^(?:verifies\\b)/i,/^(?:refines\\b)/i,/^(?:traces\\b)/i,/^(?:type\\b)/i,/^(?:docref\\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:[\"])/i,/^(?:[\"])/i,/^(?:[^\"]*)/i,/^(?:[\\w][^\\r\\n\\{\\<\\>\\-\\=]*)/i],\nconditions: {\"acc_descr_multiline\":{\"rules\":[11,12],\"inclusive\":false},\"acc_descr\":{\"rules\":[9],\"inclusive\":false},\"acc_title\":{\"rules\":[7],\"inclusive\":false},\"close_directive\":{\"rules\":[],\"inclusive\":false},\"arg_directive\":{\"rules\":[3,4],\"inclusive\":false},\"type_directive\":{\"rules\":[2,3],\"inclusive\":false},\"open_directive\":{\"rules\":[1],\"inclusive\":false},\"unqString\":{\"rules\":[],\"inclusive\":false},\"token\":{\"rules\":[],\"inclusive\":false},\"string\":{\"rules\":[53,54],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,18],$V8=[1,19],$V9=[1,21],$Va=[1,22],$Vb=[1,23],$Vc=[1,29],$Vd=[1,30],$Ve=[1,31],$Vf=[1,32],$Vg=[1,33],$Vh=[1,34],$Vi=[1,35],$Vj=[1,36],$Vk=[1,37],$Vl=[1,38],$Vm=[1,39],$Vn=[1,40],$Vo=[1,43],$Vp=[1,44],$Vq=[1,45],$Vr=[1,46],$Vs=[1,47],$Vt=[1,48],$Vu=[1,51],$Vv=[1,4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,51,52,53,58,59,60,61,69,79],$Vw=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,53,58,59,60,61,69,79],$Vx=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,52,53,58,59,60,61,69,79],$Vy=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,51,53,58,59,60,61,69,79],$Vz=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,53,58,59,60,61,69,79],$VA=[67,68,69],$VB=[1,121],$VC=[1,4,5,7,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,51,52,53,58,59,60,61,69,79];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"SPACE\":4,\"NEWLINE\":5,\"directive\":6,\"SD\":7,\"document\":8,\"line\":9,\"statement\":10,\"openDirective\":11,\"typeDirective\":12,\"closeDirective\":13,\":\":14,\"argDirective\":15,\"participant\":16,\"actor\":17,\"AS\":18,\"restOfLine\":19,\"participant_actor\":20,\"signal\":21,\"autonumber\":22,\"NUM\":23,\"off\":24,\"activate\":25,\"deactivate\":26,\"note_statement\":27,\"links_statement\":28,\"link_statement\":29,\"properties_statement\":30,\"details_statement\":31,\"title\":32,\"legacy_title\":33,\"acc_title\":34,\"acc_title_value\":35,\"acc_descr\":36,\"acc_descr_value\":37,\"acc_descr_multiline_value\":38,\"loop\":39,\"end\":40,\"rect\":41,\"opt\":42,\"alt\":43,\"else_sections\":44,\"par\":45,\"par_sections\":46,\"critical\":47,\"option_sections\":48,\"break\":49,\"option\":50,\"and\":51,\"else\":52,\"note\":53,\"placement\":54,\"text2\":55,\"over\":56,\"actor_pair\":57,\"links\":58,\"link\":59,\"properties\":60,\"details\":61,\"spaceList\":62,\",\":63,\"left_of\":64,\"right_of\":65,\"signaltype\":66,\"+\":67,\"-\":68,\"ACTOR\":69,\"SOLID_OPEN_ARROW\":70,\"DOTTED_OPEN_ARROW\":71,\"SOLID_ARROW\":72,\"DOTTED_ARROW\":73,\"SOLID_CROSS\":74,\"DOTTED_CROSS\":75,\"SOLID_POINT\":76,\"DOTTED_POINT\":77,\"TXT\":78,\"open_directive\":79,\"type_directive\":80,\"arg_directive\":81,\"close_directive\":82,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",4:\"SPACE\",5:\"NEWLINE\",7:\"SD\",14:\":\",16:\"participant\",18:\"AS\",19:\"restOfLine\",20:\"participant_actor\",22:\"autonumber\",23:\"NUM\",24:\"off\",25:\"activate\",26:\"deactivate\",32:\"title\",33:\"legacy_title\",34:\"acc_title\",35:\"acc_title_value\",36:\"acc_descr\",37:\"acc_descr_value\",38:\"acc_descr_multiline_value\",39:\"loop\",40:\"end\",41:\"rect\",42:\"opt\",43:\"alt\",45:\"par\",47:\"critical\",49:\"break\",50:\"option\",51:\"and\",52:\"else\",53:\"note\",56:\"over\",58:\"links\",59:\"link\",60:\"properties\",61:\"details\",63:\",\",64:\"left_of\",65:\"right_of\",67:\"+\",68:\"-\",69:\"ACTOR\",70:\"SOLID_OPEN_ARROW\",71:\"DOTTED_OPEN_ARROW\",72:\"SOLID_ARROW\",73:\"DOTTED_ARROW\",74:\"SOLID_CROSS\",75:\"DOTTED_CROSS\",76:\"SOLID_POINT\",77:\"DOTTED_POINT\",78:\"TXT\",79:\"open_directive\",80:\"type_directive\",81:\"arg_directive\",82:\"close_directive\"},\nproductions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[6,4],[6,6],[10,5],[10,3],[10,5],[10,3],[10,2],[10,4],[10,3],[10,3],[10,2],[10,3],[10,3],[10,2],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,2],[10,2],[10,1],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,1],[48,1],[48,4],[46,1],[46,4],[44,1],[44,4],[27,4],[27,4],[28,3],[29,3],[30,3],[31,3],[62,2],[62,1],[57,3],[57,1],[54,1],[54,1],[21,5],[21,5],[21,4],[17,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[55,1],[11,1],[12,1],[15,1],[13,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 4:\n yy.apply($$[$0]);return $$[$0]; \nbreak;\ncase 5:\n this.$ = [] \nbreak;\ncase 6:\n$$[$0-1].push($$[$0]);this.$ = $$[$0-1]\nbreak;\ncase 7: case 8:\n this.$ = $$[$0] \nbreak;\ncase 9:\n this.$=[]; \nbreak;\ncase 12:\n$$[$0-3].type='addParticipant';$$[$0-3].description=yy.parseMessage($$[$0-1]); this.$=$$[$0-3];\nbreak;\ncase 13:\n$$[$0-1].type='addParticipant';this.$=$$[$0-1];\nbreak;\ncase 14:\n$$[$0-3].type='addActor';$$[$0-3].description=yy.parseMessage($$[$0-1]); this.$=$$[$0-3];\nbreak;\ncase 15:\n$$[$0-1].type='addActor'; this.$=$$[$0-1];\nbreak;\ncase 17:\n this.$= {type:'sequenceIndex',sequenceIndex: Number($$[$0-2]), sequenceIndexStep:Number($$[$0-1]), sequenceVisible:true, signalType:yy.LINETYPE.AUTONUMBER};\nbreak;\ncase 18:\n this.$ = {type:'sequenceIndex',sequenceIndex: Number($$[$0-1]), sequenceIndexStep:1, sequenceVisible:true, signalType:yy.LINETYPE.AUTONUMBER};\nbreak;\ncase 19:\n this.$ = {type:'sequenceIndex', sequenceVisible:false, signalType:yy.LINETYPE.AUTONUMBER};\nbreak;\ncase 20:\nthis.$ = {type:'sequenceIndex', sequenceVisible:true, signalType:yy.LINETYPE.AUTONUMBER}; \nbreak;\ncase 21:\nthis.$={type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]};\nbreak;\ncase 22:\nthis.$={type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-1]};\nbreak;\ncase 28:\nyy.setDiagramTitle($$[$0].substring(6));this.$=$$[$0].substring(6);\nbreak;\ncase 29:\nyy.setDiagramTitle($$[$0].substring(7));this.$=$$[$0].substring(7);\nbreak;\ncase 30:\n this.$=$$[$0].trim();yy.setAccTitle(this.$); \nbreak;\ncase 31: case 32:\n this.$=$$[$0].trim();yy.setAccDescription(this.$); \nbreak;\ncase 33:\n\n\t\t$$[$0-1].unshift({type: 'loopStart', loopText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.LOOP_START});\n\t\t$$[$0-1].push({type: 'loopEnd', loopText:$$[$0-2], signalType: yy.LINETYPE.LOOP_END});\n\t\tthis.$=$$[$0-1];\nbreak;\ncase 34:\n\n\t\t$$[$0-1].unshift({type: 'rectStart', color:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.RECT_START });\n\t\t$$[$0-1].push({type: 'rectEnd', color:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.RECT_END });\n\t\tthis.$=$$[$0-1];\nbreak;\ncase 35:\n\n\t\t$$[$0-1].unshift({type: 'optStart', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.OPT_START});\n\t\t$$[$0-1].push({type: 'optEnd', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.OPT_END});\n\t\tthis.$=$$[$0-1];\nbreak;\ncase 36:\n\n\t\t// Alt start\n\t\t$$[$0-1].unshift({type: 'altStart', altText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.ALT_START});\n\t\t// Content in alt is already in $$[$0-1]\n\t\t// End\n\t\t$$[$0-1].push({type: 'altEnd', signalType: yy.LINETYPE.ALT_END});\n\t\tthis.$=$$[$0-1];\nbreak;\ncase 37:\n\n\t\t// Parallel start\n\t\t$$[$0-1].unshift({type: 'parStart', parText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.PAR_START});\n\t\t// Content in par is already in $$[$0-1]\n\t\t// End\n\t\t$$[$0-1].push({type: 'parEnd', signalType: yy.LINETYPE.PAR_END});\n\t\tthis.$=$$[$0-1];\nbreak;\ncase 38:\n\n\t\t// critical start\n\t\t$$[$0-1].unshift({type: 'criticalStart', criticalText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.CRITICAL_START});\n\t\t// Content in critical is already in $$[$0-1]\n\t\t// critical end\n\t\t$$[$0-1].push({type: 'criticalEnd', signalType: yy.LINETYPE.CRITICAL_END});\n\t\tthis.$=$$[$0-1];\nbreak;\ncase 39:\n\n\t\t$$[$0-1].unshift({type: 'breakStart', breakText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.BREAK_START});\n\t\t$$[$0-1].push({type: 'breakEnd', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.BREAK_END});\n\t\tthis.$=$$[$0-1];\nbreak;\ncase 42:\n this.$ = $$[$0-3].concat([{type: 'option', optionText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.CRITICAL_OPTION}, $$[$0]]); \nbreak;\ncase 44:\n this.$ = $$[$0-3].concat([{type: 'and', parText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.PAR_AND}, $$[$0]]); \nbreak;\ncase 46:\n this.$ = $$[$0-3].concat([{type: 'else', altText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.ALT_ELSE}, $$[$0]]); \nbreak;\ncase 47:\n\n\t\tthis.$ = [$$[$0-1], {type:'addNote', placement:$$[$0-2], actor:$$[$0-1].actor, text:$$[$0]}];\nbreak;\ncase 48:\n\n\t\t// Coerce actor_pair into a [to, from, ...] array\n\t\t$$[$0-2] = [].concat($$[$0-1], $$[$0-1]).slice(0, 2);\n\t\t$$[$0-2][0] = $$[$0-2][0].actor;\n\t\t$$[$0-2][1] = $$[$0-2][1].actor;\n\t\tthis.$ = [$$[$0-1], {type:'addNote', placement:yy.PLACEMENT.OVER, actor:$$[$0-2].slice(0, 2), text:$$[$0]}];\nbreak;\ncase 49:\n\n\t\tthis.$ = [$$[$0-1], {type:'addLinks', actor:$$[$0-1].actor, text:$$[$0]}];\n \nbreak;\ncase 50:\n\n\t\tthis.$ = [$$[$0-1], {type:'addALink', actor:$$[$0-1].actor, text:$$[$0]}];\n \nbreak;\ncase 51:\n\n\t\tthis.$ = [$$[$0-1], {type:'addProperties', actor:$$[$0-1].actor, text:$$[$0]}];\n \nbreak;\ncase 52:\n\n\t\tthis.$ = [$$[$0-1], {type:'addDetails', actor:$$[$0-1].actor, text:$$[$0]}];\n \nbreak;\ncase 55:\n this.$ = [$$[$0-2], $$[$0]]; \nbreak;\ncase 56:\n this.$ = $$[$0]; \nbreak;\ncase 57:\n this.$ = yy.PLACEMENT.LEFTOF; \nbreak;\ncase 58:\n this.$ = yy.PLACEMENT.RIGHTOF; \nbreak;\ncase 59:\n this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]},\n\t {type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]}\n\t ]\nbreak;\ncase 60:\n this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]},\n\t {type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-4]}\n\t ]\nbreak;\ncase 61:\n this.$ = [$$[$0-3],$$[$0-1],{type: 'addMessage', from:$$[$0-3].actor, to:$$[$0-1].actor, signalType:$$[$0-2], msg:$$[$0]}]\nbreak;\ncase 62:\nthis.$={ type: 'addParticipant', actor:$$[$0]}\nbreak;\ncase 63:\n this.$ = yy.LINETYPE.SOLID_OPEN; \nbreak;\ncase 64:\n this.$ = yy.LINETYPE.DOTTED_OPEN; \nbreak;\ncase 65:\n this.$ = yy.LINETYPE.SOLID; \nbreak;\ncase 66:\n this.$ = yy.LINETYPE.DOTTED; \nbreak;\ncase 67:\n this.$ = yy.LINETYPE.SOLID_CROSS; \nbreak;\ncase 68:\n this.$ = yy.LINETYPE.DOTTED_CROSS; \nbreak;\ncase 69:\n this.$ = yy.LINETYPE.SOLID_POINT; \nbreak;\ncase 70:\n this.$ = yy.LINETYPE.DOTTED_POINT; \nbreak;\ncase 71:\nthis.$ = yy.parseMessage($$[$0].trim().substring(1)) \nbreak;\ncase 72:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 73:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 74:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 75:\n yy.parseDirective('}%%', 'close_directive', 'sequence'); \nbreak;\n}\n},\ntable: [{3:1,4:$V0,5:$V1,6:4,7:$V2,11:6,79:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,11:6,79:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,11:6,79:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,11:6,79:$V3},o([1,4,5,16,20,22,25,26,32,33,34,36,38,39,41,42,43,45,47,49,53,58,59,60,61,69,79],$V4,{8:11}),{12:12,80:[1,13]},{80:[2,72]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{13:49,14:[1,50],82:$Vu},o([14,82],[2,73]),o($Vv,[2,6]),{6:41,10:52,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},o($Vv,[2,8]),o($Vv,[2,9]),{17:53,69:$Vt},{17:54,69:$Vt},{5:[1,55]},{5:[1,58],23:[1,56],24:[1,57]},{17:59,69:$Vt},{17:60,69:$Vt},{5:[1,61]},{5:[1,62]},{5:[1,63]},{5:[1,64]},{5:[1,65]},o($Vv,[2,28]),o($Vv,[2,29]),{35:[1,66]},{37:[1,67]},o($Vv,[2,32]),{19:[1,68]},{19:[1,69]},{19:[1,70]},{19:[1,71]},{19:[1,72]},{19:[1,73]},{19:[1,74]},o($Vv,[2,40]),{66:75,70:[1,76],71:[1,77],72:[1,78],73:[1,79],74:[1,80],75:[1,81],76:[1,82],77:[1,83]},{54:84,56:[1,85],64:[1,86],65:[1,87]},{17:88,69:$Vt},{17:89,69:$Vt},{17:90,69:$Vt},{17:91,69:$Vt},o([5,18,63,70,71,72,73,74,75,76,77,78],[2,62]),{5:[1,92]},{15:93,81:[1,94]},{5:[2,75]},o($Vv,[2,7]),{5:[1,96],18:[1,95]},{5:[1,98],18:[1,97]},o($Vv,[2,16]),{5:[1,100],23:[1,99]},{5:[1,101]},o($Vv,[2,20]),{5:[1,102]},{5:[1,103]},o($Vv,[2,23]),o($Vv,[2,24]),o($Vv,[2,25]),o($Vv,[2,26]),o($Vv,[2,27]),o($Vv,[2,30]),o($Vv,[2,31]),o($Vw,$V4,{8:104}),o($Vw,$V4,{8:105}),o($Vw,$V4,{8:106}),o($Vx,$V4,{44:107,8:108}),o($Vy,$V4,{46:109,8:110}),o($Vz,$V4,{48:111,8:112}),o($Vw,$V4,{8:113}),{17:116,67:[1,114],68:[1,115],69:$Vt},o($VA,[2,63]),o($VA,[2,64]),o($VA,[2,65]),o($VA,[2,66]),o($VA,[2,67]),o($VA,[2,68]),o($VA,[2,69]),o($VA,[2,70]),{17:117,69:$Vt},{17:119,57:118,69:$Vt},{69:[2,57]},{69:[2,58]},{55:120,78:$VB},{55:122,78:$VB},{55:123,78:$VB},{55:124,78:$VB},o($VC,[2,10]),{13:125,82:$Vu},{82:[2,74]},{19:[1,126]},o($Vv,[2,13]),{19:[1,127]},o($Vv,[2,15]),{5:[1,128]},o($Vv,[2,18]),o($Vv,[2,19]),o($Vv,[2,21]),o($Vv,[2,22]),{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[1,129],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[1,130],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[1,131],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{40:[1,132]},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[2,45],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,52:[1,133],53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{40:[1,134]},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[2,43],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,51:[1,135],53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{40:[1,136]},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[2,41],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,50:[1,137],53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[1,138],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{17:139,69:$Vt},{17:140,69:$Vt},{55:141,78:$VB},{55:142,78:$VB},{55:143,78:$VB},{63:[1,144],78:[2,56]},{5:[2,49]},{5:[2,71]},{5:[2,50]},{5:[2,51]},{5:[2,52]},{5:[1,145]},{5:[1,146]},{5:[1,147]},o($Vv,[2,17]),o($Vv,[2,33]),o($Vv,[2,34]),o($Vv,[2,35]),o($Vv,[2,36]),{19:[1,148]},o($Vv,[2,37]),{19:[1,149]},o($Vv,[2,38]),{19:[1,150]},o($Vv,[2,39]),{55:151,78:$VB},{55:152,78:$VB},{5:[2,61]},{5:[2,47]},{5:[2,48]},{17:153,69:$Vt},o($VC,[2,11]),o($Vv,[2,12]),o($Vv,[2,14]),o($Vx,$V4,{8:108,44:154}),o($Vy,$V4,{8:110,46:155}),o($Vz,$V4,{8:112,48:156}),{5:[2,59]},{5:[2,60]},{78:[2,55]},{40:[2,46]},{40:[2,44]},{40:[2,42]}],\ndefaultActions: {7:[2,72],8:[2,1],9:[2,2],10:[2,3],51:[2,75],86:[2,57],87:[2,58],94:[2,74],120:[2,49],121:[2,71],122:[2,50],123:[2,51],124:[2,52],141:[2,61],142:[2,47],143:[2,48],151:[2,59],152:[2,60],153:[2,55],154:[2,46],155:[2,44],156:[2,42]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin('open_directive'); return 79; \nbreak;\ncase 1: this.begin('type_directive'); return 80; \nbreak;\ncase 2: this.popState(); this.begin('arg_directive'); return 14; \nbreak;\ncase 3: this.popState(); this.popState(); return 82; \nbreak;\ncase 4:return 81;\nbreak;\ncase 5:return 5;\nbreak;\ncase 6:/* skip all whitespace */\nbreak;\ncase 7:/* skip same-line whitespace */\nbreak;\ncase 8:/* skip comments */\nbreak;\ncase 9:/* skip comments */\nbreak;\ncase 10:/* skip comments */\nbreak;\ncase 11:return 23;\nbreak;\ncase 12: this.begin('ID'); return 16; \nbreak;\ncase 13: this.begin('ID'); return 20; \nbreak;\ncase 14: yy_.yytext = yy_.yytext.trim(); this.begin('ALIAS'); return 69; \nbreak;\ncase 15: this.popState(); this.popState(); this.begin('LINE'); return 18; \nbreak;\ncase 16: this.popState(); this.popState(); return 5; \nbreak;\ncase 17: this.begin('LINE'); return 39; \nbreak;\ncase 18: this.begin('LINE'); return 41; \nbreak;\ncase 19: this.begin('LINE'); return 42; \nbreak;\ncase 20: this.begin('LINE'); return 43; \nbreak;\ncase 21: this.begin('LINE'); return 52; \nbreak;\ncase 22: this.begin('LINE'); return 45; \nbreak;\ncase 23: this.begin('LINE'); return 51; \nbreak;\ncase 24: this.begin('LINE'); return 47; \nbreak;\ncase 25: this.begin('LINE'); return 50; \nbreak;\ncase 26: this.begin('LINE'); return 49; \nbreak;\ncase 27: this.popState(); return 19; \nbreak;\ncase 28:return 40;\nbreak;\ncase 29:return 64;\nbreak;\ncase 30:return 65;\nbreak;\ncase 31:return 58;\nbreak;\ncase 32:return 59;\nbreak;\ncase 33:return 60;\nbreak;\ncase 34:return 61;\nbreak;\ncase 35:return 56;\nbreak;\ncase 36:return 53;\nbreak;\ncase 37: this.begin('ID'); return 25; \nbreak;\ncase 38: this.begin('ID'); return 26; \nbreak;\ncase 39:return 32;\nbreak;\ncase 40:return 33;\nbreak;\ncase 41: this.begin(\"acc_title\");return 34; \nbreak;\ncase 42: this.popState(); return \"acc_title_value\"; \nbreak;\ncase 43: this.begin(\"acc_descr\");return 36; \nbreak;\ncase 44: this.popState(); return \"acc_descr_value\"; \nbreak;\ncase 45: this.begin(\"acc_descr_multiline\");\nbreak;\ncase 46: this.popState(); \nbreak;\ncase 47:return \"acc_descr_multiline_value\";\nbreak;\ncase 48:return 7;\nbreak;\ncase 49:return 22;\nbreak;\ncase 50:return 24;\nbreak;\ncase 51:return 63;\nbreak;\ncase 52:return 5;\nbreak;\ncase 53: yy_.yytext = yy_.yytext.trim(); return 69; \nbreak;\ncase 54:return 72;\nbreak;\ncase 55:return 73;\nbreak;\ncase 56:return 70;\nbreak;\ncase 57:return 71;\nbreak;\ncase 58:return 74;\nbreak;\ncase 59:return 75;\nbreak;\ncase 60:return 76;\nbreak;\ncase 61:return 77;\nbreak;\ncase 62:return 78;\nbreak;\ncase 63:return 67;\nbreak;\ncase 64:return 68;\nbreak;\ncase 65:return 5;\nbreak;\ncase 66:return 'INVALID';\nbreak;\n}\n},\nrules: [/^(?:%%\\{)/i,/^(?:((?:(?!\\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\\}%%)/i,/^(?:((?:(?!\\}%%).|\\n)*))/i,/^(?:[\\n]+)/i,/^(?:\\s+)/i,/^(?:((?!\\n)\\s)+)/i,/^(?:#[^\\n]*)/i,/^(?:%(?!\\{)[^\\n]*)/i,/^(?:[^\\}]%%[^\\n]*)/i,/^(?:[0-9]+(?=[ \\n]+))/i,/^(?:participant\\b)/i,/^(?:actor\\b)/i,/^(?:[^\\->:\\n,;]+?(?=((?!\\n)\\s)+as(?!\\n)\\s|[#\\n;]|$))/i,/^(?:as\\b)/i,/^(?:(?:))/i,/^(?:loop\\b)/i,/^(?:rect\\b)/i,/^(?:opt\\b)/i,/^(?:alt\\b)/i,/^(?:else\\b)/i,/^(?:par\\b)/i,/^(?:and\\b)/i,/^(?:critical\\b)/i,/^(?:option\\b)/i,/^(?:break\\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\\n;]*)/i,/^(?:end\\b)/i,/^(?:left of\\b)/i,/^(?:right of\\b)/i,/^(?:links\\b)/i,/^(?:link\\b)/i,/^(?:properties\\b)/i,/^(?:details\\b)/i,/^(?:over\\b)/i,/^(?:note\\b)/i,/^(?:activate\\b)/i,/^(?:deactivate\\b)/i,/^(?:title\\s[^#\\n;]+)/i,/^(?:title:\\s[^#\\n;]+)/i,/^(?:accTitle\\s*:\\s*)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:accDescr\\s*:\\s*)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:accDescr\\s*\\{\\s*)/i,/^(?:[\\}])/i,/^(?:[^\\}]*)/i,/^(?:sequenceDiagram\\b)/i,/^(?:autonumber\\b)/i,/^(?:off\\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\\+\\->:\\n,;]+((?!(-x|--x|-\\)|--\\)))[\\-]*[^\\+\\->:\\n,;]+)*)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\\)])/i,/^(?:--[\\)])/i,/^(?::(?:(?:no)?wrap)?[^#\\n;]+)/i,/^(?:\\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],\nconditions: {\"acc_descr_multiline\":{\"rules\":[46,47],\"inclusive\":false},\"acc_descr\":{\"rules\":[44],\"inclusive\":false},\"acc_title\":{\"rules\":[42],\"inclusive\":false},\"open_directive\":{\"rules\":[1,8],\"inclusive\":false},\"type_directive\":{\"rules\":[2,3,8],\"inclusive\":false},\"arg_directive\":{\"rules\":[3,4,8],\"inclusive\":false},\"ID\":{\"rules\":[7,8,14],\"inclusive\":false},\"ALIAS\":{\"rules\":[7,8,15,16],\"inclusive\":false},\"LINE\":{\"rules\":[7,8,27],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,5,6,8,9,10,11,12,13,17,18,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,45,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,33],$Vc=[1,23],$Vd=[1,24],$Ve=[1,25],$Vf=[1,26],$Vg=[1,27],$Vh=[1,30],$Vi=[1,31],$Vj=[1,32],$Vk=[1,35],$Vl=[1,36],$Vm=[1,37],$Vn=[1,38],$Vo=[1,34],$Vp=[1,41],$Vq=[1,4,5,14,15,17,19,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50],$Vr=[1,4,5,12,13,14,15,17,19,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50],$Vs=[1,4,5,7,14,15,17,19,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50],$Vt=[4,5,14,15,17,19,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"SPACE\":4,\"NL\":5,\"directive\":6,\"SD\":7,\"document\":8,\"line\":9,\"statement\":10,\"idStatement\":11,\"DESCR\":12,\"-->\":13,\"HIDE_EMPTY\":14,\"scale\":15,\"WIDTH\":16,\"COMPOSIT_STATE\":17,\"STRUCT_START\":18,\"STRUCT_STOP\":19,\"STATE_DESCR\":20,\"AS\":21,\"ID\":22,\"FORK\":23,\"JOIN\":24,\"CHOICE\":25,\"CONCURRENT\":26,\"note\":27,\"notePosition\":28,\"NOTE_TEXT\":29,\"direction\":30,\"acc_title\":31,\"acc_title_value\":32,\"acc_descr\":33,\"acc_descr_value\":34,\"acc_descr_multiline_value\":35,\"openDirective\":36,\"typeDirective\":37,\"closeDirective\":38,\":\":39,\"argDirective\":40,\"direction_tb\":41,\"direction_bt\":42,\"direction_rl\":43,\"direction_lr\":44,\"eol\":45,\";\":46,\"EDGE_STATE\":47,\"left_of\":48,\"right_of\":49,\"open_directive\":50,\"type_directive\":51,\"arg_directive\":52,\"close_directive\":53,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",4:\"SPACE\",5:\"NL\",7:\"SD\",12:\"DESCR\",13:\"-->\",14:\"HIDE_EMPTY\",15:\"scale\",16:\"WIDTH\",17:\"COMPOSIT_STATE\",18:\"STRUCT_START\",19:\"STRUCT_STOP\",20:\"STATE_DESCR\",21:\"AS\",22:\"ID\",23:\"FORK\",24:\"JOIN\",25:\"CHOICE\",26:\"CONCURRENT\",27:\"note\",29:\"NOTE_TEXT\",31:\"acc_title\",32:\"acc_title_value\",33:\"acc_descr\",34:\"acc_descr_value\",35:\"acc_descr_multiline_value\",39:\":\",41:\"direction_tb\",42:\"direction_bt\",43:\"direction_rl\",44:\"direction_lr\",46:\";\",47:\"EDGE_STATE\",48:\"left_of\",49:\"right_of\",50:\"open_directive\",51:\"type_directive\",52:\"arg_directive\",53:\"close_directive\"},\nproductions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,1],[10,2],[10,1],[10,4],[10,3],[10,6],[10,1],[10,1],[10,1],[10,1],[10,4],[10,4],[10,1],[10,1],[10,2],[10,2],[10,1],[6,3],[6,5],[30,1],[30,1],[30,1],[30,1],[45,1],[45,1],[11,1],[11,1],[28,1],[28,1],[36,1],[37,1],[40,1],[38,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 4:\n /*console.warn('Root document', $$[$0]);*/ yy.setRootDoc($$[$0]);return $$[$0]; \nbreak;\ncase 5:\n this.$ = [] \nbreak;\ncase 6:\n\n if($$[$0]!='nl'){\n $$[$0-1].push($$[$0]);this.$ = $$[$0-1]\n }\n // console.warn('Got document',$$[$0-1], $$[$0]);\n \nbreak;\ncase 7: case 8:\n this.$ = $$[$0] \nbreak;\ncase 9:\n this.$='nl';\nbreak;\ncase 10:\n /*console.warn('got id and descr', $$[$0]);*/this.$={ stmt: 'state', id: $$[$0], type: 'default', description: ''};\nbreak;\ncase 11:\n /*console.warn('got id and descr', $$[$0-1], $$[$0].trim());*/this.$={ stmt: 'state', id: $$[$0-1], type: 'default', description: yy.trimColon($$[$0])};\nbreak;\ncase 12:\n\n /*console.warn('got id', $$[$0-2]);yy.addRelation($$[$0-2], $$[$0]);*/\n this.$={ stmt: 'relation', state1: { stmt: 'state', id: $$[$0-2], type: 'default', description: '' }, state2:{ stmt: 'state', id: $$[$0] ,type: 'default', description: ''}};\n \nbreak;\ncase 13:\n\n /*yy.addRelation($$[$0-3], $$[$0-1], $$[$0].substr(1).trim());*/\n this.$={ stmt: 'relation', state1: { stmt: 'state', id: $$[$0-3], type: 'default', description: '' }, state2:{ stmt: 'state', id: $$[$0-1] ,type: 'default', description: ''}, description: $$[$0].substr(1).trim()};\n \nbreak;\ncase 17:\n\n /* console.warn('Adding document for state without id ', $$[$0-3]);*/\n this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: '', doc: $$[$0-1] }\n \nbreak;\ncase 18:\n\n var id=$$[$0];\n var description = $$[$0-2].trim();\n if($$[$0].match(':')){\n var parts = $$[$0].split(':');\n id=parts[0];\n description = [description, parts[1]];\n }\n this.$={stmt: 'state', id: id, type: 'default', description: description};\n\n \nbreak;\ncase 19:\n\n // console.warn('Adding document for state with id zxzx', $$[$0-3], $$[$0-2], yy.getDirection()); yy.addDocument($$[$0-3]);\n this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: $$[$0-5], doc: $$[$0-1] }\n \nbreak;\ncase 20:\n\n this.$={ stmt: 'state', id: $$[$0], type: 'fork' }\n \nbreak;\ncase 21:\n\n this.$={ stmt: 'state', id: $$[$0], type: 'join' }\n \nbreak;\ncase 22:\n\n this.$={ stmt: 'state', id: $$[$0], type: 'choice' }\n \nbreak;\ncase 23:\n\n this.$={ stmt: 'state', id: yy.getDividerId(), type: 'divider' }\n \nbreak;\ncase 24:\n\n /* console.warn('got NOTE, position: ', $$[$0-2].trim(), 'id = ', $$[$0-1].trim(), 'note: ', $$[$0]);*/\n this.$={ stmt: 'state', id: $$[$0-1].trim(), note:{position: $$[$0-2].trim(), text: $$[$0].trim()}};\n \nbreak;\ncase 28:\n this.$=$$[$0].trim();yy.setAccTitle(this.$); \nbreak;\ncase 29: case 30:\n this.$=$$[$0].trim();yy.setAccDescription(this.$); \nbreak;\ncase 33:\n yy.setDirection('TB');this.$={stmt:'dir', value:'TB'};\nbreak;\ncase 34:\n yy.setDirection('BT');this.$={stmt:'dir', value:'BT'};\nbreak;\ncase 35:\n yy.setDirection('RL'); this.$={stmt:'dir', value:'RL'};\nbreak;\ncase 36:\n yy.setDirection('LR');this.$={stmt:'dir', value:'LR'};\nbreak;\ncase 39: case 40:\nthis.$=$$[$0];\nbreak;\ncase 43:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 44:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 45:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 46:\n yy.parseDirective('}%%', 'close_directive', 'state'); \nbreak;\n}\n},\ntable: [{3:1,4:$V0,5:$V1,6:4,7:$V2,36:6,50:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,36:6,50:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,36:6,50:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,36:6,50:$V3},o([1,4,5,14,15,17,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50],$V4,{8:11}),{37:12,51:[1,13]},{51:[2,43]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:$Vh,33:$Vi,35:$Vj,36:6,41:$Vk,42:$Vl,43:$Vm,44:$Vn,47:$Vo,50:$V3},{38:39,39:[1,40],53:$Vp},o([39,53],[2,44]),o($Vq,[2,6]),{6:28,10:42,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:$Vh,33:$Vi,35:$Vj,36:6,41:$Vk,42:$Vl,43:$Vm,44:$Vn,47:$Vo,50:$V3},o($Vq,[2,8]),o($Vq,[2,9]),o($Vq,[2,10],{12:[1,43],13:[1,44]}),o($Vq,[2,14]),{16:[1,45]},o($Vq,[2,16],{18:[1,46]}),{21:[1,47]},o($Vq,[2,20]),o($Vq,[2,21]),o($Vq,[2,22]),o($Vq,[2,23]),{28:48,29:[1,49],48:[1,50],49:[1,51]},o($Vq,[2,26]),o($Vq,[2,27]),{32:[1,52]},{34:[1,53]},o($Vq,[2,30]),o($Vr,[2,39]),o($Vr,[2,40]),o($Vq,[2,33]),o($Vq,[2,34]),o($Vq,[2,35]),o($Vq,[2,36]),o($Vs,[2,31]),{40:54,52:[1,55]},o($Vs,[2,46]),o($Vq,[2,7]),o($Vq,[2,11]),{11:56,22:$Vb,47:$Vo},o($Vq,[2,15]),o($Vt,$V4,{8:57}),{22:[1,58]},{22:[1,59]},{21:[1,60]},{22:[2,41]},{22:[2,42]},o($Vq,[2,28]),o($Vq,[2,29]),{38:61,53:$Vp},{53:[2,45]},o($Vq,[2,12],{12:[1,62]}),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,63],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:$Vh,33:$Vi,35:$Vj,36:6,41:$Vk,42:$Vl,43:$Vm,44:$Vn,47:$Vo,50:$V3},o($Vq,[2,18],{18:[1,64]}),{29:[1,65]},{22:[1,66]},o($Vs,[2,32]),o($Vq,[2,13]),o($Vq,[2,17]),o($Vt,$V4,{8:67}),o($Vq,[2,24]),o($Vq,[2,25]),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,68],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:$Vh,33:$Vi,35:$Vj,36:6,41:$Vk,42:$Vl,43:$Vm,44:$Vn,47:$Vo,50:$V3},o($Vq,[2,19])],\ndefaultActions: {7:[2,43],8:[2,1],9:[2,2],10:[2,3],50:[2,41],51:[2,42],55:[2,45]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0:return 41;\nbreak;\ncase 1:return 42;\nbreak;\ncase 2:return 43;\nbreak;\ncase 3:return 44;\nbreak;\ncase 4: this.begin('open_directive'); return 50; \nbreak;\ncase 5: this.begin('type_directive'); return 51; \nbreak;\ncase 6: this.popState(); this.begin('arg_directive'); return 39; \nbreak;\ncase 7: this.popState(); this.popState(); return 53; \nbreak;\ncase 8:return 52;\nbreak;\ncase 9:/* skip comments */\nbreak;\ncase 10:/* skip comments */{ /*console.log('Crap after close');*/ }\nbreak;\ncase 11:return 5;\nbreak;\ncase 12:/* skip all whitespace */\nbreak;\ncase 13:/* skip same-line whitespace */\nbreak;\ncase 14:/* skip comments */\nbreak;\ncase 15:/* skip comments */\nbreak;\ncase 16: this.pushState('SCALE'); /* console.log('Got scale', yy_.yytext);*/ return 15; \nbreak;\ncase 17:return 16;\nbreak;\ncase 18:this.popState();\nbreak;\ncase 19: this.begin(\"acc_title\");return 31; \nbreak;\ncase 20: this.popState(); return \"acc_title_value\"; \nbreak;\ncase 21: this.begin(\"acc_descr\");return 33; \nbreak;\ncase 22: this.popState(); return \"acc_descr_value\"; \nbreak;\ncase 23: this.begin(\"acc_descr_multiline\");\nbreak;\ncase 24: this.popState(); \nbreak;\ncase 25:return \"acc_descr_multiline_value\";\nbreak;\ncase 26: /*console.log('Starting STATE zxzx'+yy.getDirection());*/this.pushState('STATE'); \nbreak;\ncase 27:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim(); /*console.warn('Fork Fork: ',yy_.yytext);*/return 23;\nbreak;\ncase 28:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24;\nbreak;\ncase 29:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25;\nbreak;\ncase 30:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Fork: ',yy_.yytext);*/return 23;\nbreak;\ncase 31:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24;\nbreak;\ncase 32:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25;\nbreak;\ncase 33: return 41;\nbreak;\ncase 34: return 42;\nbreak;\ncase 35: return 43;\nbreak;\ncase 36: return 44;\nbreak;\ncase 37: /*console.log('Starting STATE_STRING zxzx');*/this.begin(\"STATE_STRING\");\nbreak;\ncase 38:this.popState();this.pushState('STATE_ID');return \"AS\";\nbreak;\ncase 39:this.popState();/* console.log('STATE_ID', yy_.yytext);*/return \"ID\";\nbreak;\ncase 40:this.popState();\nbreak;\ncase 41: /*console.log('Long description:', yy_.yytext);*/return \"STATE_DESCR\";\nbreak;\ncase 42:/*console.log('COMPOSIT_STATE', yy_.yytext);*/return 17;\nbreak;\ncase 43:this.popState();\nbreak;\ncase 44:this.popState();this.pushState('struct'); /*console.log('begin struct', yy_.yytext);*/return 18;\nbreak;\ncase 45: /*console.log('Ending struct');*/ this.popState(); return 19;\nbreak;\ncase 46:/* nothing */\nbreak;\ncase 47: this.begin('NOTE'); return 27; \nbreak;\ncase 48: this.popState();this.pushState('NOTE_ID');return 48;\nbreak;\ncase 49: this.popState();this.pushState('NOTE_ID');return 49;\nbreak;\ncase 50: this.popState();this.pushState('FLOATING_NOTE');\nbreak;\ncase 51:this.popState();this.pushState('FLOATING_NOTE_ID');return \"AS\";\nbreak;\ncase 52:/**/\nbreak;\ncase 53: /*console.log('Floating note text: ', yy_.yytext);*/return \"NOTE_TEXT\";\nbreak;\ncase 54:this.popState();/*console.log('Floating note ID', yy_.yytext);*/return \"ID\";\nbreak;\ncase 55: this.popState();this.pushState('NOTE_TEXT');/*console.log('Got ID for note', yy_.yytext);*/return 22;\nbreak;\ncase 56: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.substr(2).trim();return 29;\nbreak;\ncase 57: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.slice(0,-8).trim();return 29;\nbreak;\ncase 58: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7; \nbreak;\ncase 59: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7; \nbreak;\ncase 60: /*console.log('HIDE_EMPTY', yy_.yytext,'#');*/return 14; \nbreak;\ncase 61: /*console.log('EDGE_STATE=',yy_.yytext);*/ return 47;\nbreak;\ncase 62: /*console.log('=>ID=',yy_.yytext);*/ return 22;\nbreak;\ncase 63: yy_.yytext = yy_.yytext.trim(); /*console.log('Descr = ', yy_.yytext);*/ return 12; \nbreak;\ncase 64:return 13;\nbreak;\ncase 65:return 26;\nbreak;\ncase 66:return 5;\nbreak;\ncase 67:return 'INVALID';\nbreak;\n}\n},\nrules: [/^(?:.*direction\\s+TB[^\\n]*)/i,/^(?:.*direction\\s+BT[^\\n]*)/i,/^(?:.*direction\\s+RL[^\\n]*)/i,/^(?:.*direction\\s+LR[^\\n]*)/i,/^(?:%%\\{)/i,/^(?:((?:(?!\\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\\}%%)/i,/^(?:((?:(?!\\}%%).|\\n)*))/i,/^(?:%%(?!\\{)[^\\n]*)/i,/^(?:[^\\}]%%[^\\n]*)/i,/^(?:[\\n]+)/i,/^(?:[\\s]+)/i,/^(?:((?!\\n)\\s)+)/i,/^(?:#[^\\n]*)/i,/^(?:%[^\\n]*)/i,/^(?:scale\\s+)/i,/^(?:\\d+)/i,/^(?:\\s+width\\b)/i,/^(?:accTitle\\s*:\\s*)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:accDescr\\s*:\\s*)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:accDescr\\s*\\{\\s*)/i,/^(?:[\\}])/i,/^(?:[^\\}]*)/i,/^(?:state\\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\\[\\[fork\\]\\])/i,/^(?:.*\\[\\[join\\]\\])/i,/^(?:.*\\[\\[choice\\]\\])/i,/^(?:.*direction\\s+TB[^\\n]*)/i,/^(?:.*direction\\s+BT[^\\n]*)/i,/^(?:.*direction\\s+RL[^\\n]*)/i,/^(?:.*direction\\s+LR[^\\n]*)/i,/^(?:[\"])/i,/^(?:\\s*as\\s+)/i,/^(?:[^\\n\\{]*)/i,/^(?:[\"])/i,/^(?:[^\"]*)/i,/^(?:[^\\n\\s\\{]+)/i,/^(?:\\n)/i,/^(?:\\{)/i,/^(?:\\})/i,/^(?:[\\n])/i,/^(?:note\\s+)/i,/^(?:left of\\b)/i,/^(?:right of\\b)/i,/^(?:\")/i,/^(?:\\s*as\\s*)/i,/^(?:[\"])/i,/^(?:[^\"]*)/i,/^(?:[^\\n]*)/i,/^(?:\\s*[^:\\n\\s\\-]+)/i,/^(?:\\s*:[^:\\n;]+)/i,/^(?:[\\s\\S]*?end note\\b)/i,/^(?:stateDiagram\\s+)/i,/^(?:stateDiagram-v2\\s+)/i,/^(?:hide empty description\\b)/i,/^(?:\\[\\*\\])/i,/^(?:[^:\\n\\s\\-\\{]+)/i,/^(?:\\s*:[^:\\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?:$)/i,/^(?:.)/i],\nconditions: {\"LINE\":{\"rules\":[13,14],\"inclusive\":false},\"close_directive\":{\"rules\":[13,14],\"inclusive\":false},\"arg_directive\":{\"rules\":[7,8,13,14],\"inclusive\":false},\"type_directive\":{\"rules\":[6,7,13,14],\"inclusive\":false},\"open_directive\":{\"rules\":[5,13,14],\"inclusive\":false},\"struct\":{\"rules\":[13,14,26,33,34,35,36,45,46,47,61,62,63,64,65],\"inclusive\":false},\"FLOATING_NOTE_ID\":{\"rules\":[54],\"inclusive\":false},\"FLOATING_NOTE\":{\"rules\":[51,52,53],\"inclusive\":false},\"NOTE_TEXT\":{\"rules\":[56,57],\"inclusive\":false},\"NOTE_ID\":{\"rules\":[55],\"inclusive\":false},\"NOTE\":{\"rules\":[48,49,50],\"inclusive\":false},\"acc_descr_multiline\":{\"rules\":[24,25],\"inclusive\":false},\"acc_descr\":{\"rules\":[22],\"inclusive\":false},\"acc_title\":{\"rules\":[20],\"inclusive\":false},\"SCALE\":{\"rules\":[17,18],\"inclusive\":false},\"ALIAS\":{\"rules\":[],\"inclusive\":false},\"STATE_ID\":{\"rules\":[39],\"inclusive\":false},\"STATE_STRING\":{\"rules\":[40,41],\"inclusive\":false},\"FORK_STATE\":{\"rules\":[],\"inclusive\":false},\"STATE\":{\"rules\":[13,14,27,28,29,30,31,32,37,38,42,43,44],\"inclusive\":false},\"ID\":{\"rules\":[13,14],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,1,2,3,4,9,10,11,12,14,15,16,19,21,23,26,44,47,58,59,60,61,62,63,64,66,67],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/* parser generated by jison 0.4.18 */\n/*\n Returns a Parser object of the following structure:\n\n Parser: {\n yy: {}\n }\n\n Parser.prototype: {\n yy: {},\n trace: function(),\n symbols_: {associative list: name ==> number},\n terminals_: {associative list: number ==> name},\n productions_: [...],\n performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),\n table: [...],\n defaultActions: {...},\n parseError: function(str, hash),\n parse: function(input),\n\n lexer: {\n EOF: 1,\n parseError: function(str, hash),\n setInput: function(input),\n input: function(),\n unput: function(str),\n more: function(),\n less: function(n),\n pastInput: function(),\n upcomingInput: function(),\n showPosition: function(),\n test_match: function(regex_match_array, rule_index),\n next: function(),\n lex: function(),\n begin: function(condition),\n popState: function(),\n _currentRules: function(),\n topState: function(),\n pushState: function(condition),\n\n options: {\n ranges: boolean (optional: true ==> token location info will include a .range[] member)\n flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)\n backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)\n },\n\n performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),\n rules: [...],\n conditions: {associative list: name ==> set},\n }\n }\n\n\n token location info (@$, _$, etc.): {\n first_line: n,\n last_line: n,\n first_column: n,\n last_column: n,\n range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)\n }\n\n\n the parseError function receives a 'hash' object with these members for lexer and parser errors: {\n text: (matched text)\n token: (the produced terminal token, if any)\n line: (yylineno)\n }\n while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {\n loc: (yylloc)\n expected: (string describing the set of expected tokens)\n recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)\n }\n*/\nvar parser = (function(){\nvar o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,5],$V2=[6,9,11,17,18,20,22,23,24,26],$V3=[1,15],$V4=[1,16],$V5=[1,17],$V6=[1,18],$V7=[1,19],$V8=[1,20],$V9=[1,24],$Va=[4,6,9,11,17,18,20,22,23,24,26];\nvar parser = {trace: function trace () { },\nyy: {},\nsymbols_: {\"error\":2,\"start\":3,\"journey\":4,\"document\":5,\"EOF\":6,\"directive\":7,\"line\":8,\"SPACE\":9,\"statement\":10,\"NEWLINE\":11,\"openDirective\":12,\"typeDirective\":13,\"closeDirective\":14,\":\":15,\"argDirective\":16,\"title\":17,\"acc_title\":18,\"acc_title_value\":19,\"acc_descr\":20,\"acc_descr_value\":21,\"acc_descr_multiline_value\":22,\"section\":23,\"taskName\":24,\"taskData\":25,\"open_directive\":26,\"type_directive\":27,\"arg_directive\":28,\"close_directive\":29,\"$accept\":0,\"$end\":1},\nterminals_: {2:\"error\",4:\"journey\",6:\"EOF\",9:\"SPACE\",11:\"NEWLINE\",15:\":\",17:\"title\",18:\"acc_title\",19:\"acc_title_value\",20:\"acc_descr\",21:\"acc_descr_value\",22:\"acc_descr_multiline_value\",23:\"section\",24:\"taskName\",25:\"taskData\",26:\"open_directive\",27:\"type_directive\",28:\"arg_directive\",29:\"close_directive\"},\nproductions_: [0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,2],[10,2],[10,1],[10,1],[10,2],[10,1],[12,1],[13,1],[16,1],[14,1]],\nperformAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {\n/* this == yyval */\n\nvar $0 = $$.length - 1;\nswitch (yystate) {\ncase 1:\n return $$[$0-1]; \nbreak;\ncase 3:\n this.$ = [] \nbreak;\ncase 4:\n$$[$0-1].push($$[$0]);this.$ = $$[$0-1]\nbreak;\ncase 5: case 6:\n this.$ = $$[$0] \nbreak;\ncase 7: case 8:\n this.$=[];\nbreak;\ncase 11:\nyy.setDiagramTitle($$[$0].substr(6));this.$=$$[$0].substr(6);\nbreak;\ncase 12:\n this.$=$$[$0].trim();yy.setAccTitle(this.$); \nbreak;\ncase 13: case 14:\n this.$=$$[$0].trim();yy.setAccDescription(this.$); \nbreak;\ncase 15:\nyy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8);\nbreak;\ncase 16:\nyy.addTask($$[$0-1], $$[$0]);this.$='task';\nbreak;\ncase 18:\n yy.parseDirective('%%{', 'open_directive'); \nbreak;\ncase 19:\n yy.parseDirective($$[$0], 'type_directive'); \nbreak;\ncase 20:\n $$[$0] = $$[$0].trim().replace(/'/g, '\"'); yy.parseDirective($$[$0], 'arg_directive'); \nbreak;\ncase 21:\n yy.parseDirective('}%%', 'close_directive', 'journey'); \nbreak;\n}\n},\ntable: [{3:1,4:$V0,7:3,12:4,26:$V1},{1:[3]},o($V2,[2,3],{5:6}),{3:7,4:$V0,7:3,12:4,26:$V1},{13:8,27:[1,9]},{27:[2,18]},{6:[1,10],7:21,8:11,9:[1,12],10:13,11:[1,14],12:4,17:$V3,18:$V4,20:$V5,22:$V6,23:$V7,24:$V8,26:$V1},{1:[2,2]},{14:22,15:[1,23],29:$V9},o([15,29],[2,19]),o($V2,[2,8],{1:[2,1]}),o($V2,[2,4]),{7:21,10:25,12:4,17:$V3,18:$V4,20:$V5,22:$V6,23:$V7,24:$V8,26:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,11]),{19:[1,26]},{21:[1,27]},o($V2,[2,14]),o($V2,[2,15]),{25:[1,28]},o($V2,[2,17]),{11:[1,29]},{16:30,28:[1,31]},{11:[2,21]},o($V2,[2,5]),o($V2,[2,12]),o($V2,[2,13]),o($V2,[2,16]),o($Va,[2,9]),{14:32,29:$V9},{29:[2,20]},{11:[1,33]},o($Va,[2,10])],\ndefaultActions: {5:[2,18],7:[2,2],24:[2,21],31:[2,20]},\nparseError: function parseError (str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n},\nparse: function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer;\n sharedState.yy.parser = this;\n if (typeof lexer.yylloc == 'undefined') {\n lexer.yylloc = {};\n }\n var yyloc = lexer.yylloc;\n lstack.push(yyloc);\n var ranges = lexer.options && lexer.options.ranges;\n if (typeof sharedState.yy.parseError === 'function') {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n function lex() {\n var token;\n token = tstack.pop() || lexer.lex() || EOF;\n if (typeof token !== 'number') {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == 'undefined') {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === 'undefined' || !action.length || !action[0]) {\n var errStr = '';\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push('\\'' + this.terminals_[p] + '\\'');\n }\n }\n if (lexer.showPosition) {\n errStr = 'Parse error on line ' + (yylineno + 1) + ':\\n' + lexer.showPosition() + '\\nExpecting ' + expected.join(', ') + ', got \\'' + (this.terminals_[symbol] || symbol) + '\\'';\n } else {\n errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\\'' + (this.terminals_[symbol] || symbol) + '\\'');\n }\n this.parseError(errStr, {\n text: lexer.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer.yylineno,\n loc: yyloc,\n expected: expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer.yytext);\n lstack.push(lexer.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer.yyleng;\n yytext = lexer.yytext;\n yylineno = lexer.yylineno;\n yyloc = lexer.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== 'undefined') {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n}};\n\r\n/* generated by jison-lex 0.3.4 */\nvar lexer = (function(){\nvar lexer = ({\n\nEOF:1,\n\nparseError:function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n },\n\n// resets the lexer, sets new input\nsetInput:function (input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = '';\n this.conditionStack = ['INITIAL'];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0,0];\n }\n this.offset = 0;\n return this;\n },\n\n// consumes and returns one char from the input\ninput:function () {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n\n this._input = this._input.slice(1);\n return ch;\n },\n\n// unshifts one char (or a string) into the input\nunput:function (ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n //this.yyleng -= len;\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ?\n (lines.length === oldLines.length ? this.yylloc.first_column : 0)\n + oldLines[oldLines.length - lines.length].length - lines[0].length :\n this.yylloc.first_column - len\n };\n\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n },\n\n// When called from action, caches matched text and appends it on next action\nmore:function () {\n this._more = true;\n return this;\n },\n\n// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\nreject:function () {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n\n }\n return this;\n },\n\n// retain first n characters of the match\nless:function (n) {\n this.unput(this.match.slice(n));\n },\n\n// displays already matched input, i.e. for error messages\npastInput:function () {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");\n },\n\n// displays upcoming input, i.e. for error messages\nupcomingInput:function () {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20-next.length);\n }\n return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\\n/g, \"\");\n },\n\n// displays the character position where the lexing error occurred, i.e. for error messages\nshowPosition:function () {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n },\n\n// test the lexed token: return FALSE when not a match, otherwise return token\ntest_match:function(match, indexed_rule) {\n var token,\n lines,\n backup;\n\n if (this.options.backtrack_lexer) {\n // save context\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ?\n lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length :\n this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n // recover context\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false; // rule action called reject() implying the next rule should be tested instead.\n }\n return false;\n },\n\n// return next match in input\nnext:function () {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n\n var token,\n match,\n tempMatch,\n index;\n if (!this._more) {\n this.yytext = '';\n this.match = '';\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue; // rule action called reject() implying a rule MISmatch.\n } else {\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\\n' + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n },\n\n// return next match that has a token\nlex:function lex () {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n },\n\n// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\nbegin:function begin (condition) {\n this.conditionStack.push(condition);\n },\n\n// pop the previously active lexer condition state off the condition stack\npopState:function popState () {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n },\n\n// produce the lexer rule set which is active for the currently active lexer condition state\n_currentRules:function _currentRules () {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n },\n\n// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\ntopState:function topState (n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n },\n\n// alias for begin(condition)\npushState:function pushState (condition) {\n this.begin(condition);\n },\n\n// return the number of states currently on the stack\nstateStackSize:function stateStackSize() {\n return this.conditionStack.length;\n },\noptions: {\"case-insensitive\":true},\nperformAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {\nvar YYSTATE=YY_START;\nswitch($avoiding_name_collisions) {\ncase 0: this.begin('open_directive'); return 26; \nbreak;\ncase 1: this.begin('type_directive'); return 27; \nbreak;\ncase 2: this.popState(); this.begin('arg_directive'); return 15; \nbreak;\ncase 3: this.popState(); this.popState(); return 29; \nbreak;\ncase 4:return 28;\nbreak;\ncase 5:/* skip comments */\nbreak;\ncase 6:/* skip comments */\nbreak;\ncase 7:return 11;\nbreak;\ncase 8:/* skip whitespace */\nbreak;\ncase 9:/* skip comments */\nbreak;\ncase 10:return 4;\nbreak;\ncase 11:return 17;\nbreak;\ncase 12: this.begin(\"acc_title\");return 18; \nbreak;\ncase 13: this.popState(); return \"acc_title_value\"; \nbreak;\ncase 14: this.begin(\"acc_descr\");return 20; \nbreak;\ncase 15: this.popState(); return \"acc_descr_value\"; \nbreak;\ncase 16: this.begin(\"acc_descr_multiline\");\nbreak;\ncase 17: this.popState(); \nbreak;\ncase 18:return \"acc_descr_multiline_value\";\nbreak;\ncase 19:return 23;\nbreak;\ncase 20:return 24;\nbreak;\ncase 21:return 25;\nbreak;\ncase 22:return 15;\nbreak;\ncase 23:return 6;\nbreak;\ncase 24:return 'INVALID';\nbreak;\n}\n},\nrules: [/^(?:%%\\{)/i,/^(?:((?:(?!\\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\\}%%)/i,/^(?:((?:(?!\\}%%).|\\n)*))/i,/^(?:%(?!\\{)[^\\n]*)/i,/^(?:[^\\}]%%[^\\n]*)/i,/^(?:[\\n]+)/i,/^(?:\\s+)/i,/^(?:#[^\\n]*)/i,/^(?:journey\\b)/i,/^(?:title\\s[^#\\n;]+)/i,/^(?:accTitle\\s*:\\s*)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:accDescr\\s*:\\s*)/i,/^(?:(?!\\n||)*[^\\n]*)/i,/^(?:accDescr\\s*\\{\\s*)/i,/^(?:[\\}])/i,/^(?:[^\\}]*)/i,/^(?:section\\s[^#:\\n;]+)/i,/^(?:[^#:\\n;]+)/i,/^(?::[^#\\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],\nconditions: {\"open_directive\":{\"rules\":[1],\"inclusive\":false},\"type_directive\":{\"rules\":[2,3],\"inclusive\":false},\"arg_directive\":{\"rules\":[3,4],\"inclusive\":false},\"acc_descr_multiline\":{\"rules\":[17,18],\"inclusive\":false},\"acc_descr\":{\"rules\":[15],\"inclusive\":false},\"acc_title\":{\"rules\":[13],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,5,6,7,8,9,10,11,12,14,16,19,20,21,22,23,24],\"inclusive\":true}}\n});\nreturn lexer;\n})();\nparser.lexer = lexer;\nfunction Parser () {\n this.yy = {};\n}\nParser.prototype = parser;parser.Parser = Parser;\nreturn new Parser;\n})();\n\n\nif (typeof require !== 'undefined' && typeof exports !== 'undefined') {\nexports.parser = parser;\nexports.Parser = parser.Parser;\nexports.parse = function () { return parser.parse.apply(parser, arguments); };\nexports.main = function commonjsMain (args) {\n if (!args[1]) {\n console.log('Usage: '+args[0]+' FILE');\n process.exit(1);\n }\n var source = require('fs').readFileSync(require('path').normalize(args[1]), \"utf8\");\n return exports.parser.parse(source);\n};\nif (typeof module !== 'undefined' && require.main === module) {\n exports.main(process.argv.slice(1));\n}\n}","/**\n * This method will add a basic title and description element to a chart. The yy parser will need to\n * respond to getAccTitle and getAccDescription, where the title is the title element on the chart,\n * which is generally not displayed and the accDescription is the description element on the chart,\n * which is never displayed.\n *\n * The following charts display their title as a visual and accessibility element: gantt\n *\n * @param yy_parser\n * @param svg\n * @param id\n */\nexport default function addSVGAccessibilityFields(yy_parser, svg, id) {\n if (typeof svg.insert === 'undefined') {\n return;\n }\n\n let title_string = yy_parser.getAccTitle();\n let description = yy_parser.getAccDescription();\n svg.attr('role', 'img').attr('aria-labelledby', 'chart-title-' + id + ' chart-desc-' + id);\n svg\n .insert('desc', ':first-child')\n .attr('id', 'chart-desc-' + id)\n .text(description);\n svg\n .insert('title', ':first-child')\n .attr('id', 'chart-title-' + id)\n .text(title_string);\n}\n","import { sanitizeText as _sanitizeText } from './diagrams/common/common';\nimport { getConfig } from './config';\nlet title = '';\nlet diagramTitle = '';\nlet description = '';\nconst sanitizeText = (txt) => _sanitizeText(txt, getConfig());\n\nexport const clear = function () {\n title = '';\n description = '';\n diagramTitle = '';\n};\n\nexport const setAccTitle = function (txt) {\n title = sanitizeText(txt).replace(/^\\s+/g, '');\n};\n\nexport const getAccTitle = function () {\n return title || diagramTitle;\n};\n\nexport const setAccDescription = function (txt) {\n description = sanitizeText(txt).replace(/\\n\\s+/g, '\\n');\n};\n\nexport const getAccDescription = function () {\n return description;\n};\n\nexport const setDiagramTitle = function (txt) {\n diagramTitle = sanitizeText(txt);\n};\n\nexport const getDiagramTitle = function () {\n return diagramTitle;\n};\n\nexport default {\n setAccTitle,\n getAccTitle,\n setDiagramTitle,\n getDiagramTitle: getDiagramTitle,\n getAccDescription,\n setAccDescription,\n clear,\n};\n","import { assignWithDepth } from './utils';\nimport { log } from './logger';\nimport theme from './themes';\nimport config from './defaultConfig';\n\nexport const defaultConfig = Object.freeze(config);\n\nlet siteConfig = assignWithDepth({}, defaultConfig);\nlet configFromInitialize;\nlet directives = [];\nlet currentConfig = assignWithDepth({}, defaultConfig);\n\nexport const updateCurrentConfig = (siteCfg, _directives) => {\n // start with config beeing the siteConfig\n let cfg = assignWithDepth({}, siteCfg);\n // let sCfg = assignWithDepth(defaultConfig, siteConfigDelta);\n\n // Join directives\n let sumOfDirectives = {};\n for (let i = 0; i < _directives.length; i++) {\n const d = _directives[i];\n sanitize(d);\n\n // Apply the data from the directive where the the overrides the themeVariables\n sumOfDirectives = assignWithDepth(sumOfDirectives, d);\n }\n\n cfg = assignWithDepth(cfg, sumOfDirectives);\n\n if (sumOfDirectives.theme && theme[sumOfDirectives.theme]) {\n const tmpConfigFromInitialize = assignWithDepth({}, configFromInitialize);\n const themeVariables = assignWithDepth(\n tmpConfigFromInitialize.themeVariables || {},\n sumOfDirectives.themeVariables\n );\n cfg.themeVariables = theme[cfg.theme].getThemeVariables(themeVariables);\n }\n\n currentConfig = cfg;\n return cfg;\n};\n\n/**\n * ## setSiteConfig\n *\n * | Function | Description | Type | Values |\n * | ------------- | ------------------------------------- | ----------- | --------------------------------------- |\n * | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array |\n *\n * **Notes:** Sets the siteConfig. The siteConfig is a protected configuration for repeat use. Calls\n * to reset() will reset the currentConfig to siteConfig. Calls to reset(configApi.defaultConfig)\n * will reset siteConfig and currentConfig to the defaultConfig Note: currentConfig is set in this\n * function _Default value: At default, will mirror Global Config_\n *\n * @param conf - The base currentConfig to use as siteConfig\n * @returns {object} - The siteConfig\n */\nexport const setSiteConfig = (conf) => {\n siteConfig = assignWithDepth({}, defaultConfig);\n siteConfig = assignWithDepth(siteConfig, conf);\n\n if (conf.theme && theme[conf.theme]) {\n siteConfig.themeVariables = theme[conf.theme].getThemeVariables(conf.themeVariables);\n }\n\n currentConfig = updateCurrentConfig(siteConfig, directives);\n return siteConfig;\n};\n\nexport const saveConfigFromInitialize = (conf) => {\n configFromInitialize = assignWithDepth({}, conf);\n};\n\nexport const updateSiteConfig = (conf) => {\n siteConfig = assignWithDepth(siteConfig, conf);\n updateCurrentConfig(siteConfig, directives);\n\n return siteConfig;\n};\n/**\n * ## getSiteConfig\n *\n * | Function | Description | Type | Values |\n * | ------------- | ------------------------------------------------- | ----------- | -------------------------------- |\n * | setSiteConfig | Returns the current siteConfig base configuration | Get Request | Returns Any Values in siteConfig |\n *\n * **Notes**: Returns **any** values in siteConfig.\n *\n * @returns {object} - The siteConfig\n */\nexport const getSiteConfig = () => {\n return assignWithDepth({}, siteConfig);\n};\n/**\n * ## setConfig\n *\n * | Function | Description | Type | Values |\n * | ------------- | ------------------------------------- | ----------- | --------------------------------------- |\n * | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array |\n *\n * **Notes**: Sets the currentConfig. The parameter conf is sanitized based on the siteConfig.secure\n * keys. Any values found in conf with key found in siteConfig.secure will be replaced with the\n * corresponding siteConfig value.\n *\n * @param {any} conf - The potential currentConfig\n * @returns {any} - The currentConfig merged with the sanitized conf\n */\nexport const setConfig = (conf) => {\n // sanitize(conf);\n // Object.keys(conf).forEach(key => {\n // const manipulator = manipulators[key];\n // conf[key] = manipulator ? manipulator(conf[key]) : conf[key];\n // });\n\n assignWithDepth(currentConfig, conf);\n\n return getConfig();\n};\n\n/**\n * ## getConfig\n *\n * | Function | Description | Type | Return Values |\n * | --------- | ------------------------- | ----------- | ------------------------------ |\n * | getConfig | Obtains the currentConfig | Get Request | Any Values from current Config |\n *\n * **Notes**: Returns **any** the currentConfig\n *\n * @returns {any} - The currentConfig\n */\nexport const getConfig = () => {\n return assignWithDepth({}, currentConfig);\n};\n/**\n * ## sanitize\n *\n * | Function | Description | Type | Values |\n * | -------- | -------------------------------------- | ----------- | ------ |\n * | sanitize | Sets the siteConfig to desired values. | Put Request | None |\n *\n * Ensures options parameter does not attempt to override siteConfig secure keys **Notes**: modifies\n * options in-place\n *\n * @param {any} options - The potential setConfig parameter\n */\nexport const sanitize = (options) => {\n // Checking that options are not in the list of excluded options\n Object.keys(siteConfig.secure).forEach((key) => {\n if (typeof options[siteConfig.secure[key]] !== 'undefined') {\n // DO NOT attempt to print options[siteConfig.secure[key]] within `${}` as a malicious script\n // can exploit the logger's attempt to stringify the value and execute arbitrary code\n log.debug(\n `Denied attempt to modify a secure key ${siteConfig.secure[key]}`,\n options[siteConfig.secure[key]]\n );\n delete options[siteConfig.secure[key]];\n }\n });\n\n // Check that there no attempts of prototype pollution\n Object.keys(options).forEach((key) => {\n if (key.indexOf('__') === 0) {\n delete options[key];\n }\n });\n // Check that there no attempts of xss, there should be no tags at all in the directive\n // blocking data urls as base64 urls can contain svgs with inline script tags\n Object.keys(options).forEach((key) => {\n if (typeof options[key] === 'string') {\n if (\n options[key].indexOf('<') > -1 ||\n options[key].indexOf('>') > -1 ||\n options[key].indexOf('url(data:') > -1\n ) {\n delete options[key];\n }\n }\n if (typeof options[key] === 'object') {\n sanitize(options[key]);\n }\n });\n};\n\n/**\n * Pushes in a directive to the configuration\n *\n * @param {object} directive The directive to push in\n */\nexport const addDirective = (directive) => {\n if (directive.fontFamily) {\n if (!directive.themeVariables) {\n directive.themeVariables = { fontFamily: directive.fontFamily };\n } else {\n if (!directive.themeVariables.fontFamily) {\n directive.themeVariables = { fontFamily: directive.fontFamily };\n }\n }\n }\n directives.push(directive);\n updateCurrentConfig(siteConfig, directives);\n};\n\n/**\n * ## reset\n *\n * | Function | Description | Type | Required | Values |\n * | -------- | ---------------------------- | ----------- | -------- | ------ |\n * | reset | Resets currentConfig to conf | Put Request | Required | None |\n *\n * ## conf\n *\n * | Parameter | Description | Type | Required | Values |\n * | --------- | -------------------------------------------------------------- | ---------- | -------- | -------------------------------------------- |\n * | conf | base set of values, which currentConfig could be **reset** to. | Dictionary | Required | Any Values, with respect to the secure Array |\n *\n * **Notes**: (default: current siteConfig ) (optional, default `getSiteConfig()`)\n */\nexport const reset = () => {\n // Replace current config with siteConfig\n directives = [];\n updateCurrentConfig(siteConfig, directives);\n};\n","import intersectRect from './intersect/intersect-rect';\nimport { log } from '../logger';\nimport createLabel from './createLabel';\nimport { select } from 'd3';\nimport { getConfig } from '../config';\nimport { evaluate } from '../diagrams/common/common';\n\nconst rect = (parent, node) => {\n log.trace('Creating subgraph rect for ', node.id, node);\n\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'cluster' + (node.class ? ' ' + node.class : ''))\n .attr('id', node.id);\n\n // add the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n\n // Create the label and insert it after the rect\n const label = shapeSvg.insert('g').attr('class', 'cluster-label');\n\n const text = label\n .node()\n .appendChild(createLabel(node.labelText, node.labelStyle, undefined, true));\n\n // Get the size of the label\n let bbox = text.getBBox();\n\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = text.children[0];\n const dv = select(text);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n\n const padding = 0 * node.padding;\n const halfPadding = padding / 2;\n\n const width = node.width <= bbox.width + padding ? bbox.width + padding : node.width;\n if (node.width <= bbox.width + padding) {\n node.diff = (bbox.width - node.width) / 2 - node.padding / 2;\n } else {\n node.diff = -node.padding / 2;\n }\n\n log.trace('Data ', node, JSON.stringify(node));\n // center the rect around its coordinate\n rect\n .attr('style', node.style)\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('x', node.x - width / 2)\n .attr('y', node.y - node.height / 2 - halfPadding)\n .attr('width', width)\n .attr('height', node.height + padding);\n\n // Center the label\n label.attr(\n 'transform',\n 'translate(' +\n (node.x - bbox.width / 2) +\n ', ' +\n (node.y - node.height / 2 + node.padding / 3) +\n ')'\n );\n\n const rectBox = rect.node().getBBox();\n node.width = rectBox.width;\n node.height = rectBox.height;\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return shapeSvg;\n};\n\n/**\n * Non visible cluster where the note is group with its\n *\n * @param {any} parent\n * @param {any} node\n * @returns {any} ShapeSvg\n */\nconst noteGroup = (parent, node) => {\n // Add outer g element\n const shapeSvg = parent.insert('g').attr('class', 'note-cluster').attr('id', node.id);\n\n // add the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n\n const padding = 0 * node.padding;\n const halfPadding = padding / 2;\n\n // center the rect around its coordinate\n rect\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('x', node.x - node.width / 2 - halfPadding)\n .attr('y', node.y - node.height / 2 - halfPadding)\n .attr('width', node.width + padding)\n .attr('height', node.height + padding)\n .attr('fill', 'none');\n\n const rectBox = rect.node().getBBox();\n node.width = rectBox.width;\n node.height = rectBox.height;\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return shapeSvg;\n};\nconst roundedWithTitle = (parent, node) => {\n // Add outer g element\n const shapeSvg = parent.insert('g').attr('class', node.classes).attr('id', node.id);\n\n // add the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n\n // Create the label and insert it after the rect\n const label = shapeSvg.insert('g').attr('class', 'cluster-label');\n const innerRect = shapeSvg.append('rect');\n\n const text = label\n .node()\n .appendChild(createLabel(node.labelText, node.labelStyle, undefined, true));\n\n // Get the size of the label\n let bbox = text.getBBox();\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = text.children[0];\n const dv = select(text);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n bbox = text.getBBox();\n const padding = 0 * node.padding;\n const halfPadding = padding / 2;\n\n const width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width;\n if (node.width <= bbox.width + node.padding) {\n node.diff = (bbox.width + node.padding * 0 - node.width) / 2;\n } else {\n node.diff = -node.padding / 2;\n }\n\n // center the rect around its coordinate\n rect\n .attr('class', 'outer')\n .attr('x', node.x - width / 2 - halfPadding)\n .attr('y', node.y - node.height / 2 - halfPadding)\n .attr('width', width + padding)\n .attr('height', node.height + padding);\n innerRect\n .attr('class', 'inner')\n .attr('x', node.x - width / 2 - halfPadding)\n .attr('y', node.y - node.height / 2 - halfPadding + bbox.height - 1)\n .attr('width', width + padding)\n .attr('height', node.height + padding - bbox.height - 3);\n\n // Center the label\n label.attr(\n 'transform',\n 'translate(' +\n (node.x - bbox.width / 2) +\n ', ' +\n (node.y -\n node.height / 2 -\n node.padding / 3 +\n (evaluate(getConfig().flowchart.htmlLabels) ? 5 : 3)) +\n ')'\n );\n\n const rectBox = rect.node().getBBox();\n node.height = rectBox.height;\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return shapeSvg;\n};\n\nconst divider = (parent, node) => {\n // Add outer g element\n const shapeSvg = parent.insert('g').attr('class', node.classes).attr('id', node.id);\n\n // add the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n\n const padding = 0 * node.padding;\n const halfPadding = padding / 2;\n\n // center the rect around its coordinate\n rect\n .attr('class', 'divider')\n .attr('x', node.x - node.width / 2 - halfPadding)\n .attr('y', node.y - node.height / 2)\n .attr('width', node.width + padding)\n .attr('height', node.height + padding);\n\n const rectBox = rect.node().getBBox();\n node.width = rectBox.width;\n node.height = rectBox.height;\n node.diff = -node.padding / 2;\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return shapeSvg;\n};\n\nconst shapes = { rect, roundedWithTitle, noteGroup, divider };\n\nlet clusterElems = {};\n\nexport const insertCluster = (elem, node) => {\n log.trace('Inserting cluster');\n const shape = node.shape || 'rect';\n clusterElems[node.id] = shapes[shape](elem, node);\n};\nexport const getClusterTitleWidth = (elem, node) => {\n const label = createLabel(node.labelText, node.labelStyle, undefined, true);\n elem.node().appendChild(label);\n const width = label.getBBox().width;\n elem.node().removeChild(label);\n return width;\n};\n\nexport const clear = () => {\n clusterElems = {};\n};\n\nexport const positionCluster = (node) => {\n log.info('Position cluster (' + node.id + ', ' + node.x + ', ' + node.y + ')');\n const el = clusterElems[node.id];\n\n el.attr('transform', 'translate(' + node.x + ', ' + node.y + ')');\n};\n","import { select } from 'd3';\nimport { log } from '../logger'; // eslint-disable-line\nimport { getConfig } from '../config';\nimport { sanitizeText, evaluate } from '../diagrams/common/common';\n\nconst sanitizeTxt = (txt) => sanitizeText(txt, getConfig());\n\n/**\n * @param dom\n * @param styleFn\n */\nfunction applyStyle(dom, styleFn) {\n if (styleFn) {\n dom.attr('style', styleFn);\n }\n}\n\n/**\n * @param {any} node\n * @returns {SVGForeignObjectElement} Node\n */\nfunction addHtmlLabel(node) {\n const fo = select(document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject'));\n const div = fo.append('xhtml:div');\n\n const label = node.label;\n const labelClass = node.isNode ? 'nodeLabel' : 'edgeLabel';\n div.html(\n '' +\n label +\n ''\n );\n\n applyStyle(div, node.labelStyle);\n div.style('display', 'inline-block');\n // Fix for firefox\n div.style('white-space', 'nowrap');\n div.attr('xmlns', 'http://www.w3.org/1999/xhtml');\n return fo.node();\n}\n\nconst createLabel = (_vertexText, style, isTitle, isNode) => {\n let vertexText = _vertexText || '';\n if (typeof vertexText === 'object') vertexText = vertexText[0];\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that?\n vertexText = vertexText.replace(/\\\\n|\\n/g, '
');\n log.info('vertexText' + vertexText);\n const node = {\n isNode,\n label: vertexText.replace(\n /fa[lrsb]?:fa-[\\w-]+/g,\n (s) => ``\n ),\n labelStyle: style.replace('fill:', 'color:'),\n };\n let vertexNode = addHtmlLabel(node);\n // vertexNode.parentNode.removeChild(vertexNode);\n return vertexNode;\n } else {\n const svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n svgLabel.setAttribute('style', style.replace('color:', 'fill:'));\n let rows = [];\n if (typeof vertexText === 'string') {\n rows = vertexText.split(/\\\\n|\\n|/gi);\n } else if (Array.isArray(vertexText)) {\n rows = vertexText;\n } else {\n rows = [];\n }\n\n for (let j = 0; j < rows.length; j++) {\n const tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');\n tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');\n tspan.setAttribute('dy', '1em');\n tspan.setAttribute('x', '0');\n if (isTitle) {\n tspan.setAttribute('class', 'title-row');\n } else {\n tspan.setAttribute('class', 'row');\n }\n tspan.textContent = rows[j].trim();\n svgLabel.appendChild(tspan);\n }\n return svgLabel;\n }\n};\n\nexport default createLabel;\n","import { log } from '../logger'; // eslint-disable-line\nimport createLabel from './createLabel';\nimport { line, curveBasis, select } from 'd3';\nimport { getConfig } from '../config';\nimport utils from '../utils';\nimport { evaluate } from '../diagrams/common/common';\n\nlet edgeLabels = {};\nlet terminalLabels = {};\n\nexport const clear = () => {\n edgeLabels = {};\n terminalLabels = {};\n};\n\nexport const insertEdgeLabel = (elem, edge) => {\n // Create the actual text element\n const labelElement = createLabel(edge.label, edge.labelStyle);\n\n // Create outer g, edgeLabel, this will be positioned after graph layout\n const edgeLabel = elem.insert('g').attr('class', 'edgeLabel');\n\n // Create inner g, label, this will be positioned now for centering the text\n const label = edgeLabel.insert('g').attr('class', 'label');\n label.node().appendChild(labelElement);\n\n // Center the label\n let bbox = labelElement.getBBox();\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = labelElement.children[0];\n const dv = select(labelElement);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n label.attr('transform', 'translate(' + -bbox.width / 2 + ', ' + -bbox.height / 2 + ')');\n\n // Make element accessible by id for positioning\n edgeLabels[edge.id] = edgeLabel;\n\n // Update the abstract data of the edge with the new information about its width and height\n edge.width = bbox.width;\n edge.height = bbox.height;\n\n let fo;\n if (edge.startLabelLeft) {\n // Create the actual text element\n const startLabelElement = createLabel(edge.startLabelLeft, edge.labelStyle);\n const startEdgeLabelLeft = elem.insert('g').attr('class', 'edgeTerminals');\n const inner = startEdgeLabelLeft.insert('g').attr('class', 'inner');\n fo = inner.node().appendChild(startLabelElement);\n const slBox = startLabelElement.getBBox();\n inner.attr('transform', 'translate(' + -slBox.width / 2 + ', ' + -slBox.height / 2 + ')');\n if (!terminalLabels[edge.id]) {\n terminalLabels[edge.id] = {};\n }\n terminalLabels[edge.id].startLeft = startEdgeLabelLeft;\n setTerminalWidth(fo, edge.startLabelLeft);\n }\n if (edge.startLabelRight) {\n // Create the actual text element\n const startLabelElement = createLabel(edge.startLabelRight, edge.labelStyle);\n const startEdgeLabelRight = elem.insert('g').attr('class', 'edgeTerminals');\n const inner = startEdgeLabelRight.insert('g').attr('class', 'inner');\n fo = startEdgeLabelRight.node().appendChild(startLabelElement);\n inner.node().appendChild(startLabelElement);\n const slBox = startLabelElement.getBBox();\n inner.attr('transform', 'translate(' + -slBox.width / 2 + ', ' + -slBox.height / 2 + ')');\n\n if (!terminalLabels[edge.id]) {\n terminalLabels[edge.id] = {};\n }\n terminalLabels[edge.id].startRight = startEdgeLabelRight;\n setTerminalWidth(fo, edge.startLabelRight);\n }\n if (edge.endLabelLeft) {\n // Create the actual text element\n const endLabelElement = createLabel(edge.endLabelLeft, edge.labelStyle);\n const endEdgeLabelLeft = elem.insert('g').attr('class', 'edgeTerminals');\n const inner = endEdgeLabelLeft.insert('g').attr('class', 'inner');\n fo = inner.node().appendChild(endLabelElement);\n const slBox = endLabelElement.getBBox();\n inner.attr('transform', 'translate(' + -slBox.width / 2 + ', ' + -slBox.height / 2 + ')');\n\n endEdgeLabelLeft.node().appendChild(endLabelElement);\n\n if (!terminalLabels[edge.id]) {\n terminalLabels[edge.id] = {};\n }\n terminalLabels[edge.id].endLeft = endEdgeLabelLeft;\n setTerminalWidth(fo, edge.endLabelLeft);\n }\n if (edge.endLabelRight) {\n // Create the actual text element\n const endLabelElement = createLabel(edge.endLabelRight, edge.labelStyle);\n const endEdgeLabelRight = elem.insert('g').attr('class', 'edgeTerminals');\n const inner = endEdgeLabelRight.insert('g').attr('class', 'inner');\n\n fo = inner.node().appendChild(endLabelElement);\n const slBox = endLabelElement.getBBox();\n inner.attr('transform', 'translate(' + -slBox.width / 2 + ', ' + -slBox.height / 2 + ')');\n\n endEdgeLabelRight.node().appendChild(endLabelElement);\n if (!terminalLabels[edge.id]) {\n terminalLabels[edge.id] = {};\n }\n terminalLabels[edge.id].endRight = endEdgeLabelRight;\n setTerminalWidth(fo, edge.endLabelRight);\n }\n};\n\n/**\n * @param {any} fo\n * @param {any} value\n */\nfunction setTerminalWidth(fo, value) {\n if (getConfig().flowchart.htmlLabels && fo) {\n fo.style.width = value.length * 9 + 'px';\n fo.style.height = '12px';\n }\n}\n\nexport const positionEdgeLabel = (edge, paths) => {\n log.info('Moving label abc78 ', edge.id, edge.label, edgeLabels[edge.id]);\n let path = paths.updatedPath ? paths.updatedPath : paths.originalPath;\n if (edge.label) {\n const el = edgeLabels[edge.id];\n let x = edge.x;\n let y = edge.y;\n if (path) {\n // // debugger;\n const pos = utils.calcLabelPosition(path);\n log.info('Moving label from (', x, ',', y, ') to (', pos.x, ',', pos.y, ') abc78');\n // x = pos.x;\n // y = pos.y;\n }\n el.attr('transform', 'translate(' + x + ', ' + y + ')');\n }\n\n //let path = paths.updatedPath ? paths.updatedPath : paths.originalPath;\n if (edge.startLabelLeft) {\n const el = terminalLabels[edge.id].startLeft;\n let x = edge.x;\n let y = edge.y;\n if (path) {\n // debugger;\n const pos = utils.calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, 'start_left', path);\n x = pos.x;\n y = pos.y;\n }\n el.attr('transform', 'translate(' + x + ', ' + y + ')');\n }\n if (edge.startLabelRight) {\n const el = terminalLabels[edge.id].startRight;\n let x = edge.x;\n let y = edge.y;\n if (path) {\n // debugger;\n const pos = utils.calcTerminalLabelPosition(\n edge.arrowTypeStart ? 10 : 0,\n 'start_right',\n path\n );\n x = pos.x;\n y = pos.y;\n }\n el.attr('transform', 'translate(' + x + ', ' + y + ')');\n }\n if (edge.endLabelLeft) {\n const el = terminalLabels[edge.id].endLeft;\n let x = edge.x;\n let y = edge.y;\n if (path) {\n // debugger;\n const pos = utils.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, 'end_left', path);\n x = pos.x;\n y = pos.y;\n }\n el.attr('transform', 'translate(' + x + ', ' + y + ')');\n }\n if (edge.endLabelRight) {\n const el = terminalLabels[edge.id].endRight;\n let x = edge.x;\n let y = edge.y;\n if (path) {\n // debugger;\n const pos = utils.calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, 'end_right', path);\n x = pos.x;\n y = pos.y;\n }\n el.attr('transform', 'translate(' + x + ', ' + y + ')');\n }\n};\n\nconst outsideNode = (node, point) => {\n // log.warn('Checking bounds ', node, point);\n const x = node.x;\n const y = node.y;\n const dx = Math.abs(point.x - x);\n const dy = Math.abs(point.y - y);\n const w = node.width / 2;\n const h = node.height / 2;\n if (dx >= w || dy >= h) {\n return true;\n }\n return false;\n};\n\nexport const intersection = (node, outsidePoint, insidePoint) => {\n log.warn(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(outsidePoint)}\n insidePoint : ${JSON.stringify(insidePoint)}\n node : x:${node.x} y:${node.y} w:${node.width} h:${node.height}`);\n const x = node.x;\n const y = node.y;\n\n const dx = Math.abs(x - insidePoint.x);\n // const dy = Math.abs(y - insidePoint.y);\n const w = node.width / 2;\n let r = insidePoint.x < outsidePoint.x ? w - dx : w + dx;\n const h = node.height / 2;\n\n // const edges = {\n // x1: x - w,\n // x2: x + w,\n // y1: y - h,\n // y2: y + h\n // };\n\n // if (\n // outsidePoint.x === edges.x1 ||\n // outsidePoint.x === edges.x2 ||\n // outsidePoint.y === edges.y1 ||\n // outsidePoint.y === edges.y2\n // ) {\n // log.warn('abc89 calc equals on edge', outsidePoint, edges);\n // return outsidePoint;\n // }\n\n const Q = Math.abs(outsidePoint.y - insidePoint.y);\n const R = Math.abs(outsidePoint.x - insidePoint.x);\n // log.warn();\n if (Math.abs(y - outsidePoint.y) * w > Math.abs(x - outsidePoint.x) * h) { // eslint-disable-line\n // Intersection is top or bottom of rect.\n // let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y;\n let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y;\n r = (R * q) / Q;\n const res = {\n x: insidePoint.x < outsidePoint.x ? insidePoint.x + r : insidePoint.x - R + r,\n y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q,\n };\n\n if (r === 0) {\n res.x = outsidePoint.x;\n res.y = outsidePoint.y;\n }\n if (R === 0) {\n res.x = outsidePoint.x;\n }\n if (Q === 0) {\n res.y = outsidePoint.y;\n }\n\n log.warn(`abc89 topp/bott calc, Q ${Q}, q ${q}, R ${R}, r ${r}`, res);\n\n return res;\n } else {\n // Intersection onn sides of rect\n if (insidePoint.x < outsidePoint.x) {\n r = outsidePoint.x - w - x;\n } else {\n // r = outsidePoint.x - w - x;\n r = x - w - outsidePoint.x;\n }\n let q = (Q * r) / R;\n // OK let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x + dx - w;\n // OK let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : outsidePoint.x + r;\n let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x - R + r;\n // let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : outsidePoint.x + r;\n let _y = insidePoint.y < outsidePoint.y ? insidePoint.y + q : insidePoint.y - q;\n log.warn(`sides calc abc89, Q ${Q}, q ${q}, R ${R}, r ${r}`, { _x, _y });\n if (r === 0) {\n _x = outsidePoint.x;\n _y = outsidePoint.y;\n }\n if (R === 0) {\n _x = outsidePoint.x;\n }\n if (Q === 0) {\n _y = outsidePoint.y;\n }\n\n return { x: _x, y: _y };\n }\n};\n/**\n * This function will page a path and node where the last point(s) in the path is inside the node\n * and return an update path ending by the border of the node.\n *\n * @param {Array} _points\n * @param {any} boundryNode\n * @returns {Array} Points\n */\nconst cutPathAtIntersect = (_points, boundryNode) => {\n log.warn('abc88 cutPathAtIntersect', _points, boundryNode);\n let points = [];\n let lastPointOutside = _points[0];\n let isInside = false;\n _points.forEach((point) => {\n // const node = clusterDb[edge.toCluster].node;\n log.info('abc88 checking point', point, boundryNode);\n\n // check if point is inside the boundry rect\n if (!outsideNode(boundryNode, point) && !isInside) {\n // First point inside the rect found\n // Calc the intersection coord between the point anf the last point outside the rect\n const inter = intersection(boundryNode, lastPointOutside, point);\n log.warn('abc88 inside', point, lastPointOutside, inter);\n log.warn('abc88 intersection', inter);\n\n // // Check case where the intersection is the same as the last point\n let pointPresent = false;\n points.forEach((p) => {\n pointPresent = pointPresent || (p.x === inter.x && p.y === inter.y);\n });\n // // if (!pointPresent) {\n if (!points.find((e) => e.x === inter.x && e.y === inter.y)) {\n points.push(inter);\n } else {\n log.warn('abc88 no intersect', inter, points);\n }\n // points.push(inter);\n isInside = true;\n } else {\n // Outside\n log.warn('abc88 outside', point, lastPointOutside);\n lastPointOutside = point;\n // points.push(point);\n if (!isInside) points.push(point);\n }\n });\n log.warn('abc88 returning points', points);\n return points;\n};\n\n//(edgePaths, e, edge, clusterDb, diagramtype, graph)\nexport const insertEdge = function (elem, e, edge, clusterDb, diagramType, graph) {\n let points = edge.points;\n let pointsHasChanged = false;\n const tail = graph.node(e.v);\n var head = graph.node(e.w);\n\n log.info('abc88 InsertEdge: ', edge);\n if (head.intersect && tail.intersect) {\n points = points.slice(1, edge.points.length - 1);\n points.unshift(tail.intersect(points[0]));\n log.info(\n 'Last point',\n points[points.length - 1],\n head,\n head.intersect(points[points.length - 1])\n );\n points.push(head.intersect(points[points.length - 1]));\n }\n if (edge.toCluster) {\n log.info('to cluster abc88', clusterDb[edge.toCluster]);\n points = cutPathAtIntersect(edge.points, clusterDb[edge.toCluster].node);\n // log.trace('edge', edge);\n // points = [];\n // let lastPointOutside; // = edge.points[0];\n // let isInside = false;\n // edge.points.forEach(point => {\n // const node = clusterDb[edge.toCluster].node;\n // log.warn('checking from', edge.fromCluster, point, node);\n\n // if (!outsideNode(node, point) && !isInside) {\n // log.trace('inside', edge.toCluster, point, lastPointOutside);\n\n // // First point inside the rect\n // const inter = intersection(node, lastPointOutside, point);\n\n // let pointPresent = false;\n // points.forEach(p => {\n // pointPresent = pointPresent || (p.x === inter.x && p.y === inter.y);\n // });\n // // if (!pointPresent) {\n // if (!points.find(e => e.x === inter.x && e.y === inter.y)) {\n // points.push(inter);\n // } else {\n // log.warn('no intersect', inter, points);\n // }\n // isInside = true;\n // } else {\n // // outside\n // lastPointOutside = point;\n // if (!isInside) points.push(point);\n // }\n // });\n pointsHasChanged = true;\n }\n\n if (edge.fromCluster) {\n log.info('from cluster abc88', clusterDb[edge.fromCluster]);\n points = cutPathAtIntersect(points.reverse(), clusterDb[edge.fromCluster].node).reverse();\n\n pointsHasChanged = true;\n }\n\n // The data for our line\n const lineData = points.filter((p) => !Number.isNaN(p.y));\n\n // This is the accessor function we talked about above\n let curve;\n // Currently only flowcharts get the curve from the settings, perhaps this should\n // be expanded to a common setting? Restricting it for now in order not to cause side-effects that\n // have not been thought through\n if (diagramType === 'graph' || diagramType === 'flowchart') {\n curve = edge.curve || curveBasis;\n } else {\n curve = curveBasis;\n }\n // curve = curveLinear;\n const lineFunction = line()\n .x(function (d) {\n return d.x;\n })\n .y(function (d) {\n return d.y;\n })\n .curve(curve);\n\n // Contruct stroke classes based on properties\n let strokeClasses;\n switch (edge.thickness) {\n case 'normal':\n strokeClasses = 'edge-thickness-normal';\n break;\n case 'thick':\n strokeClasses = 'edge-thickness-thick';\n break;\n default:\n strokeClasses = '';\n }\n switch (edge.pattern) {\n case 'solid':\n strokeClasses += ' edge-pattern-solid';\n break;\n case 'dotted':\n strokeClasses += ' edge-pattern-dotted';\n break;\n case 'dashed':\n strokeClasses += ' edge-pattern-dashed';\n break;\n }\n\n const svgPath = elem\n .append('path')\n .attr('d', lineFunction(lineData))\n .attr('id', edge.id)\n .attr('class', ' ' + strokeClasses + (edge.classes ? ' ' + edge.classes : ''))\n .attr('style', edge.style);\n\n // DEBUG code, adds a red circle at each edge coordinate\n // edge.points.forEach(point => {\n // elem\n // .append('circle')\n // .style('stroke', 'red')\n // .style('fill', 'red')\n // .attr('r', 1)\n // .attr('cx', point.x)\n // .attr('cy', point.y);\n // });\n\n let url = '';\n if (getConfig().state.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 log.info('arrowTypeStart', edge.arrowTypeStart);\n log.info('arrowTypeEnd', edge.arrowTypeEnd);\n\n switch (edge.arrowTypeStart) {\n case 'arrow_cross':\n svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-crossStart' + ')');\n break;\n case 'arrow_point':\n svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-pointStart' + ')');\n break;\n case 'arrow_barb':\n svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-barbStart' + ')');\n break;\n case 'arrow_circle':\n svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-circleStart' + ')');\n break;\n case 'aggregation':\n svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-aggregationStart' + ')');\n break;\n case 'extension':\n svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-extensionStart' + ')');\n break;\n case 'composition':\n svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-compositionStart' + ')');\n break;\n case 'dependency':\n svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-dependencyStart' + ')');\n break;\n default:\n }\n switch (edge.arrowTypeEnd) {\n case 'arrow_cross':\n svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-crossEnd' + ')');\n break;\n case 'arrow_point':\n svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-pointEnd' + ')');\n break;\n case 'arrow_barb':\n svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-barbEnd' + ')');\n break;\n case 'arrow_circle':\n svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-circleEnd' + ')');\n break;\n case 'aggregation':\n svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-aggregationEnd' + ')');\n break;\n case 'extension':\n svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-extensionEnd' + ')');\n break;\n case 'composition':\n svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-compositionEnd' + ')');\n break;\n case 'dependency':\n svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-dependencyEnd' + ')');\n break;\n default:\n }\n let paths = {};\n if (pointsHasChanged) {\n paths.updatedPath = points;\n }\n paths.originalPath = edge.points;\n return paths;\n};\n","import dagre from 'dagre';\nimport graphlib from 'graphlib';\nimport insertMarkers from './markers';\nimport { updateNodeBounds } from './shapes/util';\nimport {\n clear as clearGraphlib,\n clusterDb,\n adjustClustersAndEdges,\n findNonClusterChild,\n sortNodesByHierarchy,\n} from './mermaid-graphlib';\nimport { insertNode, positionNode, clear as clearNodes, setNodeElem } from './nodes';\nimport { insertCluster, clear as clearClusters } from './clusters';\nimport { insertEdgeLabel, positionEdgeLabel, insertEdge, clear as clearEdges } from './edges';\nimport { log } from '../logger';\n\nconst recursiveRender = (_elem, graph, diagramtype, parentCluster) => {\n log.info('Graph in recursive render: XXX', graphlib.json.write(graph), parentCluster);\n const dir = graph.graph().rankdir;\n log.trace('Dir in recursive render - dir:', dir);\n\n const elem = _elem.insert('g').attr('class', 'root'); // eslint-disable-line\n if (!graph.nodes()) {\n log.info('No nodes found for', graph);\n } else {\n log.info('Recursive render XXX', graph.nodes());\n }\n if (graph.edges().length > 0) {\n log.trace('Recursive edges', graph.edge(graph.edges()[0]));\n }\n const clusters = elem.insert('g').attr('class', 'clusters'); // eslint-disable-line\n const edgePaths = elem.insert('g').attr('class', 'edgePaths');\n const edgeLabels = elem.insert('g').attr('class', 'edgeLabels');\n const nodes = elem.insert('g').attr('class', 'nodes');\n\n // Insert nodes, this will insert them into the dom and each node will get a size. The size is updated\n // to the abstract node and is later used by dagre for the layout\n graph.nodes().forEach(function (v) {\n const node = graph.node(v);\n if (typeof parentCluster !== 'undefined') {\n const data = JSON.parse(JSON.stringify(parentCluster.clusterData));\n // data.clusterPositioning = true;\n log.info('Setting data for cluster XXX (', v, ') ', data, parentCluster);\n graph.setNode(parentCluster.id, data);\n if (!graph.parent(v)) {\n log.trace('Setting parent', v, parentCluster.id);\n graph.setParent(v, parentCluster.id, data);\n }\n }\n log.info('(Insert) Node XXX' + v + ': ' + JSON.stringify(graph.node(v)));\n if (node && node.clusterNode) {\n // const children = graph.children(v);\n log.info('Cluster identified', v, node.width, graph.node(v));\n const o = recursiveRender(nodes, node.graph, diagramtype, graph.node(v));\n const newEl = o.elem;\n updateNodeBounds(node, newEl);\n node.diff = o.diff || 0;\n log.info('Node bounds (abc123)', v, node, node.width, node.x, node.y);\n setNodeElem(newEl, node);\n\n log.warn('Recursive render complete ', newEl, node);\n } else {\n if (graph.children(v).length > 0) {\n // This is a cluster but not to be rendered recursively\n // Render as before\n log.info('Cluster - the non recursive path XXX', v, node.id, node, graph);\n log.info(findNonClusterChild(node.id, graph));\n clusterDb[node.id] = { id: findNonClusterChild(node.id, graph), node };\n // insertCluster(clusters, graph.node(v));\n } else {\n log.info('Node - the non recursive path', v, node.id, node);\n insertNode(nodes, graph.node(v), dir);\n }\n }\n });\n\n // Insert labels, this will insert them into the dom so that the width can be calculated\n // Also figure out which edges point to/from clusters and adjust them accordingly\n // Edges from/to clusters really points to the first child in the cluster.\n // TODO: pick optimal child in the cluster to us as link anchor\n graph.edges().forEach(function (e) {\n const edge = graph.edge(e.v, e.w, e.name);\n log.info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e));\n log.info('Edge ' + e.v + ' -> ' + e.w + ': ', e, ' ', JSON.stringify(graph.edge(e)));\n\n // Check if link is either from or to a cluster\n log.info('Fix', clusterDb, 'ids:', e.v, e.w, 'Translateing: ', clusterDb[e.v], clusterDb[e.w]);\n insertEdgeLabel(edgeLabels, edge);\n });\n\n graph.edges().forEach(function (e) {\n log.info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e));\n });\n log.info('#############################################');\n log.info('### Layout ###');\n log.info('#############################################');\n log.info(graph);\n dagre.layout(graph);\n log.info('Graph after layout:', graphlib.json.write(graph));\n // Move the nodes to the correct place\n let diff = 0;\n sortNodesByHierarchy(graph).forEach(function (v) {\n const node = graph.node(v);\n log.info('Position ' + v + ': ' + JSON.stringify(graph.node(v)));\n log.info(\n 'Position ' + v + ': (' + node.x,\n ',' + node.y,\n ') width: ',\n node.width,\n ' height: ',\n node.height\n );\n if (node && node.clusterNode) {\n // clusterDb[node.id].node = node;\n\n positionNode(node);\n } else {\n // Non cluster node\n if (graph.children(v).length > 0) {\n // A cluster in the non-recursive way\n // positionCluster(node);\n insertCluster(clusters, node);\n clusterDb[node.id].node = node;\n } else {\n positionNode(node);\n }\n }\n });\n\n // Move the edge labels to the correct place after layout\n graph.edges().forEach(function (e) {\n const edge = graph.edge(e);\n log.info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(edge), edge);\n\n const paths = insertEdge(edgePaths, e, edge, clusterDb, diagramtype, graph);\n positionEdgeLabel(edge, paths);\n });\n\n graph.nodes().forEach(function (v) {\n const n = graph.node(v);\n log.info(v, n.type, n.diff);\n if (n.type === 'group') {\n diff = n.diff;\n }\n });\n return { elem, diff };\n};\n\nexport const render = (elem, graph, markers, diagramtype, id) => {\n insertMarkers(elem, markers, diagramtype, id);\n clearNodes();\n clearEdges();\n clearClusters();\n clearGraphlib();\n\n log.warn('Graph at first:', graphlib.json.write(graph));\n adjustClustersAndEdges(graph);\n log.warn('Graph after:', graphlib.json.write(graph));\n // log.warn('Graph ever after:', graphlib.json.write(graph.node('A').graph));\n recursiveRender(elem, graph, diagramtype);\n};\n\n// const shapeDefinitions = {};\n// export const addShape = ({ shapeType: fun }) => {\n// shapeDefinitions[shapeType] = fun;\n// };\n\n// const arrowDefinitions = {};\n// export const addArrow = ({ arrowType: fun }) => {\n// arrowDefinitions[arrowType] = fun;\n// };\n","/*\n * Borrowed with love from from dagrge-d3. Many thanks to cpettitt!\n */\n\nimport node from './intersect-node.js';\nimport circle from './intersect-circle.js';\nimport ellipse from './intersect-ellipse.js';\nimport polygon from './intersect-polygon.js';\nimport rect from './intersect-rect.js';\n\nexport default {\n node,\n circle,\n ellipse,\n polygon,\n rect,\n};\n","import intersectEllipse from './intersect-ellipse';\n\n/**\n * @param node\n * @param rx\n * @param point\n */\nfunction intersectCircle(node, rx, point) {\n return intersectEllipse(node, rx, rx, point);\n}\n\nexport default intersectCircle;\n","/**\n * @param node\n * @param rx\n * @param ry\n * @param point\n */\nfunction intersectEllipse(node, rx, ry, point) {\n // Formulae from: https://mathworld.wolfram.com/Ellipse-LineIntersection.html\n\n var cx = node.x;\n var cy = node.y;\n\n var px = cx - point.x;\n var py = cy - point.y;\n\n var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px);\n\n var dx = Math.abs((rx * ry * px) / det);\n if (point.x < cx) {\n dx = -dx;\n }\n var dy = Math.abs((rx * ry * py) / det);\n if (point.y < cy) {\n dy = -dy;\n }\n\n return { x: cx + dx, y: cy + dy };\n}\n\nexport default intersectEllipse;\n","/**\n * Returns the point at which two lines, p and q, intersect or returns undefined if they do not intersect.\n *\n * @param p1\n * @param p2\n * @param q1\n * @param q2\n */\nfunction intersectLine(p1, p2, q1, q2) {\n // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,\n // p7 and p473.\n\n var a1, a2, b1, b2, c1, c2;\n var r1, r2, r3, r4;\n var denom, offset, num;\n var x, y;\n\n // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x +\n // b1 y + c1 = 0.\n a1 = p2.y - p1.y;\n b1 = p1.x - p2.x;\n c1 = p2.x * p1.y - p1.x * p2.y;\n\n // Compute r3 and r4.\n r3 = a1 * q1.x + b1 * q1.y + c1;\n r4 = a1 * q2.x + b1 * q2.y + c1;\n\n // Check signs of r3 and r4. If both point 3 and point 4 lie on\n // same side of line 1, the line segments do not intersect.\n if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) {\n return /*DONT_INTERSECT*/;\n }\n\n // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0\n a2 = q2.y - q1.y;\n b2 = q1.x - q2.x;\n c2 = q2.x * q1.y - q1.x * q2.y;\n\n // Compute r1 and r2\n r1 = a2 * p1.x + b2 * p1.y + c2;\n r2 = a2 * p2.x + b2 * p2.y + c2;\n\n // Check signs of r1 and r2. If both point 1 and point 2 lie\n // on same side of second line segment, the line segments do\n // not intersect.\n if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) {\n return /*DONT_INTERSECT*/;\n }\n\n // Line segments intersect: compute intersection point.\n denom = a1 * b2 - a2 * b1;\n if (denom === 0) {\n return /*COLLINEAR*/;\n }\n\n offset = Math.abs(denom / 2);\n\n // The denom/2 is to get rounding instead of truncating. It\n // is added or subtracted to the numerator, depending upon the\n // sign of the numerator.\n num = b1 * c2 - b2 * c1;\n x = num < 0 ? (num - offset) / denom : (num + offset) / denom;\n\n num = a2 * c1 - a1 * c2;\n y = num < 0 ? (num - offset) / denom : (num + offset) / denom;\n\n return { x: x, y: y };\n}\n\n/**\n * @param r1\n * @param r2\n */\nfunction sameSign(r1, r2) {\n return r1 * r2 > 0;\n}\n\nexport default intersectLine;\n","module.exports = intersectNode;\n\n/**\n * @param node\n * @param point\n */\nfunction intersectNode(node, point) {\n // console.info('Intersect Node');\n return node.intersect(point);\n}\n","/* eslint \"no-console\": off */\n\nimport intersectLine from './intersect-line';\n\nexport default intersectPolygon;\n\n/**\n * Returns the point ({x, y}) at which the point argument intersects with the node argument assuming\n * that it has the shape specified by polygon.\n *\n * @param node\n * @param polyPoints\n * @param point\n */\nfunction intersectPolygon(node, polyPoints, point) {\n var x1 = node.x;\n var y1 = node.y;\n\n var intersections = [];\n\n var minX = Number.POSITIVE_INFINITY;\n var minY = Number.POSITIVE_INFINITY;\n if (typeof polyPoints.forEach === 'function') {\n polyPoints.forEach(function (entry) {\n minX = Math.min(minX, entry.x);\n minY = Math.min(minY, entry.y);\n });\n } else {\n minX = Math.min(minX, polyPoints.x);\n minY = Math.min(minY, polyPoints.y);\n }\n\n var left = x1 - node.width / 2 - minX;\n var top = y1 - node.height / 2 - minY;\n\n for (var i = 0; i < polyPoints.length; i++) {\n var p1 = polyPoints[i];\n var p2 = polyPoints[i < polyPoints.length - 1 ? i + 1 : 0];\n var intersect = intersectLine(\n node,\n point,\n { x: left + p1.x, y: top + p1.y },\n { x: left + p2.x, y: top + p2.y }\n );\n if (intersect) {\n intersections.push(intersect);\n }\n }\n\n if (!intersections.length) {\n // console.log('NO INTERSECTION FOUND, RETURN NODE CENTER', node);\n return node;\n }\n\n if (intersections.length > 1) {\n // More intersections, find the one nearest to edge end point\n intersections.sort(function (p, q) {\n var pdx = p.x - point.x;\n var pdy = p.y - point.y;\n var distp = Math.sqrt(pdx * pdx + pdy * pdy);\n\n var qdx = q.x - point.x;\n var qdy = q.y - point.y;\n var distq = Math.sqrt(qdx * qdx + qdy * qdy);\n\n return distp < distq ? -1 : distp === distq ? 0 : 1;\n });\n }\n return intersections[0];\n}\n","const intersectRect = (node, point) => {\r\n var x = node.x;\r\n var y = node.y;\r\n\r\n // Rectangle intersection algorithm from:\r\n // https://math.stackexchange.com/questions/108113/find-edge-between-two-boxes\r\n var dx = point.x - x;\r\n var dy = point.y - y;\r\n var w = node.width / 2;\r\n var h = node.height / 2;\r\n\r\n var sx, sy;\r\n if (Math.abs(dy) * w > Math.abs(dx) * h) {\r\n // Intersection is top or bottom of rect.\r\n if (dy < 0) {\r\n h = -h;\r\n }\r\n sx = dy === 0 ? 0 : (h * dx) / dy;\r\n sy = h;\r\n } else {\r\n // Intersection is left or right of rect.\r\n if (dx < 0) {\r\n w = -w;\r\n }\r\n sx = w;\r\n sy = dx === 0 ? 0 : (w * dy) / dx;\r\n }\r\n\r\n return { x: x + sx, y: y + sy };\r\n};\r\n\r\nexport default intersectRect;\r\n","/** Setup arrow head and define the marker. The result is appended to the svg. */\n\nimport { log } from '../logger';\n\n// Only add the number of markers that the diagram needs\nconst insertMarkers = (elem, markerArray, type, id) => {\n markerArray.forEach((markerName) => {\n markers[markerName](elem, type, id);\n });\n};\n\nconst extension = (elem, type, id) => {\n log.trace('Making markers for ', id);\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-extensionStart')\n .attr('class', 'marker extension ' + type)\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,7 L18,13 V 1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-extensionEnd')\n .attr('class', 'marker extension ' + type)\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead\n};\n\nconst composition = (elem, type) => {\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-compositionStart')\n .attr('class', 'marker composition ' + type)\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-compositionEnd')\n .attr('class', 'marker composition ' + type)\n .attr('refX', 19)\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 L1,7 L9,1 Z');\n};\nconst aggregation = (elem, type) => {\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-aggregationStart')\n .attr('class', 'marker aggregation ' + type)\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-aggregationEnd')\n .attr('class', 'marker aggregation ' + type)\n .attr('refX', 19)\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 L1,7 L9,1 Z');\n};\nconst dependency = (elem, type) => {\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-dependencyStart')\n .attr('class', 'marker dependency ' + type)\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-dependencyEnd')\n .attr('class', 'marker dependency ' + type)\n .attr('refX', 19)\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};\nconst point = (elem, type) => {\n elem\n .append('marker')\n .attr('id', type + '-pointEnd')\n .attr('class', 'marker ' + type)\n .attr('viewBox', '0 0 10 10')\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')\n .attr('class', 'arrowMarkerPath')\n .style('stroke-width', 1)\n .style('stroke-dasharray', '1,0');\n elem\n .append('marker')\n .attr('id', type + '-pointStart')\n .attr('class', 'marker ' + type)\n .attr('viewBox', '0 0 10 10')\n .attr('refX', 0)\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 5 L 10 10 L 10 0 z')\n .attr('class', 'arrowMarkerPath')\n .style('stroke-width', 1)\n .style('stroke-dasharray', '1,0');\n};\nconst circle = (elem, type) => {\n elem\n .append('marker')\n .attr('id', type + '-circleEnd')\n .attr('class', 'marker ' + type)\n .attr('viewBox', '0 0 10 10')\n .attr('refX', 11)\n .attr('refY', 5)\n .attr('markerUnits', 'userSpaceOnUse')\n .attr('markerWidth', 11)\n .attr('markerHeight', 11)\n .attr('orient', 'auto')\n .append('circle')\n .attr('cx', '5')\n .attr('cy', '5')\n .attr('r', '5')\n .attr('class', 'arrowMarkerPath')\n .style('stroke-width', 1)\n .style('stroke-dasharray', '1,0');\n\n elem\n .append('marker')\n .attr('id', type + '-circleStart')\n .attr('class', 'marker ' + type)\n .attr('viewBox', '0 0 10 10')\n .attr('refX', -1)\n .attr('refY', 5)\n .attr('markerUnits', 'userSpaceOnUse')\n .attr('markerWidth', 11)\n .attr('markerHeight', 11)\n .attr('orient', 'auto')\n .append('circle')\n .attr('cx', '5')\n .attr('cy', '5')\n .attr('r', '5')\n .attr('class', 'arrowMarkerPath')\n .style('stroke-width', 1)\n .style('stroke-dasharray', '1,0');\n};\nconst cross = (elem, type) => {\n elem\n .append('marker')\n .attr('id', type + '-crossEnd')\n .attr('class', 'marker cross ' + type)\n .attr('viewBox', '0 0 11 11')\n .attr('refX', 12)\n .attr('refY', 5.2)\n .attr('markerUnits', 'userSpaceOnUse')\n .attr('markerWidth', 11)\n .attr('markerHeight', 11)\n .attr('orient', 'auto')\n .append('path')\n // .attr('stroke', 'black')\n .attr('d', 'M 1,1 l 9,9 M 10,1 l -9,9')\n .attr('class', 'arrowMarkerPath')\n .style('stroke-width', 2)\n .style('stroke-dasharray', '1,0');\n\n elem\n .append('marker')\n .attr('id', type + '-crossStart')\n .attr('class', 'marker cross ' + type)\n .attr('viewBox', '0 0 11 11')\n .attr('refX', -1)\n .attr('refY', 5.2)\n .attr('markerUnits', 'userSpaceOnUse')\n .attr('markerWidth', 11)\n .attr('markerHeight', 11)\n .attr('orient', 'auto')\n .append('path')\n // .attr('stroke', 'black')\n .attr('d', 'M 1,1 l 9,9 M 10,1 l -9,9')\n .attr('class', 'arrowMarkerPath')\n .style('stroke-width', 2)\n .style('stroke-dasharray', '1,0');\n};\nconst barb = (elem, type) => {\n elem\n .append('defs')\n .append('marker')\n .attr('id', type + '-barbEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 14)\n .attr('markerUnits', 'strokeWidth')\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 19,7 L9,13 L14,7 L9,1 Z');\n};\n\n// TODO rename the class diagram markers to something shape descriptive and semantic free\nconst markers = {\n extension,\n composition,\n aggregation,\n dependency,\n point,\n circle,\n cross,\n barb,\n};\nexport default insertMarkers;\n","/** Decorates with functions required by mermaids dagre-wrapper. */\nimport { log } from '../logger';\nimport graphlib from 'graphlib';\n\nexport let clusterDb = {};\nlet decendants = {};\nlet parents = {};\n\nexport const clear = () => {\n decendants = {};\n parents = {};\n clusterDb = {};\n};\n\nconst isDecendant = (id, ancenstorId) => {\n // if (id === ancenstorId) return true;\n\n log.trace(\n 'In isDecendant',\n ancenstorId,\n ' ',\n id,\n ' = ',\n decendants[ancenstorId].indexOf(id) >= 0\n );\n if (decendants[ancenstorId].indexOf(id) >= 0) return true;\n\n return false;\n};\n\nconst edgeInCluster = (edge, clusterId) => {\n log.info('Decendants of ', clusterId, ' is ', decendants[clusterId]);\n log.info('Edge is ', edge);\n // Edges to/from the cluster is not in the cluster, they are in the parent\n if (edge.v === clusterId) return false;\n if (edge.w === clusterId) return false;\n\n if (!decendants[clusterId]) {\n log.debug('Tilt, ', clusterId, ',not in decendants');\n return false;\n }\n log.info('Here ');\n\n if (decendants[clusterId].indexOf(edge.v) >= 0) return true;\n if (isDecendant(edge.v, clusterId)) return true;\n if (isDecendant(edge.w, clusterId)) return true;\n if (decendants[clusterId].indexOf(edge.w) >= 0) return true;\n\n return false;\n};\n\nconst copy = (clusterId, graph, newGraph, rootId) => {\n log.warn(\n 'Copying children of ',\n clusterId,\n 'root',\n rootId,\n 'data',\n graph.node(clusterId),\n rootId\n );\n const nodes = graph.children(clusterId) || [];\n\n // Include cluster node if it is not the root\n if (clusterId !== rootId) {\n nodes.push(clusterId);\n }\n\n log.warn('Copying (nodes) clusterId', clusterId, 'nodes', nodes);\n\n nodes.forEach((node) => {\n if (graph.children(node).length > 0) {\n copy(node, graph, newGraph, rootId);\n } else {\n const data = graph.node(node);\n log.info('cp ', node, ' to ', rootId, ' with parent ', clusterId); //,node, data, ' parent is ', clusterId);\n newGraph.setNode(node, data);\n if (rootId !== graph.parent(node)) {\n log.warn('Setting parent', node, graph.parent(node));\n newGraph.setParent(node, graph.parent(node));\n }\n\n if (clusterId !== rootId && node !== clusterId) {\n log.debug('Setting parent', node, clusterId);\n newGraph.setParent(node, clusterId);\n } else {\n log.info('In copy ', clusterId, 'root', rootId, 'data', graph.node(clusterId), rootId);\n log.debug(\n 'Not Setting parent for node=',\n node,\n 'cluster!==rootId',\n clusterId !== rootId,\n 'node!==clusterId',\n node !== clusterId\n );\n }\n const edges = graph.edges(node);\n log.debug('Copying Edges', edges);\n edges.forEach((edge) => {\n log.info('Edge', edge);\n const data = graph.edge(edge.v, edge.w, edge.name);\n log.info('Edge data', data, rootId);\n try {\n // Do not copy edges in and out of the root cluster, they belong to the parent graph\n if (edgeInCluster(edge, rootId)) {\n log.info('Copying as ', edge.v, edge.w, data, edge.name);\n newGraph.setEdge(edge.v, edge.w, data, edge.name);\n log.info('newGraph edges ', newGraph.edges(), newGraph.edge(newGraph.edges()[0]));\n } else {\n log.info(\n 'Skipping copy of edge ',\n edge.v,\n '-->',\n edge.w,\n ' rootId: ',\n rootId,\n ' clusterId:',\n clusterId\n );\n }\n } catch (e) {\n log.error(e);\n }\n });\n }\n log.debug('Removing node', node);\n graph.removeNode(node);\n });\n};\nexport const extractDecendants = (id, graph) => {\n // log.debug('Extracting ', id);\n const children = graph.children(id);\n let res = [].concat(children);\n\n for (let i = 0; i < children.length; i++) {\n parents[children[i]] = id;\n res = res.concat(extractDecendants(children[i], graph));\n }\n\n return res;\n};\n\n/**\n * Validates the graph, checking that all parent child relation points to existing nodes and that\n * edges between nodes also ia correct. When not correct the function logs the discrepancies.\n *\n * @param graph\n */\nexport const validate = (graph) => {\n const edges = graph.edges();\n log.trace('Edges: ', edges);\n for (let i = 0; i < edges.length; i++) {\n if (graph.children(edges[i].v).length > 0) {\n log.trace('The node ', edges[i].v, ' is part of and edge even though it has children');\n return false;\n }\n if (graph.children(edges[i].w).length > 0) {\n log.trace('The node ', edges[i].w, ' is part of and edge even though it has children');\n return false;\n }\n }\n return true;\n};\n\n/**\n * Finds a child that is not a cluster. When faking a edge between a node and a cluster.\n *\n * @param {Finds a} id\n * @param {any} graph\n */\nexport const findNonClusterChild = (id, graph) => {\n // const node = graph.node(id);\n log.trace('Searching', id);\n // const children = graph.children(id).reverse();\n const children = graph.children(id); //.reverse();\n log.trace('Searching children of id ', id, children);\n if (children.length < 1) {\n log.trace('This is a valid node', id);\n return id;\n }\n for (let i = 0; i < children.length; i++) {\n const _id = findNonClusterChild(children[i], graph);\n if (_id) {\n log.trace('Found replacement for', id, ' => ', _id);\n return _id;\n }\n }\n};\n\nconst getAnchorId = (id) => {\n if (!clusterDb[id]) {\n return id;\n }\n // If the cluster has no external connections\n if (!clusterDb[id].externalConnections) {\n return id;\n }\n\n // Return the replacement node\n if (clusterDb[id]) {\n return clusterDb[id].id;\n }\n return id;\n};\n\nexport const adjustClustersAndEdges = (graph, depth) => {\n if (!graph || depth > 10) {\n log.debug('Opting out, no graph ');\n return;\n } else {\n log.debug('Opting in, graph ');\n }\n // Go through the nodes and for each cluster found, save a replacement node, this can be used when\n // faking a link to a cluster\n graph.nodes().forEach(function (id) {\n const children = graph.children(id);\n if (children.length > 0) {\n log.warn(\n 'Cluster identified',\n id,\n ' Replacement id in edges: ',\n findNonClusterChild(id, graph)\n );\n decendants[id] = extractDecendants(id, graph);\n clusterDb[id] = { id: findNonClusterChild(id, graph), clusterData: graph.node(id) };\n }\n });\n\n // Check incoming and outgoing edges for each cluster\n graph.nodes().forEach(function (id) {\n const children = graph.children(id);\n const edges = graph.edges();\n if (children.length > 0) {\n log.debug('Cluster identified', id, decendants);\n edges.forEach((edge) => {\n // log.debug('Edge, decendants: ', edge, decendants[id]);\n\n // Check if any edge leaves the cluster (not the actual cluster, thats a link from the box)\n if (edge.v !== id && edge.w !== id) {\n // Any edge where either the one of the nodes is decending to the cluster but not the other\n // if (decendants[id].indexOf(edge.v) < 0 && decendants[id].indexOf(edge.w) < 0) {\n\n const d1 = isDecendant(edge.v, id);\n const d2 = isDecendant(edge.w, id);\n\n // d1 xor d2 - if either d1 is true and d2 is false or the other way around\n if (d1 ^ d2) {\n log.warn('Edge: ', edge, ' leaves cluster ', id);\n log.warn('Decendants of XXX ', id, ': ', decendants[id]);\n clusterDb[id].externalConnections = true;\n }\n }\n });\n } else {\n log.debug('Not a cluster ', id, decendants);\n }\n });\n\n // For clusters with incoming and/or outgoing edges translate those edges to a real node\n // in the cluster in order to fake the edge\n graph.edges().forEach(function (e) {\n const edge = graph.edge(e);\n log.warn('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e));\n log.warn('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(graph.edge(e)));\n\n let v = e.v;\n let w = e.w;\n // Check if link is either from or to a cluster\n log.warn(\n 'Fix XXX',\n clusterDb,\n 'ids:',\n e.v,\n e.w,\n 'Translateing: ',\n clusterDb[e.v],\n ' --- ',\n clusterDb[e.w]\n );\n if (clusterDb[e.v] && clusterDb[e.w] && clusterDb[e.v] === clusterDb[e.w]) {\n log.warn('Fixing and trixing link to self - removing XXX', e.v, e.w, e.name);\n log.warn('Fixing and trixing - removing XXX', e.v, e.w, e.name);\n v = getAnchorId(e.v);\n w = getAnchorId(e.w);\n graph.removeEdge(e.v, e.w, e.name);\n const specialId = e.w + '---' + e.v;\n graph.setNode(specialId, {\n domId: specialId,\n id: specialId,\n labelStyle: '',\n labelText: edge.label,\n padding: 0,\n shape: 'labelRect',\n style: '',\n });\n const edge1 = JSON.parse(JSON.stringify(edge));\n const edge2 = JSON.parse(JSON.stringify(edge));\n edge1.label = '';\n edge1.arrowTypeEnd = 'none';\n edge2.label = '';\n edge1.fromCluster = e.v;\n edge2.toCluster = e.v;\n\n graph.setEdge(v, specialId, edge1, e.name + '-cyclic-special');\n graph.setEdge(specialId, w, edge2, e.name + '-cyclic-special');\n } else if (clusterDb[e.v] || clusterDb[e.w]) {\n log.warn('Fixing and trixing - removing XXX', e.v, e.w, e.name);\n v = getAnchorId(e.v);\n w = getAnchorId(e.w);\n graph.removeEdge(e.v, e.w, e.name);\n if (v !== e.v) edge.fromCluster = e.v;\n if (w !== e.w) edge.toCluster = e.w;\n log.warn('Fix Replacing with XXX', v, w, e.name);\n graph.setEdge(v, w, edge, e.name);\n }\n });\n log.warn('Adjusted Graph', graphlib.json.write(graph));\n extractor(graph, 0);\n\n log.trace(clusterDb);\n\n // Remove references to extracted cluster\n // graph.edges().forEach(edge => {\n // if (isDecendant(edge.v, clusterId) || isDecendant(edge.w, clusterId)) {\n // graph.removeEdge(edge);\n // }\n // });\n};\n\nexport const extractor = (graph, depth) => {\n log.warn('extractor - ', depth, graphlib.json.write(graph), graph.children('D'));\n if (depth > 10) {\n log.error('Bailing out');\n return;\n }\n // For clusters without incoming and/or outgoing edges, create a new cluster-node\n // containing the nodes and edges in the custer in a new graph\n // for (let i = 0;)\n let nodes = graph.nodes();\n let hasChildren = false;\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n const children = graph.children(node);\n hasChildren = hasChildren || children.length > 0;\n }\n\n if (!hasChildren) {\n log.debug('Done, no node has children', graph.nodes());\n return;\n }\n // const clusters = Object.keys(clusterDb);\n // clusters.forEach(clusterId => {\n log.debug('Nodes = ', nodes, depth);\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n\n log.debug(\n 'Extracting node',\n node,\n clusterDb,\n clusterDb[node] && !clusterDb[node].externalConnections,\n !graph.parent(node),\n graph.node(node),\n graph.children('D'),\n ' Depth ',\n depth\n );\n // Note that the node might have been removed after the Object.keys call so better check\n // that it still is in the game\n if (!clusterDb[node]) {\n // Skip if the node is not a cluster\n log.debug('Not a cluster', node, depth);\n // break;\n } else if (\n !clusterDb[node].externalConnections &&\n // !graph.parent(node) &&\n graph.children(node) &&\n graph.children(node).length > 0\n ) {\n log.warn(\n 'Cluster without external connections, without a parent and with children',\n node,\n depth\n );\n\n const graphSettings = graph.graph();\n let dir = graphSettings.rankdir === 'TB' ? 'LR' : 'TB';\n if (clusterDb[node]) {\n if (clusterDb[node].clusterData && clusterDb[node].clusterData.dir) {\n dir = clusterDb[node].clusterData.dir;\n log.warn('Fixing dir', clusterDb[node].clusterData.dir, dir);\n }\n }\n\n const clusterGraph = new graphlib.Graph({\n multigraph: true,\n compound: true,\n })\n .setGraph({\n rankdir: dir, // Todo: set proper spacing\n nodesep: 50,\n ranksep: 50,\n marginx: 8,\n marginy: 8,\n })\n .setDefaultEdgeLabel(function () {\n return {};\n });\n\n log.warn('Old graph before copy', graphlib.json.write(graph));\n copy(node, graph, clusterGraph, node);\n graph.setNode(node, {\n clusterNode: true,\n id: node,\n clusterData: clusterDb[node].clusterData,\n labelText: clusterDb[node].labelText,\n graph: clusterGraph,\n });\n log.warn('New graph after copy node: (', node, ')', graphlib.json.write(clusterGraph));\n log.debug('Old graph after copy', graphlib.json.write(graph));\n } else {\n log.warn(\n 'Cluster ** ',\n node,\n ' **not meeting the criteria !externalConnections:',\n !clusterDb[node].externalConnections,\n ' no parent: ',\n !graph.parent(node),\n ' children ',\n graph.children(node) && graph.children(node).length > 0,\n graph.children('D'),\n depth\n );\n log.debug(clusterDb);\n }\n }\n\n nodes = graph.nodes();\n log.warn('New list of nodes', nodes);\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n const data = graph.node(node);\n log.warn(' Now next level', node, data);\n if (data.clusterNode) {\n extractor(data.graph, depth + 1);\n }\n }\n};\n\nconst sorter = (graph, nodes) => {\n if (nodes.length === 0) return [];\n let result = Object.assign(nodes);\n nodes.forEach((node) => {\n const children = graph.children(node);\n const sorted = sorter(graph, children);\n result = result.concat(sorted);\n });\n\n return result;\n};\n\nexport const sortNodesByHierarchy = (graph) => sorter(graph, graph.children());\n","import { select } from 'd3';\nimport { log } from '../logger'; // eslint-disable-line\nimport { labelHelper, updateNodeBounds, insertPolygonShape } from './shapes/util';\nimport { getConfig } from '../config';\nimport intersect from './intersect/index.js';\nimport createLabel from './createLabel';\nimport note from './shapes/note';\nimport { parseMember } from '../diagrams/class/svgDraw';\nimport { evaluate, sanitizeText as sanitize } from '../diagrams/common/common';\n\nconst sanitizeText = (txt) => sanitize(txt, getConfig());\n\nconst question = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const s = w + h;\n const points = [\n { x: s / 2, y: 0 },\n { x: s, y: -s / 2 },\n { x: s / 2, y: -s },\n { x: 0, y: -s / 2 },\n ];\n\n log.info('Question main (Circle)');\n\n const questionElem = insertPolygonShape(shapeSvg, s, s, points);\n questionElem.attr('style', node.style);\n updateNodeBounds(node, questionElem);\n\n node.intersect = function (point) {\n log.warn('Intersect called');\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst choice = (parent, node) => {\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'node default')\n .attr('id', node.domId || node.id);\n\n const s = 28;\n const points = [\n { x: 0, y: s / 2 },\n { x: s / 2, y: 0 },\n { x: 0, y: -s / 2 },\n { x: -s / 2, y: 0 },\n ];\n\n const choice = shapeSvg.insert('polygon', ':first-child').attr(\n 'points',\n points\n .map(function (d) {\n return d.x + ',' + d.y;\n })\n .join(' ')\n );\n // center the circle around its coordinate\n choice.attr('class', 'state-start').attr('r', 7).attr('width', 28).attr('height', 28);\n node.width = 28;\n node.height = 28;\n\n node.intersect = function (point) {\n return intersect.circle(node, 14, point);\n };\n\n return shapeSvg;\n};\n\nconst hexagon = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const f = 4;\n const h = bbox.height + node.padding;\n const m = h / f;\n const w = bbox.width + 2 * m + node.padding;\n const points = [\n { x: m, y: 0 },\n { x: w - m, y: 0 },\n { x: w, y: -h / 2 },\n { x: w - m, y: -h },\n { x: m, y: -h },\n { x: 0, y: -h / 2 },\n ];\n\n const hex = insertPolygonShape(shapeSvg, w, h, points);\n hex.attr('style', node.style);\n updateNodeBounds(node, hex);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst rect_left_inv_arrow = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: -h / 2, y: 0 },\n { x: w, y: 0 },\n { x: w, y: -h },\n { x: -h / 2, y: -h },\n { x: 0, y: -h / 2 },\n ];\n\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr('style', node.style);\n\n node.width = w + h;\n node.height = h;\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst lean_right = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: (-2 * h) / 6, y: 0 },\n { x: w - h / 6, y: 0 },\n { x: w + (2 * h) / 6, y: -h },\n { x: h / 6, y: -h },\n ];\n\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr('style', node.style);\n updateNodeBounds(node, el);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst lean_left = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: (2 * h) / 6, y: 0 },\n { x: w + h / 6, y: 0 },\n { x: w - (2 * h) / 6, y: -h },\n { x: -h / 6, y: -h },\n ];\n\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr('style', node.style);\n updateNodeBounds(node, el);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst trapezoid = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: (-2 * h) / 6, y: 0 },\n { x: w + (2 * h) / 6, y: 0 },\n { x: w - h / 6, y: -h },\n { x: h / 6, y: -h },\n ];\n\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr('style', node.style);\n updateNodeBounds(node, el);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst inv_trapezoid = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: h / 6, y: 0 },\n { x: w - h / 6, y: 0 },\n { x: w + (2 * h) / 6, y: -h },\n { x: (-2 * h) / 6, y: -h },\n ];\n\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr('style', node.style);\n updateNodeBounds(node, el);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst rect_right_inv_arrow = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: 0, y: 0 },\n { x: w + h / 2, y: 0 },\n { x: w, y: -h / 2 },\n { x: w + h / 2, y: -h },\n { x: 0, y: -h },\n ];\n\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr('style', node.style);\n updateNodeBounds(node, el);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst cylinder = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const rx = w / 2;\n const ry = rx / (2.5 + w / 50);\n const h = bbox.height + ry + node.padding;\n\n const shape =\n 'M 0,' +\n ry +\n ' a ' +\n rx +\n ',' +\n ry +\n ' 0,0,0 ' +\n w +\n ' 0 a ' +\n rx +\n ',' +\n ry +\n ' 0,0,0 ' +\n -w +\n ' 0 l 0,' +\n h +\n ' a ' +\n rx +\n ',' +\n ry +\n ' 0,0,0 ' +\n w +\n ' 0 l 0,' +\n -h;\n\n const el = shapeSvg\n .attr('label-offset-y', ry)\n .insert('path', ':first-child')\n .attr('style', node.style)\n .attr('d', shape)\n .attr('transform', 'translate(' + -w / 2 + ',' + -(h / 2 + ry) + ')');\n\n updateNodeBounds(node, el);\n\n node.intersect = function (point) {\n const pos = intersect.rect(node, point);\n const x = pos.x - node.x;\n\n if (\n rx != 0 &&\n (Math.abs(x) < node.width / 2 ||\n (Math.abs(x) == node.width / 2 && Math.abs(pos.y - node.y) > node.height / 2 - ry))\n ) {\n // ellipsis equation: x*x / a*a + y*y / b*b = 1\n // solve for y to get adjustion value for pos.y\n let y = ry * ry * (1 - (x * x) / (rx * rx));\n if (y != 0) y = Math.sqrt(y);\n y = ry - y;\n if (point.y - node.y > 0) y = -y;\n\n pos.y += y;\n }\n\n return pos;\n };\n\n return shapeSvg;\n};\n\nconst rect = (parent, node) => {\n const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, 'node ' + node.classes, true);\n\n log.trace('Classes = ', node.classes);\n // add the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n\n const totalWidth = bbox.width + node.padding;\n const totalHeight = bbox.height + node.padding;\n rect\n .attr('class', 'basic label-container')\n .attr('style', node.style)\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('x', -bbox.width / 2 - halfPadding)\n .attr('y', -bbox.height / 2 - halfPadding)\n .attr('width', totalWidth)\n .attr('height', totalHeight);\n\n if (node.props) {\n const propKeys = new Set(Object.keys(node.props));\n if (node.props.borders) {\n applyNodePropertyBorders(rect, node.props.borders, totalWidth, totalHeight);\n propKeys.delete('borders');\n }\n propKeys.forEach((propKey) => {\n log.warn(`Unknown node property ${propKey}`);\n });\n }\n\n updateNodeBounds(node, rect);\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n};\n\nconst labelRect = (parent, node) => {\n const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, 'label', true);\n\n log.trace('Classes = ', node.classes);\n // add the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n\n // Hide the rect we are only after the label\n const totalWidth = 0;\n const totalHeight = 0;\n rect.attr('width', totalWidth).attr('height', totalHeight);\n shapeSvg.attr('class', 'label edgeLabel');\n\n if (node.props) {\n const propKeys = new Set(Object.keys(node.props));\n if (node.props.borders) {\n applyNodePropertyBorders(rect, node.props.borders, totalWidth, totalHeight);\n propKeys.delete('borders');\n }\n propKeys.forEach((propKey) => {\n log.warn(`Unknown node property ${propKey}`);\n });\n }\n\n updateNodeBounds(node, rect);\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n};\n\n/**\n * @param rect\n * @param borders\n * @param totalWidth\n * @param totalHeight\n */\nfunction applyNodePropertyBorders(rect, borders, totalWidth, totalHeight) {\n const strokeDashArray = [];\n const addBorder = (length) => {\n strokeDashArray.push(length);\n strokeDashArray.push(0);\n };\n const skipBorder = (length) => {\n strokeDashArray.push(0);\n strokeDashArray.push(length);\n };\n if (borders.includes('t')) {\n log.debug('add top border');\n addBorder(totalWidth);\n } else {\n skipBorder(totalWidth);\n }\n if (borders.includes('r')) {\n log.debug('add right border');\n addBorder(totalHeight);\n } else {\n skipBorder(totalHeight);\n }\n if (borders.includes('b')) {\n log.debug('add bottom border');\n addBorder(totalWidth);\n } else {\n skipBorder(totalWidth);\n }\n if (borders.includes('l')) {\n log.debug('add left border');\n addBorder(totalHeight);\n } else {\n skipBorder(totalHeight);\n }\n rect.attr('stroke-dasharray', strokeDashArray.join(' '));\n}\n\nconst rectWithTitle = (parent, node) => {\n // const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, 'node ' + node.classes);\n\n let classes;\n if (!node.classes) {\n classes = 'node default';\n } else {\n classes = 'node ' + node.classes;\n }\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', classes)\n .attr('id', node.domId || node.id);\n\n // Create the title label and insert it after the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n // const innerRect = shapeSvg.insert('rect');\n const innerLine = shapeSvg.insert('line');\n\n const label = shapeSvg.insert('g').attr('class', 'label');\n\n const text2 = node.labelText.flat ? node.labelText.flat() : node.labelText;\n // const text2 = typeof text2prim === 'object' ? text2prim[0] : text2prim;\n\n let title = '';\n if (typeof text2 === 'object') {\n title = text2[0];\n } else {\n title = text2;\n }\n log.info('Label text abc79', title, text2, typeof text2 === 'object');\n\n const text = label.node().appendChild(createLabel(title, node.labelStyle, true, true));\n let bbox = { width: 0, height: 0 };\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = text.children[0];\n const dv = select(text);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n log.info('Text 2', text2);\n const textRows = text2.slice(1, text2.length);\n let titleBox = text.getBBox();\n const descr = label\n .node()\n .appendChild(\n createLabel(textRows.join ? textRows.join('
') : textRows, node.labelStyle, true, true)\n );\n\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = descr.children[0];\n const dv = select(descr);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n // bbox = label.getBBox();\n // log.info(descr);\n const halfPadding = node.padding / 2;\n select(descr).attr(\n 'transform',\n 'translate( ' +\n // (titleBox.width - bbox.width) / 2 +\n (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) +\n ', ' +\n (titleBox.height + halfPadding + 5) +\n ')'\n );\n select(text).attr(\n 'transform',\n 'translate( ' +\n // (titleBox.width - bbox.width) / 2 +\n (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) +\n ', ' +\n 0 +\n ')'\n );\n // Get the size of the label\n\n // Bounding box for title and text\n bbox = label.node().getBBox();\n\n // Center the label\n label.attr(\n 'transform',\n 'translate(' + -bbox.width / 2 + ', ' + (-bbox.height / 2 - halfPadding + 3) + ')'\n );\n\n rect\n .attr('class', 'outer title-state')\n .attr('x', -bbox.width / 2 - halfPadding)\n .attr('y', -bbox.height / 2 - halfPadding)\n .attr('width', bbox.width + node.padding)\n .attr('height', bbox.height + node.padding);\n\n innerLine\n .attr('class', 'divider')\n .attr('x1', -bbox.width / 2 - halfPadding)\n .attr('x2', bbox.width / 2 + halfPadding)\n .attr('y1', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding)\n .attr('y2', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding);\n\n updateNodeBounds(node, rect);\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n};\n\nconst stadium = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const h = bbox.height + node.padding;\n const w = bbox.width + h / 4 + node.padding;\n\n // add the rect\n const rect = shapeSvg\n .insert('rect', ':first-child')\n .attr('style', node.style)\n .attr('rx', h / 2)\n .attr('ry', h / 2)\n .attr('x', -w / 2)\n .attr('y', -h / 2)\n .attr('width', w)\n .attr('height', h);\n\n updateNodeBounds(node, rect);\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n};\n\nconst circle = (parent, node) => {\n const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, undefined, true);\n const circle = shapeSvg.insert('circle', ':first-child');\n\n // center the circle around its coordinate\n circle\n .attr('style', node.style)\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('r', bbox.width / 2 + halfPadding)\n .attr('width', bbox.width + node.padding)\n .attr('height', bbox.height + node.padding);\n\n log.info('Circle main');\n\n updateNodeBounds(node, circle);\n\n node.intersect = function (point) {\n log.info('Circle intersect', node, bbox.width / 2 + halfPadding, point);\n return intersect.circle(node, bbox.width / 2 + halfPadding, point);\n };\n\n return shapeSvg;\n};\n\nconst doublecircle = (parent, node) => {\n const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, undefined, true);\n const gap = 5;\n const circleGroup = shapeSvg.insert('g', ':first-child');\n const outerCircle = circleGroup.insert('circle');\n const innerCircle = circleGroup.insert('circle');\n\n // center the circle around its coordinate\n outerCircle\n .attr('style', node.style)\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('r', bbox.width / 2 + halfPadding + gap)\n .attr('width', bbox.width + node.padding + gap * 2)\n .attr('height', bbox.height + node.padding + gap * 2);\n\n innerCircle\n .attr('style', node.style)\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('r', bbox.width / 2 + halfPadding)\n .attr('width', bbox.width + node.padding)\n .attr('height', bbox.height + node.padding);\n\n log.info('DoubleCircle main');\n\n updateNodeBounds(node, outerCircle);\n\n node.intersect = function (point) {\n log.info('DoubleCircle intersect', node, bbox.width / 2 + halfPadding + gap, point);\n return intersect.circle(node, bbox.width / 2 + halfPadding + gap, point);\n };\n\n return shapeSvg;\n};\n\nconst subroutine = (parent, node) => {\n const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);\n\n const w = bbox.width + node.padding;\n const h = bbox.height + node.padding;\n const points = [\n { x: 0, y: 0 },\n { x: w, y: 0 },\n { x: w, y: -h },\n { x: 0, y: -h },\n { x: 0, y: 0 },\n { x: -8, y: 0 },\n { x: w + 8, y: 0 },\n { x: w + 8, y: -h },\n { x: -8, y: -h },\n { x: -8, y: 0 },\n ];\n\n const el = insertPolygonShape(shapeSvg, w, h, points);\n el.attr('style', node.style);\n updateNodeBounds(node, el);\n\n node.intersect = function (point) {\n return intersect.polygon(node, points, point);\n };\n\n return shapeSvg;\n};\n\nconst start = (parent, node) => {\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'node default')\n .attr('id', node.domId || node.id);\n const circle = shapeSvg.insert('circle', ':first-child');\n\n // center the circle around its coordinate\n circle.attr('class', 'state-start').attr('r', 7).attr('width', 14).attr('height', 14);\n\n updateNodeBounds(node, circle);\n\n node.intersect = function (point) {\n return intersect.circle(node, 7, point);\n };\n\n return shapeSvg;\n};\n\nconst forkJoin = (parent, node, dir) => {\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'node default')\n .attr('id', node.domId || node.id);\n\n let width = 70;\n let height = 10;\n\n if (dir === 'LR') {\n width = 10;\n height = 70;\n }\n\n const shape = shapeSvg\n .append('rect')\n .attr('x', (-1 * width) / 2)\n .attr('y', (-1 * height) / 2)\n .attr('width', width)\n .attr('height', height)\n .attr('class', 'fork-join');\n\n updateNodeBounds(node, shape);\n node.height = node.height + node.padding / 2;\n node.width = node.width + node.padding / 2;\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n};\n\nconst end = (parent, node) => {\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'node default')\n .attr('id', node.domId || node.id);\n const innerCircle = shapeSvg.insert('circle', ':first-child');\n const circle = shapeSvg.insert('circle', ':first-child');\n\n circle.attr('class', 'state-start').attr('r', 7).attr('width', 14).attr('height', 14);\n\n innerCircle.attr('class', 'state-end').attr('r', 5).attr('width', 10).attr('height', 10);\n\n updateNodeBounds(node, circle);\n\n node.intersect = function (point) {\n return intersect.circle(node, 7, point);\n };\n\n return shapeSvg;\n};\n\nconst class_box = (parent, node) => {\n const halfPadding = node.padding / 2;\n const rowPadding = 4;\n const lineHeight = 8;\n\n let classes;\n if (!node.classes) {\n classes = 'node default';\n } else {\n classes = 'node ' + node.classes;\n }\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', classes)\n .attr('id', node.domId || node.id);\n\n // Create the title label and insert it after the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n const topLine = shapeSvg.insert('line');\n const bottomLine = shapeSvg.insert('line');\n let maxWidth = 0;\n let maxHeight = rowPadding;\n\n const labelContainer = shapeSvg.insert('g').attr('class', 'label');\n let verticalPos = 0;\n const hasInterface = node.classData.annotations && node.classData.annotations[0];\n\n // 1. Create the labels\n const interfaceLabelText = node.classData.annotations[0]\n ? '«' + node.classData.annotations[0] + '»'\n : '';\n const interfaceLabel = labelContainer\n .node()\n .appendChild(createLabel(interfaceLabelText, node.labelStyle, true, true));\n let interfaceBBox = interfaceLabel.getBBox();\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = interfaceLabel.children[0];\n const dv = select(interfaceLabel);\n interfaceBBox = div.getBoundingClientRect();\n dv.attr('width', interfaceBBox.width);\n dv.attr('height', interfaceBBox.height);\n }\n if (node.classData.annotations[0]) {\n maxHeight += interfaceBBox.height + rowPadding;\n maxWidth += interfaceBBox.width;\n }\n\n let classTitleString = node.classData.id;\n\n if (node.classData.type !== undefined && node.classData.type !== '') {\n if (getConfig().flowchart.htmlLabels) {\n classTitleString += '<' + node.classData.type + '>';\n } else {\n classTitleString += '<' + node.classData.type + '>';\n }\n }\n const classTitleLabel = labelContainer\n .node()\n .appendChild(createLabel(classTitleString, node.labelStyle, true, true));\n select(classTitleLabel).attr('class', 'classTitle');\n let classTitleBBox = classTitleLabel.getBBox();\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = classTitleLabel.children[0];\n const dv = select(classTitleLabel);\n classTitleBBox = div.getBoundingClientRect();\n dv.attr('width', classTitleBBox.width);\n dv.attr('height', classTitleBBox.height);\n }\n maxHeight += classTitleBBox.height + rowPadding;\n if (classTitleBBox.width > maxWidth) {\n maxWidth = classTitleBBox.width;\n }\n const classAttributes = [];\n node.classData.members.forEach((str) => {\n const parsedInfo = parseMember(str);\n let parsedText = parsedInfo.displayText;\n if (getConfig().flowchart.htmlLabels) {\n parsedText = parsedText.replace(//g, '>');\n }\n const lbl = labelContainer\n .node()\n .appendChild(\n createLabel(\n parsedText,\n parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle,\n true,\n true\n )\n );\n let bbox = lbl.getBBox();\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = lbl.children[0];\n const dv = select(lbl);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n if (bbox.width > maxWidth) {\n maxWidth = bbox.width;\n }\n maxHeight += bbox.height + rowPadding;\n classAttributes.push(lbl);\n });\n\n maxHeight += lineHeight;\n\n const classMethods = [];\n node.classData.methods.forEach((str) => {\n const parsedInfo = parseMember(str);\n let displayText = parsedInfo.displayText;\n if (getConfig().flowchart.htmlLabels) {\n displayText = displayText.replace(//g, '>');\n }\n const lbl = labelContainer\n .node()\n .appendChild(\n createLabel(\n displayText,\n parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle,\n true,\n true\n )\n );\n let bbox = lbl.getBBox();\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = lbl.children[0];\n const dv = select(lbl);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n if (bbox.width > maxWidth) {\n maxWidth = bbox.width;\n }\n maxHeight += bbox.height + rowPadding;\n\n classMethods.push(lbl);\n });\n\n maxHeight += lineHeight;\n\n // 2. Position the labels\n\n // position the interface label\n if (hasInterface) {\n let diffX = (maxWidth - interfaceBBox.width) / 2;\n select(interfaceLabel).attr(\n 'transform',\n 'translate( ' + ((-1 * maxWidth) / 2 + diffX) + ', ' + (-1 * maxHeight) / 2 + ')'\n );\n verticalPos = interfaceBBox.height + rowPadding;\n }\n // Position the class title label\n let diffX = (maxWidth - classTitleBBox.width) / 2;\n select(classTitleLabel).attr(\n 'transform',\n 'translate( ' +\n ((-1 * maxWidth) / 2 + diffX) +\n ', ' +\n ((-1 * maxHeight) / 2 + verticalPos) +\n ')'\n );\n verticalPos += classTitleBBox.height + rowPadding;\n\n topLine\n .attr('class', 'divider')\n .attr('x1', -maxWidth / 2 - halfPadding)\n .attr('x2', maxWidth / 2 + halfPadding)\n .attr('y1', -maxHeight / 2 - halfPadding + lineHeight + verticalPos)\n .attr('y2', -maxHeight / 2 - halfPadding + lineHeight + verticalPos);\n\n verticalPos += lineHeight;\n\n classAttributes.forEach((lbl) => {\n select(lbl).attr(\n 'transform',\n 'translate( ' +\n -maxWidth / 2 +\n ', ' +\n ((-1 * maxHeight) / 2 + verticalPos + lineHeight / 2) +\n ')'\n );\n verticalPos += classTitleBBox.height + rowPadding;\n });\n\n verticalPos += lineHeight;\n bottomLine\n .attr('class', 'divider')\n .attr('x1', -maxWidth / 2 - halfPadding)\n .attr('x2', maxWidth / 2 + halfPadding)\n .attr('y1', -maxHeight / 2 - halfPadding + lineHeight + verticalPos)\n .attr('y2', -maxHeight / 2 - halfPadding + lineHeight + verticalPos);\n\n verticalPos += lineHeight;\n\n classMethods.forEach((lbl) => {\n select(lbl).attr(\n 'transform',\n 'translate( ' + -maxWidth / 2 + ', ' + ((-1 * maxHeight) / 2 + verticalPos) + ')'\n );\n verticalPos += classTitleBBox.height + rowPadding;\n });\n //\n // let bbox;\n // if (evaluate(getConfig().flowchart.htmlLabels)) {\n // const div = interfaceLabel.children[0];\n // const dv = select(interfaceLabel);\n // bbox = div.getBoundingClientRect();\n // dv.attr('width', bbox.width);\n // dv.attr('height', bbox.height);\n // }\n // bbox = labelContainer.getBBox();\n\n // log.info('Text 2', text2);\n // const textRows = text2.slice(1, text2.length);\n // let titleBox = text.getBBox();\n // const descr = label\n // .node()\n // .appendChild(createLabel(textRows.join('
'), node.labelStyle, true, true));\n\n // if (evaluate(getConfig().flowchart.htmlLabels)) {\n // const div = descr.children[0];\n // const dv = select(descr);\n // bbox = div.getBoundingClientRect();\n // dv.attr('width', bbox.width);\n // dv.attr('height', bbox.height);\n // }\n // // bbox = label.getBBox();\n // // log.info(descr);\n // select(descr).attr(\n // 'transform',\n // 'translate( ' +\n // // (titleBox.width - bbox.width) / 2 +\n // (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) +\n // ', ' +\n // (titleBox.height + halfPadding + 5) +\n // ')'\n // );\n // select(text).attr(\n // 'transform',\n // 'translate( ' +\n // // (titleBox.width - bbox.width) / 2 +\n // (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) +\n // ', ' +\n // 0 +\n // ')'\n // );\n // // Get the size of the label\n\n // // Bounding box for title and text\n // bbox = label.node().getBBox();\n\n // // Center the label\n // label.attr(\n // 'transform',\n // 'translate(' + -bbox.width / 2 + ', ' + (-bbox.height / 2 - halfPadding + 3) + ')'\n // );\n\n rect\n .attr('class', 'outer title-state')\n .attr('x', -maxWidth / 2 - halfPadding)\n .attr('y', -(maxHeight / 2) - halfPadding)\n .attr('width', maxWidth + node.padding)\n .attr('height', maxHeight + node.padding);\n\n // innerLine\n // .attr('class', 'divider')\n // .attr('x1', -bbox.width / 2 - halfPadding)\n // .attr('x2', bbox.width / 2 + halfPadding)\n // .attr('y1', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding)\n // .attr('y2', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding);\n\n updateNodeBounds(node, rect);\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n};\n\nconst shapes = {\n question,\n rect,\n labelRect,\n rectWithTitle,\n choice,\n circle,\n doublecircle,\n stadium,\n hexagon,\n rect_left_inv_arrow,\n lean_right,\n lean_left,\n trapezoid,\n inv_trapezoid,\n rect_right_inv_arrow,\n cylinder,\n start,\n end,\n note,\n subroutine,\n fork: forkJoin,\n join: forkJoin,\n class_box,\n};\n\nlet nodeElems = {};\n\nexport const insertNode = (elem, node, dir) => {\n let newEl;\n let el;\n\n // Add link when appropriate\n if (node.link) {\n let target;\n if (getConfig().securityLevel === 'sandbox') {\n target = '_top';\n } else if (node.linkTarget) {\n target = node.linkTarget || '_blank';\n }\n newEl = elem.insert('svg:a').attr('xlink:href', node.link).attr('target', target);\n el = shapes[node.shape](newEl, node, dir);\n } else {\n el = shapes[node.shape](elem, node, dir);\n newEl = el;\n }\n if (node.tooltip) {\n el.attr('title', node.tooltip);\n }\n if (node.class) {\n el.attr('class', 'node default ' + node.class);\n }\n\n nodeElems[node.id] = newEl;\n\n if (node.haveCallback) {\n nodeElems[node.id].attr('class', nodeElems[node.id].attr('class') + ' clickable');\n }\n};\nexport const setNodeElem = (elem, node) => {\n nodeElems[node.id] = elem;\n};\nexport const clear = () => {\n nodeElems = {};\n};\n\nexport const positionNode = (node) => {\n const el = nodeElems[node.id];\n log.trace(\n 'Transforming node',\n node.diff,\n node,\n 'translate(' + (node.x - node.width / 2 - 5) + ', ' + node.width / 2 + ')'\n );\n const padding = 8;\n const diff = node.diff || 0;\n if (node.clusterNode) {\n el.attr(\n 'transform',\n 'translate(' +\n (node.x + diff - node.width / 2) +\n ', ' +\n (node.y - node.height / 2 - padding) +\n ')'\n );\n } else {\n el.attr('transform', 'translate(' + node.x + ', ' + node.y + ')');\n }\n return diff;\n};\n","import { updateNodeBounds, labelHelper } from './util';\nimport { log } from '../../logger'; // eslint-disable-line\nimport intersect from '../intersect/index.js';\n\nconst note = (parent, node) => {\n const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, 'node ' + node.classes, true);\n\n log.info('Classes = ', node.classes);\n // add the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n\n rect\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('x', -bbox.width / 2 - halfPadding)\n .attr('y', -bbox.height / 2 - halfPadding)\n .attr('width', bbox.width + node.padding)\n .attr('height', bbox.height + node.padding);\n\n updateNodeBounds(node, rect);\n\n node.intersect = function (point) {\n return intersect.rect(node, point);\n };\n\n return shapeSvg;\n};\n\nexport default note;\n","import createLabel from '../createLabel';\nimport { getConfig } from '../../config';\nimport { decodeEntities } from '../../mermaidAPI';\nimport { select } from 'd3';\nimport { evaluate, sanitizeText } from '../../diagrams/common/common';\nexport const labelHelper = (parent, node, _classes, isNode) => {\n let classes;\n if (!_classes) {\n classes = 'node default';\n } else {\n classes = _classes;\n }\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', classes)\n .attr('id', node.domId || node.id);\n\n // Create the label and insert it after the rect\n const label = shapeSvg.insert('g').attr('class', 'label').attr('style', node.labelStyle);\n\n const labelText = typeof node.labelText === 'string' ? node.labelText : node.labelText[0];\n\n const text = label\n .node()\n .appendChild(\n createLabel(\n sanitizeText(decodeEntities(labelText), getConfig()),\n node.labelStyle,\n false,\n isNode\n )\n );\n\n // Get the size of the label\n let bbox = text.getBBox();\n\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const div = text.children[0];\n const dv = select(text);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n\n const halfPadding = node.padding / 2;\n\n // Center the label\n label.attr('transform', 'translate(' + -bbox.width / 2 + ', ' + -bbox.height / 2 + ')');\n\n return { shapeSvg, bbox, halfPadding, label };\n};\n\nexport const updateNodeBounds = (node, element) => {\n const bbox = element.node().getBBox();\n node.width = bbox.width;\n node.height = bbox.height;\n};\n\n/**\n * @param parent\n * @param w\n * @param h\n * @param points\n */\nexport function insertPolygonShape(parent, w, h, points) {\n return parent\n .insert('polygon', ':first-child')\n .attr(\n 'points',\n points\n .map(function (d) {\n return d.x + ',' + d.y;\n })\n .join(' ')\n )\n .attr('class', 'label-container')\n .attr('transform', 'translate(' + -w / 2 + ',' + h / 2 + ')');\n}\n","import theme from './themes';\n/**\n * **Configuration methods in Mermaid version 8.6.0 have been updated, to learn more[[click\n * here](8.6.0_docs.md)].**\n *\n * ## **What follows are config instructions for older versions**\n *\n * These are the default options which can be overridden with the initialization call like so:\n *\n * **Example 1:**

 mermaid.initialize({ flowchart:{ htmlLabels: false } }); 
\n *\n * **Example 2:**
  
\n *\n * A summary of all options and their defaults is found [here](#mermaidapi-configuration-defaults).\n * A description of each option follows below.\n *\n * @name Configuration\n */\nconst config = {\n /**\n * Theme , the CSS style sheet\n *\n * | Parameter | Description | Type | Required | Values |\n * | --------- | --------------- | ------ | -------- | ---------------------------------------------- |\n * | theme | Built in Themes | string | Optional | 'default', 'forest', 'dark', 'neutral', 'null' |\n *\n * **Notes:** To disable any pre-defined mermaid theme, use \"null\".
 \"theme\": \"forest\",\n   * \"themeCSS\": \".node rect { fill: red; }\" 
\n */\n theme: 'default',\n themeVariables: theme['default'].getThemeVariables(),\n themeCSS: undefined,\n /* **maxTextSize** - The maximum allowed size of the users text diagram */\n maxTextSize: 50000,\n darkMode: false,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ---------- | ------------------------------------------------------ | ------ | -------- | --------------------------- |\n * | fontFamily | specifies the font to be used in the rendered diagrams | string | Required | Any Possible CSS FontFamily |\n *\n * **Notes:** Default value: '\"trebuchet ms\", verdana, arial, sans-serif;'.\n */\n fontFamily: '\"trebuchet ms\", verdana, arial, sans-serif;',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ----------------------------------------------------- | ---------------- | -------- | ------------- |\n * | logLevel | This option decides the amount of logging to be used. | string \\| number | Required | 1, 2, 3, 4, 5 |\n *\n * **Notes:**\n *\n * - Debug: 1\n * - Info: 2\n * - Warn: 3\n * - Error: 4\n * - Fatal: 5 (default)\n */\n logLevel: 5,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------- | --------------------------------- | ------ | -------- | ------------------------------- |\n * | securitylevel | Level of trust for parsed diagram | string | Required | 'strict', 'loose', 'antiscript' |\n *\n * **Notes**:\n *\n * - **strict**: (**default**) tags in text are encoded, click functionality is disabled\n * - **loose**: tags in text are allowed, click functionality is enabled\n * - **antiscript**: html tags in text are allowed, (only script element is removed), click\n * functionality is enabled\n */\n securityLevel: 'strict',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | -------------------------------------------- | ------- | -------- | ----------- |\n * | startOnLoad | Dictates whether mermaid starts on Page load | boolean | Required | true, false |\n *\n * **Notes:** Default value: true\n */\n startOnLoad: true,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------------- | ---------------------------------------------------------------------------- | ------- | -------- | ----------- |\n * | arrowMarkerAbsolute | Controls whether or arrow markers in html code are absolute paths or anchors | boolean | Required | true, false |\n *\n * **Notes**:\n *\n * This matters if you are using base tag settings.\n *\n * Default value: false\n */\n arrowMarkerAbsolute: false,\n\n /**\n * This option controls which currentConfig keys are considered _secure_ and can only be changed\n * via call to mermaidAPI.initialize. Calls to mermaidAPI.reinitialize cannot make changes to the\n * `secure` keys in the current currentConfig. This prevents malicious graph directives from\n * overriding a site's default security.\n *\n * **Notes**:\n *\n * Default value: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']\n */\n secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],\n\n /**\n * This option controls if the generated ids of nodes in the SVG are generated randomly or based\n * on a seed. If set to false, the IDs are generated based on the current date and thus are not\n * deterministic. This is the default behaviour.\n *\n * **Notes**:\n *\n * This matters if your files are checked into sourcecontrol e.g. git and should not change unless\n * content is changed.\n *\n * Default value: false\n */\n deterministicIds: false,\n\n /**\n * This option is the optional seed for deterministic ids. if set to undefined but\n * deterministicIds is true, a simple number iterator is used. You can set this attribute to base\n * the seed on a static string.\n */\n deterministicIDSeed: undefined,\n\n /** The object containing configurations specific for flowcharts */\n flowchart: {\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | ----------------------------------------------- | ------- | -------- | ------------------ |\n * | diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value |\n *\n * **Notes:**\n *\n * The amount of padding around the diagram as a whole so that embedded diagrams have margins,\n * expressed in pixels\n *\n * Default value: 8\n */\n diagramPadding: 8,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ---------- | -------------------------------------------------------------------------------------------- | ------- | -------- | ----------- |\n * | htmlLabels | Flag for setting whether or not a html tag should be used for rendering labels on the edges. | boolean | Required | true, false |\n *\n * **Notes:** Default value: true.\n */\n htmlLabels: true,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | --------------------------------------------------- | ------- | -------- | ------------------- |\n * | nodeSpacing | Defines the spacing between nodes on the same level | Integer | Required | Any positive Number |\n *\n * **Notes:**\n *\n * Pertains to horizontal spacing for TB (top to bottom) or BT (bottom to top) graphs, and the\n * vertical spacing for LR as well as RL graphs.**\n *\n * Default value: 50\n */\n nodeSpacing: 50,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------------------------------------------------- | ------- | -------- | ------------------- |\n * | rankSpacing | Defines the spacing between nodes on different levels | Integer | Required | Any Positive Number |\n *\n * **Notes**:\n *\n * Pertains to vertical spacing for TB (top to bottom) or BT (bottom to top), and the horizontal\n * spacing for LR as well as RL graphs.\n *\n * Default value 50\n */\n rankSpacing: 50,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | -------------------------------------------------- | ------ | -------- | ----------------------------- |\n * | curve | Defines how mermaid renders curves for flowcharts. | string | Required | 'basis', 'linear', 'cardinal' |\n *\n * **Notes:**\n *\n * Default Value: 'basis'\n */\n curve: 'basis',\n // Only used in new experimental rendering\n // represents the padding between the labels and the shape\n padding: 15,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See notes | boolean | 4 | true, false |\n *\n * **Notes:**\n *\n * When this flag is set the height and width is set to 100% and is then scaling with the\n * available space if not the absolute space required is used.\n *\n * Default value: true\n */\n useMaxWidth: true,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ----------- | ------- | -------- | ----------------------- |\n * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper |\n *\n * **Notes:**\n *\n * Decides which rendering engine that is to be used for the rendering. Legal values are:\n * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid\n *\n * Default value: 'dagre-d3'\n */\n defaultRenderer: 'dagre-d3',\n },\n\n /** The object containing configurations specific for sequence diagrams */\n sequence: {\n hideUnusedParticipants: false,\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ---------------------------- | ------- | -------- | ------------------ |\n * | activationWidth | Width of the activation rect | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value :10\n */\n activationWidth: 10,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ |\n * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 50\n */\n diagramMarginX: 50,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | ------------------------------------------------- | ------- | -------- | ------------------ |\n * | diagramMarginY | Margin to the over and under the sequence diagram | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 10\n */\n diagramMarginY: 10,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | --------------------- | ------- | -------- | ------------------ |\n * | actorMargin | Margin between actors | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 50\n */\n actorMargin: 50,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | -------------------- | ------- | -------- | ------------------ |\n * | width | Width of actor boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 150\n */\n width: 150,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | --------------------- | ------- | -------- | ------------------ |\n * | height | Height of actor boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 65\n */\n height: 65,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ------------------------ | ------- | -------- | ------------------ |\n * | boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 10\n */\n boxMargin: 10,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------- | -------------------------------------------- | ------- | -------- | ------------------ |\n * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 5\n */\n boxTextMargin: 5,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ---------- | ------------------- | ------- | -------- | ------------------ |\n * | noteMargin | margin around notes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 10\n */\n noteMargin: 10,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------- | ---------------------- | ------- | -------- | ------------------ |\n * | messageMargin | Space between messages | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 35\n */\n messageMargin: 35,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------ | --------------------------- | ------ | -------- | ------------------------- |\n * | messageAlign | Multiline message alignment | string | Required | 'left', 'center', 'right' |\n *\n * **Notes:** Default value: 'center'\n */\n messageAlign: 'center',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------ | --------------------------- | ------- | -------- | ----------- |\n * | mirrorActors | Mirror actors under diagram | boolean | Required | true, false |\n *\n * **Notes:** Default value: true\n */\n mirrorActors: true,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ---------- | ----------------------------------------------------------------------- | ------- | -------- | ----------- |\n * | forceMenus | forces actor popup menus to always be visible (to support E2E testing). | Boolean | Required | True, False |\n *\n * **Notes:**\n *\n * Default value: false.\n */\n forceMenus: false,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ------------------------------------------ | ------- | -------- | ------------------ |\n * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | Required | Any Positive Value |\n *\n * **Notes:**\n *\n * Depending on css styling this might need adjustment.\n *\n * Default value: 1\n */\n bottomMarginAdj: 1,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See Notes | boolean | Required | true, false |\n *\n * **Notes:** When this flag is set to true, the height and width is set to 100% and is then\n * scaling with the available space. If set to false, the absolute space required is used.\n *\n * Default value: true\n */\n useMaxWidth: true,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ------------------------------------ | ------- | -------- | ----------- |\n * | rightAngles | display curve arrows as right angles | boolean | Required | true, false |\n *\n * **Notes:**\n *\n * This will display arrows that start and begin at the same node as right angles, rather than a curve\n *\n * Default value: false\n */\n rightAngles: false,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------------- | ------------------------------- | ------- | -------- | ----------- |\n * | showSequenceNumbers | This will show the node numbers | boolean | Required | true, false |\n *\n * **Notes:** Default value: false\n */\n showSequenceNumbers: false,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------- | -------------------------------------------------- | ------- | -------- | ------------------ |\n * | actorFontSize | This sets the font size of the actor's description | Integer | Require | Any Positive Value |\n *\n * **Notes:** **Default value 14**..\n */\n actorFontSize: 14,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ---------------------------------------------------- | ------ | -------- | --------------------------- |\n * | actorFontFamily | This sets the font family of the actor's description | string | Required | Any Possible CSS FontFamily |\n *\n * **Notes:** Default value: \"'Open Sans\", sans-serif'\n */\n actorFontFamily: '\"Open Sans\", sans-serif',\n\n /**\n * This sets the font weight of the actor's description\n *\n * **Notes:** Default value: 400.\n */\n actorFontWeight: 400,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------ | ----------------------------------------------- | ------- | -------- | ------------------ |\n * | noteFontSize | This sets the font size of actor-attached notes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 14\n */\n noteFontSize: 14,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | -------------------------------------------------- | ------ | -------- | --------------------------- |\n * | noteFontFamily | This sets the font family of actor-attached notes. | string | Required | Any Possible CSS FontFamily |\n *\n * **Notes:** Default value: ''\"trebuchet ms\", verdana, arial, sans-serif'\n */\n noteFontFamily: '\"trebuchet ms\", verdana, arial, sans-serif',\n\n /**\n * This sets the font weight of the note's description\n *\n * **Notes:** Default value: 400\n */\n noteFontWeight: 400,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ---------------------------------------------------- | ------ | -------- | ------------------------- |\n * | noteAlign | This sets the text alignment of actor-attached notes | string | required | 'left', 'center', 'right' |\n *\n * **Notes:** Default value: 'center'\n */\n noteAlign: 'center',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ----------------------------------------- | ------- | -------- | ------------------- |\n * | messageFontSize | This sets the font size of actor messages | Integer | Required | Any Positive Number |\n *\n * **Notes:** Default value: 16\n */\n messageFontSize: 16,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------------- | ------------------------------------------- | ------ | -------- | --------------------------- |\n * | messageFontFamily | This sets the font family of actor messages | string | Required | Any Possible CSS FontFamily |\n *\n * **Notes:** Default value: '\"trebuchet ms\", verdana, arial, sans-serif'\n */\n messageFontFamily: '\"trebuchet ms\", verdana, arial, sans-serif',\n\n /**\n * This sets the font weight of the message's description\n *\n * **Notes:** Default value: 400.\n */\n messageFontWeight: 400,\n\n /**\n * This sets the auto-wrap state for the diagram\n *\n * **Notes:** Default value: false.\n */\n wrap: false,\n\n /**\n * This sets the auto-wrap padding for the diagram (sides only)\n *\n * **Notes:** Default value: 0.\n */\n wrapPadding: 10,\n\n /**\n * This sets the width of the loop-box (loop, alt, opt, par)\n *\n * **Notes:** Default value: 50.\n */\n labelBoxWidth: 50,\n\n /**\n * This sets the height of the loop-box (loop, alt, opt, par)\n *\n * **Notes:** Default value: 20.\n */\n labelBoxHeight: 20,\n\n messageFont: function () {\n return {\n fontFamily: this.messageFontFamily,\n fontSize: this.messageFontSize,\n fontWeight: this.messageFontWeight,\n };\n },\n noteFont: function () {\n return {\n fontFamily: this.noteFontFamily,\n fontSize: this.noteFontSize,\n fontWeight: this.noteFontWeight,\n };\n },\n actorFont: function () {\n return {\n fontFamily: this.actorFontFamily,\n fontSize: this.actorFontSize,\n fontWeight: this.actorFontWeight,\n };\n },\n },\n\n /** The object containing configurations specific for gantt diagrams */\n gantt: {\n /**\n * ### titleTopMargin\n *\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ |\n * | titleTopMargin | Margin top for the text over the gantt diagram | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 25\n */\n titleTopMargin: 25,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ----------------------------------- | ------- | -------- | ------------------ |\n * | barHeight | The height of the bars in the graph | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 20\n */\n barHeight: 20,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ---------------------------------------------------------------- | ------- | -------- | ------------------ |\n * | barGap | The margin between the different activities in the gantt diagram | Integer | Optional | Any Positive Value |\n *\n * **Notes:** Default value: 4\n */\n barGap: 4,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ---------- | -------------------------------------------------------------------------- | ------- | -------- | ------------------ |\n * | topPadding | Margin between title and gantt diagram and between axis and gantt diagram. | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 50\n */\n topPadding: 50,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------ | ----------------------------------------------------------------------- | ------- | -------- | ------------------ |\n * | rightPadding | The space allocated for the section name to the right of the activities | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 75\n */\n rightPadding: 75,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ---------------------------------------------------------------------- | ------- | -------- | ------------------ |\n * | leftPadding | The space allocated for the section name to the left of the activities | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 75\n */\n leftPadding: 75,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------------- | -------------------------------------------- | ------- | -------- | ------------------ |\n * | gridLineStartPadding | Vertical starting position of the grid lines | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 35\n */\n gridLineStartPadding: 35,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ----------- | ------- | -------- | ------------------ |\n * | fontSize | Font size | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 11\n */\n fontSize: 11,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ---------------------- | ------- | -------- | ------------------ |\n * | sectionFontSize | Font size for sections | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 11\n */\n sectionFontSize: 11,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------------- | ---------------------------------------- | ------- | -------- | ------------------ |\n * | numberSectionStyles | The number of alternating section styles | Integer | 4 | Any Positive Value |\n *\n * **Notes:** Default value: 4\n */\n numberSectionStyles: 4,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ---------- | --------------------------- | ---- | -------- | ---------------- |\n * | axisFormat | Datetime format of the axis | 3 | Required | Date in yy-mm-dd |\n *\n * **Notes:**\n *\n * This might need adjustment to match your locale and preferences\n *\n * Default value: '%Y-%m-%d'.\n */\n axisFormat: '%Y-%m-%d',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See notes | boolean | 4 | true, false |\n *\n * **Notes:**\n *\n * When this flag is set the height and width is set to 100% and is then scaling with the\n * available space if not the absolute space required is used.\n *\n * Default value: true\n */\n useMaxWidth: true,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ----------- | ------- | -------- | ----------- |\n * | topAxis | See notes | Boolean | 4 | True, False |\n *\n * **Notes:** when this flag is set date labels will be added to the top of the chart\n *\n * **Default value false**.\n */\n topAxis: false,\n\n useWidth: undefined,\n },\n\n /** The object containing configurations specific for journey diagrams */\n journey: {\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ |\n * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 50\n */\n diagramMarginX: 50,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | -------------------------------------------------- | ------- | -------- | ------------------ |\n * | diagramMarginY | Margin to the over and under the sequence diagram. | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 10\n */\n diagramMarginY: 10,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | --------------------- | ------- | -------- | ------------------ |\n * | actorMargin | Margin between actors | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 50\n */\n leftMargin: 150,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | -------------------- | ------- | -------- | ------------------ |\n * | width | Width of actor boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 150\n */\n width: 150,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | --------------------- | ------- | -------- | ------------------ |\n * | height | Height of actor boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 65\n */\n height: 50,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ------------------------ | ------- | -------- | ------------------ |\n * | boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 10\n */\n boxMargin: 10,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------- | -------------------------------------------- | ------- | -------- | ------------------ |\n * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 5\n */\n boxTextMargin: 5,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ---------- | ------------------- | ------- | -------- | ------------------ |\n * | noteMargin | Margin around notes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 10\n */\n noteMargin: 10,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------- | ----------------------- | ------- | -------- | ------------------ |\n * | messageMargin | Space between messages. | Integer | Required | Any Positive Value |\n *\n * **Notes:**\n *\n * Space between messages.\n *\n * Default value: 35\n */\n messageMargin: 35,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------ | --------------------------- | ---- | -------- | ------------------------- |\n * | messageAlign | Multiline message alignment | 3 | 4 | 'left', 'center', 'right' |\n *\n * **Notes:** Default value: 'center'\n */\n messageAlign: 'center',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ------------------------------------------ | ------- | -------- | ------------------ |\n * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | 4 | Any Positive Value |\n *\n * **Notes:**\n *\n * Depending on css styling this might need adjustment.\n *\n * Default value: 1\n */\n bottomMarginAdj: 1,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See notes | boolean | 4 | true, false |\n *\n * **Notes:**\n *\n * When this flag is set the height and width is set to 100% and is then scaling with the\n * available space if not the absolute space required is used.\n *\n * Default value: true\n */\n useMaxWidth: true,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | --------------------------------- | ---- | -------- | ----------- |\n * | rightAngles | Curved Arrows become Right Angles | 3 | 4 | true, false |\n *\n * **Notes:**\n *\n * This will display arrows that start and begin at the same node as right angles, rather than a curves\n *\n * Default value: false\n */\n rightAngles: false,\n taskFontSize: 14,\n taskFontFamily: '\"Open Sans\", sans-serif',\n taskMargin: 50,\n // width of activation box\n activationWidth: 10,\n\n // text placement as: tspan | fo | old only text as before\n textPlacement: 'fo',\n actorColours: ['#8FBC8F', '#7CFC00', '#00FFFF', '#20B2AA', '#B0E0E6', '#FFFFE0'],\n\n sectionFills: ['#191970', '#8B008B', '#4B0082', '#2F4F4F', '#800000', '#8B4513', '#00008B'],\n sectionColours: ['#fff'],\n },\n class: {\n arrowMarkerAbsolute: false,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See notes | boolean | 4 | true, false |\n *\n * **Notes:**\n *\n * When this flag is set the height and width is set to 100% and is then scaling with the\n * available space if not the absolute space required is used.\n *\n * Default value: true\n */\n useMaxWidth: true,\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ----------- | ------- | -------- | ----------------------- |\n * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper |\n *\n * **Notes**:\n *\n * Decides which rendering engine that is to be used for the rendering. Legal values are:\n * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid\n *\n * Default value: 'dagre-d3'\n */\n defaultRenderer: 'dagre-wrapper',\n },\n state: {\n dividerMargin: 10,\n sizeUnit: 5,\n padding: 8,\n textHeight: 10,\n titleShift: -15,\n noteMargin: 10,\n forkWidth: 70,\n forkHeight: 7,\n // Used\n miniPadding: 2,\n // Font size factor, this is used to guess the width of the edges labels before rendering by dagre\n // layout. This might need updating if/when switching font\n fontSizeFactor: 5.02,\n fontSize: 24,\n labelHeight: 16,\n edgeLengthFactor: '20',\n compositTitleSize: 35,\n radius: 5,\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See notes | boolean | 4 | true, false |\n *\n * **Notes:**\n *\n * When this flag is set the height and width is set to 100% and is then scaling with the\n * available space if not the absolute space required is used.\n *\n * Default value: true\n */\n useMaxWidth: true,\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ----------- | ------- | -------- | ----------------------- |\n * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper |\n *\n * **Notes:**\n *\n * Decides which rendering engine that is to be used for the rendering. Legal values are:\n * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid\n *\n * Default value: 'dagre-d3'\n */\n defaultRenderer: 'dagre-wrapper',\n },\n\n /** The object containing configurations specific for entity relationship diagrams */\n er: {\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | ----------------------------------------------- | ------- | -------- | ------------------ |\n * | diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value |\n *\n * **Notes:**\n *\n * The amount of padding around the diagram as a whole so that embedded diagrams have margins,\n * expressed in pixels\n *\n * Default value: 20\n */\n diagramPadding: 20,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ---------------------------------------- | ------ | -------- | ---------------------- |\n * | layoutDirection | Directional bias for layout of entities. | string | Required | \"TB\", \"BT\", \"LR\", \"RL\" |\n *\n * **Notes:**\n *\n * 'TB' for Top-Bottom, 'BT'for Bottom-Top, 'LR' for Left-Right, or 'RL' for Right to Left.\n *\n * T = top, B = bottom, L = left, and R = right.\n *\n * Default value: 'TB'\n */\n layoutDirection: 'TB',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | ---------------------------------- | ------- | -------- | ------------------ |\n * | minEntityWidth | The minimum width of an entity box | Integer | Required | Any Positive Value |\n *\n * **Notes:** Expressed in pixels. Default value: 100\n */\n minEntityWidth: 100,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ----------------------------------- | ------- | -------- | ------------------ |\n * | minEntityHeight | The minimum height of an entity box | Integer | 4 | Any Positive Value |\n *\n * **Notes:** Expressed in pixels Default value: 75\n */\n minEntityHeight: 75,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------- | ------------------------------------------------------------ | ------- | -------- | ------------------ |\n * | entityPadding | Minimum internal padding between text in box and box borders | Integer | 4 | Any Positive Value |\n *\n * **Notes:**\n *\n * The minimum internal padding between text in an entity box and the enclosing box borders,\n * expressed in pixels.\n *\n * Default value: 15\n */\n entityPadding: 15,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ----------------------------------- | ------ | -------- | -------------------- |\n * | stroke | Stroke color of box edges and lines | string | 4 | Any recognized color |\n *\n * **Notes:** Default value: 'gray'\n */\n stroke: 'gray',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | -------------------------- | ------ | -------- | -------------------- |\n * | fill | Fill color of entity boxes | string | 4 | Any recognized color |\n *\n * **Notes:** Default value: 'honeydew'\n */\n fill: 'honeydew',\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ------------------- | ------- | -------- | ------------------ |\n * | fontSize | Font Size in pixels | Integer | | Any Positive Value |\n *\n * **Notes:**\n *\n * Font size (expressed as an integer representing a number of pixels) Default value: 12\n */\n fontSize: 12,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See Notes | boolean | Required | true, false |\n *\n * **Notes:**\n *\n * When this flag is set to true, the diagram width is locked to 100% and scaled based on\n * available space. If set to false, the diagram reserves its absolute width.\n *\n * Default value: true\n */\n useMaxWidth: true,\n },\n\n /** The object containing configurations specific for pie diagrams */\n pie: {\n useWidth: undefined,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See Notes | boolean | Required | true, false |\n *\n * **Notes:**\n *\n * When this flag is set to true, the diagram width is locked to 100% and scaled based on\n * available space. If set to false, the diagram reserves its absolute width.\n *\n * Default value: true\n */\n useMaxWidth: true,\n },\n\n /** The object containing configurations specific for req diagrams */\n requirement: {\n useWidth: undefined,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See Notes | boolean | Required | true, false |\n *\n * **Notes:**\n *\n * When this flag is set to true, the diagram width is locked to 100% and scaled based on\n * available space. If set to false, the diagram reserves its absolute width.\n *\n * Default value: true\n */\n useMaxWidth: true,\n\n rect_fill: '#f9f9f9',\n text_color: '#333',\n rect_border_size: '0.5px',\n rect_border_color: '#bbb',\n rect_min_width: 200,\n rect_min_height: 200,\n fontSize: 14,\n rect_padding: 10,\n line_height: 20,\n },\n gitGraph: {\n diagramPadding: 8,\n nodeLabel: {\n width: 75,\n height: 100,\n x: -25,\n y: 0,\n },\n mainBranchName: 'main',\n mainBranchOrder: 0,\n showCommitLabel: true,\n showBranches: true,\n rotateCommitLabel: true,\n },\n\n /** The object containing configurations specific for c4 diagrams */\n c4: {\n useWidth: undefined,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ |\n * | diagramMarginX | Margin to the right and left of the c4 diagram | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 50\n */\n diagramMarginX: 50,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | ------------------------------------------- | ------- | -------- | ------------------ |\n * | diagramMarginY | Margin to the over and under the c4 diagram | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 10\n */\n diagramMarginY: 10,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------- | --------------------- | ------- | -------- | ------------------ |\n * | c4ShapeMargin | Margin between shapes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 50\n */\n c4ShapeMargin: 50,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | -------------- | ---------------------- | ------- | -------- | ------------------ |\n * | c4ShapePadding | Padding between shapes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 20\n */\n c4ShapePadding: 20,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | --------------------- | ------- | -------- | ------------------ |\n * | width | Width of person boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 216\n */\n width: 216,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ---------------------- | ------- | -------- | ------------------ |\n * | height | Height of person boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 60\n */\n height: 60,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------- | ------------------- | ------- | -------- | ------------------ |\n * | boxMargin | Margin around boxes | Integer | Required | Any Positive Value |\n *\n * **Notes:** Default value: 10\n */\n boxMargin: 10,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ----------- | ----------- | ------- | -------- | ----------- |\n * | useMaxWidth | See Notes | boolean | Required | true, false |\n *\n * **Notes:** When this flag is set to true, the height and width is set to 100% and is then\n * scaling with the available space. If set to false, the absolute space required is used.\n *\n * Default value: true\n */\n useMaxWidth: true,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | ------------ | ----------- | ------- | -------- | ------------------ |\n * | c4ShapeInRow | See Notes | Integer | Required | Any Positive Value |\n *\n * **Notes:** How many shapes to place in each row.\n *\n * Default value: 4\n */\n c4ShapeInRow: 4,\n\n nextLinePaddingX: 0,\n\n /**\n * | Parameter | Description | Type | Required | Values |\n * | --------------- | ----------- | ------- | -------- | ------------------ |\n * | c4BoundaryInRow | See Notes | Integer | Required | Any Positive Value |\n *\n * **Notes:** How many boundarys to place in each row.\n *\n * Default value: 2\n */\n c4BoundaryInRow: 2,\n\n /**\n * This sets the font size of Person shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n personFontSize: 14,\n /**\n * This sets the font family of Person shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n personFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of Person shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n personFontWeight: 'normal',\n\n /**\n * This sets the font size of External Person shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n external_personFontSize: 14,\n /**\n * This sets the font family of External Person shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n external_personFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of External Person shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n external_personFontWeight: 'normal',\n\n /**\n * This sets the font size of System shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n systemFontSize: 14,\n /**\n * This sets the font family of System shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n systemFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of System shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n systemFontWeight: 'normal',\n\n /**\n * This sets the font size of External System shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n external_systemFontSize: 14,\n /**\n * This sets the font family of External System shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n external_systemFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of External System shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n external_systemFontWeight: 'normal',\n\n /**\n * This sets the font size of System DB shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n system_dbFontSize: 14,\n /**\n * This sets the font family of System DB shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n system_dbFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of System DB shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n system_dbFontWeight: 'normal',\n\n /**\n * This sets the font size of External System DB shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n external_system_dbFontSize: 14,\n /**\n * This sets the font family of External System DB shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n external_system_dbFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of External System DB shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n external_system_dbFontWeight: 'normal',\n\n /**\n * This sets the font size of System Queue shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n system_queueFontSize: 14,\n /**\n * This sets the font family of System Queue shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n system_queueFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of System Queue shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n system_queueFontWeight: 'normal',\n\n /**\n * This sets the font size of External System Queue shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n external_system_queueFontSize: 14,\n /**\n * This sets the font family of External System Queue shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n external_system_queueFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of External System Queue shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n external_system_queueFontWeight: 'normal',\n\n /**\n * This sets the font size of Boundary shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n boundaryFontSize: 14,\n /**\n * This sets the font family of Boundary shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n boundaryFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of Boundary shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n boundaryFontWeight: 'normal',\n\n /**\n * This sets the font size of Message shape for the diagram\n *\n * **Notes:** Default value: 12.\n */\n messageFontSize: 12,\n /**\n * This sets the font family of Message shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n messageFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of Message shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n messageFontWeight: 'normal',\n\n /**\n * This sets the font size of Container shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n containerFontSize: 14,\n /**\n * This sets the font family of Container shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n containerFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of Container shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n containerFontWeight: 'normal',\n\n /**\n * This sets the font size of External Container shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n external_containerFontSize: 14,\n /**\n * This sets the font family of External Container shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n external_containerFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of External Container shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n external_containerFontWeight: 'normal',\n\n /**\n * This sets the font size of Container DB shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n container_dbFontSize: 14,\n /**\n * This sets the font family of Container DB shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n container_dbFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of Container DB shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n container_dbFontWeight: 'normal',\n\n /**\n * This sets the font size of External Container DB shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n external_container_dbFontSize: 14,\n /**\n * This sets the font family of External Container DB shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n external_container_dbFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of External Container DB shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n external_container_dbFontWeight: 'normal',\n\n /**\n * This sets the font size of Container Queue shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n container_queueFontSize: 14,\n /**\n * This sets the font family of Container Queue shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n container_queueFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of Container Queue shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n container_queueFontWeight: 'normal',\n\n /**\n * This sets the font size of External Container Queue shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n external_container_queueFontSize: 14,\n /**\n * This sets the font family of External Container Queue shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n external_container_queueFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of External Container Queue shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n external_container_queueFontWeight: 'normal',\n\n /**\n * This sets the font size of Component shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n componentFontSize: 14,\n /**\n * This sets the font family of Component shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n componentFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of Component shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n componentFontWeight: 'normal',\n\n /**\n * This sets the font size of External Component shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n external_componentFontSize: 14,\n /**\n * This sets the font family of External Component shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n external_componentFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of External Component shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n external_componentFontWeight: 'normal',\n\n /**\n * This sets the font size of Component DB shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n component_dbFontSize: 14,\n /**\n * This sets the font family of Component DB shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n component_dbFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of Component DB shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n component_dbFontWeight: 'normal',\n\n /**\n * This sets the font size of External Component DB shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n external_component_dbFontSize: 14,\n /**\n * This sets the font family of External Component DB shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n external_component_dbFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of External Component DB shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n external_component_dbFontWeight: 'normal',\n\n /**\n * This sets the font size of Component Queue shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n component_queueFontSize: 14,\n /**\n * This sets the font family of Component Queue shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n component_queueFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of Component Queue shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n component_queueFontWeight: 'normal',\n\n /**\n * This sets the font size of External Component Queue shape for the diagram\n *\n * **Notes:** Default value: 14.\n */\n external_component_queueFontSize: 14,\n /**\n * This sets the font family of External Component Queue shape for the diagram\n *\n * **Notes:** Default value: \"Open Sans\", sans-serif.\n */\n external_component_queueFontFamily: '\"Open Sans\", sans-serif',\n /**\n * This sets the font weight of External Component Queue shape for the diagram\n *\n * **Notes:** Default value: normal.\n */\n external_component_queueFontWeight: 'normal',\n\n /**\n * This sets the auto-wrap state for the diagram\n *\n * **Notes:** Default value: true.\n */\n wrap: true,\n\n /**\n * This sets the auto-wrap padding for the diagram (sides only)\n *\n * **Notes:** Default value: 0.\n */\n wrapPadding: 10,\n\n personFont: function () {\n return {\n fontFamily: this.personFontFamily,\n fontSize: this.personFontSize,\n fontWeight: this.personFontWeight,\n };\n },\n\n external_personFont: function () {\n return {\n fontFamily: this.external_personFontFamily,\n fontSize: this.external_personFontSize,\n fontWeight: this.external_personFontWeight,\n };\n },\n\n systemFont: function () {\n return {\n fontFamily: this.systemFontFamily,\n fontSize: this.systemFontSize,\n fontWeight: this.systemFontWeight,\n };\n },\n\n external_systemFont: function () {\n return {\n fontFamily: this.external_systemFontFamily,\n fontSize: this.external_systemFontSize,\n fontWeight: this.external_systemFontWeight,\n };\n },\n\n system_dbFont: function () {\n return {\n fontFamily: this.system_dbFontFamily,\n fontSize: this.system_dbFontSize,\n fontWeight: this.system_dbFontWeight,\n };\n },\n\n external_system_dbFont: function () {\n return {\n fontFamily: this.external_system_dbFontFamily,\n fontSize: this.external_system_dbFontSize,\n fontWeight: this.external_system_dbFontWeight,\n };\n },\n\n system_queueFont: function () {\n return {\n fontFamily: this.system_queueFontFamily,\n fontSize: this.system_queueFontSize,\n fontWeight: this.system_queueFontWeight,\n };\n },\n\n external_system_queueFont: function () {\n return {\n fontFamily: this.external_system_queueFontFamily,\n fontSize: this.external_system_queueFontSize,\n fontWeight: this.external_system_queueFontWeight,\n };\n },\n\n containerFont: function () {\n return {\n fontFamily: this.containerFontFamily,\n fontSize: this.containerFontSize,\n fontWeight: this.containerFontWeight,\n };\n },\n\n external_containerFont: function () {\n return {\n fontFamily: this.external_containerFontFamily,\n fontSize: this.external_containerFontSize,\n fontWeight: this.external_containerFontWeight,\n };\n },\n\n container_dbFont: function () {\n return {\n fontFamily: this.container_dbFontFamily,\n fontSize: this.container_dbFontSize,\n fontWeight: this.container_dbFontWeight,\n };\n },\n\n external_container_dbFont: function () {\n return {\n fontFamily: this.external_container_dbFontFamily,\n fontSize: this.external_container_dbFontSize,\n fontWeight: this.external_container_dbFontWeight,\n };\n },\n\n container_queueFont: function () {\n return {\n fontFamily: this.container_queueFontFamily,\n fontSize: this.container_queueFontSize,\n fontWeight: this.container_queueFontWeight,\n };\n },\n\n external_container_queueFont: function () {\n return {\n fontFamily: this.external_container_queueFontFamily,\n fontSize: this.external_container_queueFontSize,\n fontWeight: this.external_container_queueFontWeight,\n };\n },\n\n componentFont: function () {\n return {\n fontFamily: this.componentFontFamily,\n fontSize: this.componentFontSize,\n fontWeight: this.componentFontWeight,\n };\n },\n\n external_componentFont: function () {\n return {\n fontFamily: this.external_componentFontFamily,\n fontSize: this.external_componentFontSize,\n fontWeight: this.external_componentFontWeight,\n };\n },\n\n component_dbFont: function () {\n return {\n fontFamily: this.component_dbFontFamily,\n fontSize: this.component_dbFontSize,\n fontWeight: this.component_dbFontWeight,\n };\n },\n\n external_component_dbFont: function () {\n return {\n fontFamily: this.external_component_dbFontFamily,\n fontSize: this.external_component_dbFontSize,\n fontWeight: this.external_component_dbFontWeight,\n };\n },\n\n component_queueFont: function () {\n return {\n fontFamily: this.component_queueFontFamily,\n fontSize: this.component_queueFontSize,\n fontWeight: this.component_queueFontWeight,\n };\n },\n\n external_component_queueFont: function () {\n return {\n fontFamily: this.external_component_queueFontFamily,\n fontSize: this.external_component_queueFontSize,\n fontWeight: this.external_component_queueFontWeight,\n };\n },\n\n boundaryFont: function () {\n return {\n fontFamily: this.boundaryFontFamily,\n fontSize: this.boundaryFontSize,\n fontWeight: this.boundaryFontWeight,\n };\n },\n\n messageFont: function () {\n return {\n fontFamily: this.messageFontFamily,\n fontSize: this.messageFontSize,\n fontWeight: this.messageFontWeight,\n };\n },\n\n // ' Colors\n // ' ##################################\n person_bg_color: '#08427B',\n person_border_color: '#073B6F',\n external_person_bg_color: '#686868',\n external_person_border_color: '#8A8A8A',\n system_bg_color: '#1168BD',\n system_border_color: '#3C7FC0',\n system_db_bg_color: '#1168BD',\n system_db_border_color: '#3C7FC0',\n system_queue_bg_color: '#1168BD',\n system_queue_border_color: '#3C7FC0',\n external_system_bg_color: '#999999',\n external_system_border_color: '#8A8A8A',\n external_system_db_bg_color: '#999999',\n external_system_db_border_color: '#8A8A8A',\n external_system_queue_bg_color: '#999999',\n external_system_queue_border_color: '#8A8A8A',\n container_bg_color: '#438DD5',\n container_border_color: '#3C7FC0',\n container_db_bg_color: '#438DD5',\n container_db_border_color: '#3C7FC0',\n container_queue_bg_color: '#438DD5',\n container_queue_border_color: '#3C7FC0',\n external_container_bg_color: '#B3B3B3',\n external_container_border_color: '#A6A6A6',\n external_container_db_bg_color: '#B3B3B3',\n external_container_db_border_color: '#A6A6A6',\n external_container_queue_bg_color: '#B3B3B3',\n external_container_queue_border_color: '#A6A6A6',\n component_bg_color: '#85BBF0',\n component_border_color: '#78A8D8',\n component_db_bg_color: '#85BBF0',\n component_db_border_color: '#78A8D8',\n component_queue_bg_color: '#85BBF0',\n component_queue_border_color: '#78A8D8',\n external_component_bg_color: '#CCCCCC',\n external_component_border_color: '#BFBFBF',\n external_component_db_bg_color: '#CCCCCC',\n external_component_db_border_color: '#BFBFBF',\n external_component_queue_bg_color: '#CCCCCC',\n external_component_queue_border_color: '#BFBFBF',\n },\n};\n\nconfig.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;\nconfig.gitGraph.arrowMarkerAbsolute = config.arrowMarkerAbsolute;\n\nconst keyify = (obj, prefix = '') =>\n Object.keys(obj).reduce((res, el) => {\n if (Array.isArray(obj[el])) {\n return res;\n } else if (typeof obj[el] === 'object' && obj[el] !== null) {\n return [...res, prefix + el, ...keyify(obj[el], '')];\n }\n return [...res, prefix + el];\n }, []);\n\nexport const configKeys = keyify(config, '');\nexport default config;\n","import mermaidAPI from '../../mermaidAPI';\nimport * as configApi from '../../config';\nimport { log } from '../../logger';\nimport { sanitizeText } from '../common/common';\nimport { setAccTitle, getAccTitle, getAccDescription, setAccDescription } from '../../commonDb';\n\nlet c4ShapeArray = [];\nlet boundaryParseStack = [''];\nlet currentBoundaryParse = 'global';\nlet parentBoundaryParse = '';\nlet boundarys = [\n {\n alias: 'global',\n label: { text: 'global' },\n type: { text: 'global' },\n tags: null,\n link: null,\n parentBoundary: '',\n },\n];\nlet rels = [];\nlet title = '';\nlet wrapEnabled = false;\nlet description = '';\nlet c4ShapeInRow = 4;\nlet c4BoundaryInRow = 2;\nvar c4Type;\n\nexport const getC4Type = function () {\n return c4Type;\n};\n\nexport const setC4Type = function (c4TypeParam) {\n let sanitizedText = sanitizeText(c4TypeParam, configApi.getConfig());\n c4Type = sanitizedText;\n};\n\nexport const parseDirective = function (statement, context, type) {\n mermaidAPI.parseDirective(this, statement, context, type);\n};\n\n//type, from, to, label, ?techn, ?descr, ?sprite, ?tags, $link\nexport const addRel = function (type, from, to, label, techn, descr, sprite, tags, link) {\n // Don't allow label nulling\n if (\n type === undefined ||\n type === null ||\n from === undefined ||\n from === null ||\n to === undefined ||\n to === null ||\n label === undefined ||\n label === null\n )\n return;\n\n let rel = {};\n const old = rels.find((rel) => rel.from === from && rel.to === to);\n if (old) {\n rel = old;\n } else {\n rels.push(rel);\n }\n\n rel.type = type;\n rel.from = from;\n rel.to = to;\n rel.label = { text: label };\n\n if (techn === undefined || techn === null) {\n rel.techn = { text: '' };\n } else {\n if (typeof techn === 'object') {\n let [key, value] = Object.entries(techn)[0];\n rel[key] = { text: value };\n } else {\n rel.techn = { text: techn };\n }\n }\n\n if (descr === undefined || descr === null) {\n rel.descr = { text: '' };\n } else {\n if (typeof descr === 'object') {\n let [key, value] = Object.entries(descr)[0];\n rel[key] = { text: value };\n } else {\n rel.descr = { text: descr };\n }\n }\n\n if (typeof sprite === 'object') {\n let [key, value] = Object.entries(sprite)[0];\n rel[key] = value;\n } else {\n rel.sprite = sprite;\n }\n if (typeof tags === 'object') {\n let [key, value] = Object.entries(tags)[0];\n rel[key] = value;\n } else {\n rel.tags = tags;\n }\n if (typeof link === 'object') {\n let [key, value] = Object.entries(link)[0];\n rel[key] = value;\n } else {\n rel.link = link;\n }\n rel.wrap = autoWrap();\n};\n\n//type, alias, label, ?descr, ?sprite, ?tags, $link\nexport const addPersonOrSystem = function (typeC4Shape, alias, label, descr, sprite, tags, link) {\n // Don't allow label nulling\n if (alias === null || label === null) return;\n\n let personOrSystem = {};\n const old = c4ShapeArray.find((personOrSystem) => personOrSystem.alias === alias);\n if (old && alias === old.alias) {\n personOrSystem = old;\n } else {\n personOrSystem.alias = alias;\n c4ShapeArray.push(personOrSystem);\n }\n\n // Don't allow null labels, either\n if (label === undefined || label === null) {\n personOrSystem.label = { text: '' };\n } else {\n personOrSystem.label = { text: label };\n }\n\n if (descr === undefined || descr === null) {\n personOrSystem.descr = { text: '' };\n } else {\n if (typeof descr === 'object') {\n let [key, value] = Object.entries(descr)[0];\n personOrSystem[key] = { text: value };\n } else {\n personOrSystem.descr = { text: descr };\n }\n }\n\n if (typeof sprite === 'object') {\n let [key, value] = Object.entries(sprite)[0];\n personOrSystem[key] = value;\n } else {\n personOrSystem.sprite = sprite;\n }\n if (typeof tags === 'object') {\n let [key, value] = Object.entries(tags)[0];\n personOrSystem[key] = value;\n } else {\n personOrSystem.tags = tags;\n }\n if (typeof link === 'object') {\n let [key, value] = Object.entries(link)[0];\n personOrSystem[key] = value;\n } else {\n personOrSystem.link = link;\n }\n personOrSystem.typeC4Shape = { text: typeC4Shape };\n personOrSystem.parentBoundary = currentBoundaryParse;\n personOrSystem.wrap = autoWrap();\n};\n\n//type, alias, label, ?techn, ?descr ?sprite, ?tags, $link\nexport const addContainer = function (typeC4Shape, alias, label, techn, descr, sprite, tags, link) {\n // Don't allow label nulling\n if (alias === null || label === null) return;\n\n let container = {};\n const old = c4ShapeArray.find((container) => container.alias === alias);\n if (old && alias === old.alias) {\n container = old;\n } else {\n container.alias = alias;\n c4ShapeArray.push(container);\n }\n\n // Don't allow null labels, either\n if (label === undefined || label === null) {\n container.label = { text: '' };\n } else {\n container.label = { text: label };\n }\n\n if (techn === undefined || techn === null) {\n container.techn = { text: '' };\n } else {\n if (typeof techn === 'object') {\n let [key, value] = Object.entries(techn)[0];\n container[key] = { text: value };\n } else {\n container.techn = { text: techn };\n }\n }\n\n if (descr === undefined || descr === null) {\n container.descr = { text: '' };\n } else {\n if (typeof descr === 'object') {\n let [key, value] = Object.entries(descr)[0];\n container[key] = { text: value };\n } else {\n container.descr = { text: descr };\n }\n }\n\n if (typeof sprite === 'object') {\n let [key, value] = Object.entries(sprite)[0];\n container[key] = value;\n } else {\n container.sprite = sprite;\n }\n if (typeof tags === 'object') {\n let [key, value] = Object.entries(tags)[0];\n container[key] = value;\n } else {\n container.tags = tags;\n }\n if (typeof link === 'object') {\n let [key, value] = Object.entries(link)[0];\n container[key] = value;\n } else {\n container.link = link;\n }\n container.wrap = autoWrap();\n container.typeC4Shape = { text: typeC4Shape };\n container.parentBoundary = currentBoundaryParse;\n};\n\n//type, alias, label, ?techn, ?descr ?sprite, ?tags, $link\nexport const addComponent = function (typeC4Shape, alias, label, techn, descr, sprite, tags, link) {\n // Don't allow label nulling\n if (alias === null || label === null) return;\n\n let component = {};\n const old = c4ShapeArray.find((component) => component.alias === alias);\n if (old && alias === old.alias) {\n component = old;\n } else {\n component.alias = alias;\n c4ShapeArray.push(component);\n }\n\n // Don't allow null labels, either\n if (label === undefined || label === null) {\n component.label = { text: '' };\n } else {\n component.label = { text: label };\n }\n\n if (techn === undefined || techn === null) {\n component.techn = { text: '' };\n } else {\n if (typeof techn === 'object') {\n let [key, value] = Object.entries(techn)[0];\n component[key] = { text: value };\n } else {\n component.techn = { text: techn };\n }\n }\n\n if (descr === undefined || descr === null) {\n component.descr = { text: '' };\n } else {\n if (typeof descr === 'object') {\n let [key, value] = Object.entries(descr)[0];\n component[key] = { text: value };\n } else {\n component.descr = { text: descr };\n }\n }\n\n if (typeof sprite === 'object') {\n let [key, value] = Object.entries(sprite)[0];\n component[key] = value;\n } else {\n component.sprite = sprite;\n }\n if (typeof tags === 'object') {\n let [key, value] = Object.entries(tags)[0];\n component[key] = value;\n } else {\n component.tags = tags;\n }\n if (typeof link === 'object') {\n let [key, value] = Object.entries(link)[0];\n component[key] = value;\n } else {\n component.link = link;\n }\n component.wrap = autoWrap();\n component.typeC4Shape = { text: typeC4Shape };\n component.parentBoundary = currentBoundaryParse;\n};\n\n//alias, label, ?type, ?tags, $link\nexport const addPersonOrSystemBoundary = function (alias, label, type, tags, link) {\n // if (parentBoundary === null) return;\n\n // Don't allow label nulling\n if (alias === null || label === null) return;\n\n let boundary = {};\n const old = boundarys.find((boundary) => boundary.alias === alias);\n if (old && alias === old.alias) {\n boundary = old;\n } else {\n boundary.alias = alias;\n boundarys.push(boundary);\n }\n\n // Don't allow null labels, either\n if (label === undefined || label === null) {\n boundary.label = { text: '' };\n } else {\n boundary.label = { text: label };\n }\n\n if (type === undefined || type === null) {\n boundary.type = { text: 'system' };\n } else {\n if (typeof type === 'object') {\n let [key, value] = Object.entries(type)[0];\n boundary[key] = { text: value };\n } else {\n boundary.type = { text: type };\n }\n }\n\n if (typeof tags === 'object') {\n let [key, value] = Object.entries(tags)[0];\n boundary[key] = value;\n } else {\n boundary.tags = tags;\n }\n if (typeof link === 'object') {\n let [key, value] = Object.entries(link)[0];\n boundary[key] = value;\n } else {\n boundary.link = link;\n }\n boundary.parentBoundary = currentBoundaryParse;\n boundary.wrap = autoWrap();\n\n parentBoundaryParse = currentBoundaryParse;\n currentBoundaryParse = alias;\n boundaryParseStack.push(parentBoundaryParse);\n};\n\n//alias, label, ?type, ?tags, $link\nexport const addContainerBoundary = function (alias, label, type, tags, link) {\n // if (parentBoundary === null) return;\n\n // Don't allow label nulling\n if (alias === null || label === null) return;\n\n let boundary = {};\n const old = boundarys.find((boundary) => boundary.alias === alias);\n if (old && alias === old.alias) {\n boundary = old;\n } else {\n boundary.alias = alias;\n boundarys.push(boundary);\n }\n\n // Don't allow null labels, either\n if (label === undefined || label === null) {\n boundary.label = { text: '' };\n } else {\n boundary.label = { text: label };\n }\n\n if (type === undefined || type === null) {\n boundary.type = { text: 'container' };\n } else {\n if (typeof type === 'object') {\n let [key, value] = Object.entries(type)[0];\n boundary[key] = { text: value };\n } else {\n boundary.type = { text: type };\n }\n }\n\n if (typeof tags === 'object') {\n let [key, value] = Object.entries(tags)[0];\n boundary[key] = value;\n } else {\n boundary.tags = tags;\n }\n if (typeof link === 'object') {\n let [key, value] = Object.entries(link)[0];\n boundary[key] = value;\n } else {\n boundary.link = link;\n }\n boundary.parentBoundary = currentBoundaryParse;\n boundary.wrap = autoWrap();\n\n parentBoundaryParse = currentBoundaryParse;\n currentBoundaryParse = alias;\n boundaryParseStack.push(parentBoundaryParse);\n};\n\n//alias, label, ?type, ?descr, ?sprite, ?tags, $link\nexport const addDeploymentNode = function (\n nodeType,\n alias,\n label,\n type,\n descr,\n sprite,\n tags,\n link\n) {\n // if (parentBoundary === null) return;\n\n // Don't allow label nulling\n if (alias === null || label === null) return;\n\n let boundary = {};\n const old = boundarys.find((boundary) => boundary.alias === alias);\n if (old && alias === old.alias) {\n boundary = old;\n } else {\n boundary.alias = alias;\n boundarys.push(boundary);\n }\n\n // Don't allow null labels, either\n if (label === undefined || label === null) {\n boundary.label = { text: '' };\n } else {\n boundary.label = { text: label };\n }\n\n if (type === undefined || type === null) {\n boundary.type = { text: 'node' };\n } else {\n if (typeof type === 'object') {\n let [key, value] = Object.entries(type)[0];\n boundary[key] = { text: value };\n } else {\n boundary.type = { text: type };\n }\n }\n\n if (descr === undefined || descr === null) {\n boundary.descr = { text: '' };\n } else {\n if (typeof descr === 'object') {\n let [key, value] = Object.entries(descr)[0];\n boundary[key] = { text: value };\n } else {\n boundary.descr = { text: descr };\n }\n }\n\n if (typeof tags === 'object') {\n let [key, value] = Object.entries(tags)[0];\n boundary[key] = value;\n } else {\n boundary.tags = tags;\n }\n if (typeof link === 'object') {\n let [key, value] = Object.entries(link)[0];\n boundary[key] = value;\n } else {\n boundary.link = link;\n }\n boundary.nodeType = nodeType;\n boundary.parentBoundary = currentBoundaryParse;\n boundary.wrap = autoWrap();\n\n parentBoundaryParse = currentBoundaryParse;\n currentBoundaryParse = alias;\n boundaryParseStack.push(parentBoundaryParse);\n};\n\nexport const popBoundaryParseStack = function () {\n currentBoundaryParse = parentBoundaryParse;\n boundaryParseStack.pop();\n parentBoundaryParse = boundaryParseStack.pop();\n boundaryParseStack.push(parentBoundaryParse);\n};\n\n//elementName, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?sprite, ?techn, ?legendText, ?legendSprite\nexport const updateElStyle = function (\n typeC4Shape,\n elementName,\n bgColor,\n fontColor,\n borderColor,\n shadowing,\n shape,\n sprite,\n techn,\n legendText,\n legendSprite\n) {\n let old = c4ShapeArray.find((element) => element.alias === elementName);\n if (old === undefined) {\n old = boundarys.find((element) => element.alias === elementName);\n if (old === undefined) {\n return;\n }\n }\n if (bgColor !== undefined && bgColor !== null) {\n if (typeof bgColor === 'object') {\n let [key, value] = Object.entries(bgColor)[0];\n old[key] = value;\n } else {\n old.bgColor = bgColor;\n }\n }\n if (fontColor !== undefined && fontColor !== null) {\n if (typeof fontColor === 'object') {\n let [key, value] = Object.entries(fontColor)[0];\n old[key] = value;\n } else {\n old.fontColor = fontColor;\n }\n }\n if (borderColor !== undefined && borderColor !== null) {\n if (typeof borderColor === 'object') {\n let [key, value] = Object.entries(borderColor)[0];\n old[key] = value;\n } else {\n old.borderColor = borderColor;\n }\n }\n if (shadowing !== undefined && shadowing !== null) {\n if (typeof shadowing === 'object') {\n let [key, value] = Object.entries(shadowing)[0];\n old[key] = value;\n } else {\n old.shadowing = shadowing;\n }\n }\n if (shape !== undefined && shape !== null) {\n if (typeof shape === 'object') {\n let [key, value] = Object.entries(shape)[0];\n old[key] = value;\n } else {\n old.shape = shape;\n }\n }\n if (sprite !== undefined && sprite !== null) {\n if (typeof sprite === 'object') {\n let [key, value] = Object.entries(sprite)[0];\n old[key] = value;\n } else {\n old.sprite = sprite;\n }\n }\n if (techn !== undefined && techn !== null) {\n if (typeof techn === 'object') {\n let [key, value] = Object.entries(techn)[0];\n old[key] = value;\n } else {\n old.techn = techn;\n }\n }\n if (legendText !== undefined && legendText !== null) {\n if (typeof legendText === 'object') {\n let [key, value] = Object.entries(legendText)[0];\n old[key] = value;\n } else {\n old.legendText = legendText;\n }\n }\n if (legendSprite !== undefined && legendSprite !== null) {\n if (typeof legendSprite === 'object') {\n let [key, value] = Object.entries(legendSprite)[0];\n old[key] = value;\n } else {\n old.legendSprite = legendSprite;\n }\n }\n};\n\n//textColor, lineColor, ?offsetX, ?offsetY\nexport const updateRelStyle = function (\n typeC4Shape,\n from,\n to,\n textColor,\n lineColor,\n offsetX,\n offsetY\n) {\n const old = rels.find((rel) => rel.from === from && rel.to === to);\n if (old === undefined) {\n return;\n }\n if (textColor !== undefined && textColor !== null) {\n if (typeof textColor === 'object') {\n let [key, value] = Object.entries(textColor)[0];\n old[key] = value;\n } else {\n old.textColor = textColor;\n }\n }\n if (lineColor !== undefined && lineColor !== null) {\n if (typeof lineColor === 'object') {\n let [key, value] = Object.entries(lineColor)[0];\n old[key] = value;\n } else {\n old.lineColor = lineColor;\n }\n }\n if (offsetX !== undefined && offsetX !== null) {\n if (typeof offsetX === 'object') {\n let [key, value] = Object.entries(offsetX)[0];\n old[key] = parseInt(value);\n } else {\n old.offsetX = parseInt(offsetX);\n }\n }\n if (offsetY !== undefined && offsetY !== null) {\n if (typeof offsetY === 'object') {\n let [key, value] = Object.entries(offsetY)[0];\n old[key] = parseInt(value);\n } else {\n old.offsetY = parseInt(offsetY);\n }\n }\n};\n\n//?c4ShapeInRow, ?c4BoundaryInRow\nexport const updateLayoutConfig = function (typeC4Shape, c4ShapeInRowParam, c4BoundaryInRowParam) {\n let c4ShapeInRowValue = c4ShapeInRow;\n let c4BoundaryInRowValue = c4BoundaryInRow;\n\n if (typeof c4ShapeInRowParam === 'object') {\n let [key, value] = Object.entries(c4ShapeInRowParam)[0];\n c4ShapeInRowValue = parseInt(value);\n } else {\n c4ShapeInRowValue = parseInt(c4ShapeInRowParam);\n }\n if (typeof c4BoundaryInRowParam === 'object') {\n let [key, value] = Object.entries(c4BoundaryInRowParam)[0];\n c4BoundaryInRowValue = parseInt(value);\n } else {\n c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam);\n }\n\n if (c4ShapeInRowValue >= 1) c4ShapeInRow = c4ShapeInRowValue;\n if (c4BoundaryInRowValue >= 1) c4BoundaryInRow = c4BoundaryInRowValue;\n};\n\nexport const getC4ShapeInRow = function () {\n return c4ShapeInRow;\n};\nexport const getC4BoundaryInRow = function () {\n return c4BoundaryInRow;\n};\nexport const getCurrentBoundaryParse = function () {\n return currentBoundaryParse;\n};\n\nexport const getParentBoundaryParse = function () {\n return parentBoundaryParse;\n};\n\nexport const getC4ShapeArray = function (parentBoundary) {\n if (parentBoundary === undefined || parentBoundary === null) return c4ShapeArray;\n else\n return c4ShapeArray.filter((personOrSystem) => {\n return personOrSystem.parentBoundary === parentBoundary;\n });\n};\nexport const getC4Shape = function (alias) {\n return c4ShapeArray.find((personOrSystem) => personOrSystem.alias === alias);\n};\nexport const getC4ShapeKeys = function (parentBoundary) {\n return Object.keys(getC4ShapeArray(parentBoundary));\n};\n\nexport const getBoundarys = function (parentBoundary) {\n if (parentBoundary === undefined || parentBoundary === null) return boundarys;\n else return boundarys.filter((boundary) => boundary.parentBoundary === parentBoundary);\n};\n\nexport const getRels = function () {\n return rels;\n};\n\nexport const getTitle = function () {\n return title;\n};\n\nexport const setWrap = function (wrapSetting) {\n wrapEnabled = wrapSetting;\n};\n\nexport const autoWrap = function () {\n return wrapEnabled;\n};\n\nexport const clear = function () {\n c4ShapeArray = [];\n boundarys = [\n {\n alias: 'global',\n label: { text: 'global' },\n type: { text: 'global' },\n tags: null,\n link: null,\n parentBoundary: '',\n },\n ];\n parentBoundaryParse = '';\n currentBoundaryParse = 'global';\n boundaryParseStack = [''];\n rels = [];\n\n boundaryParseStack = [''];\n title = '';\n wrapEnabled = false;\n description = '';\n c4ShapeInRow = 4;\n c4BoundaryInRow = 2;\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};\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 setTitle = function (txt) {\n let sanitizedText = sanitizeText(txt, configApi.getConfig());\n title = sanitizedText;\n};\n\nexport default {\n addPersonOrSystem,\n addPersonOrSystemBoundary,\n addContainer,\n addContainerBoundary,\n addComponent,\n addDeploymentNode,\n popBoundaryParseStack,\n addRel,\n updateElStyle,\n updateRelStyle,\n updateLayoutConfig,\n autoWrap,\n setWrap,\n getC4ShapeArray,\n getC4Shape,\n getC4ShapeKeys,\n getBoundarys,\n getCurrentBoundaryParse,\n getParentBoundaryParse,\n getRels,\n getTitle,\n getC4Type,\n getC4ShapeInRow,\n getC4BoundaryInRow,\n setAccTitle,\n getAccTitle,\n getAccDescription,\n setAccDescription,\n parseDirective,\n getConfig: () => configApi.getConfig().c4,\n clear,\n LINETYPE,\n ARROWTYPE,\n PLACEMENT,\n setTitle,\n setC4Type,\n // apply,\n};\n","import { select } from 'd3';\nimport svgDraw, { drawText, fixLifeLineHeights } from './svgDraw';\nimport { log } from '../../logger';\nimport { parser } from './parser/c4Diagram';\nimport common from '../common/common';\nimport c4Db from './c4Db';\nimport * as configApi from '../../config';\nimport utils, {\n wrapLabel,\n calculateTextWidth,\n calculateTextHeight,\n assignWithDepth,\n configureSvgSize,\n} from '../../utils';\nimport addSVGAccessibilityFields from '../../accessibility';\n\nlet globalBoundaryMaxX = 0,\n globalBoundaryMaxY = 0;\n\nlet c4ShapeInRow = 4;\nlet c4BoundaryInRow = 2;\n\nparser.yy = c4Db;\n\nlet conf = {};\n\nclass Bounds {\n constructor() {\n this.name = '';\n this.data = {};\n this.data.startx = undefined;\n this.data.stopx = undefined;\n this.data.starty = undefined;\n this.data.stopy = undefined;\n this.data.widthLimit = undefined;\n\n this.nextData = {};\n this.nextData.startx = undefined;\n this.nextData.stopx = undefined;\n this.nextData.starty = undefined;\n this.nextData.stopy = undefined;\n this.nextData.cnt = 0;\n\n setConf(parser.yy.getConfig());\n }\n\n setData(startx, stopx, starty, stopy) {\n this.nextData.startx = this.data.startx = startx;\n this.nextData.stopx = this.data.stopx = stopx;\n this.nextData.starty = this.data.starty = starty;\n this.nextData.stopy = this.data.stopy = stopy;\n }\n\n updateVal(obj, key, val, fun) {\n if (typeof obj[key] === 'undefined') {\n obj[key] = val;\n } else {\n obj[key] = fun(val, obj[key]);\n }\n }\n\n insert(c4Shape) {\n this.nextData.cnt = this.nextData.cnt + 1;\n let _startx =\n this.nextData.startx === this.nextData.stopx\n ? this.nextData.stopx + c4Shape.margin\n : this.nextData.stopx + c4Shape.margin * 2;\n let _stopx = _startx + c4Shape.width;\n let _starty = this.nextData.starty + c4Shape.margin * 2;\n let _stopy = _starty + c4Shape.height;\n if (\n _startx >= this.data.widthLimit ||\n _stopx >= this.data.widthLimit ||\n this.nextData.cnt > c4ShapeInRow\n ) {\n _startx = this.nextData.startx + c4Shape.margin + conf.nextLinePaddingX;\n _starty = this.nextData.stopy + c4Shape.margin * 2;\n\n this.nextData.stopx = _stopx = _startx + c4Shape.width;\n this.nextData.starty = this.nextData.stopy;\n this.nextData.stopy = _stopy = _starty + c4Shape.height;\n this.nextData.cnt = 1;\n }\n\n c4Shape.x = _startx;\n c4Shape.y = _starty;\n\n this.updateVal(this.data, 'startx', _startx, Math.min);\n this.updateVal(this.data, 'starty', _starty, Math.min);\n this.updateVal(this.data, 'stopx', _stopx, Math.max);\n this.updateVal(this.data, 'stopy', _stopy, Math.max);\n\n this.updateVal(this.nextData, 'startx', _startx, Math.min);\n this.updateVal(this.nextData, 'starty', _starty, Math.min);\n this.updateVal(this.nextData, 'stopx', _stopx, Math.max);\n this.updateVal(this.nextData, 'stopy', _stopy, Math.max);\n }\n\n init() {\n this.name = '';\n this.data = {\n startx: undefined,\n stopx: undefined,\n starty: undefined,\n stopy: undefined,\n widthLimit: undefined,\n };\n this.nextData = {\n startx: undefined,\n stopx: undefined,\n starty: undefined,\n stopy: undefined,\n cnt: 0,\n };\n setConf(parser.yy.getConfig());\n }\n\n bumpLastMargin(margin) {\n this.data.stopx += margin;\n this.data.stopy += margin;\n }\n}\n\nexport const setConf = function (cnf) {\n assignWithDepth(conf, cnf);\n\n if (cnf.fontFamily) {\n conf.personFontFamily = conf.systemFontFamily = conf.messageFontFamily = cnf.fontFamily;\n }\n if (cnf.fontSize) {\n conf.personFontSize = conf.systemFontSize = conf.messageFontSize = cnf.fontSize;\n }\n if (cnf.fontWeight) {\n conf.personFontWeight = conf.systemFontWeight = conf.messageFontWeight = cnf.fontWeight;\n }\n};\n\nconst c4ShapeFont = (cnf, typeC4Shape) => {\n return {\n fontFamily: cnf[typeC4Shape + 'FontFamily'],\n fontSize: cnf[typeC4Shape + 'FontSize'],\n fontWeight: cnf[typeC4Shape + 'FontWeight'],\n };\n};\n\nconst boundaryFont = (cnf) => {\n return {\n fontFamily: cnf.boundaryFontFamily,\n fontSize: cnf.boundaryFontSize,\n fontWeight: cnf.boundaryFontWeight,\n };\n};\n\nconst messageFont = (cnf) => {\n return {\n fontFamily: cnf.messageFontFamily,\n fontSize: cnf.messageFontSize,\n fontWeight: cnf.messageFontWeight,\n };\n};\n\n/**\n * @param textType\n * @param c4Shape\n * @param c4ShapeTextWrap\n * @param textConf\n * @param textLimitWidth\n */\nfunction calcC4ShapeTextWH(textType, c4Shape, c4ShapeTextWrap, textConf, textLimitWidth) {\n if (!c4Shape[textType].width) {\n if (c4ShapeTextWrap) {\n c4Shape[textType].text = wrapLabel(c4Shape[textType].text, textLimitWidth, textConf);\n c4Shape[textType].textLines = c4Shape[textType].text.split(common.lineBreakRegex).length;\n // c4Shape[textType].width = calculateTextWidth(c4Shape[textType].text, textConf);\n c4Shape[textType].width = textLimitWidth;\n // c4Shape[textType].height = c4Shape[textType].textLines * textConf.fontSize;\n c4Shape[textType].height = calculateTextHeight(c4Shape[textType].text, textConf);\n } else {\n let lines = c4Shape[textType].text.split(common.lineBreakRegex);\n c4Shape[textType].textLines = lines.length;\n let lineHeight = 0;\n c4Shape[textType].height = 0;\n c4Shape[textType].width = 0;\n for (let i = 0; i < lines.length; i++) {\n c4Shape[textType].width = Math.max(\n calculateTextWidth(lines[i], textConf),\n c4Shape[textType].width\n );\n lineHeight = calculateTextHeight(lines[i], textConf);\n c4Shape[textType].height = c4Shape[textType].height + lineHeight;\n }\n // c4Shapes[textType].height = c4Shapes[textType].textLines * textConf.fontSize;\n }\n }\n}\n\nexport const drawBoundary = function (diagram, boundary, bounds) {\n boundary.x = bounds.data.startx;\n boundary.y = bounds.data.starty;\n boundary.width = bounds.data.stopx - bounds.data.startx;\n boundary.height = bounds.data.stopy - bounds.data.starty;\n\n boundary.label.y = conf.c4ShapeMargin - 35;\n\n let boundaryTextWrap = boundary.wrap && conf.wrap;\n let boundaryLabelConf = boundaryFont(conf);\n boundaryLabelConf.fontSize = boundaryLabelConf.fontSize + 2;\n boundaryLabelConf.fontWeight = 'bold';\n let textLimitWidth = calculateTextWidth(boundary.label.text, boundaryLabelConf);\n calcC4ShapeTextWH('label', boundary, boundaryTextWrap, boundaryLabelConf, textLimitWidth);\n\n svgDraw.drawBoundary(diagram, boundary, conf);\n};\n\nexport const drawC4ShapeArray = function (currentBounds, diagram, c4ShapeArray, c4ShapeKeys) {\n // Upper Y is relative point\n let Y = 0;\n // Draw the c4ShapeArray\n for (let i = 0; i < c4ShapeKeys.length; i++) {\n Y = 0;\n const c4Shape = c4ShapeArray[c4ShapeKeys[i]];\n\n // calc c4 shape type width and height\n\n let c4ShapeTypeConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);\n c4ShapeTypeConf.fontSize = c4ShapeTypeConf.fontSize - 2;\n c4Shape.typeC4Shape.width = calculateTextWidth(\n '<<' + c4Shape.typeC4Shape.text + '>>',\n c4ShapeTypeConf\n );\n c4Shape.typeC4Shape.height = c4ShapeTypeConf.fontSize + 2;\n c4Shape.typeC4Shape.Y = conf.c4ShapePadding;\n Y = c4Shape.typeC4Shape.Y + c4Shape.typeC4Shape.height - 4;\n\n // set image width and height c4Shape.x + c4Shape.width / 2 - 24, c4Shape.y + 28\n // let imageWidth = 0,\n // imageHeight = 0,\n // imageY = 0;\n //\n c4Shape.image = { width: 0, height: 0, Y: 0 };\n switch (c4Shape.typeC4Shape.text) {\n case 'person':\n case 'external_person':\n c4Shape.image.width = 48;\n c4Shape.image.height = 48;\n c4Shape.image.Y = Y;\n Y = c4Shape.image.Y + c4Shape.image.height;\n break;\n }\n if (c4Shape.sprite) {\n c4Shape.image.width = 48;\n c4Shape.image.height = 48;\n c4Shape.image.Y = Y;\n Y = c4Shape.image.Y + c4Shape.image.height;\n }\n\n // Y = conf.c4ShapePadding + c4Shape.image.height;\n\n let c4ShapeTextWrap = c4Shape.wrap && conf.wrap;\n let textLimitWidth = conf.width - conf.c4ShapePadding * 2;\n\n let c4ShapeLabelConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);\n c4ShapeLabelConf.fontSize = c4ShapeLabelConf.fontSize + 2;\n c4ShapeLabelConf.fontWeight = 'bold';\n calcC4ShapeTextWH('label', c4Shape, c4ShapeTextWrap, c4ShapeLabelConf, textLimitWidth);\n c4Shape['label'].Y = Y + 8;\n Y = c4Shape['label'].Y + c4Shape['label'].height;\n\n if (c4Shape.type && c4Shape.type.text !== '') {\n c4Shape.type.text = '[' + c4Shape.type.text + ']';\n let c4ShapeTypeConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);\n calcC4ShapeTextWH('type', c4Shape, c4ShapeTextWrap, c4ShapeTypeConf, textLimitWidth);\n c4Shape['type'].Y = Y + 5;\n Y = c4Shape['type'].Y + c4Shape['type'].height;\n } else if (c4Shape.techn && c4Shape.techn.text !== '') {\n c4Shape.techn.text = '[' + c4Shape.techn.text + ']';\n let c4ShapeTechnConf = c4ShapeFont(conf, c4Shape.techn.text);\n calcC4ShapeTextWH('techn', c4Shape, c4ShapeTextWrap, c4ShapeTechnConf, textLimitWidth);\n c4Shape['techn'].Y = Y + 5;\n Y = c4Shape['techn'].Y + c4Shape['techn'].height;\n }\n\n let rectHeight = Y;\n let rectWidth = c4Shape.label.width;\n\n if (c4Shape.descr && c4Shape.descr.text !== '') {\n let c4ShapeDescrConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text);\n calcC4ShapeTextWH('descr', c4Shape, c4ShapeTextWrap, c4ShapeDescrConf, textLimitWidth);\n c4Shape['descr'].Y = Y + 20;\n Y = c4Shape['descr'].Y + c4Shape['descr'].height;\n\n rectWidth = Math.max(c4Shape.label.width, c4Shape.descr.width);\n rectHeight = Y - c4Shape['descr'].textLines * 5;\n }\n\n rectWidth = rectWidth + conf.c4ShapePadding;\n // let rectHeight =\n\n c4Shape.width = Math.max(c4Shape.width || conf.width, rectWidth, conf.width);\n c4Shape.height = Math.max(c4Shape.height || conf.height, rectHeight, conf.height);\n c4Shape.margin = c4Shape.margin || conf.c4ShapeMargin;\n\n currentBounds.insert(c4Shape);\n\n const height = svgDraw.drawC4Shape(diagram, c4Shape, conf);\n }\n\n currentBounds.bumpLastMargin(conf.c4ShapeMargin);\n};\n\nclass Point {\n constructor(x, y) {\n this.x = x;\n this.y = y;\n }\n}\n\n/* * *\n * Get the intersection of the line between the center point of a rectangle and a point outside the rectangle.\n * Algorithm idea.\n * Using a point outside the rectangle as the coordinate origin, the graph is divided into four quadrants, and each quadrant is divided into two cases, with separate treatment on the coordinate axes\n * 1. The case of coordinate axes.\n * 1. The case of the negative x-axis\n * 2. The case of the positive x-axis\n * 3. The case of the positive y-axis\n * 4. The negative y-axis case\n * 2. Quadrant cases.\n * 2.1. first quadrant: the case where the line intersects the left side of the rectangle; the case where it intersects the lower side of the rectangle\n * 2.2. second quadrant: the case where the line intersects the right side of the rectangle; the case where it intersects the lower edge of the rectangle\n * 2.3. third quadrant: the case where the line intersects the right side of the rectangle; the case where it intersects the upper edge of the rectangle\n * 2.4. fourth quadrant: the case where the line intersects the left side of the rectangle; the case where it intersects the upper side of the rectangle\n *\n */\nlet getIntersectPoint = function (fromNode, endPoint) {\n let x1 = fromNode.x;\n\n let y1 = fromNode.y;\n\n let x2 = endPoint.x;\n\n let y2 = endPoint.y;\n\n let fromCenterX = x1 + fromNode.width / 2;\n\n let fromCenterY = y1 + fromNode.height / 2;\n\n let dx = Math.abs(x1 - x2);\n\n let dy = Math.abs(y1 - y2);\n\n let tanDYX = dy / dx;\n\n let fromDYX = fromNode.height / fromNode.width;\n\n let returnPoint = null;\n\n if (y1 == y2 && x1 < x2) {\n returnPoint = new Point(x1 + fromNode.width, fromCenterY);\n } else if (y1 == y2 && x1 > x2) {\n returnPoint = new Point(x1, fromCenterY);\n } else if (x1 == x2 && y1 < y2) {\n returnPoint = new Point(fromCenterX, y1 + fromNode.height);\n } else if (x1 == x2 && y1 > y2) {\n returnPoint = new Point(fromCenterX, y1);\n }\n\n if (x1 > x2 && y1 < y2) {\n if (fromDYX >= tanDYX) {\n returnPoint = new Point(x1, fromCenterY + (tanDYX * fromNode.width) / 2);\n } else {\n returnPoint = new Point(\n fromCenterX - ((dx / dy) * fromNode.height) / 2,\n y1 + fromNode.height\n );\n }\n } else if (x1 < x2 && y1 < y2) {\n //\n if (fromDYX >= tanDYX) {\n returnPoint = new Point(x1 + fromNode.width, fromCenterY + (tanDYX * fromNode.width) / 2);\n } else {\n returnPoint = new Point(\n fromCenterX + ((dx / dy) * fromNode.height) / 2,\n y1 + fromNode.height\n );\n }\n } else if (x1 < x2 && y1 > y2) {\n if (fromDYX >= tanDYX) {\n returnPoint = new Point(x1 + fromNode.width, fromCenterY - (tanDYX * fromNode.width) / 2);\n } else {\n returnPoint = new Point(fromCenterX + ((fromNode.height / 2) * dx) / dy, y1);\n }\n } else if (x1 > x2 && y1 > y2) {\n if (fromDYX >= tanDYX) {\n returnPoint = new Point(x1, fromCenterY - (fromNode.width / 2) * tanDYX);\n } else {\n returnPoint = new Point(fromCenterX - ((fromNode.height / 2) * dx) / dy, y1);\n }\n }\n return returnPoint;\n};\n\nlet getIntersectPoints = function (fromNode, endNode) {\n let endIntersectPoint = { x: 0, y: 0 };\n endIntersectPoint.x = endNode.x + endNode.width / 2;\n endIntersectPoint.y = endNode.y + endNode.height / 2;\n let startPoint = getIntersectPoint(fromNode, endIntersectPoint);\n\n endIntersectPoint.x = fromNode.x + fromNode.width / 2;\n endIntersectPoint.y = fromNode.y + fromNode.height / 2;\n let endPoint = getIntersectPoint(endNode, endIntersectPoint);\n return { startPoint: startPoint, endPoint: endPoint };\n};\n\nexport const drawRels = function (diagram, rels, getC4ShapeObj) {\n let i = 0;\n for (let rel of rels) {\n i = i + 1;\n let relTextWrap = rel.wrap && conf.wrap;\n let relConf = messageFont(conf);\n let diagramType = parser.yy.getC4Type();\n if (diagramType === 'C4Dynamic') rel.label.text = i + ': ' + rel.label.text;\n let textLimitWidth = calculateTextWidth(rel.label.text, relConf);\n calcC4ShapeTextWH('label', rel, relTextWrap, relConf, textLimitWidth);\n\n if (rel.techn && rel.techn.text !== '') {\n textLimitWidth = calculateTextWidth(rel.techn.text, relConf);\n calcC4ShapeTextWH('techn', rel, relTextWrap, relConf, textLimitWidth);\n }\n\n if (rel.descr && rel.descr.text !== '') {\n textLimitWidth = calculateTextWidth(rel.descr.text, relConf);\n calcC4ShapeTextWH('descr', rel, relTextWrap, relConf, textLimitWidth);\n }\n\n let fromNode = getC4ShapeObj(rel.from);\n let endNode = getC4ShapeObj(rel.to);\n let points = getIntersectPoints(fromNode, endNode);\n rel.startPoint = points.startPoint;\n rel.endPoint = points.endPoint;\n }\n svgDraw.drawRels(diagram, rels, conf);\n};\n\n/**\n * @param diagram\n * @param parentBoundaryAlias\n * @param parentBounds\n * @param currentBoundarys\n */\nfunction drawInsideBoundary(diagram, parentBoundaryAlias, parentBounds, currentBoundarys) {\n let currentBounds = new Bounds();\n // Calculate the width limit of the boundar. label/type 的长度,\n currentBounds.data.widthLimit =\n parentBounds.data.widthLimit / Math.min(c4BoundaryInRow, currentBoundarys.length);\n // Math.min(\n // conf.width * conf.c4ShapeInRow + conf.c4ShapeMargin * conf.c4ShapeInRow * 2,\n // parentBounds.data.widthLimit / Math.min(conf.c4BoundaryInRow, currentBoundarys.length)\n // );\n for (let i = 0; i < currentBoundarys.length; i++) {\n let currentBoundary = currentBoundarys[i];\n let Y = 0;\n currentBoundary.image = { width: 0, height: 0, Y: 0 };\n if (currentBoundary.sprite) {\n currentBoundary.image.width = 48;\n currentBoundary.image.height = 48;\n currentBoundary.image.Y = Y;\n Y = currentBoundary.image.Y + currentBoundary.image.height;\n }\n\n let currentBoundaryTextWrap = currentBoundary.wrap && conf.wrap;\n\n let currentBoundaryLabelConf = boundaryFont(conf);\n currentBoundaryLabelConf.fontSize = currentBoundaryLabelConf.fontSize + 2;\n currentBoundaryLabelConf.fontWeight = 'bold';\n calcC4ShapeTextWH(\n 'label',\n currentBoundary,\n currentBoundaryTextWrap,\n currentBoundaryLabelConf,\n currentBounds.data.widthLimit\n );\n currentBoundary['label'].Y = Y + 8;\n Y = currentBoundary['label'].Y + currentBoundary['label'].height;\n\n if (currentBoundary.type && currentBoundary.type.text !== '') {\n currentBoundary.type.text = '[' + currentBoundary.type.text + ']';\n let currentBoundaryTypeConf = boundaryFont(conf);\n calcC4ShapeTextWH(\n 'type',\n currentBoundary,\n currentBoundaryTextWrap,\n currentBoundaryTypeConf,\n currentBounds.data.widthLimit\n );\n currentBoundary['type'].Y = Y + 5;\n Y = currentBoundary['type'].Y + currentBoundary['type'].height;\n }\n\n if (currentBoundary.descr && currentBoundary.descr.text !== '') {\n let currentBoundaryDescrConf = boundaryFont(conf);\n currentBoundaryDescrConf.fontSize = currentBoundaryDescrConf.fontSize - 2;\n calcC4ShapeTextWH(\n 'descr',\n currentBoundary,\n currentBoundaryTextWrap,\n currentBoundaryDescrConf,\n currentBounds.data.widthLimit\n );\n currentBoundary['descr'].Y = Y + 20;\n Y = currentBoundary['descr'].Y + currentBoundary['descr'].height;\n }\n\n if (i == 0 || i % c4BoundaryInRow === 0) {\n // Calculate the drawing start point of the currentBoundarys.\n let _x = parentBounds.data.startx + conf.diagramMarginX;\n let _y = parentBounds.data.stopy + conf.diagramMarginY + Y;\n\n currentBounds.setData(_x, _x, _y, _y);\n } else {\n // Calculate the drawing start point of the currentBoundarys.\n let _x =\n currentBounds.data.stopx !== currentBounds.data.startx\n ? currentBounds.data.stopx + conf.diagramMarginX\n : currentBounds.data.startx;\n let _y = currentBounds.data.starty;\n\n currentBounds.setData(_x, _x, _y, _y);\n }\n currentBounds.name = currentBoundary.alias;\n let currentPersonOrSystemArray = parser.yy.getC4ShapeArray(currentBoundary.alias);\n let currentPersonOrSystemKeys = parser.yy.getC4ShapeKeys(currentBoundary.alias);\n\n if (currentPersonOrSystemKeys.length > 0) {\n drawC4ShapeArray(\n currentBounds,\n diagram,\n currentPersonOrSystemArray,\n currentPersonOrSystemKeys\n );\n }\n parentBoundaryAlias = currentBoundary.alias;\n let nextCurrentBoundarys = parser.yy.getBoundarys(parentBoundaryAlias);\n\n if (nextCurrentBoundarys.length > 0) {\n // draw boundary inside currentBoundary\n // bounds.init();\n // parentBoundaryWidthLimit = bounds.data.stopx - bounds.startx;\n drawInsideBoundary(diagram, parentBoundaryAlias, currentBounds, nextCurrentBoundarys);\n }\n // draw boundary\n if (currentBoundary.alias !== 'global') drawBoundary(diagram, currentBoundary, currentBounds);\n parentBounds.data.stopy = Math.max(\n currentBounds.data.stopy + conf.c4ShapeMargin,\n parentBounds.data.stopy\n );\n parentBounds.data.stopx = Math.max(\n currentBounds.data.stopx + conf.c4ShapeMargin,\n parentBounds.data.stopx\n );\n globalBoundaryMaxX = Math.max(globalBoundaryMaxX, parentBounds.data.stopx);\n globalBoundaryMaxY = Math.max(globalBoundaryMaxY, parentBounds.data.stopy);\n }\n}\n\n/**\n * Draws a sequenceDiagram in the tag with id: id based on the graph definition in text.\n *\n * @param {any} text\n * @param {any} id\n */\nexport const draw = function (text, id) {\n conf = configApi.getConfig().c4;\n const securityLevel = configApi.getConfig().securityLevel;\n // Handle root and Document for when rendering in sanbox mode\n let sandboxElement;\n if (securityLevel === 'sandbox') {\n sandboxElement = select('#i' + id);\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\n let db = parser.yy;\n\n parser.yy.clear();\n parser.yy.setWrap(conf.wrap);\n parser.parse(text + '\\n');\n\n c4ShapeInRow = db.getC4ShapeInRow();\n c4BoundaryInRow = db.getC4BoundaryInRow();\n\n log.debug(`C:${JSON.stringify(conf, null, 2)}`);\n\n const diagram =\n securityLevel === 'sandbox' ? root.select(`[id=\"${id}\"]`) : select(`[id=\"${id}\"]`);\n\n svgDraw.insertComputerIcon(diagram);\n svgDraw.insertDatabaseIcon(diagram);\n svgDraw.insertClockIcon(diagram);\n\n let screenBounds = new Bounds();\n\n screenBounds.setData(\n conf.diagramMarginX,\n conf.diagramMarginX,\n conf.diagramMarginY,\n conf.diagramMarginY\n );\n\n screenBounds.data.widthLimit = screen.availWidth;\n globalBoundaryMaxX = conf.diagramMarginX;\n globalBoundaryMaxY = conf.diagramMarginY;\n\n const title = parser.yy.getTitle();\n const c4type = parser.yy.getC4Type();\n let currentBoundarys = parser.yy.getBoundarys('');\n // switch (c4type) {\n // case 'C4Context':\n drawInsideBoundary(diagram, '', screenBounds, currentBoundarys);\n // break;\n // }\n\n // The arrow head definition is attached to the svg once\n svgDraw.insertArrowHead(diagram);\n svgDraw.insertArrowEnd(diagram);\n svgDraw.insertArrowCrossHead(diagram);\n svgDraw.insertArrowFilledHead(diagram);\n\n drawRels(diagram, parser.yy.getRels(), parser.yy.getC4Shape);\n\n screenBounds.data.stopx = globalBoundaryMaxX;\n screenBounds.data.stopy = globalBoundaryMaxY;\n\n const box = screenBounds.data;\n\n // Make sure the height of the diagram supports long menus.\n let boxHeight = box.stopy - box.starty;\n\n let height = boxHeight + 2 * conf.diagramMarginY;\n\n // Make sure the width of the diagram supports wide menus.\n let boxWidth = box.stopx - box.startx;\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 - 4 * conf.diagramMarginX)\n .attr('y', box.starty + conf.diagramMarginY);\n }\n\n configureSvgSize(diagram, height, width, conf.useMaxWidth);\n\n const extraVertForTitle = title ? 60 : 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 addSVGAccessibilityFields(parser.yy, diagram, id);\n log.debug(`models:`, box);\n};\n\nexport default {\n drawPersonOrSystemArray: drawC4ShapeArray,\n drawBoundary,\n setConf,\n draw,\n};\n","const getStyles = (options) =>\n `.person {\n stroke: ${options.personBorder};\n fill: ${options.personBkg};\n }\n`;\n\nexport default getStyles;\n","import common from '../common/common';\nimport { addFunction } from '../../interactionDb';\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.attrs !== 'undefined' && rectData.attrs !== null) {\n for (let attrKey in rectData.attrs) rectElem.attr(attrKey, rectData.attrs[attrKey]);\n }\n\n if (rectData.class !== 'undefined') {\n rectElem.attr('class', rectData.class);\n }\n\n return rectElem;\n};\n\nexport const drawImage = function (elem, width, height, x, y, link) {\n const imageElem = elem.append('image');\n imageElem.attr('width', width);\n imageElem.attr('height', height);\n imageElem.attr('x', x);\n imageElem.attr('y', y);\n let sanitizedLink = link.startsWith('data:image/png;base64') ? link : 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 drawText = function (elem, textData) {\n let prevTextHeight = 0,\n textHeight = 0;\n const lines = textData.text.split(common.lineBreakRegex);\n\n let textElems = [];\n let dy = 0;\n let yfunc = () => textData.y;\n if (\n typeof textData.valign !== 'undefined' &&\n typeof 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 typeof textData.anchor !== 'undefined' &&\n typeof textData.textMargin !== 'undefined' &&\n typeof 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 = 'text-after-edge';\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 = 'text-before-edge';\n textData.alignmentBaseline = 'middle';\n break;\n }\n }\n for (let i = 0; i < lines.length; i++) {\n let line = lines[i];\n if (\n typeof textData.textMargin !== 'undefined' &&\n textData.textMargin === 0 &&\n typeof textData.fontSize !== 'undefined'\n ) {\n dy = i * textData.fontSize;\n }\n\n const textElem = elem.append('text');\n textElem.attr('x', textData.x);\n textElem.attr('y', yfunc());\n if (typeof 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 (typeof textData.fontFamily !== 'undefined') {\n textElem.style('font-family', textData.fontFamily);\n }\n if (typeof textData.fontSize !== 'undefined') {\n textElem.style('font-size', textData.fontSize);\n }\n if (typeof textData.fontWeight !== 'undefined') {\n textElem.style('font-weight', textData.fontWeight);\n }\n if (typeof textData.fill !== 'undefined') {\n textElem.attr('fill', textData.fill);\n }\n if (typeof textData.class !== 'undefined') {\n textElem.attr('class', textData.class);\n }\n if (typeof 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 (typeof textData.fill !== 'undefined') {\n span.attr('fill', textData.fill);\n }\n span.text(line);\n } else {\n textElem.text(line);\n }\n if (\n typeof textData.valign !== 'undefined' &&\n typeof 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\nexport const drawRels = (elem, rels, conf) => {\n const relsElem = elem.append('g');\n let i = 0;\n for (let rel of rels) {\n let textColor = rel.textColor ? rel.textColor : '#444444';\n let strokeColor = rel.lineColor ? rel.lineColor : '#444444';\n let offsetX = rel.offsetX ? parseInt(rel.offsetX) : 0;\n let offsetY = rel.offsetY ? parseInt(rel.offsetY) : 0;\n\n let url = '';\n if (i === 0) {\n let line = relsElem.append('line');\n line.attr('x1', rel.startPoint.x);\n line.attr('y1', rel.startPoint.y);\n line.attr('x2', rel.endPoint.x);\n line.attr('y2', rel.endPoint.y);\n\n line.attr('stroke-width', '1');\n line.attr('stroke', strokeColor);\n line.style('fill', 'none');\n if (rel.type !== 'rel_b') line.attr('marker-end', 'url(' + url + '#arrowhead)');\n if (rel.type === 'birel' || rel.type === 'rel_b')\n line.attr('marker-start', 'url(' + url + '#arrowend)');\n i = -1;\n } else {\n let line = relsElem.append('path');\n line\n .attr('fill', 'none')\n .attr('stroke-width', '1')\n .attr('stroke', strokeColor)\n .attr(\n 'd',\n 'Mstartx,starty Qcontrolx,controly stopx,stopy '\n .replaceAll('startx', rel.startPoint.x)\n .replaceAll('starty', rel.startPoint.y)\n .replaceAll(\n 'controlx',\n rel.startPoint.x +\n (rel.endPoint.x - rel.startPoint.x) / 2 -\n (rel.endPoint.x - rel.startPoint.x) / 4\n )\n .replaceAll('controly', rel.startPoint.y + (rel.endPoint.y - rel.startPoint.y) / 2)\n .replaceAll('stopx', rel.endPoint.x)\n .replaceAll('stopy', rel.endPoint.y)\n );\n if (rel.type !== 'rel_b') line.attr('marker-end', 'url(' + url + '#arrowhead)');\n if (rel.type === 'birel' || rel.type === 'rel_b')\n line.attr('marker-start', 'url(' + url + '#arrowend)');\n }\n\n let messageConf = conf.messageFont();\n _drawTextCandidateFunc(conf)(\n rel.label.text,\n relsElem,\n Math.min(rel.startPoint.x, rel.endPoint.x) +\n Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 +\n offsetX,\n Math.min(rel.startPoint.y, rel.endPoint.y) +\n Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 +\n offsetY,\n rel.label.width,\n rel.label.height,\n { fill: textColor },\n messageConf\n );\n\n if (rel.techn && rel.techn.text !== '') {\n messageConf = conf.messageFont();\n _drawTextCandidateFunc(conf)(\n '[' + rel.techn.text + ']',\n relsElem,\n Math.min(rel.startPoint.x, rel.endPoint.x) +\n Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 +\n offsetX,\n Math.min(rel.startPoint.y, rel.endPoint.y) +\n Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 +\n conf.messageFontSize +\n 5 +\n offsetY,\n Math.max(rel.label.width, rel.techn.width),\n rel.techn.height,\n { fill: textColor, 'font-style': 'italic' },\n messageConf\n );\n }\n }\n};\n\n/**\n * Draws an boundary in the diagram\n *\n * @param {any} elem - The diagram we'll draw to.\n * @param {any} boundary - The boundary to draw.\n * @param {any} conf - DrawText implementation discriminator object\n */\nconst drawBoundary = function (elem, boundary, conf) {\n const boundaryElem = elem.append('g');\n\n let fillColor = boundary.bgColor ? boundary.bgColor : 'none';\n let strokeColor = boundary.borderColor ? boundary.borderColor : '#444444';\n let fontColor = boundary.fontColor ? boundary.fontColor : 'black';\n\n let attrsValue = { 'stroke-width': 1.0, 'stroke-dasharray': '7.0,7.0' };\n if (boundary.nodeType) attrsValue = { 'stroke-width': 1.0 };\n let rectData = {\n x: boundary.x,\n y: boundary.y,\n fill: fillColor,\n stroke: strokeColor,\n width: boundary.width,\n height: boundary.height,\n rx: 2.5,\n ry: 2.5,\n attrs: attrsValue,\n };\n\n drawRect(boundaryElem, rectData);\n\n // draw label\n let boundaryConf = conf.boundaryFont();\n boundaryConf.fontWeight = 'bold';\n boundaryConf.fontSize = boundaryConf.fontSize + 2;\n boundaryConf.fontColor = fontColor;\n _drawTextCandidateFunc(conf)(\n boundary.label.text,\n boundaryElem,\n boundary.x,\n boundary.y + boundary.label.Y,\n boundary.width,\n boundary.height,\n { fill: '#444444' },\n boundaryConf\n );\n\n // draw type\n if (boundary.type && boundary.type.text !== '') {\n boundaryConf = conf.boundaryFont();\n boundaryConf.fontColor = fontColor;\n _drawTextCandidateFunc(conf)(\n boundary.type.text,\n boundaryElem,\n boundary.x,\n boundary.y + boundary.type.Y,\n boundary.width,\n boundary.height,\n { fill: '#444444' },\n boundaryConf\n );\n }\n\n // draw descr\n if (boundary.descr && boundary.descr.text !== '') {\n boundaryConf = conf.boundaryFont();\n boundaryConf.fontSize = boundaryConf.fontSize - 2;\n boundaryConf.fontColor = fontColor;\n _drawTextCandidateFunc(conf)(\n boundary.descr.text,\n boundaryElem,\n boundary.x,\n boundary.y + boundary.descr.Y,\n boundary.width,\n boundary.height,\n { fill: '#444444' },\n boundaryConf\n );\n }\n};\n\nexport const drawC4Shape = function (elem, c4Shape, conf) {\n let fillColor = c4Shape.bgColor ? c4Shape.bgColor : conf[c4Shape.typeC4Shape.text + '_bg_color'];\n let strokeColor = c4Shape.borderColor\n ? c4Shape.borderColor\n : conf[c4Shape.typeC4Shape.text + '_border_color'];\n let fontColor = c4Shape.fontColor ? c4Shape.fontColor : '#FFFFFF';\n\n let personImg =\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8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Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=';\n break;\n }\n\n const c4ShapeElem = elem.append('g');\n c4ShapeElem.attr('class', 'person-man');\n\n // \n // draw rect of c4Shape\n const rect = getNoteRect();\n switch (c4Shape.typeC4Shape.text) {\n case 'person':\n case 'external_person':\n case 'system':\n case 'external_system':\n case 'container':\n case 'external_container':\n case 'component':\n case 'external_component':\n rect.x = c4Shape.x;\n rect.y = c4Shape.y;\n rect.fill = fillColor;\n rect.width = c4Shape.width;\n rect.height = c4Shape.height;\n rect.style = 'stroke:' + strokeColor + ';stroke-width:0.5;';\n rect.rx = 2.5;\n rect.ry = 2.5;\n drawRect(c4ShapeElem, rect);\n break;\n case 'system_db':\n case 'external_system_db':\n case 'container_db':\n case 'external_container_db':\n case 'component_db':\n case 'external_component_db':\n c4ShapeElem\n .append('path')\n .attr('fill', fillColor)\n .attr('stroke-width', '0.5')\n .attr('stroke', strokeColor)\n .attr(\n 'd',\n 'Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height'\n .replaceAll('startx', c4Shape.x)\n .replaceAll('starty', c4Shape.y)\n .replaceAll('half', c4Shape.width / 2)\n .replaceAll('height', c4Shape.height)\n );\n c4ShapeElem\n .append('path')\n .attr('fill', 'none')\n .attr('stroke-width', '0.5')\n .attr('stroke', strokeColor)\n .attr(\n 'd',\n 'Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10'\n .replaceAll('startx', c4Shape.x)\n .replaceAll('starty', c4Shape.y)\n .replaceAll('half', c4Shape.width / 2)\n );\n break;\n case 'system_queue':\n case 'external_system_queue':\n case 'container_queue':\n case 'external_container_queue':\n case 'component_queue':\n case 'external_component_queue':\n c4ShapeElem\n .append('path')\n .attr('fill', fillColor)\n .attr('stroke-width', '0.5')\n .attr('stroke', strokeColor)\n .attr(\n 'd',\n 'Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half'\n .replaceAll('startx', c4Shape.x)\n .replaceAll('starty', c4Shape.y)\n .replaceAll('width', c4Shape.width)\n .replaceAll('half', c4Shape.height / 2)\n );\n c4ShapeElem\n .append('path')\n .attr('fill', 'none')\n .attr('stroke-width', '0.5')\n .attr('stroke', strokeColor)\n .attr(\n 'd',\n 'Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half'\n .replaceAll('startx', c4Shape.x + c4Shape.width)\n .replaceAll('starty', c4Shape.y)\n .replaceAll('half', c4Shape.height / 2)\n );\n break;\n }\n\n // draw type of c4Shape\n let c4ShapeFontConf = getC4ShapeFont(conf, c4Shape.typeC4Shape.text);\n c4ShapeElem\n .append('text')\n .attr('fill', fontColor)\n .attr('font-family', c4ShapeFontConf.fontFamily)\n .attr('font-size', c4ShapeFontConf.fontSize - 2)\n .attr('font-style', 'italic')\n .attr('lengthAdjust', 'spacing')\n .attr('textLength', c4Shape.typeC4Shape.width)\n .attr('x', c4Shape.x + c4Shape.width / 2 - c4Shape.typeC4Shape.width / 2)\n .attr('y', c4Shape.y + c4Shape.typeC4Shape.Y)\n .text('<<' + c4Shape.typeC4Shape.text + '>>');\n\n // draw image/sprite\n switch (c4Shape.typeC4Shape.text) {\n case 'person':\n case 'external_person':\n drawImage(\n c4ShapeElem,\n 48,\n 48,\n c4Shape.x + c4Shape.width / 2 - 24,\n c4Shape.y + c4Shape.image.Y,\n personImg\n );\n break;\n }\n\n // draw label\n let textFontConf = conf[c4Shape.typeC4Shape.text + 'Font']();\n textFontConf.fontWeight = 'bold';\n textFontConf.fontSize = textFontConf.fontSize + 2;\n textFontConf.fontColor = fontColor;\n _drawTextCandidateFunc(conf)(\n c4Shape.label.text,\n c4ShapeElem,\n c4Shape.x,\n c4Shape.y + c4Shape.label.Y,\n c4Shape.width,\n c4Shape.height,\n { fill: fontColor },\n textFontConf\n );\n\n // draw techn/type\n textFontConf = conf[c4Shape.typeC4Shape.text + 'Font']();\n textFontConf.fontColor = fontColor;\n\n if (c4Shape.thchn && c4Shape.thchn.text !== '') {\n _drawTextCandidateFunc(conf)(\n c4Shape.thchn.text,\n c4ShapeElem,\n c4Shape.x,\n c4Shape.y + c4Shape.thchn.Y,\n c4Shape.width,\n c4Shape.height,\n { fill: fontColor, 'font-style': 'italic' },\n textFontConf\n );\n } else if (c4Shape.type && c4Shape.type.text !== '') {\n _drawTextCandidateFunc(conf)(\n c4Shape.type.text,\n c4ShapeElem,\n c4Shape.x,\n c4Shape.y + c4Shape.type.Y,\n c4Shape.width,\n c4Shape.height,\n { fill: fontColor, 'font-style': 'italic' },\n textFontConf\n );\n }\n\n // draw descr\n if (c4Shape.descr && c4Shape.descr.text !== '') {\n textFontConf = conf.personFont();\n textFontConf.fontColor = fontColor;\n _drawTextCandidateFunc(conf)(\n c4Shape.descr.text,\n c4ShapeElem,\n c4Shape.x,\n c4Shape.y + c4Shape.descr.Y,\n c4Shape.width,\n c4Shape.height,\n { fill: fontColor },\n textFontConf\n );\n }\n\n return c4Shape.height;\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};\nexport const insertArrowEnd = function (elem) {\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'arrowend')\n .attr('refX', 1)\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 10 0 L 0 5 L 10 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 insertDynamicNumber = 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 arrow 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', 16)\n .attr('refY', 4);\n\n // The arrow\n marker\n .append('path')\n .attr('fill', 'black')\n .attr('stroke', '#000000')\n .style('stroke-dasharray', '0, 0')\n .attr('stroke-width', '1px')\n .attr('d', 'M 9,2 V 6 L16,4 Z');\n\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', '1px')\n .attr('d', 'M 0,1 L 6,7 M 6,1 L 0,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 getC4ShapeFont = (cnf, typeC4Shape) => {\n return {\n fontFamily: cnf[typeC4Shape + 'FontFamily'],\n fontSize: cnf[typeC4Shape + 'FontSize'],\n fontWeight: cnf[typeC4Shape + 'FontWeight'],\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 { fontSize, fontFamily, fontWeight } = conf;\n\n const lines = content.split(common.lineBreakRegex);\n for (let i = 0; i < lines.length; i++) {\n const dy = i * fontSize - (fontSize * (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 .attr('dominant-baseline', 'middle')\n .style('font-size', fontSize)\n .style('font-weight', fontWeight)\n .style('font-family', fontFamily);\n text\n .append('tspan')\n // .attr('x', x + width / 2)\n .attr('dy', dy)\n .text(lines[i])\n // .attr('y', y + height / 2)\n .attr('alignment-baseline', 'mathematical');\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 // eslint-disable-line\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 drawBoundary,\n drawC4Shape,\n drawRels,\n drawImage,\n drawEmbeddedImage,\n insertArrowHead,\n insertArrowEnd,\n insertArrowFilledHead,\n insertDynamicNumber,\n insertArrowCrossHead,\n insertDatabaseIcon,\n insertComputerIcon,\n insertClockIcon,\n getTextObj,\n getNoteRect,\n sanitizeUrl,\n};\n","import { select } from 'd3';\nimport { log } from '../../logger';\nimport * as configApi from '../../config';\nimport common from '../common/common';\nimport utils from '../../utils';\nimport mermaidAPI from '../../mermaidAPI';\nimport {\n setAccTitle,\n getAccTitle,\n getAccDescription,\n setAccDescription,\n clear as commonClear,\n} from '../../commonDb';\n\nconst MERMAID_DOM_ID_PREFIX = 'classid-';\n\nlet relations = [];\nlet classes = {};\nlet classCounter = 0;\n\nlet funs = [];\n\nconst sanitizeText = (txt) => common.sanitizeText(txt, configApi.getConfig());\n\nexport const parseDirective = function (statement, context, type) {\n mermaidAPI.parseDirective(this, statement, context, type);\n};\n\nconst splitClassNameAndType = function (id) {\n let genericType = '';\n let className = id;\n\n if (id.indexOf('~') > 0) {\n let split = id.split('~');\n className = split[0];\n\n genericType = common.sanitizeText(split[1], configApi.getConfig());\n }\n\n return { className: className, type: genericType };\n};\n\n/**\n * Function called by parser when a node definition has been found.\n *\n * @param id\n * @public\n */\nexport const addClass = function (id) {\n let classId = splitClassNameAndType(id);\n // Only add class if not exists\n if (typeof classes[classId.className] !== 'undefined') return;\n\n classes[classId.className] = {\n id: classId.className,\n type: classId.type,\n cssClasses: [],\n methods: [],\n members: [],\n annotations: [],\n domId: MERMAID_DOM_ID_PREFIX + classId.className + '-' + classCounter,\n };\n\n classCounter++;\n};\n\n/**\n * Function to lookup domId from id in the graph definition.\n *\n * @param id\n * @public\n */\nexport const lookUpDomId = function (id) {\n const classKeys = Object.keys(classes);\n for (let i = 0; i < classKeys.length; i++) {\n if (classes[classKeys[i]].id === id) {\n return classes[classKeys[i]].domId;\n }\n }\n};\n\nexport const clear = function () {\n relations = [];\n classes = {};\n funs = [];\n funs.push(setupToolTips);\n commonClear();\n};\n\nexport const getClass = function (id) {\n return classes[id];\n};\nexport const getClasses = function () {\n return classes;\n};\n\nexport const getRelations = function () {\n return relations;\n};\n\nexport const addRelation = function (relation) {\n log.debug('Adding relation: ' + JSON.stringify(relation));\n addClass(relation.id1);\n addClass(relation.id2);\n\n relation.id1 = splitClassNameAndType(relation.id1).className;\n relation.id2 = splitClassNameAndType(relation.id2).className;\n\n relation.relationTitle1 = common.sanitizeText(\n relation.relationTitle1.trim(),\n configApi.getConfig()\n );\n\n relation.relationTitle2 = common.sanitizeText(\n relation.relationTitle2.trim(),\n configApi.getConfig()\n );\n\n relations.push(relation);\n};\n\n/**\n * Adds an annotation to the specified class Annotations mark special properties of the given type\n * (like 'interface' or 'service')\n *\n * @param className The class name\n * @param annotation The name of the annotation without any brackets\n * @public\n */\nexport const addAnnotation = function (className, annotation) {\n const validatedClassName = splitClassNameAndType(className).className;\n classes[validatedClassName].annotations.push(annotation);\n};\n\n/**\n * Adds a member to the specified class\n *\n * @param className The class name\n * @param member The full name of the member. If the member is enclosed in <> it is\n * treated as an annotation If the member is ending with a closing bracket ) it is treated as a\n * method Otherwise the member will be treated as a normal property\n * @public\n */\nexport const addMember = function (className, member) {\n const validatedClassName = splitClassNameAndType(className).className;\n const theClass = classes[validatedClassName];\n\n if (typeof member === 'string') {\n // Member can contain white spaces, we trim them out\n const memberString = member.trim();\n\n if (memberString.startsWith('<<') && memberString.endsWith('>>')) {\n // Remove leading and trailing brackets\n // theClass.annotations.push(memberString.substring(2, memberString.length - 2));\n theClass.annotations.push(sanitizeText(memberString.substring(2, memberString.length - 2)));\n } else if (memberString.indexOf(')') > 0) {\n theClass.methods.push(sanitizeText(memberString));\n } else if (memberString) {\n theClass.members.push(sanitizeText(memberString));\n }\n }\n};\n\nexport const addMembers = function (className, members) {\n if (Array.isArray(members)) {\n members.reverse();\n members.forEach((member) => addMember(className, member));\n }\n};\n\nexport const cleanupLabel = function (label) {\n if (label.substring(0, 1) === ':') {\n return common.sanitizeText(label.substr(1).trim(), configApi.getConfig());\n } else {\n return sanitizeText(label.trim());\n }\n};\n\n/**\n * Called by parser when a special node is found, e.g. a clickable element.\n *\n * @param ids Comma separated list of ids\n * @param className Class to add\n */\nexport const setCssClass = function (ids, className) {\n ids.split(',').forEach(function (_id) {\n let id = _id;\n if (_id[0].match(/\\d/)) id = MERMAID_DOM_ID_PREFIX + id;\n if (typeof classes[id] !== 'undefined') {\n classes[id].cssClasses.push(className);\n }\n });\n};\n\n/**\n * Called by parser when a tooltip is found, e.g. a clickable element.\n *\n * @param ids Comma separated list of ids\n * @param tooltip Tooltip to add\n */\nconst setTooltip = function (ids, tooltip) {\n const config = configApi.getConfig();\n ids.split(',').forEach(function (id) {\n if (typeof tooltip !== 'undefined') {\n classes[id].tooltip = common.sanitizeText(tooltip, config);\n }\n });\n};\n\n/**\n * Called by parser when a link is found. Adds the URL to the vertex data.\n *\n * @param ids Comma separated list of ids\n * @param linkStr URL to create a link for\n * @param target Target of the link, _blank by default as originally defined in the svgDraw.js file\n */\nexport const setLink = function (ids, linkStr, target) {\n const config = configApi.getConfig();\n ids.split(',').forEach(function (_id) {\n let id = _id;\n if (_id[0].match(/\\d/)) id = MERMAID_DOM_ID_PREFIX + id;\n if (typeof classes[id] !== 'undefined') {\n classes[id].link = utils.formatUrl(linkStr, config);\n if (config.securityLevel === 'sandbox') {\n classes[id].linkTarget = '_top';\n } else if (typeof target === 'string') {\n classes[id].linkTarget = sanitizeText(target);\n } else {\n classes[id].linkTarget = '_blank';\n }\n }\n });\n setCssClass(ids, 'clickable');\n};\n\n/**\n * Called by parser when a click definition is found. Registers an event handler.\n *\n * @param ids Comma separated list of ids\n * @param functionName Function to be called on click\n * @param functionArgs Function args the function should be called with\n */\nexport const setClickEvent = function (ids, functionName, functionArgs) {\n ids.split(',').forEach(function (id) {\n setClickFunc(id, functionName, functionArgs);\n classes[id].haveCallback = true;\n });\n setCssClass(ids, 'clickable');\n};\n\nconst setClickFunc = function (domId, functionName, functionArgs) {\n const config = configApi.getConfig();\n let id = domId;\n let elemId = lookUpDomId(id);\n\n if (config.securityLevel !== 'loose') {\n return;\n }\n if (typeof functionName === 'undefined') {\n return;\n }\n if (typeof classes[id] !== 'undefined') {\n let argList = [];\n if (typeof functionArgs === 'string') {\n /* Splits functionArgs by ',', ignoring all ',' in double quoted strings */\n argList = functionArgs.split(/,(?=(?:(?:[^\"]*\"){2})*[^\"]*$)/);\n for (let i = 0; i < argList.length; i++) {\n let item = argList[i].trim();\n /* Removes all double quotes at the start and end of an argument */\n /* This preserves all starting and ending whitespace inside */\n if (item.charAt(0) === '\"' && item.charAt(item.length - 1) === '\"') {\n item = item.substr(1, item.length - 2);\n }\n argList[i] = item;\n }\n }\n\n /* if no arguments passed into callback, default to passing in id */\n if (argList.length === 0) {\n argList.push(elemId);\n }\n\n funs.push(function () {\n const elem = document.querySelector(`[id=\"${elemId}\"]`);\n if (elem !== null) {\n elem.addEventListener(\n 'click',\n function () {\n utils.runFunc(functionName, ...argList);\n },\n false\n );\n }\n });\n }\n};\n\nexport const bindFunctions = function (element) {\n funs.forEach(function (fun) {\n fun(element);\n });\n};\n\nexport const lineType = {\n LINE: 0,\n DOTTED_LINE: 1,\n};\n\nexport const relationType = {\n AGGREGATION: 0,\n EXTENSION: 1,\n COMPOSITION: 2,\n DEPENDENCY: 3,\n};\n\nconst setupToolTips = function (element) {\n let tooltipElem = select('.mermaidTooltip');\n if ((tooltipElem._groups || tooltipElem)[0][0] === null) {\n tooltipElem = select('body').append('div').attr('class', 'mermaidTooltip').style('opacity', 0);\n }\n\n const svg = select(element).select('svg');\n\n const nodes = svg.selectAll('g.node');\n nodes\n .on('mouseover', function () {\n const el = select(this);\n const title = el.attr('title');\n // Dont try to draw a tooltip if no data is provided\n if (title === null) {\n return;\n }\n const rect = this.getBoundingClientRect();\n\n tooltipElem.transition().duration(200).style('opacity', '.9');\n tooltipElem\n .text(el.attr('title'))\n .style('left', window.scrollX + rect.left + (rect.right - rect.left) / 2 + 'px')\n .style('top', window.scrollY + rect.top - 14 + document.body.scrollTop + 'px');\n el.classed('hover', true);\n })\n .on('mouseout', function () {\n tooltipElem.transition().duration(500).style('opacity', 0);\n const el = select(this);\n el.classed('hover', false);\n });\n};\nfuns.push(setupToolTips);\n\nlet direction = 'TB';\nconst getDirection = () => direction;\nconst setDirection = (dir) => {\n direction = dir;\n};\n\nexport default {\n parseDirective,\n setAccTitle,\n getAccTitle,\n getAccDescription,\n setAccDescription,\n getConfig: () => configApi.getConfig().class,\n addClass,\n bindFunctions,\n clear,\n getClass,\n getClasses,\n addAnnotation,\n getRelations,\n addRelation,\n getDirection,\n setDirection,\n addMember,\n addMembers,\n cleanupLabel,\n lineType,\n relationType,\n setClickEvent,\n setCssClass,\n setLink,\n setTooltip,\n lookUpDomId,\n};\n","import { select } from 'd3';\nimport dagre from 'dagre';\nimport graphlib from 'graphlib';\nimport { log } from '../../logger';\nimport classDb, { lookUpDomId } from './classDb';\nimport { parser } from './parser/classDiagram';\nimport svgDraw from './svgDraw';\nimport { getConfig } from '../../config';\nimport { render } from '../../dagre-wrapper/index.js';\n// import addHtmlLabel from 'dagre-d3/lib/label/add-html-label.js';\nimport { curveLinear } from 'd3';\nimport { interpolateToCurve, getStylesFromArray, setupGraphViewbox } from '../../utils';\nimport common from '../common/common';\nimport addSVGAccessibilityFields from '../../accessibility';\n\nparser.yy = classDb;\n\nlet idCache = {};\nconst padding = 20;\n\nconst sanitizeText = (txt) => common.sanitizeText(txt, getConfig());\n\nconst conf = {\n dividerMargin: 10,\n padding: 5,\n textHeight: 10,\n};\n\n/**\n * Function that adds the vertices found during parsing to the graph to be rendered.\n *\n * @param {Object<\n * string,\n * { cssClasses: string[]; text: string; id: string; type: string; domId: string }\n * >} classes\n * Object containing the vertices.\n * @param {SVGGElement} g The graph that is to be drawn.\n */\nexport const addClasses = function (classes, g) {\n // const svg = select(`[id=\"${svgId}\"]`);\n const keys = Object.keys(classes);\n log.info('keys:', keys);\n log.info(classes);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n keys.forEach(function (id) {\n const vertex = classes[id];\n\n /**\n * Variable for storing the classes for the vertex\n *\n * @type {string}\n */\n let cssClassStr = '';\n if (vertex.cssClasses.length > 0) {\n cssClassStr = cssClassStr + ' ' + vertex.cssClasses.join(' ');\n }\n // if (vertex.classes.length > 0) {\n // classStr = vertex.classes.join(' ');\n // }\n\n const styles = { labelStyle: '' }; //getStylesFromArray(vertex.styles);\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n let vertexText = vertex.text !== undefined ? vertex.text : vertex.id;\n\n // We create a SVG label, either by delegating to addHtmlLabel or manually\n // let vertexNode;\n // if (evaluate(getConfig().flowchart.htmlLabels)) {\n // const node = {\n // label: vertexText.replace(\n // /fa[lrsb]?:fa-[\\w-]+/g,\n // s => ``\n // )\n // };\n // vertexNode = addHtmlLabel(svg, node).node();\n // vertexNode.parentNode.removeChild(vertexNode);\n // } else {\n // const svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n // svgLabel.setAttribute('style', styles.labelStyle.replace('color:', 'fill:'));\n\n // const rows = vertexText.split(common.lineBreakRegex);\n\n // for (let j = 0; j < rows.length; j++) {\n // const tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');\n // tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');\n // tspan.setAttribute('dy', '1em');\n // tspan.setAttribute('x', '1');\n // tspan.textContent = rows[j];\n // svgLabel.appendChild(tspan);\n // }\n // vertexNode = svgLabel;\n // }\n\n let radious = 0;\n let _shape = '';\n // Set the shape based parameters\n switch (vertex.type) {\n case 'class':\n _shape = 'class_box';\n break;\n default:\n _shape = 'class_box';\n }\n // Add the node\n g.setNode(vertex.id, {\n labelStyle: styles.labelStyle,\n shape: _shape,\n labelText: sanitizeText(vertexText),\n classData: vertex,\n rx: radious,\n ry: radious,\n class: cssClassStr,\n style: styles.style,\n id: vertex.id,\n domId: vertex.domId,\n haveCallback: vertex.haveCallback,\n link: vertex.link,\n width: vertex.type === 'group' ? 500 : undefined,\n type: vertex.type,\n padding: getConfig().flowchart.padding,\n });\n\n log.info('setNode', {\n labelStyle: styles.labelStyle,\n shape: _shape,\n labelText: vertexText,\n rx: radious,\n ry: radious,\n class: cssClassStr,\n style: styles.style,\n id: vertex.id,\n width: vertex.type === 'group' ? 500 : undefined,\n type: vertex.type,\n padding: getConfig().flowchart.padding,\n });\n });\n};\n\n/**\n * Add edges to graph based on parsed graph definition\n *\n * @param relations\n * @param {object} g The graph object\n */\nexport const addRelations = function (relations, g) {\n let cnt = 0;\n\n let defaultStyle;\n let defaultLabelStyle;\n\n // if (typeof relations.defaultStyle !== 'undefined') {\n // const defaultStyles = getStylesFromArray(relations.defaultStyle);\n // defaultStyle = defaultStyles.style;\n // defaultLabelStyle = defaultStyles.labelStyle;\n // }\n\n relations.forEach(function (edge) {\n cnt++;\n const edgeData = {};\n //Set relationship style and line type\n edgeData.classes = 'relation';\n edgeData.pattern = edge.relation.lineType == 1 ? 'dashed' : 'solid';\n\n edgeData.id = 'id' + cnt;\n // Set link type for rendering\n if (edge.type === 'arrow_open') {\n edgeData.arrowhead = 'none';\n } else {\n edgeData.arrowhead = 'normal';\n }\n\n log.info(edgeData, edge);\n //Set edge extra labels\n //edgeData.startLabelLeft = edge.relationTitle1;\n edgeData.startLabelRight = edge.relationTitle1 === 'none' ? '' : edge.relationTitle1;\n edgeData.endLabelLeft = edge.relationTitle2 === 'none' ? '' : edge.relationTitle2;\n //edgeData.endLabelRight = edge.relationTitle2;\n\n //Set relation arrow types\n edgeData.arrowTypeStart = getArrowMarker(edge.relation.type1);\n edgeData.arrowTypeEnd = getArrowMarker(edge.relation.type2);\n let style = '';\n let labelStyle = '';\n\n if (typeof edge.style !== 'undefined') {\n const styles = getStylesFromArray(edge.style);\n style = styles.style;\n labelStyle = styles.labelStyle;\n } else {\n style = 'fill:none';\n if (typeof defaultStyle !== 'undefined') {\n style = defaultStyle;\n }\n if (typeof defaultLabelStyle !== 'undefined') {\n labelStyle = defaultLabelStyle;\n }\n }\n\n edgeData.style = style;\n edgeData.labelStyle = labelStyle;\n\n if (typeof edge.interpolate !== 'undefined') {\n edgeData.curve = interpolateToCurve(edge.interpolate, curveLinear);\n } else if (typeof relations.defaultInterpolate !== 'undefined') {\n edgeData.curve = interpolateToCurve(relations.defaultInterpolate, curveLinear);\n } else {\n edgeData.curve = interpolateToCurve(conf.curve, curveLinear);\n }\n\n edge.text = edge.title;\n if (typeof edge.text === 'undefined') {\n if (typeof edge.style !== 'undefined') {\n edgeData.arrowheadStyle = 'fill: #333';\n }\n } else {\n edgeData.arrowheadStyle = 'fill: #333';\n edgeData.labelpos = 'c';\n\n if (getConfig().flowchart.htmlLabels) {\n // eslint-disable-line\n edgeData.labelType = 'html';\n edgeData.label = '' + edge.text + '';\n } else {\n edgeData.labelType = 'text';\n edgeData.label = edge.text.replace(common.lineBreakRegex, '\\n');\n\n if (typeof edge.style === 'undefined') {\n edgeData.style = edgeData.style || 'stroke: #333; stroke-width: 1.5px;fill:none';\n }\n\n edgeData.labelStyle = edgeData.labelStyle.replace('color:', 'fill:');\n }\n }\n // Add the edge to the graph\n g.setEdge(edge.id1, edge.id2, edgeData, cnt);\n });\n};\n\n/**\n * Gets the ID with the same label as in the cache\n *\n * @param {string} label The label to look for\n * @returns {string} The resulting ID\n */\nconst getGraphId = function (label) {\n const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);\n\n if (foundEntry) {\n return foundEntry[0];\n }\n};\n\n/**\n * Merges the value of `conf` with the passed `cnf`\n *\n * @param {object} cnf Config to merge\n */\nexport const setConf = function (cnf) {\n const keys = Object.keys(cnf);\n\n keys.forEach(function (key) {\n conf[key] = cnf[key];\n });\n};\n\n/**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n *\n * @param {string} text\n * @param {string} id\n */\nexport const draw = function (text, id) {\n log.info('Drawing class - ', id);\n classDb.clear();\n // const parser = classDb.parser;\n // parser.yy = classDb;\n\n // Parse the graph definition\n // try {\n parser.parse(text);\n // } catch (err) {\n // log.debug('Parsing failed');\n // }\n\n // Fetch the default direction, use TD if none was found\n //let dir = 'TD';\n\n const conf = getConfig().flowchart;\n const securityLevel = getConfig().securityLevel;\n log.info('config:', conf);\n const nodeSpacing = conf.nodeSpacing || 50;\n const rankSpacing = conf.rankSpacing || 50;\n\n // Create the input mermaid.graph\n const g = new graphlib.Graph({\n multigraph: true,\n compound: true,\n })\n .setGraph({\n rankdir: classDb.getDirection(),\n nodesep: nodeSpacing,\n ranksep: rankSpacing,\n marginx: 8,\n marginy: 8,\n })\n .setDefaultEdgeLabel(function () {\n return {};\n });\n\n // let subG;\n // const subGraphs = flowDb.getSubGraphs();\n // log.info('Subgraphs - ', subGraphs);\n // for (let i = subGraphs.length - 1; i >= 0; i--) {\n // subG = subGraphs[i];\n // log.info('Subgraph - ', subG);\n // flowDb.addVertex(subG.id, subG.title, 'group', undefined, subG.classes);\n // }\n\n // Fetch the vertices/nodes and edges/links from the parsed graph definition\n const classes = classDb.getClasses();\n const relations = classDb.getRelations();\n\n log.info(relations);\n addClasses(classes, g, id);\n addRelations(relations, g);\n\n // Add custom shapes\n // flowChartShapes.addToRenderV2(addShape);\n\n // Set up an SVG group so that we can translate the final graph.\n let sandboxElement;\n if (securityLevel === 'sandbox') {\n sandboxElement = select('#i' + id);\n }\n const root =\n securityLevel === 'sandbox'\n ? select(sandboxElement.nodes()[0].contentDocument.body)\n : select('body');\n const svg = root.select(`[id=\"${id}\"]`);\n svg.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n\n // Run the renderer. This is what draws the final graph.\n const element = root.select('#' + id + ' g');\n render(element, g, ['aggregation', 'extension', 'composition', 'dependency'], 'classDiagram', id);\n\n setupGraphViewbox(g, svg, conf.diagramPadding, conf.useMaxWidth);\n\n // Add label rects for non html labels\n if (!conf.htmlLabels) {\n const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document;\n const labels = doc.querySelectorAll('[id=\"' + id + '\"] .edgeLabel .label');\n for (let k = 0; k < labels.length; k++) {\n const label = labels[k];\n\n // Get dimensions of label\n const dim = label.getBBox();\n\n const rect = doc.createElementNS('http://www.w3.org/2000/svg', 'rect');\n rect.setAttribute('rx', 0);\n rect.setAttribute('ry', 0);\n rect.setAttribute('width', dim.width);\n rect.setAttribute('height', dim.height);\n // rect.setAttribute('style', 'fill:#e8e8e8;');\n\n label.insertBefore(rect, label.firstChild);\n }\n }\n\n addSVGAccessibilityFields(parser.yy, svg, id);\n // If node has a link, wrap it in an anchor SVG object.\n // const keys = Object.keys(classes);\n // keys.forEach(function(key) {\n // const vertex = classes[key];\n\n // if (vertex.link) {\n // const node = select('#' + id + ' [id=\"' + key + '\"]');\n // if (node) {\n // const link = document.createElementNS('http://www.w3.org/2000/svg', 'a');\n // link.setAttributeNS('http://www.w3.org/2000/svg', 'class', vertex.classes.join(' '));\n // link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link);\n // link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener');\n\n // const linkNode = node.insert(function() {\n // return link;\n // }, ':first-child');\n\n // const shape = node.select('.label-container');\n // if (shape) {\n // linkNode.append(function() {\n // return shape.node();\n // });\n // }\n\n // const label = node.select('.label');\n // if (label) {\n // linkNode.append(function() {\n // return label.node();\n // });\n // }\n // }\n // }\n // });\n};\n\n/**\n * Gets the arrow marker for a type index\n *\n * @param {number} type The type to look for\n * @returns {'aggregation' | 'extension' | 'composition' | 'dependency'} The arrow marker\n */\nfunction getArrowMarker(type) {\n let marker;\n switch (type) {\n case 0:\n marker = 'aggregation';\n break;\n case 1:\n marker = 'extension';\n break;\n case 2:\n marker = 'composition';\n break;\n case 3:\n marker = 'dependency';\n break;\n default:\n marker = 'none';\n }\n return marker;\n}\n\nexport default {\n setConf,\n draw,\n};\n","import { select } from 'd3';\nimport dagre from 'dagre';\nimport graphlib from 'graphlib';\nimport { log } from '../../logger';\nimport classDb, { lookUpDomId } from './classDb';\nimport { parser } from './parser/classDiagram';\nimport svgDraw from './svgDraw';\nimport { configureSvgSize } from '../../utils';\nimport { getConfig } from '../../config';\nimport addSVGAccessibilityFields from '../../accessibility';\n\nparser.yy = classDb;\n\nlet idCache = {};\nconst padding = 20;\n\nconst conf = {\n dividerMargin: 10,\n padding: 5,\n textHeight: 10,\n};\n\n/**\n * Gets the ID with the same label as in the cache\n *\n * @param {string} label The label to look for\n * @returns {string} The resulting ID\n */\nconst getGraphId = function (label) {\n const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);\n\n if (foundEntry) {\n return foundEntry[0];\n }\n};\n\n/**\n * Setup arrow head and define the marker. The result is appended to the svg.\n *\n * @param {SVGSVGElement} elem The SVG element to append to\n */\nconst insertMarkers = function (elem) {\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'extensionStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,7 L18,13 V 1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'extensionEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'compositionStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'compositionEnd')\n .attr('refX', 19)\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 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'aggregationStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'aggregationEnd')\n .attr('refX', 19)\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 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'dependencyStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'dependencyEnd')\n .attr('refX', 19)\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/**\n * Merges the value of `conf` with the passed `cnf`\n *\n * @param {object} cnf Config to merge\n */\nexport const setConf = function (cnf) {\n const keys = Object.keys(cnf);\n\n keys.forEach(function (key) {\n conf[key] = cnf[key];\n });\n};\n\n/**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n *\n * @param {string} text\n * @param {string} id\n */\nexport const draw = function (text, id) {\n idCache = {};\n parser.yy.clear();\n parser.parse(text);\n\n log.info('Rendering diagram ' + text);\n\n const securityLevel = getConfig().securityLevel;\n // Handle root and Document for when rendering in sanbox mode\n let sandboxElement;\n if (securityLevel === 'sandbox') {\n sandboxElement = select('#i' + id);\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\n // Fetch the default direction, use TD if none was found\n const diagram = root.select(`[id='${id}']`);\n diagram.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n insertMarkers(diagram);\n\n // Layout graph, Create a new directed graph\n const g = new graphlib.Graph({\n multigraph: true,\n });\n\n // Set an object for the graph label\n g.setGraph({\n isMultiGraph: true,\n });\n\n // Default to assigning a new object as a label for each new edge.\n g.setDefaultEdgeLabel(function () {\n return {};\n });\n\n const classes = classDb.getClasses();\n const keys = Object.keys(classes);\n\n for (let i = 0; i < keys.length; i++) {\n const classDef = classes[keys[i]];\n const node = svgDraw.drawClass(diagram, classDef, conf);\n idCache[node.id] = node;\n\n // Add nodes to the graph. The first argument is the node id. The second is\n // metadata about the node. In this case we're going to add labels to each of\n // our nodes.\n g.setNode(node.id, node);\n\n log.info('Org height: ' + node.height);\n }\n\n const relations = classDb.getRelations();\n relations.forEach(function (relation) {\n log.info(\n 'tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation)\n );\n g.setEdge(\n getGraphId(relation.id1),\n getGraphId(relation.id2),\n {\n relation: relation,\n },\n relation.title || 'DEFAULT'\n );\n });\n\n dagre.layout(g);\n g.nodes().forEach(function (v) {\n if (typeof v !== 'undefined' && typeof g.node(v) !== 'undefined') {\n log.debug('Node ' + v + ': ' + JSON.stringify(g.node(v)));\n root\n .select('#' + lookUpDomId(v))\n .attr(\n 'transform',\n 'translate(' +\n (g.node(v).x - g.node(v).width / 2) +\n ',' +\n (g.node(v).y - g.node(v).height / 2) +\n ' )'\n );\n }\n });\n\n g.edges().forEach(function (e) {\n if (typeof e !== 'undefined' && typeof g.edge(e) !== 'undefined') {\n log.debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(g.edge(e)));\n svgDraw.drawEdge(diagram, g.edge(e), g.edge(e).relation, conf);\n }\n });\n\n const svgBounds = diagram.node().getBBox();\n const width = svgBounds.width + padding * 2;\n const height = svgBounds.height + padding * 2;\n\n configureSvgSize(diagram, height, width, conf.useMaxWidth);\n\n // Ensure the viewBox includes the whole svgBounds area with extra space for padding\n const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`;\n log.debug(`viewBox ${vBox}`);\n diagram.attr('viewBox', vBox);\n addSVGAccessibilityFields(parser.yy, diagram, id);\n};\n\nexport default {\n setConf,\n draw,\n};\n","const getStyles = (options) =>\n `g.classGroup text {\n fill: ${options.nodeBorder};\n fill: ${options.classText};\n stroke: none;\n font-family: ${options.fontFamily};\n font-size: 10px;\n\n .title {\n font-weight: bolder;\n }\n\n}\n\n.nodeLabel, .edgeLabel {\n color: ${options.classText};\n}\n.edgeLabel .label rect {\n fill: ${options.mainBkg};\n}\n.label text {\n fill: ${options.classText};\n}\n.edgeLabel .label span {\n background: ${options.mainBkg};\n}\n\n.classTitle {\n font-weight: bolder;\n}\n.node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${options.mainBkg};\n stroke: ${options.nodeBorder};\n stroke-width: 1px;\n }\n\n\n.divider {\n stroke: ${options.nodeBorder};\n stroke: 1;\n}\n\ng.clickable {\n cursor: pointer;\n}\n\ng.classGroup rect {\n fill: ${options.mainBkg};\n stroke: ${options.nodeBorder};\n}\n\ng.classGroup line {\n stroke: ${options.nodeBorder};\n stroke-width: 1;\n}\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${options.mainBkg};\n opacity: 0.5;\n}\n\n.classLabel .label {\n fill: ${options.nodeBorder};\n font-size: 10px;\n}\n\n.relation {\n stroke: ${options.lineColor};\n stroke-width: 1;\n fill: none;\n}\n\n.dashed-line{\n stroke-dasharray: 3;\n}\n\n#compositionStart, .composition {\n fill: ${options.lineColor} !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n}\n\n#compositionEnd, .composition {\n fill: ${options.lineColor} !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${options.lineColor} !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ${options.lineColor} !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionStart, .extension {\n fill: ${options.lineColor} !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n}\n\n#extensionEnd, .extension {\n fill: ${options.lineColor} !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationStart, .aggregation {\n fill: ${options.mainBkg} !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n}\n\n#aggregationEnd, .aggregation {\n fill: ${options.mainBkg} !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n}\n\n.edgeTerminals {\n font-size: 11px;\n}\n\n`;\n\nexport default getStyles;\n","import { line, curveBasis } from 'd3';\nimport { lookUpDomId, relationType } from './classDb';\nimport utils from '../../utils';\nimport { log } from '../../logger';\n\nlet edgeCount = 0;\nexport const drawEdge = function (elem, path, relation, conf) {\n const getRelationType = function (type) {\n switch (type) {\n case relationType.AGGREGATION:\n return 'aggregation';\n case relationType.EXTENSION:\n return 'extension';\n case relationType.COMPOSITION:\n return 'composition';\n case relationType.DEPENDENCY:\n return 'dependency';\n }\n };\n\n path.points = path.points.filter((p) => !Number.isNaN(p.y));\n\n // The data for our line\n const lineData = path.points;\n\n // This is the accessor function we talked about above\n const lineFunction = line()\n .x(function (d) {\n return d.x;\n })\n .y(function (d) {\n return d.y;\n })\n .curve(curveBasis);\n\n const svgPath = elem\n .append('path')\n .attr('d', lineFunction(lineData))\n .attr('id', 'edge' + edgeCount)\n .attr('class', 'relation');\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 if (relation.relation.lineType == 1) {\n svgPath.attr('class', 'relation dashed-line');\n }\n if (relation.relation.type1 !== 'none') {\n svgPath.attr(\n 'marker-start',\n 'url(' + url + '#' + getRelationType(relation.relation.type1) + 'Start' + ')'\n );\n }\n if (relation.relation.type2 !== 'none') {\n svgPath.attr(\n 'marker-end',\n 'url(' + url + '#' + getRelationType(relation.relation.type2) + 'End' + ')'\n );\n }\n\n let x, y;\n const l = path.points.length;\n // Calculate Label position\n let labelPosition = utils.calcLabelPosition(path.points);\n x = labelPosition.x;\n y = labelPosition.y;\n\n let p1_card_x, p1_card_y;\n let p2_card_x, p2_card_y;\n\n if (l % 2 !== 0 && l > 1) {\n let cardinality_1_point = utils.calcCardinalityPosition(\n relation.relation.type1 !== 'none',\n path.points,\n path.points[0]\n );\n let cardinality_2_point = utils.calcCardinalityPosition(\n relation.relation.type2 !== 'none',\n path.points,\n path.points[l - 1]\n );\n\n log.debug('cardinality_1_point ' + JSON.stringify(cardinality_1_point));\n log.debug('cardinality_2_point ' + JSON.stringify(cardinality_2_point));\n\n p1_card_x = cardinality_1_point.x;\n p1_card_y = cardinality_1_point.y;\n p2_card_x = cardinality_2_point.x;\n p2_card_y = cardinality_2_point.y;\n }\n\n if (typeof relation.title !== 'undefined') {\n const g = elem.append('g').attr('class', 'classLabel');\n const label = g\n .append('text')\n .attr('class', 'label')\n .attr('x', x)\n .attr('y', y)\n .attr('fill', 'red')\n .attr('text-anchor', 'middle')\n .text(relation.title);\n\n window.label = label;\n const bounds = label.node().getBBox();\n\n g.insert('rect', ':first-child')\n .attr('class', 'box')\n .attr('x', bounds.x - conf.padding / 2)\n .attr('y', bounds.y - conf.padding / 2)\n .attr('width', bounds.width + conf.padding)\n .attr('height', bounds.height + conf.padding);\n }\n\n log.info('Rendering relation ' + JSON.stringify(relation));\n if (typeof relation.relationTitle1 !== 'undefined' && relation.relationTitle1 !== 'none') {\n const g = elem.append('g').attr('class', 'cardinality');\n g.append('text')\n .attr('class', 'type1')\n .attr('x', p1_card_x)\n .attr('y', p1_card_y)\n .attr('fill', 'black')\n .attr('font-size', '6')\n .text(relation.relationTitle1);\n }\n if (typeof relation.relationTitle2 !== 'undefined' && relation.relationTitle2 !== 'none') {\n const g = elem.append('g').attr('class', 'cardinality');\n g.append('text')\n .attr('class', 'type2')\n .attr('x', p2_card_x)\n .attr('y', p2_card_y)\n .attr('fill', 'black')\n .attr('font-size', '6')\n .text(relation.relationTitle2);\n }\n\n edgeCount++;\n};\n\n/**\n * Renders a class diagram\n *\n * @param {SVGSVGElement} elem The element to draw it into\n * @param classDef\n * @param conf\n * @todo Add more information in the JSDOC here\n */\nexport const drawClass = function (elem, classDef, conf) {\n log.info('Rendering class ' + classDef);\n\n const id = classDef.id;\n const classInfo = {\n id: id,\n label: classDef.id,\n width: 0,\n height: 0,\n };\n\n // add class group\n const g = elem.append('g').attr('id', lookUpDomId(id)).attr('class', 'classGroup');\n\n // add title\n let title;\n if (classDef.link) {\n title = g\n .append('svg:a')\n .attr('xlink:href', classDef.link)\n .attr('target', classDef.linkTarget)\n .append('text')\n .attr('y', conf.textHeight + conf.padding)\n .attr('x', 0);\n } else {\n title = g\n .append('text')\n .attr('y', conf.textHeight + conf.padding)\n .attr('x', 0);\n }\n\n // add annotations\n let isFirst = true;\n classDef.annotations.forEach(function (member) {\n const titleText2 = title.append('tspan').text('«' + member + '»');\n if (!isFirst) titleText2.attr('dy', conf.textHeight);\n isFirst = false;\n });\n\n let classTitleString = classDef.id;\n\n if (classDef.type !== undefined && classDef.type !== '') {\n classTitleString += '<' + classDef.type + '>';\n }\n\n const classTitle = title.append('tspan').text(classTitleString).attr('class', 'title');\n\n // If class has annotations the title needs to have an offset of the text height\n if (!isFirst) classTitle.attr('dy', conf.textHeight);\n\n const titleHeight = title.node().getBBox().height;\n\n const membersLine = g\n .append('line') // text label for the x axis\n .attr('x1', 0)\n .attr('y1', conf.padding + titleHeight + conf.dividerMargin / 2)\n .attr('y2', conf.padding + titleHeight + conf.dividerMargin / 2);\n\n const members = g\n .append('text') // text label for the x axis\n .attr('x', conf.padding)\n .attr('y', titleHeight + conf.dividerMargin + conf.textHeight)\n .attr('fill', 'white')\n .attr('class', 'classText');\n\n isFirst = true;\n classDef.members.forEach(function (member) {\n addTspan(members, member, isFirst, conf);\n isFirst = false;\n });\n\n const membersBox = members.node().getBBox();\n\n const methodsLine = g\n .append('line') // text label for the x axis\n .attr('x1', 0)\n .attr('y1', conf.padding + titleHeight + conf.dividerMargin + membersBox.height)\n .attr('y2', conf.padding + titleHeight + conf.dividerMargin + membersBox.height);\n\n const methods = g\n .append('text') // text label for the x axis\n .attr('x', conf.padding)\n .attr('y', titleHeight + 2 * conf.dividerMargin + membersBox.height + conf.textHeight)\n .attr('fill', 'white')\n .attr('class', 'classText');\n\n isFirst = true;\n\n classDef.methods.forEach(function (method) {\n addTspan(methods, method, isFirst, conf);\n isFirst = false;\n });\n\n const classBox = g.node().getBBox();\n var cssClassStr = ' ';\n\n if (classDef.cssClasses.length > 0) {\n cssClassStr = cssClassStr + classDef.cssClasses.join(' ');\n }\n\n const rect = g\n .insert('rect', ':first-child')\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', classBox.width + 2 * conf.padding)\n .attr('height', classBox.height + conf.padding + 0.5 * conf.dividerMargin)\n .attr('class', cssClassStr);\n\n const rectWidth = rect.node().getBBox().width;\n\n // Center title\n // We subtract the width of each text element from the class box width and divide it by 2\n title.node().childNodes.forEach(function (x) {\n x.setAttribute('x', (rectWidth - x.getBBox().width) / 2);\n });\n\n if (classDef.tooltip) {\n title.insert('title').text(classDef.tooltip);\n }\n\n membersLine.attr('x2', rectWidth);\n methodsLine.attr('x2', rectWidth);\n\n classInfo.width = rectWidth;\n classInfo.height = classBox.height + conf.padding + 0.5 * conf.dividerMargin;\n\n return classInfo;\n};\n\nexport const parseMember = function (text) {\n const fieldRegEx = /^(\\+|-|~|#)?(\\w+)(~\\w+~|\\[\\])?\\s+(\\w+) *(\\*|\\$)?$/;\n const methodRegEx = /^([+|\\-|~|#])?(\\w+) *\\( *(.*)\\) *(\\*|\\$)? *(\\w*[~|[\\]]*\\s*\\w*~?)$/;\n\n let fieldMatch = text.match(fieldRegEx);\n let methodMatch = text.match(methodRegEx);\n\n if (fieldMatch && !methodMatch) {\n return buildFieldDisplay(fieldMatch);\n } else if (methodMatch) {\n return buildMethodDisplay(methodMatch);\n } else {\n return buildLegacyDisplay(text);\n }\n};\n\nconst buildFieldDisplay = function (parsedText) {\n let cssStyle = '';\n let displayText = '';\n\n try {\n let visibility = parsedText[1] ? parsedText[1].trim() : '';\n let fieldType = parsedText[2] ? parsedText[2].trim() : '';\n let genericType = parsedText[3] ? parseGenericTypes(parsedText[3].trim()) : '';\n let fieldName = parsedText[4] ? parsedText[4].trim() : '';\n let classifier = parsedText[5] ? parsedText[5].trim() : '';\n\n displayText = visibility + fieldType + genericType + ' ' + fieldName;\n cssStyle = parseClassifier(classifier);\n } catch (err) {\n displayText = parsedText;\n }\n\n return {\n displayText: displayText,\n cssStyle: cssStyle,\n };\n};\n\nconst buildMethodDisplay = function (parsedText) {\n let cssStyle = '';\n let displayText = '';\n\n try {\n let visibility = parsedText[1] ? parsedText[1].trim() : '';\n let methodName = parsedText[2] ? parsedText[2].trim() : '';\n let parameters = parsedText[3] ? parseGenericTypes(parsedText[3].trim()) : '';\n let classifier = parsedText[4] ? parsedText[4].trim() : '';\n let returnType = parsedText[5] ? ' : ' + parseGenericTypes(parsedText[5]).trim() : '';\n\n displayText = visibility + methodName + '(' + parameters + ')' + returnType;\n cssStyle = parseClassifier(classifier);\n } catch (err) {\n displayText = parsedText;\n }\n\n return {\n displayText: displayText,\n cssStyle: cssStyle,\n };\n};\n\nconst buildLegacyDisplay = function (text) {\n // if for some reason we dont have any match, use old format to parse text\n let displayText = '';\n let cssStyle = '';\n let memberText = '';\n let returnType = '';\n let methodStart = text.indexOf('(');\n let methodEnd = text.indexOf(')');\n\n if (methodStart > 1 && methodEnd > methodStart && methodEnd <= text.length) {\n let visibility = '';\n let methodName = '';\n\n let firstChar = text.substring(0, 1);\n if (firstChar.match(/\\w/)) {\n methodName = text.substring(0, methodStart).trim();\n } else {\n if (firstChar.match(/\\+|-|~|#/)) {\n visibility = firstChar;\n }\n\n methodName = text.substring(1, methodStart).trim();\n }\n\n let parameters = text.substring(methodStart + 1, methodEnd);\n let classifier = text.substring(methodEnd + 1, 1);\n cssStyle = parseClassifier(classifier);\n\n displayText = visibility + methodName + '(' + parseGenericTypes(parameters.trim()) + ')';\n\n if (methodEnd < memberText.length) {\n returnType = text.substring(methodEnd + 2).trim();\n if (returnType !== '') {\n returnType = ' : ' + parseGenericTypes(returnType);\n }\n }\n } else {\n // finally - if all else fails, just send the text back as written (other than parsing for generic types)\n displayText = parseGenericTypes(text);\n }\n\n return {\n displayText: displayText,\n cssStyle: cssStyle,\n };\n};\n\n/**\n * Adds a for a member in a diagram\n *\n * @param {SVGElement} textEl The element to append to\n * @param {string} txt The member\n * @param {boolean} isFirst\n * @param {{ padding: string; textHeight: string }} conf The configuration for the member\n */\nconst addTspan = function (textEl, txt, isFirst, conf) {\n let member = parseMember(txt);\n\n const tSpan = textEl.append('tspan').attr('x', conf.padding).text(member.displayText);\n\n if (member.cssStyle !== '') {\n tSpan.attr('style', member.cssStyle);\n }\n\n if (!isFirst) {\n tSpan.attr('dy', conf.textHeight);\n }\n};\n\n/**\n * Makes generics in typescript syntax\n *\n * @example Array of array of strings in typescript syntax\n * // returns \"Array>\"\n * parseGenericTypes('Array~Array~string~~');\n *\n * @param {string} text The text to convert\n * @returns {string} The converted string\n */\nconst parseGenericTypes = function (text) {\n let cleanedText = text;\n\n if (text.indexOf('~') != -1) {\n cleanedText = cleanedText.replace('~', '<');\n cleanedText = cleanedText.replace('~', '>');\n\n return parseGenericTypes(cleanedText);\n } else {\n return cleanedText;\n }\n};\n\n/**\n * Gives the styles for a classifier\n *\n * @param {'+' | '-' | '#' | '~' | '*' | '$'} classifier The classifier string\n * @returns {string} Styling for the classifier\n */\nconst parseClassifier = function (classifier) {\n switch (classifier) {\n case '*':\n return 'font-style:italic;';\n case '$':\n return 'text-decoration:underline;';\n default:\n return '';\n }\n};\n\nexport default {\n drawClass,\n drawEdge,\n parseMember,\n};\n","import DOMPurify from 'dompurify';\n\n/**\n * Gets the number of lines in a string\n *\n * @param {string | undefined} s The string to check the lines for\n * @returns {number} The number of lines in that string\n */\nexport const getRows = (s) => {\n if (!s) return 1;\n let str = breakToPlaceholder(s);\n str = str.replace(/\\\\n/g, '#br#');\n return str.split('#br#');\n};\n\nexport const removeEscapes = (text) => {\n let newStr = text.replace(/\\\\u[\\dA-F]{4}/gi, function (match) {\n return String.fromCharCode(parseInt(match.replace(/\\\\u/g, ''), 16));\n });\n\n newStr = newStr.replace(/\\\\x([0-9a-f]{2})/gi, (_, c) => String.fromCharCode(parseInt(c, 16)));\n newStr = newStr.replace(/\\\\[\\d\\d\\d]{3}/gi, function (match) {\n return String.fromCharCode(parseInt(match.replace(/\\\\/g, ''), 8));\n });\n newStr = newStr.replace(/\\\\[\\d\\d\\d]{2}/gi, function (match) {\n return String.fromCharCode(parseInt(match.replace(/\\\\/g, ''), 8));\n });\n\n return newStr;\n};\n\n/**\n * Removes script tags from a text\n *\n * @param {string} txt The text to sanitize\n * @returns {string} The safer text\n */\nexport const removeScript = (txt) => {\n var rs = '';\n var idx = 0;\n\n while (idx >= 0) {\n idx = txt.indexOf('= 0) {\n rs += txt.substr(0, idx);\n txt = txt.substr(idx + 1);\n\n idx = txt.indexOf('');\n if (idx >= 0) {\n idx += 9;\n txt = txt.substr(idx);\n }\n } else {\n rs += txt;\n idx = -1;\n break;\n }\n }\n let decodedText = removeEscapes(rs);\n decodedText = decodedText.replaceAll(/script>/gi, '#');\n decodedText = decodedText.replaceAll(/javascript:/gi, '#');\n decodedText = decodedText.replaceAll(/javascript&colon/gi, '#');\n decodedText = decodedText.replaceAll(/onerror=/gi, 'onerror:');\n decodedText = decodedText.replaceAll(/`;\n } else {\n if (cnf.securityLevel !== 'loose') {\n svgCode = DOMPurify.sanitize(svgCode, {\n ADD_TAGS: ['foreignobject'],\n ADD_ATTR: ['dominant-baseline'],\n });\n }\n }\n\n if (typeof cb !== 'undefined') {\n switch (graphType) {\n case 'flowchart':\n case 'flowchart-v2':\n cb(svgCode, flowDb.bindFunctions);\n break;\n case 'gantt':\n cb(svgCode, ganttDb.bindFunctions);\n break;\n case 'class':\n case 'classDiagram':\n cb(svgCode, classDb.bindFunctions);\n break;\n default:\n cb(svgCode);\n }\n } else {\n log.debug('CB = undefined!');\n }\n attachFunctions();\n\n const tmpElementSelector = cnf.securityLevel === 'sandbox' ? '#i' + id : '#d' + id;\n const node = select(tmpElementSelector).node();\n if (node !== null && typeof node.remove === 'function') {\n select(tmpElementSelector).node().remove();\n }\n\n return svgCode;\n};\n\nlet currentDirective = {};\n\nconst parseDirective = function (p, statement, context, type) {\n try {\n if (statement !== undefined) {\n statement = statement.trim();\n switch (context) {\n case 'open_directive':\n currentDirective = {};\n break;\n case 'type_directive':\n currentDirective.type = statement.toLowerCase();\n break;\n case 'arg_directive':\n currentDirective.args = JSON.parse(statement);\n break;\n case 'close_directive':\n handleDirective(p, currentDirective, type);\n currentDirective = null;\n break;\n }\n }\n } catch (error) {\n log.error(\n `Error while rendering sequenceDiagram directive: ${statement} jison context: ${context}`\n );\n log.error(error.message);\n }\n};\n\nconst handleDirective = function (p, directive, type) {\n log.debug(`Directive type=${directive.type} with args:`, directive.args);\n switch (directive.type) {\n case 'init':\n case 'initialize': {\n ['config'].forEach((prop) => {\n if (typeof directive.args[prop] !== 'undefined') {\n if (type === 'flowchart-v2') {\n type = 'flowchart';\n }\n directive.args[type] = directive.args[prop];\n delete directive.args[prop];\n }\n });\n log.debug('sanitize in handleDirective', directive.args);\n directiveSanitizer(directive.args);\n log.debug('sanitize in handleDirective (done)', directive.args);\n reinitialize(directive.args);\n configApi.addDirective(directive.args);\n break;\n }\n case 'wrap':\n case 'nowrap':\n if (p && p['setWrap']) {\n p.setWrap(directive.type === 'wrap');\n }\n break;\n case 'themeCss':\n log.warn('themeCss encountered');\n break;\n default:\n log.warn(\n `Unhandled directive: source: '%%{${directive.type}: ${JSON.stringify(\n directive.args ? directive.args : {}\n )}}%%`,\n directive\n );\n break;\n }\n};\n\n/** @param {any} conf */\nfunction updateRendererConfigs(conf) {\n // Todo remove, all diagrams should get config on demand from the config object, no need for this\n\n // gitGraphRenderer.setConf(conf.git); // Todo Remove all of these\n flowRenderer.setConf(conf.flowchart);\n flowRendererV2.setConf(conf.flowchart);\n if (typeof conf['sequenceDiagram'] !== 'undefined') {\n sequenceRenderer.setConf(assignWithDepth(conf.sequence, conf['sequenceDiagram']));\n }\n sequenceRenderer.setConf(conf.sequence);\n ganttRenderer.setConf(conf.gantt);\n classRenderer.setConf(conf.class);\n stateRenderer.setConf(conf.state);\n stateRendererV2.setConf(conf.state);\n infoRenderer.setConf(conf.class);\n // pieRenderer.setConf(conf.class);\n erRenderer.setConf(conf.er);\n journeyRenderer.setConf(conf.journey);\n requirementRenderer.setConf(conf.requirement);\n errorRenderer.setConf(conf.class);\n}\n\n/** To be removed */\nfunction reinitialize() {\n // `mermaidAPI.reinitialize: v${pkg.version}`,\n // JSON.stringify(options),\n // options.themeVariables.primaryColor;\n // // if (options.theme && theme[options.theme]) {\n // // options.themeVariables = theme[options.theme].getThemeVariables(options.themeVariables);\n // // }\n // // Set default options\n // const config =\n // typeof options === 'object' ? configApi.setConfig(options) : configApi.getSiteConfig();\n // updateRendererConfigs(config);\n // setLogLevel(config.logLevel);\n // log.debug('mermaidAPI.reinitialize: ', config);\n}\n\n/** @param {any} options */\nfunction initialize(options) {\n // console.warn(`mermaidAPI.initialize: v${pkg.version} `, options);\n\n // Handle legacy location of font-family configuration\n if (options && options.fontFamily) {\n if (!options.themeVariables) {\n options.themeVariables = { fontFamily: options.fontFamily };\n } else {\n if (!options.themeVariables.fontFamily) {\n options.themeVariables = { fontFamily: options.fontFamily };\n }\n }\n }\n // Set default options\n configApi.saveConfigFromInitialize(options);\n\n if (options && options.theme && theme[options.theme]) {\n // Todo merge with user options\n options.themeVariables = theme[options.theme].getThemeVariables(options.themeVariables);\n } else {\n if (options) options.themeVariables = theme.default.getThemeVariables(options.themeVariables);\n }\n\n const config =\n typeof options === 'object' ? configApi.setSiteConfig(options) : configApi.getSiteConfig();\n\n updateRendererConfigs(config);\n setLogLevel(config.logLevel);\n // log.debug('mermaidAPI.initialize: ', config);\n}\n\nconst mermaidAPI = Object.freeze({\n render,\n parse,\n parseDirective,\n initialize,\n reinitialize,\n getConfig: configApi.getConfig,\n setConfig: configApi.setConfig,\n getSiteConfig: configApi.getSiteConfig,\n updateSiteConfig: configApi.updateSiteConfig,\n reset: () => {\n // console.warn('reset');\n configApi.reset();\n // const siteConfig = configApi.getSiteConfig();\n // updateRendererConfigs(siteConfig);\n },\n globalReset: () => {\n configApi.reset(configApi.defaultConfig);\n updateRendererConfigs(configApi.getConfig());\n },\n defaultConfig: configApi.defaultConfig,\n});\n\nsetLogLevel(configApi.getConfig().logLevel);\nconfigApi.reset(configApi.getConfig());\n\nexport default mermaidAPI;\n/**\n * ## mermaidAPI configuration defaults\n *\n * ```html\n * \n * ```\n */\n","import classDiagram from './diagrams/class/styles';\nimport er from './diagrams/er/styles';\nimport flowchart from './diagrams/flowchart/styles';\nimport gantt from './diagrams/gantt/styles';\nimport gitGraph from './diagrams/git/styles';\nimport info from './diagrams/info/styles';\nimport pie from './diagrams/pie/styles';\nimport requirement from './diagrams/requirement/styles';\nimport sequence from './diagrams/sequence/styles';\nimport stateDiagram from './diagrams/state/styles';\nimport journey from './diagrams/user-journey/styles';\nimport c4 from './diagrams/c4/styles';\nimport { log } from './logger';\n\nconst themes = {\n flowchart,\n 'flowchart-v2': flowchart,\n sequence,\n gantt,\n classDiagram,\n 'classDiagram-v2': classDiagram,\n class: classDiagram,\n stateDiagram,\n state: stateDiagram,\n gitGraph,\n info,\n pie,\n er,\n journey,\n requirement,\n c4,\n};\n\nexport const calcThemeVariables = (theme, userOverRides) => {\n log.info('userOverides', userOverRides);\n return theme.calcColors(userOverRides);\n};\n\nconst getStyles = (type, userStyles, options) => {\n return ` {\n font-family: ${options.fontFamily};\n font-size: ${options.fontSize};\n fill: ${options.textColor}\n }\n\n /* Classes common for multiple diagrams */\n\n .error-icon {\n fill: ${options.errorBkgColor};\n }\n .error-text {\n fill: ${options.errorTextColor};\n stroke: ${options.errorTextColor};\n }\n\n .edge-thickness-normal {\n stroke-width: 2px;\n }\n .edge-thickness-thick {\n stroke-width: 3.5px\n }\n .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n\n .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n .marker {\n fill: ${options.lineColor};\n stroke: ${options.lineColor};\n }\n .marker.cross {\n stroke: ${options.lineColor};\n }\n\n svg {\n font-family: ${options.fontFamily};\n font-size: ${options.fontSize};\n }\n\n ${themes[type](options)}\n\n ${userStyles}\n`;\n};\n\nexport default getStyles;\n","import { getThemeVariables as baseThemeVariables } from './theme-base';\nimport { getThemeVariables as darkThemeVariables } from './theme-dark';\nimport { getThemeVariables as defaultThemeVariables } from './theme-default';\nimport { getThemeVariables as forestThemeVariables } from './theme-forest';\nimport { getThemeVariables as neutralThemeVariables } from './theme-neutral';\n\nexport default {\n base: {\n getThemeVariables: baseThemeVariables,\n },\n dark: {\n getThemeVariables: darkThemeVariables,\n },\n default: {\n getThemeVariables: defaultThemeVariables,\n },\n forest: {\n getThemeVariables: forestThemeVariables,\n },\n neutral: {\n getThemeVariables: neutralThemeVariables,\n },\n};\n","import { darken, lighten, adjust, invert } from 'khroma';\nimport { mkBorder } from './theme-helpers';\nclass Theme {\n constructor() {\n /** # Base variables */\n /**\n * - Background - used to know what the background color is of the diagram. This is used for\n * deducing colors for instance line color. Default value is #f4f4f4.\n */\n this.background = '#f4f4f4';\n this.darkMode = false;\n\n this.primaryColor = '#fff4dd';\n\n this.noteBkgColor = '#fff5ad';\n this.noteTextColor = '#333';\n\n // dark\n\n this.fontFamily = '\"trebuchet ms\", verdana, arial, sans-serif';\n this.fontSize = '16px';\n }\n updateColors() {\n // The || is to make sure that if the variable has been defined by a user override that value is to be used\n\n /* Main */\n this.primaryTextColor = this.primaryTextColor || (this.darkMode ? '#eee' : '#333'); // invert(this.primaryColor);\n this.secondaryColor = this.secondaryColor || adjust(this.primaryColor, { h: -120 });\n this.tertiaryColor = this.tertiaryColor || adjust(this.primaryColor, { h: 180, l: 5 });\n\n this.primaryBorderColor = this.primaryBorderColor || mkBorder(this.primaryColor, this.darkMode);\n this.secondaryBorderColor =\n this.secondaryBorderColor || mkBorder(this.secondaryColor, this.darkMode);\n this.tertiaryBorderColor =\n this.tertiaryBorderColor || mkBorder(this.tertiaryColor, this.darkMode);\n this.noteBorderColor = this.noteBorderColor || mkBorder(this.noteBkgColor, this.darkMode);\n this.noteBkgColor = this.noteBkgColor || '#fff5ad';\n this.noteTextColor = this.noteTextColor || '#333';\n\n this.secondaryTextColor = this.secondaryTextColor || invert(this.secondaryColor);\n this.tertiaryTextColor = this.tertiaryTextColor || invert(this.tertiaryColor);\n this.lineColor = this.lineColor || invert(this.background);\n this.textColor = this.textColor || this.primaryTextColor;\n\n /* Flowchart variables */\n this.nodeBkg = this.nodeBkg || this.primaryColor;\n this.mainBkg = this.mainBkg || this.primaryColor;\n this.nodeBorder = this.nodeBorder || this.primaryBorderColor;\n this.clusterBkg = this.clusterBkg || this.tertiaryColor;\n this.clusterBorder = this.clusterBorder || this.tertiaryBorderColor;\n this.defaultLinkColor = this.defaultLinkColor || this.lineColor;\n this.titleColor = this.titleColor || this.tertiaryTextColor;\n this.edgeLabelBackground =\n this.edgeLabelBackground ||\n (this.darkMode ? darken(this.secondaryColor, 30) : this.secondaryColor);\n this.nodeTextColor = this.nodeTextColor || this.primaryTextColor;\n /* Sequence Diagram variables */\n\n // this.actorBorder = lighten(this.border1, 0.5);\n this.actorBorder = this.actorBorder || this.primaryBorderColor;\n this.actorBkg = this.actorBkg || this.mainBkg;\n this.actorTextColor = this.actorTextColor || this.primaryTextColor;\n this.actorLineColor = this.actorLineColor || 'grey';\n this.labelBoxBkgColor = this.labelBoxBkgColor || this.actorBkg;\n this.signalColor = this.signalColor || this.textColor;\n this.signalTextColor = this.signalTextColor || this.textColor;\n this.labelBoxBorderColor = this.labelBoxBorderColor || this.actorBorder;\n this.labelTextColor = this.labelTextColor || this.actorTextColor;\n this.loopTextColor = this.loopTextColor || this.actorTextColor;\n this.activationBorderColor = this.activationBorderColor || darken(this.secondaryColor, 10);\n this.activationBkgColor = this.activationBkgColor || this.secondaryColor;\n this.sequenceNumberColor = this.sequenceNumberColor || invert(this.lineColor);\n\n /* Gantt chart variables */\n\n this.sectionBkgColor = this.sectionBkgColor || this.tertiaryColor;\n this.altSectionBkgColor = this.altSectionBkgColor || 'white';\n this.sectionBkgColor = this.sectionBkgColor || this.secondaryColor;\n this.sectionBkgColor2 = this.sectionBkgColor2 || this.primaryColor;\n this.excludeBkgColor = this.excludeBkgColor || '#eeeeee';\n this.taskBorderColor = this.taskBorderColor || this.primaryBorderColor;\n this.taskBkgColor = this.taskBkgColor || this.primaryColor;\n this.activeTaskBorderColor = this.activeTaskBorderColor || this.primaryColor;\n this.activeTaskBkgColor = this.activeTaskBkgColor || lighten(this.primaryColor, 23);\n this.gridColor = this.gridColor || 'lightgrey';\n this.doneTaskBkgColor = this.doneTaskBkgColor || 'lightgrey';\n this.doneTaskBorderColor = this.doneTaskBorderColor || 'grey';\n this.critBorderColor = this.critBorderColor || '#ff8888';\n this.critBkgColor = this.critBkgColor || 'red';\n this.todayLineColor = this.todayLineColor || 'red';\n this.taskTextColor = this.taskTextColor || this.textColor;\n this.taskTextOutsideColor = this.taskTextOutsideColor || this.textColor;\n this.taskTextLightColor = this.taskTextLightColor || this.textColor;\n this.taskTextColor = this.taskTextColor || this.primaryTextColor;\n this.taskTextDarkColor = this.taskTextDarkColor || this.textColor;\n this.taskTextClickableColor = this.taskTextClickableColor || '#003163';\n\n /* Sequence Diagram variables */\n\n this.personBorder = this.personBorder || this.primaryBorderColor;\n this.personBkg = this.personBkg || this.mainBkg;\n\n /* state colors */\n this.transitionColor = this.transitionColor || this.lineColor;\n this.transitionLabelColor = this.transitionLabelColor || this.textColor;\n /* The color of the text tables of the states*/\n this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;\n\n this.stateBkg = this.stateBkg || this.mainBkg;\n this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;\n this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;\n this.altBackground = this.altBackground || this.tertiaryColor;\n this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;\n this.compositeBorder = this.compositeBorder || this.nodeBorder;\n this.innerEndBackground = this.nodeBorder;\n this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;\n this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;\n this.transitionColor = this.transitionColor || this.lineColor;\n this.specialStateColor = this.lineColor;\n\n /* class */\n this.classText = this.classText || this.textColor;\n\n /* user-journey */\n this.fillType0 = this.fillType0 || this.primaryColor;\n this.fillType1 = this.fillType1 || this.secondaryColor;\n this.fillType2 = this.fillType2 || adjust(this.primaryColor, { h: 64 });\n this.fillType3 = this.fillType3 || adjust(this.secondaryColor, { h: 64 });\n this.fillType4 = this.fillType4 || adjust(this.primaryColor, { h: -64 });\n this.fillType5 = this.fillType5 || adjust(this.secondaryColor, { h: -64 });\n this.fillType6 = this.fillType6 || adjust(this.primaryColor, { h: 128 });\n this.fillType7 = this.fillType7 || adjust(this.secondaryColor, { h: 128 });\n\n /* pie */\n this.pie1 = this.pie1 || this.primaryColor;\n this.pie2 = this.pie2 || this.secondaryColor;\n this.pie3 = this.pie3 || this.tertiaryColor;\n this.pie4 = this.pie4 || adjust(this.primaryColor, { l: -10 });\n this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -10 });\n this.pie6 = this.pie6 || adjust(this.tertiaryColor, { l: -10 });\n this.pie7 = this.pie7 || adjust(this.primaryColor, { h: +60, l: -10 });\n this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -10 });\n this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: 0 });\n this.pie10 = this.pie10 || adjust(this.primaryColor, { h: +60, l: -20 });\n this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -60, l: -20 });\n this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -10 });\n this.pieTitleTextSize = this.pieTitleTextSize || '25px';\n this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;\n this.pieSectionTextSize = this.pieSectionTextSize || '17px';\n this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;\n this.pieLegendTextSize = this.pieLegendTextSize || '17px';\n this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;\n this.pieStrokeColor = this.pieStrokeColor || 'black';\n this.pieStrokeWidth = this.pieStrokeWidth || '2px';\n this.pieOpacity = this.pieOpacity || '0.7';\n\n /* requirement-diagram */\n this.requirementBackground = this.requirementBackground || this.primaryColor;\n this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;\n this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor;\n this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;\n this.relationColor = this.relationColor || this.lineColor;\n this.relationLabelBackground =\n this.relationLabelBackground ||\n (this.darkMode ? darken(this.secondaryColor, 30) : this.secondaryColor);\n this.relationLabelColor = this.relationLabelColor || this.actorTextColor;\n\n /* git */\n this.git0 = this.git0 || this.primaryColor;\n this.git1 = this.git1 || this.secondaryColor;\n this.git2 = this.git2 || this.tertiaryColor;\n this.git3 = this.git3 || adjust(this.primaryColor, { h: -30 });\n this.git4 = this.git4 || adjust(this.primaryColor, { h: -60 });\n this.git5 = this.git5 || adjust(this.primaryColor, { h: -90 });\n this.git6 = this.git6 || adjust(this.primaryColor, { h: +60 });\n this.git7 = this.git7 || adjust(this.primaryColor, { h: +120 });\n if (this.darkMode) {\n this.git0 = lighten(this.git0, 25);\n this.git1 = lighten(this.git1, 25);\n this.git2 = lighten(this.git2, 25);\n this.git3 = lighten(this.git3, 25);\n this.git4 = lighten(this.git4, 25);\n this.git5 = lighten(this.git5, 25);\n this.git6 = lighten(this.git6, 25);\n this.git7 = lighten(this.git7, 25);\n } else {\n this.git0 = darken(this.git0, 25);\n this.git1 = darken(this.git1, 25);\n this.git2 = darken(this.git2, 25);\n this.git3 = darken(this.git3, 25);\n this.git4 = darken(this.git4, 25);\n this.git5 = darken(this.git5, 25);\n this.git6 = darken(this.git6, 25);\n this.git7 = darken(this.git7, 25);\n }\n this.gitInv0 = this.gitInv0 || invert(this.git0);\n this.gitInv1 = this.gitInv1 || invert(this.git1);\n this.gitInv2 = this.gitInv2 || invert(this.git2);\n this.gitInv3 = this.gitInv3 || invert(this.git3);\n this.gitInv4 = this.gitInv4 || invert(this.git4);\n this.gitInv5 = this.gitInv5 || invert(this.git5);\n this.gitInv6 = this.gitInv6 || invert(this.git6);\n this.gitInv7 = this.gitInv7 || invert(this.git7);\n this.branchLabelColor =\n this.branchLabelColor || (this.darkMode ? 'black' : this.labelTextColor);\n this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor;\n this.gitBranchLabel1 = this.gitBranchLabel1 || this.branchLabelColor;\n this.gitBranchLabel2 = this.gitBranchLabel2 || this.branchLabelColor;\n this.gitBranchLabel3 = this.gitBranchLabel3 || this.branchLabelColor;\n this.gitBranchLabel4 = this.gitBranchLabel4 || this.branchLabelColor;\n this.gitBranchLabel5 = this.gitBranchLabel5 || this.branchLabelColor;\n this.gitBranchLabel6 = this.gitBranchLabel6 || this.branchLabelColor;\n this.gitBranchLabel7 = this.gitBranchLabel7 || this.branchLabelColor;\n\n this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;\n this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;\n this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;\n this.tagLabelFontSize = this.tagLabelFontSize || '10px';\n this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;\n this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;\n this.commitLabelFontSize = this.commitLabelFontSize || '10px';\n }\n calculate(overrides) {\n if (typeof overrides !== 'object') {\n // Calculate colors form base colors\n this.updateColors();\n return;\n }\n\n const keys = Object.keys(overrides);\n\n // Copy values from overrides, this is mainly for base colors\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n\n // Calculate colors form base colors\n this.updateColors();\n // Copy values from overrides again in case of an override of derived value\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n }\n}\n\nexport const getThemeVariables = (userOverrides) => {\n const theme = new Theme();\n theme.calculate(userOverrides);\n return theme;\n};\n","import { invert, lighten, darken, rgba, adjust } from 'khroma';\nimport { mkBorder } from './theme-helpers';\nclass Theme {\n constructor() {\n this.background = '#333';\n this.primaryColor = '#1f2020';\n this.secondaryColor = lighten(this.primaryColor, 16);\n\n this.tertiaryColor = adjust(this.primaryColor, { h: -160 });\n this.primaryBorderColor = invert(this.background);\n this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);\n this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);\n this.primaryTextColor = invert(this.primaryColor);\n this.secondaryTextColor = invert(this.secondaryColor);\n this.tertiaryTextColor = invert(this.tertiaryColor);\n this.lineColor = invert(this.background);\n this.textColor = invert(this.background);\n\n this.mainBkg = '#1f2020';\n this.secondBkg = 'calculated';\n this.mainContrastColor = 'lightgrey';\n this.darkTextColor = lighten(invert('#323D47'), 10);\n this.lineColor = 'calculated';\n this.border1 = '#81B1DB';\n this.border2 = rgba(255, 255, 255, 0.25);\n this.arrowheadColor = 'calculated';\n this.fontFamily = '\"trebuchet ms\", verdana, arial, sans-serif';\n this.fontSize = '16px';\n this.labelBackground = '#181818';\n this.textColor = '#ccc';\n /* Flowchart variables */\n\n this.nodeBkg = 'calculated';\n this.nodeBorder = 'calculated';\n this.clusterBkg = 'calculated';\n this.clusterBorder = 'calculated';\n this.defaultLinkColor = 'calculated';\n this.titleColor = '#F9FFFE';\n this.edgeLabelBackground = 'calculated';\n\n /* Sequence Diagram variables */\n\n this.actorBorder = 'calculated';\n this.actorBkg = 'calculated';\n this.actorTextColor = 'calculated';\n this.actorLineColor = 'calculated';\n this.signalColor = 'calculated';\n this.signalTextColor = 'calculated';\n this.labelBoxBkgColor = 'calculated';\n this.labelBoxBorderColor = 'calculated';\n this.labelTextColor = 'calculated';\n this.loopTextColor = 'calculated';\n this.noteBorderColor = 'calculated';\n this.noteBkgColor = '#fff5ad';\n this.noteTextColor = 'calculated';\n this.activationBorderColor = 'calculated';\n this.activationBkgColor = 'calculated';\n this.sequenceNumberColor = 'black';\n\n /* Gantt chart variables */\n\n this.sectionBkgColor = darken('#EAE8D9', 30);\n this.altSectionBkgColor = 'calculated';\n this.sectionBkgColor2 = '#EAE8D9';\n this.taskBorderColor = rgba(255, 255, 255, 70);\n this.taskBkgColor = 'calculated';\n this.taskTextColor = 'calculated';\n this.taskTextLightColor = 'calculated';\n this.taskTextOutsideColor = 'calculated';\n this.taskTextClickableColor = '#003163';\n this.activeTaskBorderColor = rgba(255, 255, 255, 50);\n this.activeTaskBkgColor = '#81B1DB';\n this.gridColor = 'calculated';\n this.doneTaskBkgColor = 'calculated';\n this.doneTaskBorderColor = 'grey';\n this.critBorderColor = '#E83737';\n this.critBkgColor = '#E83737';\n this.taskTextDarkColor = 'calculated';\n this.todayLineColor = '#DB5757';\n\n /* C4 Context Diagram variables */\n\n this.personBorder = 'calculated';\n this.personBkg = 'calculated';\n\n /* state colors */\n this.labelColor = 'calculated';\n\n this.errorBkgColor = '#a44141';\n this.errorTextColor = '#ddd';\n }\n updateColors() {\n this.secondBkg = lighten(this.mainBkg, 16);\n this.lineColor = this.mainContrastColor;\n this.arrowheadColor = this.mainContrastColor;\n /* Flowchart variables */\n\n this.nodeBkg = this.mainBkg;\n this.nodeBorder = this.border1;\n this.clusterBkg = this.secondBkg;\n this.clusterBorder = this.border2;\n this.defaultLinkColor = this.lineColor;\n this.edgeLabelBackground = lighten(this.labelBackground, 25);\n\n /* Sequence Diagram variables */\n\n this.actorBorder = this.border1;\n this.actorBkg = this.mainBkg;\n this.actorTextColor = this.mainContrastColor;\n this.actorLineColor = this.mainContrastColor;\n this.signalColor = this.mainContrastColor;\n this.signalTextColor = this.mainContrastColor;\n this.labelBoxBkgColor = this.actorBkg;\n this.labelBoxBorderColor = this.actorBorder;\n this.labelTextColor = this.mainContrastColor;\n this.loopTextColor = this.mainContrastColor;\n this.noteBorderColor = this.secondaryBorderColor;\n this.noteBkgColor = this.secondBkg;\n this.noteTextColor = this.secondaryTextColor;\n this.activationBorderColor = this.border1;\n this.activationBkgColor = this.secondBkg;\n\n /* Gantt chart variables */\n\n this.altSectionBkgColor = this.background;\n this.taskBkgColor = lighten(this.mainBkg, 23);\n this.taskTextColor = this.darkTextColor;\n this.taskTextLightColor = this.mainContrastColor;\n this.taskTextOutsideColor = this.taskTextLightColor;\n this.gridColor = this.mainContrastColor;\n this.doneTaskBkgColor = this.mainContrastColor;\n this.taskTextDarkColor = this.darkTextColor;\n\n /* state colors */\n this.transitionColor = this.transitionColor || this.lineColor;\n this.transitionLabelColor = this.transitionLabelColor || this.textColor;\n this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;\n this.stateBkg = this.stateBkg || this.mainBkg;\n this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;\n this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;\n this.altBackground = this.altBackground || '#555';\n this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;\n this.compositeBorder = this.compositeBorder || this.nodeBorder;\n this.innerEndBackground = this.primaryBorderColor;\n this.specialStateColor = '#f4f4f4'; // this.lineColor;\n\n this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;\n this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;\n\n this.fillType0 = this.primaryColor;\n this.fillType1 = this.secondaryColor;\n this.fillType2 = adjust(this.primaryColor, { h: 64 });\n this.fillType3 = adjust(this.secondaryColor, { h: 64 });\n this.fillType4 = adjust(this.primaryColor, { h: -64 });\n this.fillType5 = adjust(this.secondaryColor, { h: -64 });\n this.fillType6 = adjust(this.primaryColor, { h: 128 });\n this.fillType7 = adjust(this.secondaryColor, { h: 128 });\n\n /* pie */\n this.pie1 = this.pie1 || '#0b0000';\n this.pie2 = this.pie2 || '#4d1037';\n this.pie3 = this.pie3 || '#3f5258';\n this.pie4 = this.pie4 || '#4f2f1b';\n this.pie5 = this.pie5 || '#6e0a0a';\n this.pie6 = this.pie6 || '#3b0048';\n this.pie7 = this.pie7 || '#995a01';\n this.pie8 = this.pie8 || '#154706';\n this.pie9 = this.pie9 || '#161722';\n this.pie10 = this.pie10 || '#00296f';\n this.pie11 = this.pie11 || '#01629c';\n this.pie12 = this.pie12 || '#010029';\n this.pieTitleTextSize = this.pieTitleTextSize || '25px';\n this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;\n this.pieSectionTextSize = this.pieSectionTextSize || '17px';\n this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;\n this.pieLegendTextSize = this.pieLegendTextSize || '17px';\n this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;\n this.pieStrokeColor = this.pieStrokeColor || 'black';\n this.pieStrokeWidth = this.pieStrokeWidth || '2px';\n this.pieOpacity = this.pieOpacity || '0.7';\n\n /* class */\n this.classText = this.primaryTextColor;\n\n /* requirement-diagram */\n this.requirementBackground = this.requirementBackground || this.primaryColor;\n this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;\n this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor;\n this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;\n this.relationColor = this.relationColor || this.lineColor;\n this.relationLabelBackground =\n this.relationLabelBackground ||\n (this.darkMode ? darken(this.secondaryColor, 30) : this.secondaryColor);\n this.relationLabelColor = this.relationLabelColor || this.actorTextColor;\n\n /* git */\n this.git0 = lighten(this.secondaryColor, 20);\n this.git1 = lighten(this.pie2 || this.secondaryColor, 20);\n this.git2 = lighten(this.pie3 || this.tertiaryColor, 20);\n this.git3 = lighten(this.pie4 || adjust(this.primaryColor, { h: -30 }), 20);\n this.git4 = lighten(this.pie5 || adjust(this.primaryColor, { h: -60 }), 20);\n this.git5 = lighten(this.pie6 || adjust(this.primaryColor, { h: -90 }), 10);\n this.git6 = lighten(this.pie7 || adjust(this.primaryColor, { h: +60 }), 10);\n this.git7 = lighten(this.pie8 || adjust(this.primaryColor, { h: +120 }), 20);\n this.gitInv0 = this.gitInv0 || invert(this.git0);\n this.gitInv1 = this.gitInv1 || invert(this.git1);\n this.gitInv2 = this.gitInv2 || invert(this.git2);\n this.gitInv3 = this.gitInv3 || invert(this.git3);\n this.gitInv4 = this.gitInv4 || invert(this.git4);\n this.gitInv5 = this.gitInv5 || invert(this.git5);\n this.gitInv6 = this.gitInv6 || invert(this.git6);\n this.gitInv7 = this.gitInv7 || invert(this.git7);\n\n this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;\n this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;\n this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;\n this.tagLabelFontSize = this.tagLabelFontSize || '10px';\n this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;\n this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;\n this.commitLabelFontSize = this.commitLabelFontSize || '10px';\n }\n calculate(overrides) {\n if (typeof overrides !== 'object') {\n // Calculate colors form base colors\n this.updateColors();\n return;\n }\n\n const keys = Object.keys(overrides);\n\n // Copy values from overrides, this is mainly for base colors\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n\n // Calculate colors form base colors\n this.updateColors();\n // Copy values from overrides again in case of an override of derived value\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n }\n}\n\nexport const getThemeVariables = (userOverrides) => {\n const theme = new Theme();\n theme.calculate(userOverrides);\n return theme;\n};\n","import { invert, lighten, rgba, adjust, darken } from 'khroma';\nimport { mkBorder } from './theme-helpers';\n\nclass Theme {\n constructor() {\n /* Base variables */\n this.background = '#f4f4f4';\n this.primaryColor = '#ECECFF';\n\n this.secondaryColor = adjust(this.primaryColor, { h: 120 });\n this.secondaryColor = '#ffffde';\n this.tertiaryColor = adjust(this.primaryColor, { h: -160 });\n this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);\n this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);\n this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);\n // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode);\n\n this.primaryTextColor = invert(this.primaryColor);\n this.secondaryTextColor = invert(this.secondaryColor);\n this.tertiaryTextColor = invert(this.tertiaryColor);\n this.lineColor = invert(this.background);\n this.textColor = invert(this.background);\n\n this.background = 'white';\n this.mainBkg = '#ECECFF';\n this.secondBkg = '#ffffde';\n this.lineColor = '#333333';\n this.border1 = '#9370DB';\n this.border2 = '#aaaa33';\n this.arrowheadColor = '#333333';\n this.fontFamily = '\"trebuchet ms\", verdana, arial, sans-serif';\n this.fontSize = '16px';\n this.labelBackground = '#e8e8e8';\n this.textColor = '#333';\n\n /* Flowchart variables */\n\n this.nodeBkg = 'calculated';\n this.nodeBorder = 'calculated';\n this.clusterBkg = 'calculated';\n this.clusterBorder = 'calculated';\n this.defaultLinkColor = 'calculated';\n this.titleColor = 'calculated';\n this.edgeLabelBackground = 'calculated';\n\n /* Sequence Diagram variables */\n\n this.actorBorder = 'calculated';\n this.actorBkg = 'calculated';\n this.actorTextColor = 'black';\n this.actorLineColor = 'grey';\n this.signalColor = 'calculated';\n this.signalTextColor = 'calculated';\n this.labelBoxBkgColor = 'calculated';\n this.labelBoxBorderColor = 'calculated';\n this.labelTextColor = 'calculated';\n this.loopTextColor = 'calculated';\n this.noteBorderColor = 'calculated';\n this.noteBkgColor = '#fff5ad';\n this.noteTextColor = 'calculated';\n this.activationBorderColor = '#666';\n this.activationBkgColor = '#f4f4f4';\n this.sequenceNumberColor = 'white';\n\n /* Gantt chart variables */\n\n this.sectionBkgColor = 'calculated';\n this.altSectionBkgColor = 'calculated';\n this.sectionBkgColor2 = 'calculated';\n this.excludeBkgColor = '#eeeeee';\n this.taskBorderColor = 'calculated';\n this.taskBkgColor = 'calculated';\n this.taskTextLightColor = 'calculated';\n this.taskTextColor = this.taskTextLightColor;\n this.taskTextDarkColor = 'calculated';\n this.taskTextOutsideColor = this.taskTextDarkColor;\n this.taskTextClickableColor = 'calculated';\n this.activeTaskBorderColor = 'calculated';\n this.activeTaskBkgColor = 'calculated';\n this.gridColor = 'calculated';\n this.doneTaskBkgColor = 'calculated';\n this.doneTaskBorderColor = 'calculated';\n this.critBorderColor = 'calculated';\n this.critBkgColor = 'calculated';\n this.todayLineColor = 'calculated';\n\n this.sectionBkgColor = rgba(102, 102, 255, 0.49);\n this.altSectionBkgColor = 'white';\n this.sectionBkgColor2 = '#fff400';\n this.taskBorderColor = '#534fbc';\n this.taskBkgColor = '#8a90dd';\n this.taskTextLightColor = 'white';\n this.taskTextColor = 'calculated';\n this.taskTextDarkColor = 'black';\n this.taskTextOutsideColor = 'calculated';\n this.taskTextClickableColor = '#003163';\n this.activeTaskBorderColor = '#534fbc';\n this.activeTaskBkgColor = '#bfc7ff';\n this.gridColor = 'lightgrey';\n this.doneTaskBkgColor = 'lightgrey';\n this.doneTaskBorderColor = 'grey';\n this.critBorderColor = '#ff8888';\n this.critBkgColor = 'red';\n this.todayLineColor = 'red';\n\n /* C4 Context Diagram variables */\n\n this.personBorder = 'calculated';\n this.personBkg = 'calculated';\n\n /* state colors */\n this.labelColor = 'black';\n this.errorBkgColor = '#552222';\n this.errorTextColor = '#552222';\n this.updateColors();\n }\n updateColors() {\n /* Flowchart variables */\n\n this.nodeBkg = this.mainBkg;\n this.nodeBorder = this.border1; // border 1\n this.clusterBkg = this.secondBkg;\n this.clusterBorder = this.border2;\n this.defaultLinkColor = this.lineColor;\n this.titleColor = this.textColor;\n this.edgeLabelBackground = this.labelBackground;\n\n /* Sequence Diagram variables */\n\n // this.actorBorder = lighten(this.border1, 0.5);\n this.actorBorder = lighten(this.border1, 23);\n this.actorBkg = this.mainBkg;\n this.labelBoxBkgColor = this.actorBkg;\n this.signalColor = this.textColor;\n this.signalTextColor = this.textColor;\n this.labelBoxBorderColor = this.actorBorder;\n this.labelTextColor = this.actorTextColor;\n this.loopTextColor = this.actorTextColor;\n this.noteBorderColor = this.border2;\n this.noteTextColor = this.actorTextColor;\n\n /* Gantt chart variables */\n\n this.taskTextColor = this.taskTextLightColor;\n this.taskTextOutsideColor = this.taskTextDarkColor;\n\n /* state colors */\n this.transitionColor = this.transitionColor || this.lineColor;\n this.transitionLabelColor = this.transitionLabelColor || this.textColor;\n this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;\n\n this.stateBkg = this.stateBkg || this.mainBkg;\n this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;\n this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;\n this.altBackground = this.altBackground || '#f0f0f0';\n this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;\n this.compositeBorder = this.compositeBorder || this.nodeBorder;\n this.innerEndBackground = this.nodeBorder;\n this.specialStateColor = this.lineColor;\n\n this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;\n this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;\n this.transitionColor = this.transitionColor || this.lineColor;\n /* class */\n this.classText = this.primaryTextColor;\n /* journey */\n this.fillType0 = this.primaryColor;\n this.fillType1 = this.secondaryColor;\n this.fillType2 = adjust(this.primaryColor, { h: 64 });\n this.fillType3 = adjust(this.secondaryColor, { h: 64 });\n this.fillType4 = adjust(this.primaryColor, { h: -64 });\n this.fillType5 = adjust(this.secondaryColor, { h: -64 });\n this.fillType6 = adjust(this.primaryColor, { h: 128 });\n this.fillType7 = adjust(this.secondaryColor, { h: 128 });\n\n /* pie */\n this.pie1 = this.pie1 || this.primaryColor;\n this.pie2 = this.pie2 || this.secondaryColor;\n this.pie3 = this.pie3 || adjust(this.tertiaryColor, { l: -40 });\n this.pie4 = this.pie4 || adjust(this.primaryColor, { l: -10 });\n this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -30 });\n this.pie6 = this.pie6 || adjust(this.tertiaryColor, { l: -20 });\n this.pie7 = this.pie7 || adjust(this.primaryColor, { h: +60, l: -20 });\n this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -40 });\n this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: -40 });\n this.pie10 = this.pie10 || adjust(this.primaryColor, { h: +60, l: -40 });\n this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -90, l: -40 });\n this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -30 });\n this.pieTitleTextSize = this.pieTitleTextSize || '25px';\n this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;\n this.pieSectionTextSize = this.pieSectionTextSize || '17px';\n this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;\n this.pieLegendTextSize = this.pieLegendTextSize || '17px';\n this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;\n this.pieStrokeColor = this.pieStrokeColor || 'black';\n this.pieStrokeWidth = this.pieStrokeWidth || '2px';\n this.pieOpacity = this.pieOpacity || '0.7';\n\n /* requirement-diagram */\n this.requirementBackground = this.requirementBackground || this.primaryColor;\n this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;\n this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor;\n this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;\n this.relationColor = this.relationColor || this.lineColor;\n this.relationLabelBackground = this.relationLabelBackground || this.labelBackground;\n this.relationLabelColor = this.relationLabelColor || this.actorTextColor;\n\n /* git */\n this.git0 = this.git0 || this.primaryColor;\n this.git1 = this.git1 || this.secondaryColor;\n this.git2 = this.git2 || this.tertiaryColor;\n this.git3 = this.git3 || adjust(this.primaryColor, { h: -30 });\n this.git4 = this.git4 || adjust(this.primaryColor, { h: -60 });\n this.git5 = this.git5 || adjust(this.primaryColor, { h: -90 });\n this.git6 = this.git6 || adjust(this.primaryColor, { h: +60 });\n this.git7 = this.git7 || adjust(this.primaryColor, { h: +120 });\n if (this.darkMode) {\n this.git0 = lighten(this.git0, 25);\n this.git1 = lighten(this.git1, 25);\n this.git2 = lighten(this.git2, 25);\n this.git3 = lighten(this.git3, 25);\n this.git4 = lighten(this.git4, 25);\n this.git5 = lighten(this.git5, 25);\n this.git6 = lighten(this.git6, 25);\n this.git7 = lighten(this.git7, 25);\n } else {\n this.git0 = darken(this.git0, 25);\n this.git1 = darken(this.git1, 25);\n this.git2 = darken(this.git2, 25);\n this.git3 = darken(this.git3, 25);\n this.git4 = darken(this.git4, 25);\n this.git5 = darken(this.git5, 25);\n this.git6 = darken(this.git6, 25);\n this.git7 = darken(this.git7, 25);\n }\n this.gitInv0 = this.gitInv0 || darken(invert(this.git0), 25);\n this.gitInv1 = this.gitInv1 || invert(this.git1);\n this.gitInv2 = this.gitInv2 || invert(this.git2);\n this.gitInv3 = this.gitInv3 || invert(this.git3);\n this.gitInv4 = this.gitInv4 || invert(this.git4);\n this.gitInv5 = this.gitInv5 || invert(this.git5);\n this.gitInv6 = this.gitInv6 || invert(this.git6);\n this.gitInv7 = this.gitInv7 || invert(this.git7);\n this.gitBranchLabel0 = this.gitBranchLabel0 || invert(this.labelTextColor);\n this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor;\n this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor;\n this.gitBranchLabel3 = this.gitBranchLabel3 || invert(this.labelTextColor);\n this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor;\n this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor;\n this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor;\n this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor;\n\n this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;\n this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;\n this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;\n this.tagLabelFontSize = this.tagLabelFontSize || '10px';\n this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;\n this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;\n this.commitLabelFontSize = this.commitLabelFontSize || '10px';\n }\n calculate(overrides) {\n if (typeof overrides !== 'object') {\n // Calculate colors form base colors\n this.updateColors();\n return;\n }\n\n const keys = Object.keys(overrides);\n\n // Copy values from overrides, this is mainly for base colors\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n\n // Calculate colors form base colors\n this.updateColors();\n // Copy values from overrides again in case of an override of derived value\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n }\n}\n\nexport const getThemeVariables = (userOverrides) => {\n const theme = new Theme();\n theme.calculate(userOverrides);\n return theme;\n};\n","import { darken, lighten, adjust, invert } from 'khroma';\nimport { mkBorder } from './theme-helpers';\nclass Theme {\n constructor() {\n /* Base vales */\n this.background = '#f4f4f4';\n this.primaryColor = '#cde498';\n this.secondaryColor = '#cdffb2';\n this.background = 'white';\n this.mainBkg = '#cde498';\n this.secondBkg = '#cdffb2';\n this.lineColor = 'green';\n this.border1 = '#13540c';\n this.border2 = '#6eaa49';\n this.arrowheadColor = 'green';\n this.fontFamily = '\"trebuchet ms\", verdana, arial, sans-serif';\n this.fontSize = '16px';\n\n this.tertiaryColor = lighten('#cde498', 10);\n this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);\n this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);\n this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);\n this.primaryTextColor = invert(this.primaryColor);\n this.secondaryTextColor = invert(this.secondaryColor);\n this.tertiaryTextColor = invert(this.primaryColor);\n this.lineColor = invert(this.background);\n this.textColor = invert(this.background);\n\n /* Flowchart variables */\n this.nodeBkg = 'calculated';\n this.nodeBorder = 'calculated';\n this.clusterBkg = 'calculated';\n this.clusterBorder = 'calculated';\n this.defaultLinkColor = 'calculated';\n this.titleColor = '#333';\n this.edgeLabelBackground = '#e8e8e8';\n\n /* Sequence Diagram variables */\n\n this.actorBorder = 'calculated';\n this.actorBkg = 'calculated';\n this.actorTextColor = 'black';\n this.actorLineColor = 'grey';\n this.signalColor = '#333';\n this.signalTextColor = '#333';\n this.labelBoxBkgColor = 'calculated';\n this.labelBoxBorderColor = '#326932';\n this.labelTextColor = 'calculated';\n this.loopTextColor = 'calculated';\n this.noteBorderColor = 'calculated';\n this.noteBkgColor = '#fff5ad';\n this.noteTextColor = 'calculated';\n this.activationBorderColor = '#666';\n this.activationBkgColor = '#f4f4f4';\n this.sequenceNumberColor = 'white';\n\n /* Gantt chart variables */\n\n this.sectionBkgColor = '#6eaa49';\n this.altSectionBkgColor = 'white';\n this.sectionBkgColor2 = '#6eaa49';\n this.excludeBkgColor = '#eeeeee';\n this.taskBorderColor = 'calculated';\n this.taskBkgColor = '#487e3a';\n this.taskTextLightColor = 'white';\n this.taskTextColor = 'calculated';\n this.taskTextDarkColor = 'black';\n this.taskTextOutsideColor = 'calculated';\n this.taskTextClickableColor = '#003163';\n this.activeTaskBorderColor = 'calculated';\n this.activeTaskBkgColor = 'calculated';\n this.gridColor = 'lightgrey';\n this.doneTaskBkgColor = 'lightgrey';\n this.doneTaskBorderColor = 'grey';\n this.critBorderColor = '#ff8888';\n this.critBkgColor = 'red';\n this.todayLineColor = 'red';\n\n /* C4 Context Diagram variables */\n\n this.personBorder = 'calculated';\n this.personBkg = 'calculated';\n\n /* state colors */\n this.labelColor = 'black';\n\n this.errorBkgColor = '#552222';\n this.errorTextColor = '#552222';\n }\n updateColors() {\n /* Flowchart variables */\n\n this.nodeBkg = this.mainBkg;\n this.nodeBorder = this.border1;\n this.clusterBkg = this.secondBkg;\n this.clusterBorder = this.border2;\n this.defaultLinkColor = this.lineColor;\n\n /* Sequence Diagram variables */\n\n this.actorBorder = darken(this.mainBkg, 20);\n this.actorBkg = this.mainBkg;\n this.labelBoxBkgColor = this.actorBkg;\n this.labelTextColor = this.actorTextColor;\n this.loopTextColor = this.actorTextColor;\n this.noteBorderColor = this.border2;\n this.noteTextColor = this.actorTextColor;\n\n /* Gantt chart variables */\n\n this.taskBorderColor = this.border1;\n this.taskTextColor = this.taskTextLightColor;\n this.taskTextOutsideColor = this.taskTextDarkColor;\n this.activeTaskBorderColor = this.taskBorderColor;\n this.activeTaskBkgColor = this.mainBkg;\n\n /* state colors */\n this.transitionColor = this.transitionColor || this.lineColor;\n this.transitionLabelColor = this.transitionLabelColor || this.textColor;\n this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;\n\n this.stateBkg = this.stateBkg || this.mainBkg;\n this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;\n this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;\n this.altBackground = this.altBackground || '#f0f0f0';\n this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;\n this.compositeBorder = this.compositeBorder || this.nodeBorder;\n this.innerEndBackground = this.primaryBorderColor;\n this.specialStateColor = this.lineColor;\n\n this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;\n this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;\n this.transitionColor = this.transitionColor || this.lineColor;\n /* class */\n this.classText = this.primaryTextColor;\n /* journey */\n this.fillType0 = this.primaryColor;\n this.fillType1 = this.secondaryColor;\n this.fillType2 = adjust(this.primaryColor, { h: 64 });\n this.fillType3 = adjust(this.secondaryColor, { h: 64 });\n this.fillType4 = adjust(this.primaryColor, { h: -64 });\n this.fillType5 = adjust(this.secondaryColor, { h: -64 });\n this.fillType6 = adjust(this.primaryColor, { h: 128 });\n this.fillType7 = adjust(this.secondaryColor, { h: 128 });\n\n /* pie */\n this.pie1 = this.pie1 || this.primaryColor;\n this.pie2 = this.pie2 || this.secondaryColor;\n this.pie3 = this.pie3 || this.tertiaryColor;\n this.pie4 = this.pie4 || adjust(this.primaryColor, { l: -30 });\n this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -30 });\n this.pie6 = this.pie6 || adjust(this.tertiaryColor, { h: +40, l: -40 });\n this.pie7 = this.pie7 || adjust(this.primaryColor, { h: +60, l: -10 });\n this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -10 });\n this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: 0 });\n this.pie10 = this.pie10 || adjust(this.primaryColor, { h: +60, l: -50 });\n this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -60, l: -50 });\n this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -50 });\n this.pieTitleTextSize = this.pieTitleTextSize || '25px';\n this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;\n this.pieSectionTextSize = this.pieSectionTextSize || '17px';\n this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;\n this.pieLegendTextSize = this.pieLegendTextSize || '17px';\n this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;\n this.pieStrokeColor = this.pieStrokeColor || 'black';\n this.pieStrokeWidth = this.pieStrokeWidth || '2px';\n this.pieOpacity = this.pieOpacity || '0.7';\n\n /* requirement-diagram */\n this.requirementBackground = this.requirementBackground || this.primaryColor;\n this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;\n this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor;\n this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;\n this.relationColor = this.relationColor || this.lineColor;\n this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground;\n this.relationLabelColor = this.relationLabelColor || this.actorTextColor;\n\n /* git */\n this.git0 = this.git0 || this.primaryColor;\n this.git1 = this.git1 || this.secondaryColor;\n this.git2 = this.git2 || this.tertiaryColor;\n this.git3 = this.git3 || adjust(this.primaryColor, { h: -30 });\n this.git4 = this.git4 || adjust(this.primaryColor, { h: -60 });\n this.git5 = this.git5 || adjust(this.primaryColor, { h: -90 });\n this.git6 = this.git6 || adjust(this.primaryColor, { h: +60 });\n this.git7 = this.git7 || adjust(this.primaryColor, { h: +120 });\n if (this.darkMode) {\n this.git0 = lighten(this.git0, 25);\n this.git1 = lighten(this.git1, 25);\n this.git2 = lighten(this.git2, 25);\n this.git3 = lighten(this.git3, 25);\n this.git4 = lighten(this.git4, 25);\n this.git5 = lighten(this.git5, 25);\n this.git6 = lighten(this.git6, 25);\n this.git7 = lighten(this.git7, 25);\n } else {\n this.git0 = darken(this.git0, 25);\n this.git1 = darken(this.git1, 25);\n this.git2 = darken(this.git2, 25);\n this.git3 = darken(this.git3, 25);\n this.git4 = darken(this.git4, 25);\n this.git5 = darken(this.git5, 25);\n this.git6 = darken(this.git6, 25);\n this.git7 = darken(this.git7, 25);\n }\n this.gitInv0 = this.gitInv0 || invert(this.git0);\n this.gitInv1 = this.gitInv1 || invert(this.git1);\n this.gitInv2 = this.gitInv2 || invert(this.git2);\n this.gitInv3 = this.gitInv3 || invert(this.git3);\n this.gitInv4 = this.gitInv4 || invert(this.git4);\n this.gitInv5 = this.gitInv5 || invert(this.git5);\n this.gitInv6 = this.gitInv6 || invert(this.git6);\n this.gitInv7 = this.gitInv7 || invert(this.git7);\n\n this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;\n this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;\n this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;\n this.tagLabelFontSize = this.tagLabelFontSize || '10px';\n this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;\n this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;\n this.commitLabelFontSize = this.commitLabelFontSize || '10px';\n }\n calculate(overrides) {\n if (typeof overrides !== 'object') {\n // Calculate colors form base colors\n this.updateColors();\n return;\n }\n\n const keys = Object.keys(overrides);\n\n // Copy values from overrides, this is mainly for base colors\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n\n // Calculate colors form base colors\n this.updateColors();\n // Copy values from overrides again in case of an override of derived value\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n }\n}\n\nexport const getThemeVariables = (userOverrides) => {\n const theme = new Theme();\n theme.calculate(userOverrides);\n return theme;\n};\n","import { adjust } from 'khroma';\r\n\r\nexport const mkBorder = (col, darkMode) =>\r\n darkMode ? adjust(col, { s: -40, l: 10 }) : adjust(col, { s: -40, l: -10 });\r\n","import { invert, darken, lighten, adjust } from 'khroma';\nimport { mkBorder } from './theme-helpers';\n\n// const Color = require ( 'khroma/dist/color' ).default\n// Color.format.hex.stringify(Color.parse('hsl(210, 66.6666666667%, 95%)')); // => \"#EAF2FB\"\n\nclass Theme {\n constructor() {\n this.primaryColor = '#eee';\n this.contrast = '#707070';\n this.secondaryColor = lighten(this.contrast, 55);\n this.background = '#ffffff';\n\n // this.secondaryColor = adjust(this.primaryColor, { h: 120 });\n this.tertiaryColor = adjust(this.primaryColor, { h: -160 });\n this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);\n this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);\n this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);\n // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode);\n\n this.primaryTextColor = invert(this.primaryColor);\n this.secondaryTextColor = invert(this.secondaryColor);\n this.tertiaryTextColor = invert(this.tertiaryColor);\n this.lineColor = invert(this.background);\n this.textColor = invert(this.background);\n\n // this.altBackground = lighten(this.contrast, 55);\n this.mainBkg = '#eee';\n this.secondBkg = 'calculated';\n this.lineColor = '#666';\n this.border1 = '#999';\n this.border2 = 'calculated';\n this.note = '#ffa';\n this.text = '#333';\n this.critical = '#d42';\n this.done = '#bbb';\n this.arrowheadColor = '#333333';\n this.fontFamily = '\"trebuchet ms\", verdana, arial, sans-serif';\n this.fontSize = '16px';\n\n /* Flowchart variables */\n\n this.nodeBkg = 'calculated';\n this.nodeBorder = 'calculated';\n this.clusterBkg = 'calculated';\n this.clusterBorder = 'calculated';\n this.defaultLinkColor = 'calculated';\n this.titleColor = 'calculated';\n this.edgeLabelBackground = 'white';\n\n /* Sequence Diagram variables */\n\n this.actorBorder = 'calculated';\n this.actorBkg = 'calculated';\n this.actorTextColor = 'calculated';\n this.actorLineColor = 'calculated';\n this.signalColor = 'calculated';\n this.signalTextColor = 'calculated';\n this.labelBoxBkgColor = 'calculated';\n this.labelBoxBorderColor = 'calculated';\n this.labelTextColor = 'calculated';\n this.loopTextColor = 'calculated';\n this.noteBorderColor = 'calculated';\n this.noteBkgColor = 'calculated';\n this.noteTextColor = 'calculated';\n this.activationBorderColor = '#666';\n this.activationBkgColor = '#f4f4f4';\n this.sequenceNumberColor = 'white';\n\n /* Gantt chart variables */\n\n this.sectionBkgColor = 'calculated';\n this.altSectionBkgColor = 'white';\n this.sectionBkgColor2 = 'calculated';\n this.excludeBkgColor = '#eeeeee';\n this.taskBorderColor = 'calculated';\n this.taskBkgColor = 'calculated';\n this.taskTextLightColor = 'white';\n this.taskTextColor = 'calculated';\n this.taskTextDarkColor = 'calculated';\n this.taskTextOutsideColor = 'calculated';\n this.taskTextClickableColor = '#003163';\n this.activeTaskBorderColor = 'calculated';\n this.activeTaskBkgColor = 'calculated';\n this.gridColor = 'calculated';\n this.doneTaskBkgColor = 'calculated';\n this.doneTaskBorderColor = 'calculated';\n this.critBkgColor = 'calculated';\n this.critBorderColor = 'calculated';\n this.todayLineColor = 'calculated';\n\n /* C4 Context Diagram variables */\n\n this.personBorder = 'calculated';\n this.personBkg = 'calculated';\n\n /* state colors */\n this.labelColor = 'black';\n\n this.errorBkgColor = '#552222';\n this.errorTextColor = '#552222';\n }\n updateColors() {\n this.secondBkg = lighten(this.contrast, 55);\n this.border2 = this.contrast;\n\n /* Flowchart variables */\n\n this.nodeBkg = this.mainBkg;\n this.nodeBorder = this.border1;\n this.clusterBkg = this.secondBkg;\n this.clusterBorder = this.border2;\n this.defaultLinkColor = this.lineColor;\n this.titleColor = this.text;\n\n /* Sequence Diagram variables */\n\n this.actorBorder = lighten(this.border1, 23);\n this.actorBkg = this.mainBkg;\n this.actorTextColor = this.text;\n this.actorLineColor = this.lineColor;\n this.signalColor = this.text;\n this.signalTextColor = this.text;\n this.labelBoxBkgColor = this.actorBkg;\n this.labelBoxBorderColor = this.actorBorder;\n this.labelTextColor = this.text;\n this.loopTextColor = this.text;\n this.noteBorderColor = '#999';\n this.noteBkgColor = '#666';\n this.noteTextColor = '#fff';\n\n /* Gantt chart variables */\n\n this.sectionBkgColor = lighten(this.contrast, 30);\n this.sectionBkgColor2 = lighten(this.contrast, 30);\n\n this.taskBorderColor = darken(this.contrast, 10);\n\n this.taskBkgColor = this.contrast;\n this.taskTextColor = this.taskTextLightColor;\n this.taskTextDarkColor = this.text;\n this.taskTextOutsideColor = this.taskTextDarkColor;\n this.activeTaskBorderColor = this.taskBorderColor;\n this.activeTaskBkgColor = this.mainBkg;\n this.gridColor = lighten(this.border1, 30);\n\n this.doneTaskBkgColor = this.done;\n this.doneTaskBorderColor = this.lineColor;\n this.critBkgColor = this.critical;\n this.critBorderColor = darken(this.critBkgColor, 10);\n\n this.todayLineColor = this.critBkgColor;\n\n /* state colors */\n this.transitionColor = this.transitionColor || '#000';\n this.transitionLabelColor = this.transitionLabelColor || this.textColor;\n this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor;\n\n this.stateBkg = this.stateBkg || this.mainBkg;\n this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg;\n this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor;\n this.altBackground = this.altBackground || '#f4f4f4';\n this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg;\n this.stateBorder = this.stateBorder || '#000';\n this.innerEndBackground = this.primaryBorderColor;\n this.specialStateColor = '#222';\n\n this.errorBkgColor = this.errorBkgColor || this.tertiaryColor;\n this.errorTextColor = this.errorTextColor || this.tertiaryTextColor;\n\n /* class */\n this.classText = this.primaryTextColor;\n /* journey */\n this.fillType0 = this.primaryColor;\n this.fillType1 = this.secondaryColor;\n this.fillType2 = adjust(this.primaryColor, { h: 64 });\n this.fillType3 = adjust(this.secondaryColor, { h: 64 });\n this.fillType4 = adjust(this.primaryColor, { h: -64 });\n this.fillType5 = adjust(this.secondaryColor, { h: -64 });\n this.fillType6 = adjust(this.primaryColor, { h: 128 });\n this.fillType7 = adjust(this.secondaryColor, { h: 128 });\n\n // /* pie */\n this.pie1 = this.pie1 || '#F4F4F4';\n this.pie2 = this.pie2 || '#555';\n this.pie3 = this.pie3 || '#BBB';\n this.pie4 = this.pie4 || '#777';\n this.pie5 = this.pie5 || '#999';\n this.pie6 = this.pie6 || '#DDD';\n this.pie7 = this.pie7 || '#FFF';\n this.pie8 = this.pie8 || '#DDD';\n this.pie9 = this.pie9 || '#BBB';\n this.pie10 = this.pie10 || '#999';\n this.pie11 = this.pie11 || '#777';\n this.pie12 = this.pie12 || '#555';\n this.pieTitleTextSize = this.pieTitleTextSize || '25px';\n this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;\n this.pieSectionTextSize = this.pieSectionTextSize || '17px';\n this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;\n this.pieLegendTextSize = this.pieLegendTextSize || '17px';\n this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;\n this.pieStrokeColor = this.pieStrokeColor || 'black';\n this.pieStrokeWidth = this.pieStrokeWidth || '2px';\n this.pieOpacity = this.pieOpacity || '0.7';\n\n // this.pie1 = this.pie1 || '#212529';\n // this.pie2 = this.pie2 || '#343A40';\n // this.pie3 = this.pie3 || '#495057';\n // this.pie4 = this.pie4 || '#6C757D';\n // this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -10 });\n // this.pie6 = this.pie6 || adjust(this.tertiaryColor, { l: -10 });\n // this.pie7 = this.pie7 || adjust(this.primaryColor, { h: +60, l: -10 });\n // this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -10 });\n // this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: 0 });\n // this.pie10 = this.pie10 || adjust(this.primaryColor, { h: +60, l: -20 });\n // this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -60, l: -20 });\n // this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -10 });\n\n /* requirement-diagram */\n this.requirementBackground = this.requirementBackground || this.primaryColor;\n this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor;\n this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor;\n this.requirementTextColor = this.requirementTextColor || this.primaryTextColor;\n this.relationColor = this.relationColor || this.lineColor;\n this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground;\n this.relationLabelColor = this.relationLabelColor || this.actorTextColor;\n\n /* git */\n this.git0 = darken(this.pie1, 25) || this.primaryColor;\n this.git1 = this.pie2 || this.secondaryColor;\n this.git2 = this.pie3 || this.tertiaryColor;\n this.git3 = this.pie4 || adjust(this.primaryColor, { h: -30 });\n this.git4 = this.pie5 || adjust(this.primaryColor, { h: -60 });\n this.git5 = this.pie6 || adjust(this.primaryColor, { h: -90 });\n this.git6 = this.pie7 || adjust(this.primaryColor, { h: +60 });\n this.git7 = this.pie8 || adjust(this.primaryColor, { h: +120 });\n\n this.gitInv0 = this.gitInv0 || invert(this.git0);\n this.gitInv1 = this.gitInv1 || invert(this.git1);\n this.gitInv2 = this.gitInv2 || invert(this.git2);\n this.gitInv3 = this.gitInv3 || invert(this.git3);\n this.gitInv4 = this.gitInv4 || invert(this.git4);\n this.gitInv5 = this.gitInv5 || invert(this.git5);\n this.gitInv6 = this.gitInv6 || invert(this.git6);\n this.gitInv7 = this.gitInv7 || invert(this.git7);\n\n this.branchLabelColor = this.branchLabelColor || this.labelTextColor;\n this.gitBranchLabel0 = this.branchLabelColor;\n this.gitBranchLabel1 = 'white';\n this.gitBranchLabel2 = this.branchLabelColor;\n this.gitBranchLabel3 = 'white';\n this.gitBranchLabel4 = this.branchLabelColor;\n this.gitBranchLabel5 = this.branchLabelColor;\n this.gitBranchLabel6 = this.branchLabelColor;\n this.gitBranchLabel7 = this.branchLabelColor;\n\n this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;\n this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;\n this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;\n this.tagLabelFontSize = this.tagLabelFontSize || '10px';\n this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor;\n this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor;\n this.commitLabelFontSize = this.commitLabelFontSize || '10px';\n }\n calculate(overrides) {\n if (typeof overrides !== 'object') {\n // Calculate colors form base colors\n this.updateColors();\n return;\n }\n\n const keys = Object.keys(overrides);\n\n // Copy values from overrides, this is mainly for base colors\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n\n // Calculate colors form base colors\n this.updateColors();\n // Copy values from overrides again in case of an override of derived value\n keys.forEach((k) => {\n this[k] = overrides[k];\n });\n }\n}\n\nexport const getThemeVariables = (userOverrides) => {\n const theme = new Theme();\n theme.calculate(userOverrides);\n return theme;\n};\n","import { sanitizeUrl } from '@braintree/sanitize-url';\nimport {\n curveBasis,\n curveBasisClosed,\n curveBasisOpen,\n curveLinear,\n curveLinearClosed,\n curveMonotoneX,\n curveMonotoneY,\n curveNatural,\n curveStep,\n curveStepAfter,\n curveStepBefore,\n select,\n} from 'd3';\nimport common from './diagrams/common/common';\nimport { configKeys } from './defaultConfig';\nimport { log } from './logger';\n\n// Effectively an enum of the supported curve types, accessible by name\nconst d3CurveTypes = {\n curveBasis: curveBasis,\n curveBasisClosed: curveBasisClosed,\n curveBasisOpen: curveBasisOpen,\n curveLinear: curveLinear,\n curveLinearClosed: curveLinearClosed,\n curveMonotoneX: curveMonotoneX,\n curveMonotoneY: curveMonotoneY,\n curveNatural: curveNatural,\n curveStep: curveStep,\n curveStepAfter: curveStepAfter,\n curveStepBefore: curveStepBefore,\n};\nconst directive =\n /[%]{2}[{]\\s*(?:(?:(\\w+)\\s*:|(\\w+))\\s*(?:(?:(\\w+))|((?:(?![}][%]{2}).|\\r?\\n)*))?\\s*)(?:[}][%]{2})?/gi;\nconst directiveWithoutOpen =\n /\\s*(?:(?:(\\w+)(?=:):|(\\w+))\\s*(?:(?:(\\w+))|((?:(?![}][%]{2}).|\\r?\\n)*))?\\s*)(?:[}][%]{2})?/gi;\nconst anyComment = /\\s*%%.*\\n/gm;\n\n/**\n * @function detectInit Detects the init config object from the text\n *\n * ```mermaid\n * %%{init: {\"theme\": \"debug\", \"logLevel\": 1 }}%%\n * graph LR\n * a-->b\n * b-->c\n * c-->d\n * d-->e\n * e-->f\n * f-->g\n * g-->h\n * ```\n *\n * Or\n *\n * ```mermaid\n * %%{initialize: {\"theme\": \"dark\", logLevel: \"debug\" }}%%\n * graph LR\n * a-->b\n * b-->c\n * c-->d\n * d-->e\n * e-->f\n * f-->g\n * g-->h\n * ```\n * @param {string} text The text defining the graph\n * @param {any} cnf\n * @returns {object} The json object representing the init passed to mermaid.initialize()\n */\nexport const detectInit = function (text, cnf) {\n let inits = detectDirective(text, /(?:init\\b)|(?:initialize\\b)/);\n let results = {};\n\n if (Array.isArray(inits)) {\n let args = inits.map((init) => init.args);\n directiveSanitizer(args);\n\n results = assignWithDepth(results, [...args]);\n } else {\n results = inits.args;\n }\n if (results) {\n let type = detectType(text, cnf);\n ['config'].forEach((prop) => {\n if (typeof results[prop] !== 'undefined') {\n if (type === 'flowchart-v2') {\n type = 'flowchart';\n }\n results[type] = results[prop];\n delete results[prop];\n }\n });\n }\n\n // Todo: refactor this, these results are never used\n return results;\n};\n\n/**\n * @function detectDirective Detects the directive from the text. Text can be single line or\n * multiline. If type is null or omitted the first directive encountered in text will be returned\n *\n * ```mermaid\n * graph LR\n * %%{somedirective}%%\n * a-->b\n * b-->c\n * c-->d\n * d-->e\n * e-->f\n * f-->g\n * g-->h\n * ```\n * @param {string} text The text defining the graph\n * @param {string | RegExp} type The directive to return (default: null)\n * @returns {object | Array} An object or Array representing the directive(s): { type: string, args:\n * object|null } matched by the input type if a single directive was found, that directive object\n * will be returned.\n */\nexport const detectDirective = function (text, type = null) {\n try {\n const commentWithoutDirectives = new RegExp(\n `[%]{2}(?![{]${directiveWithoutOpen.source})(?=[}][%]{2}).*\\n`,\n 'ig'\n );\n text = text.trim().replace(commentWithoutDirectives, '').replace(/'/gm, '\"');\n log.debug(\n `Detecting diagram directive${type !== null ? ' type:' + type : ''} based on the text:${text}`\n );\n let match,\n result = [];\n while ((match = directive.exec(text)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (match.index === directive.lastIndex) {\n directive.lastIndex++;\n }\n if (\n (match && !type) ||\n (type && match[1] && match[1].match(type)) ||\n (type && match[2] && match[2].match(type))\n ) {\n let type = match[1] ? match[1] : match[2];\n let args = match[3] ? match[3].trim() : match[4] ? JSON.parse(match[4].trim()) : null;\n result.push({ type, args });\n }\n }\n if (result.length === 0) {\n result.push({ type: text, args: null });\n }\n\n return result.length === 1 ? result[0] : result;\n } catch (error) {\n log.error(\n `ERROR: ${error.message} - Unable to parse directive\n ${type !== null ? ' type:' + type : ''} based on the text:${text}`\n );\n return { type: null, args: null };\n }\n};\n\n/**\n * @function detectType Detects the type of the graph text. Takes into consideration the possible\n * existence of an %%init directive\n *\n * ```mermaid\n * %%{initialize: {\"startOnLoad\": true, logLevel: \"fatal\" }}%%\n * graph LR\n * a-->b\n * b-->c\n * c-->d\n * d-->e\n * e-->f\n * f-->g\n * g-->h\n * ```\n * @param {string} text The text defining the graph\n * @param {{\n * class: { defaultRenderer: string } | undefined;\n * state: { defaultRenderer: string } | undefined;\n * flowchart: { defaultRenderer: string } | undefined;\n * }} [cnf]\n * @returns {string} A graph definition key\n */\nexport const detectType = function (text, cnf) {\n text = text.replace(directive, '').replace(anyComment, '\\n');\n if (text.match(/^\\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/)) {\n return 'c4';\n }\n\n if (text.match(/^\\s*sequenceDiagram/)) {\n return 'sequence';\n }\n\n if (text.match(/^\\s*gantt/)) {\n return 'gantt';\n }\n if (text.match(/^\\s*classDiagram-v2/)) {\n return 'classDiagram';\n }\n if (text.match(/^\\s*classDiagram/)) {\n if (cnf && cnf.class && cnf.class.defaultRenderer === 'dagre-wrapper') return 'classDiagram';\n return 'class';\n }\n\n if (text.match(/^\\s*stateDiagram-v2/)) {\n return 'stateDiagram';\n }\n\n if (text.match(/^\\s*stateDiagram/)) {\n if (cnf && cnf.class && cnf.state.defaultRenderer === 'dagre-wrapper') return 'stateDiagram';\n return 'state';\n }\n\n if (text.match(/^\\s*gitGraph/)) {\n return 'gitGraph';\n }\n if (text.match(/^\\s*flowchart/)) {\n return 'flowchart-v2';\n }\n\n if (text.match(/^\\s*info/)) {\n return 'info';\n }\n if (text.match(/^\\s*pie/)) {\n return 'pie';\n }\n\n if (text.match(/^\\s*erDiagram/)) {\n return 'er';\n }\n\n if (text.match(/^\\s*journey/)) {\n return 'journey';\n }\n\n if (text.match(/^\\s*requirement/) || text.match(/^\\s*requirementDiagram/)) {\n return 'requirement';\n }\n if (cnf && cnf.flowchart && cnf.flowchart.defaultRenderer === 'dagre-wrapper')\n return 'flowchart-v2';\n\n return 'flowchart';\n};\n\n/**\n * Caches results of functions based on input\n *\n * @param {Function} fn Function to run\n * @param {Function} resolver Function that resolves to an ID given arguments the `fn` takes\n * @returns {Function} An optimized caching function\n */\nconst memoize = (fn, resolver) => {\n let cache = {};\n return (...args) => {\n let n = resolver ? resolver.apply(this, args) : args[0];\n if (n in cache) {\n return cache[n];\n } else {\n let result = fn(...args);\n cache[n] = result;\n return result;\n }\n };\n};\n\n/**\n * @function isSubstringInArray Detects whether a substring in present in a given array\n * @param {string} str The substring to detect\n * @param {Array} arr The array to search\n * @returns {number} The array index containing the substring or -1 if not present\n */\nexport const isSubstringInArray = function (str, arr) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i].match(str)) return i;\n }\n return -1;\n};\n\n/**\n * Returns a d3 curve given a curve name\n *\n * @param {string | undefined} interpolate The interpolation name\n * @param {any} defaultCurve The default curve to return\n * @returns {import('d3-shape').CurveFactory} The curve factory to use\n */\nexport const interpolateToCurve = (interpolate, defaultCurve) => {\n if (!interpolate) {\n return defaultCurve;\n }\n const curveName = `curve${interpolate.charAt(0).toUpperCase() + interpolate.slice(1)}`;\n return d3CurveTypes[curveName] || defaultCurve;\n};\n\n/**\n * Formats a URL string\n *\n * @param {string} linkStr String of the URL\n * @param {{ securityLevel: string }} config Configuration passed to MermaidJS\n * @returns {string | undefined} The formatted URL\n */\nexport const formatUrl = (linkStr, config) => {\n let url = linkStr.trim();\n\n if (url) {\n if (config.securityLevel !== 'loose') {\n return sanitizeUrl(url);\n }\n\n return url;\n }\n};\n\n/**\n * Runs a function\n *\n * @param {string} functionName A dot seperated path to the function relative to the `window`\n * @param {...any} params Parameters to pass to the function\n */\nexport const runFunc = (functionName, ...params) => {\n const arrPaths = functionName.split('.');\n\n const len = arrPaths.length - 1;\n const fnName = arrPaths[len];\n\n let obj = window;\n for (let i = 0; i < len; i++) {\n obj = obj[arrPaths[i]];\n if (!obj) return;\n }\n\n obj[fnName](...params);\n};\n\n/**\n * @typedef {object} Point A (x, y) point\n * @property {number} x The x value\n * @property {number} y The y value\n */\n\n/**\n * Finds the distance between two points using the Distance Formula\n *\n * @param {Point} p1 The first point\n * @param {Point} p2 The second point\n * @returns {number} The distance\n */\nconst distance = (p1, p2) =>\n p1 && p2 ? Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)) : 0;\n\n/**\n * @param {Point[]} points List of points\n * @returns {Point}\n * @todo Give this a description\n */\nconst traverseEdge = (points) => {\n let prevPoint;\n let totalDistance = 0;\n\n points.forEach((point) => {\n totalDistance += distance(point, prevPoint);\n prevPoint = point;\n });\n\n // Traverse half of total distance along points\n let remainingDistance = totalDistance / 2;\n let center = undefined;\n prevPoint = undefined;\n points.forEach((point) => {\n if (prevPoint && !center) {\n const vectorDistance = distance(point, prevPoint);\n if (vectorDistance < remainingDistance) {\n remainingDistance -= vectorDistance;\n } else {\n // The point is remainingDistance from prevPoint in the vector between prevPoint and point\n // Calculate the coordinates\n const distanceRatio = remainingDistance / vectorDistance;\n if (distanceRatio <= 0) center = prevPoint;\n if (distanceRatio >= 1) center = { x: point.x, y: point.y };\n if (distanceRatio > 0 && distanceRatio < 1) {\n center = {\n x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x,\n y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y,\n };\n }\n }\n }\n prevPoint = point;\n });\n return center;\n};\n\n/**\n * Alias for `traverseEdge`\n *\n * @param {Point[]} points List of points\n * @returns {Point} Return result of `transverseEdge`\n */\nconst calcLabelPosition = (points) => {\n if (points.length === 1) {\n return points[0];\n }\n return traverseEdge(points);\n};\n\nconst calcCardinalityPosition = (isRelationTypePresent, points, initialPosition) => {\n let prevPoint;\n let totalDistance = 0; // eslint-disable-line\n log.info('our points', points);\n if (points[0] !== initialPosition) {\n points = points.reverse();\n }\n points.forEach((point) => {\n totalDistance += distance(point, prevPoint);\n prevPoint = point;\n });\n\n // Traverse only 25 total distance along points to find cardinality point\n const distanceToCardinalityPoint = 25;\n\n let remainingDistance = distanceToCardinalityPoint;\n let center;\n prevPoint = undefined;\n points.forEach((point) => {\n if (prevPoint && !center) {\n const vectorDistance = distance(point, prevPoint);\n if (vectorDistance < remainingDistance) {\n remainingDistance -= vectorDistance;\n } else {\n // The point is remainingDistance from prevPoint in the vector between prevPoint and point\n // Calculate the coordinates\n const distanceRatio = remainingDistance / vectorDistance;\n if (distanceRatio <= 0) center = prevPoint;\n if (distanceRatio >= 1) center = { x: point.x, y: point.y };\n if (distanceRatio > 0 && distanceRatio < 1) {\n center = {\n x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x,\n y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y,\n };\n }\n }\n }\n prevPoint = point;\n });\n // if relation is present (Arrows will be added), change cardinality point off-set distance (d)\n let d = isRelationTypePresent ? 10 : 5;\n //Calculate Angle for x and y axis\n let angle = Math.atan2(points[0].y - center.y, points[0].x - center.x);\n let cardinalityPosition = { x: 0, y: 0 };\n //Calculation cardinality position using angle, center point on the line/curve but pendicular and with offset-distance\n cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2;\n cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2;\n return cardinalityPosition;\n};\n\n/**\n * Position ['start_left', 'start_right', 'end_left', 'end_right']\n *\n * @param {any} terminalMarkerSize\n * @param {any} position\n * @param {any} _points\n * @returns {any}\n */\nconst calcTerminalLabelPosition = (terminalMarkerSize, position, _points) => {\n // Todo looking to faster cloning method\n let points = JSON.parse(JSON.stringify(_points));\n let prevPoint;\n let totalDistance = 0; // eslint-disable-line\n log.info('our points', points);\n if (position !== 'start_left' && position !== 'start_right') {\n points = points.reverse();\n }\n\n points.forEach((point) => {\n totalDistance += distance(point, prevPoint);\n prevPoint = point;\n });\n\n // Traverse only 25 total distance along points to find cardinality point\n const distanceToCardinalityPoint = 25 + terminalMarkerSize;\n\n let remainingDistance = distanceToCardinalityPoint;\n let center;\n prevPoint = undefined;\n points.forEach((point) => {\n if (prevPoint && !center) {\n const vectorDistance = distance(point, prevPoint);\n if (vectorDistance < remainingDistance) {\n remainingDistance -= vectorDistance;\n } else {\n // The point is remainingDistance from prevPoint in the vector between prevPoint and point\n // Calculate the coordinates\n const distanceRatio = remainingDistance / vectorDistance;\n if (distanceRatio <= 0) center = prevPoint;\n if (distanceRatio >= 1) center = { x: point.x, y: point.y };\n if (distanceRatio > 0 && distanceRatio < 1) {\n center = {\n x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x,\n y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y,\n };\n }\n }\n }\n prevPoint = point;\n });\n // if relation is present (Arrows will be added), change cardinality point off-set distance (d)\n let d = 10 + terminalMarkerSize * 0.5;\n //Calculate Angle for x and y axis\n let angle = Math.atan2(points[0].y - center.y, points[0].x - center.x);\n\n let cardinalityPosition = { x: 0, y: 0 };\n\n //Calculation cardinality position using angle, center point on the line/curve but pendicular and with offset-distance\n\n cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2;\n cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2;\n if (position === 'start_left') {\n cardinalityPosition.x = Math.sin(angle + Math.PI) * d + (points[0].x + center.x) / 2;\n cardinalityPosition.y = -Math.cos(angle + Math.PI) * d + (points[0].y + center.y) / 2;\n }\n if (position === 'end_right') {\n cardinalityPosition.x = Math.sin(angle - Math.PI) * d + (points[0].x + center.x) / 2 - 5;\n cardinalityPosition.y = -Math.cos(angle - Math.PI) * d + (points[0].y + center.y) / 2 - 5;\n }\n if (position === 'end_left') {\n cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2 - 5;\n cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2 - 5;\n }\n return cardinalityPosition;\n};\n\n/**\n * Gets styles from an array of declarations\n *\n * @param {string[]} arr Declarations\n * @returns {{ style: string; labelStyle: string }} The styles grouped as strings\n */\nexport const getStylesFromArray = (arr) => {\n let style = '';\n let labelStyle = '';\n\n for (let i = 0; i < arr.length; i++) {\n if (typeof arr[i] !== 'undefined') {\n // add text properties to label style definition\n if (arr[i].startsWith('color:') || arr[i].startsWith('text-align:')) {\n labelStyle = labelStyle + arr[i] + ';';\n } else {\n style = style + arr[i] + ';';\n }\n }\n }\n\n return { style: style, labelStyle: labelStyle };\n};\n\nlet cnt = 0;\nexport const generateId = () => {\n cnt++;\n return 'id-' + Math.random().toString(36).substr(2, 12) + '-' + cnt;\n};\n\n/**\n * @param {any} length\n * @returns {any}\n */\nfunction makeid(length) {\n var result = '';\n var characters = '0123456789abcdef';\n var charactersLength = characters.length;\n for (var i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n}\n\nexport const random = (options) => {\n return makeid(options.length);\n};\n\n/**\n * @function assignWithDepth Extends the functionality of {@link ObjectConstructor.assign} with the\n * ability to merge arbitrary-depth objects For each key in src with path `k` (recursively)\n * performs an Object.assign(dst[`k`], src[`k`]) with a slight change from the typical handling of\n * undefined for dst[`k`]: instead of raising an error, dst[`k`] is auto-initialized to {} and\n * effectively merged with src[`k`]

Additionally, dissimilar types will not clobber unless the\n * config.clobber parameter === true. Example:\n *\n * ```js\n * let config_0 = { foo: { bar: 'bar' }, bar: 'foo' };\n * let config_1 = { foo: 'foo', bar: 'bar' };\n * let result = assignWithDepth(config_0, config_1);\n * console.log(result);\n * //-> result: { foo: { bar: 'bar' }, bar: 'bar' }\n * ```\n *\n * Traditional Object.assign would have clobbered foo in config_0 with foo in config_1. If src is a\n * destructured array of objects and dst is not an array, assignWithDepth will apply each element\n * of src to dst in order.\n * @param dst\n * @param src\n * @param config\n * @param dst\n * @param src\n * @param config\n * @param dst\n * @param src\n * @param config\n * @param {any} dst - The destination of the merge\n * @param {any} src - The source object(s) to merge into destination\n * @param {{ depth: number; clobber: boolean }} [config={ depth: 2, clobber: false }] - Depth: depth\n * to traverse within src and dst for merging - clobber: should dissimilar types clobber (default:\n * { depth: 2, clobber: false }). Default is `{ depth: 2, clobber: false }`\n * @returns {any}\n */\nexport const assignWithDepth = function (dst, src, config) {\n const { depth, clobber } = Object.assign({ depth: 2, clobber: false }, config);\n if (Array.isArray(src) && !Array.isArray(dst)) {\n src.forEach((s) => assignWithDepth(dst, s, config));\n return dst;\n } else if (Array.isArray(src) && Array.isArray(dst)) {\n src.forEach((s) => {\n if (dst.indexOf(s) === -1) {\n dst.push(s);\n }\n });\n return dst;\n }\n if (typeof dst === 'undefined' || depth <= 0) {\n if (dst !== undefined && dst !== null && typeof dst === 'object' && typeof src === 'object') {\n return Object.assign(dst, src);\n } else {\n return src;\n }\n }\n if (typeof src !== 'undefined' && typeof dst === 'object' && typeof src === 'object') {\n Object.keys(src).forEach((key) => {\n if (\n typeof src[key] === 'object' &&\n (dst[key] === undefined || typeof dst[key] === 'object')\n ) {\n if (dst[key] === undefined) {\n dst[key] = Array.isArray(src[key]) ? [] : {};\n }\n dst[key] = assignWithDepth(dst[key], src[key], { depth: depth - 1, clobber });\n } else if (clobber || (typeof dst[key] !== 'object' && typeof src[key] !== 'object')) {\n dst[key] = src[key];\n }\n });\n }\n return dst;\n};\n\nexport const getTextObj = function () {\n return {\n x: 0,\n y: 0,\n fill: undefined,\n anchor: 'start',\n style: '#666',\n width: 100,\n height: 100,\n textMargin: 0,\n rx: 0,\n ry: 0,\n valign: undefined,\n };\n};\n\n/**\n * Adds text to an element\n *\n * @param {SVGElement} elem Element to add text to\n * @param {{\n * text: string;\n * x: number;\n * y: number;\n * anchor: 'start' | 'middle' | 'end';\n * fontFamily: string;\n * fontSize: string | number;\n * fontWeight: string | number;\n * fill: string;\n * class: string | undefined;\n * textMargin: number;\n * }} textData\n * @returns {SVGTextElement} Text element with given styling and content\n */\nexport const drawSimpleText = function (elem, textData) {\n // Remove and ignore br:s\n const nText = textData.text.replace(common.lineBreakRegex, ' ');\n\n const textElem = elem.append('text');\n textElem.attr('x', textData.x);\n textElem.attr('y', textData.y);\n textElem.style('text-anchor', textData.anchor);\n textElem.style('font-family', textData.fontFamily);\n textElem.style('font-size', textData.fontSize);\n textElem.style('font-weight', textData.fontWeight);\n textElem.attr('fill', textData.fill);\n if (typeof textData.class !== 'undefined') {\n textElem.attr('class', textData.class);\n }\n\n const span = textElem.append('tspan');\n span.attr('x', textData.x + textData.textMargin * 2);\n span.attr('fill', textData.fill);\n span.text(nText);\n\n return textElem;\n};\n\nexport const wrapLabel = memoize(\n (label, maxWidth, config) => {\n if (!label) {\n return label;\n }\n config = Object.assign(\n { fontSize: 12, fontWeight: 400, fontFamily: 'Arial', joinWith: '
' },\n config\n );\n if (common.lineBreakRegex.test(label)) {\n return label;\n }\n const words = label.split(' ');\n const completedLines = [];\n let nextLine = '';\n words.forEach((word, index) => {\n const wordLength = calculateTextWidth(`${word} `, config);\n const nextLineLength = calculateTextWidth(nextLine, config);\n if (wordLength > maxWidth) {\n const { hyphenatedStrings, remainingWord } = breakString(word, maxWidth, '-', config);\n completedLines.push(nextLine, ...hyphenatedStrings);\n nextLine = remainingWord;\n } else if (nextLineLength + wordLength >= maxWidth) {\n completedLines.push(nextLine);\n nextLine = word;\n } else {\n nextLine = [nextLine, word].filter(Boolean).join(' ');\n }\n const currentWord = index + 1;\n const isLastWord = currentWord === words.length;\n if (isLastWord) {\n completedLines.push(nextLine);\n }\n });\n return completedLines.filter((line) => line !== '').join(config.joinWith);\n },\n (label, maxWidth, config) =>\n `${label}-${maxWidth}-${config.fontSize}-${config.fontWeight}-${config.fontFamily}-${config.joinWith}`\n);\n\nconst breakString = memoize(\n (word, maxWidth, hyphenCharacter = '-', config) => {\n config = Object.assign(\n { fontSize: 12, fontWeight: 400, fontFamily: 'Arial', margin: 0 },\n config\n );\n const characters = word.split('');\n const lines = [];\n let currentLine = '';\n characters.forEach((character, index) => {\n const nextLine = `${currentLine}${character}`;\n const lineWidth = calculateTextWidth(nextLine, config);\n if (lineWidth >= maxWidth) {\n const currentCharacter = index + 1;\n const isLastLine = characters.length === currentCharacter;\n const hyphenatedNextLine = `${nextLine}${hyphenCharacter}`;\n lines.push(isLastLine ? nextLine : hyphenatedNextLine);\n currentLine = '';\n } else {\n currentLine = nextLine;\n }\n });\n return { hyphenatedStrings: lines, remainingWord: currentLine };\n },\n (word, maxWidth, hyphenCharacter = '-', config) =>\n `${word}-${maxWidth}-${hyphenCharacter}-${config.fontSize}-${config.fontWeight}-${config.fontFamily}`\n);\n\n/**\n * This calculates the text's height, taking into account the wrap breaks and both the statically\n * configured height, width, and the length of the text (in pixels).\n *\n * If the wrapped text text has greater height, we extend the height, so it's value won't overflow.\n *\n * @param {any} text The text to measure\n * @param {any} config - The config for fontSize, fontFamily, and fontWeight all impacting the resulting size\n * @returns {any} - The height for the given text\n */\nexport const calculateTextHeight = function (text, config) {\n config = Object.assign(\n { fontSize: 12, fontWeight: 400, fontFamily: 'Arial', margin: 15 },\n config\n );\n return calculateTextDimensions(text, config).height;\n};\n\n/**\n * This calculates the width of the given text, font size and family.\n *\n * @param {any} text - The text to calculate the width of\n * @param {any} config - The config for fontSize, fontFamily, and fontWeight all impacting the resulting size\n * @returns {any} - The width for the given text\n */\nexport const calculateTextWidth = function (text, config) {\n config = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: 'Arial' }, config);\n return calculateTextDimensions(text, config).width;\n};\n\n/**\n * This calculates the dimensions of the given text, font size, font family, font weight, and margins.\n *\n * @param {any} text - The text to calculate the width of\n * @param {any} config - The config for fontSize, fontFamily, fontWeight, and margin all impacting\n * the resulting size\n * @returns - The width for the given text\n */\nexport const calculateTextDimensions = memoize(\n function (text, config) {\n config = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: 'Arial' }, config);\n const { fontSize, fontFamily, fontWeight } = config;\n if (!text) {\n return { width: 0, height: 0 };\n }\n\n // We can't really know if the user supplied font family will render on the user agent;\n // thus, we'll take the max width between the user supplied font family, and a default\n // of sans-serif.\n const fontFamilies = ['sans-serif', fontFamily];\n const lines = text.split(common.lineBreakRegex);\n let dims = [];\n\n const body = select('body');\n // We don't want to leak DOM elements - if a removal operation isn't available\n // for any reason, do not continue.\n if (!body.remove) {\n return { width: 0, height: 0, lineHeight: 0 };\n }\n\n const g = body.append('svg');\n\n for (let fontFamily of fontFamilies) {\n let cheight = 0;\n let dim = { width: 0, height: 0, lineHeight: 0 };\n for (let line of lines) {\n const textObj = getTextObj();\n textObj.text = line;\n const textElem = drawSimpleText(g, textObj)\n .style('font-size', fontSize)\n .style('font-weight', fontWeight)\n .style('font-family', fontFamily);\n\n let bBox = (textElem._groups || textElem)[0][0].getBBox();\n dim.width = Math.round(Math.max(dim.width, bBox.width));\n cheight = Math.round(bBox.height);\n dim.height += cheight;\n dim.lineHeight = Math.round(Math.max(dim.lineHeight, cheight));\n }\n dims.push(dim);\n }\n\n g.remove();\n\n let index =\n isNaN(dims[1].height) ||\n isNaN(dims[1].width) ||\n isNaN(dims[1].lineHeight) ||\n (dims[0].height > dims[1].height &&\n dims[0].width > dims[1].width &&\n dims[0].lineHeight > dims[1].lineHeight)\n ? 0\n : 1;\n return dims[index];\n },\n (text, config) => `${text}-${config.fontSize}-${config.fontWeight}-${config.fontFamily}`\n);\n\n/**\n * Applys d3 attributes\n *\n * @param {any} d3Elem D3 Element to apply the attributes onto\n * @param {[string, string][]} attrs Object.keys equivalent format of key to value mapping of attributes\n */\nconst d3Attrs = function (d3Elem, attrs) {\n for (let attr of attrs) {\n d3Elem.attr(attr[0], attr[1]);\n }\n};\n\n/**\n * Gives attributes for an SVG's size given arguments\n *\n * @param {number} height The height of the SVG\n * @param {number} width The width of the SVG\n * @param {boolean} useMaxWidth Whether or not to use max-width and set width to 100%\n * @returns {Map<'height' | 'width' | 'style', string>} Attributes for the SVG\n */\nexport const calculateSvgSizeAttrs = function (height, width, useMaxWidth) {\n let attrs = new Map();\n attrs.set('height', height);\n if (useMaxWidth) {\n attrs.set('width', '100%');\n attrs.set('style', `max-width: ${width}px;`);\n } else {\n attrs.set('width', width);\n }\n return attrs;\n};\n\n/**\n * Applies attributes from `calculateSvgSizeAttrs`\n *\n * @param {SVGSVGElement} svgElem The SVG Element to configure\n * @param {number} height The height of the SVG\n * @param {number} width The width of the SVG\n * @param {boolean} useMaxWidth Whether or not to use max-width and set width to 100%\n */\nexport const configureSvgSize = function (svgElem, height, width, useMaxWidth) {\n const attrs = calculateSvgSizeAttrs(height, width, useMaxWidth);\n d3Attrs(svgElem, attrs);\n};\nexport const setupGraphViewbox = function (graph, svgElem, padding, useMaxWidth) {\n const svgBounds = svgElem.node().getBBox();\n const sWidth = svgBounds.width;\n const sHeight = svgBounds.height;\n\n let width = graph._label.width;\n let height = graph._label.height;\n let tx = 0;\n let ty = 0;\n if (sWidth > width) {\n tx = (sWidth - width) / 2 + padding;\n width = sWidth + padding * 2;\n } else {\n if (Math.abs(sWidth - width) >= 2 * padding + 1) {\n width = width - padding;\n }\n }\n if (sHeight > height) {\n ty = (sHeight - height) / 2 + padding;\n height = sHeight + padding * 2;\n }\n configureSvgSize(svgElem, height, width, useMaxWidth);\n\n // Ensure the viewBox includes the whole svgBounds area with extra space for padding\n const vBox = `0 0 ${width} ${height}`;\n log.debug(\n 'Graph.label',\n graph._label,\n 'swidth',\n sWidth,\n 'sheight',\n sHeight,\n 'width',\n width,\n 'height',\n height,\n 'tx',\n tx,\n 'ty',\n ty,\n 'vBox',\n vBox\n );\n svgElem.attr('viewBox', vBox);\n svgElem.select('g').attr('transform', `translate(${tx}, ${ty})`);\n};\n\nexport const initIdGenerator = class iterator {\n constructor(deterministic, seed) {\n this.deterministic = deterministic;\n this.seed = seed;\n\n this.count = seed ? seed.length : 0;\n }\n\n next() {\n if (!this.deterministic) return Date.now();\n\n return this.count++;\n }\n};\n\nlet decoder;\n\n/**\n * Decodes HTML, source: {@link https://github.com/shrpne/entity-decode/blob/v2.0.1/browser.js}\n *\n * @param {string} html HTML as a string\n * @returns Unescaped HTML\n */\nexport const entityDecode = function (html) {\n decoder = decoder || document.createElement('div');\n // Escape HTML before decoding for HTML Entities\n html = escape(html).replace(/%26/g, '&').replace(/%23/g, '#').replace(/%3B/g, ';');\n // decoding\n decoder.innerHTML = html;\n return unescape(decoder.textContent);\n};\n\n/**\n * Sanitizes directive objects\n *\n * @param {object} args Directive's JSON\n */\nexport const directiveSanitizer = (args) => {\n log.debug('directiveSanitizer called with', args);\n if (typeof args === 'object') {\n // check for array\n if (args.length) {\n args.forEach((arg) => directiveSanitizer(arg));\n } else {\n // This is an object\n Object.keys(args).forEach((key) => {\n log.debug('Checking key', key);\n if (key.indexOf('__') === 0) {\n log.debug('sanitize deleting __ option', key);\n delete args[key];\n }\n\n if (key.indexOf('proto') >= 0) {\n log.debug('sanitize deleting proto option', key);\n delete args[key];\n }\n\n if (key.indexOf('constr') >= 0) {\n log.debug('sanitize deleting constr option', key);\n delete args[key];\n }\n\n if (key.indexOf('themeCSS') >= 0) {\n log.debug('sanitizing themeCss option');\n args[key] = sanitizeCss(args[key]);\n }\n if (key.indexOf('fontFamily') >= 0) {\n log.debug('sanitizing fontFamily option');\n args[key] = sanitizeCss(args[key]);\n }\n if (key.indexOf('altFontFamily') >= 0) {\n log.debug('sanitizing altFontFamily option');\n args[key] = sanitizeCss(args[key]);\n }\n if (configKeys.indexOf(key) < 0) {\n log.debug('sanitize deleting option', key);\n delete args[key];\n } else {\n if (typeof args[key] === 'object') {\n log.debug('sanitize deleting object', key);\n directiveSanitizer(args[key]);\n }\n }\n });\n }\n }\n if (args.themeVariables) {\n const kArr = Object.keys(args.themeVariables);\n for (let i = 0; i < kArr.length; i++) {\n const k = kArr[i];\n const val = args.themeVariables[k];\n if (val && val.match && !val.match(/^[a-zA-Z0-9#,\";()%. ]+$/)) {\n args.themeVariables[k] = '';\n }\n }\n }\n log.debug('After sanitization', args);\n};\nexport const sanitizeCss = (str) => {\n let startCnt = 0;\n let endCnt = 0;\n\n for (let i = 0; i < str.length; i++) {\n if (startCnt < endCnt) {\n return '{ /* ERROR: Unbalanced CSS */ }';\n }\n if (str[i] === '{') {\n startCnt++;\n } else if (str[i] === '}') {\n endCnt++;\n }\n }\n if (startCnt !== endCnt) {\n return '{ /* ERROR: Unbalanced CSS */ }';\n }\n // Todo add more checks here\n return str;\n};\n\nexport default {\n assignWithDepth,\n wrapLabel,\n calculateTextHeight,\n calculateTextWidth,\n calculateTextDimensions,\n calculateSvgSizeAttrs,\n configureSvgSize,\n setupGraphViewbox,\n detectInit,\n detectDirective,\n detectType,\n isSubstringInArray,\n interpolateToCurve,\n calcLabelPosition,\n calcCardinalityPosition,\n calcTerminalLabelPosition,\n formatUrl,\n getStylesFromArray,\n generateId,\n random,\n memoize,\n runFunc,\n entityDecode,\n initIdGenerator: initIdGenerator,\n directiveSanitizer,\n sanitizeCss,\n};\n","// 'path' module extracted from Node.js v8.11.1 (only the posix part)\n// transplited with Babel\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nfunction assertPath(path) {\n if (typeof path !== 'string') {\n throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));\n }\n}\n\n// Resolves . and .. elements in a path with directory names\nfunction normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\n\nfunction _format(sep, pathObject) {\n var dir = pathObject.dir || pathObject.root;\n var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');\n if (!dir) {\n return base;\n }\n if (dir === pathObject.root) {\n return dir + base;\n }\n return dir + sep + base;\n}\n\nvar posix = {\n // path.resolve([from ...], to)\n resolve: function resolve() {\n var resolvedPath = '';\n var resolvedAbsolute = false;\n var cwd;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path;\n if (i >= 0)\n path = arguments[i];\n else {\n if (cwd === undefined)\n cwd = process.cwd();\n path = cwd;\n }\n\n assertPath(path);\n\n // Skip empty entries\n if (path.length === 0) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);\n\n if (resolvedAbsolute) {\n if (resolvedPath.length > 0)\n return '/' + resolvedPath;\n else\n return '/';\n } else if (resolvedPath.length > 0) {\n return resolvedPath;\n } else {\n return '.';\n }\n },\n\n normalize: function normalize(path) {\n assertPath(path);\n\n if (path.length === 0) return '.';\n\n var isAbsolute = path.charCodeAt(0) === 47 /*/*/;\n var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/;\n\n // Normalize the path\n path = normalizeStringPosix(path, !isAbsolute);\n\n if (path.length === 0 && !isAbsolute) path = '.';\n if (path.length > 0 && trailingSeparator) path += '/';\n\n if (isAbsolute) return '/' + path;\n return path;\n },\n\n isAbsolute: function isAbsolute(path) {\n assertPath(path);\n return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;\n },\n\n join: function join() {\n if (arguments.length === 0)\n return '.';\n var joined;\n for (var i = 0; i < arguments.length; ++i) {\n var arg = arguments[i];\n assertPath(arg);\n if (arg.length > 0) {\n if (joined === undefined)\n joined = arg;\n else\n joined += '/' + arg;\n }\n }\n if (joined === undefined)\n return '.';\n return posix.normalize(joined);\n },\n\n relative: function relative(from, to) {\n assertPath(from);\n assertPath(to);\n\n if (from === to) return '';\n\n from = posix.resolve(from);\n to = posix.resolve(to);\n\n if (from === to) return '';\n\n // Trim any leading backslashes\n var fromStart = 1;\n for (; fromStart < from.length; ++fromStart) {\n if (from.charCodeAt(fromStart) !== 47 /*/*/)\n break;\n }\n var fromEnd = from.length;\n var fromLen = fromEnd - fromStart;\n\n // Trim any leading backslashes\n var toStart = 1;\n for (; toStart < to.length; ++toStart) {\n if (to.charCodeAt(toStart) !== 47 /*/*/)\n break;\n }\n var toEnd = to.length;\n var toLen = toEnd - toStart;\n\n // Compare paths to find the longest common path from root\n var length = fromLen < toLen ? fromLen : toLen;\n var lastCommonSep = -1;\n var i = 0;\n for (; i <= length; ++i) {\n if (i === length) {\n if (toLen > length) {\n if (to.charCodeAt(toStart + i) === 47 /*/*/) {\n // We get here if `from` is the exact base path for `to`.\n // For example: from='/foo/bar'; to='/foo/bar/baz'\n return to.slice(toStart + i + 1);\n } else if (i === 0) {\n // We get here if `from` is the root\n // For example: from='/'; to='/foo'\n return to.slice(toStart + i);\n }\n } else if (fromLen > length) {\n if (from.charCodeAt(fromStart + i) === 47 /*/*/) {\n // We get here if `to` is the exact base path for `from`.\n // For example: from='/foo/bar/baz'; to='/foo/bar'\n lastCommonSep = i;\n } else if (i === 0) {\n // We get here if `to` is the root.\n // For example: from='/foo'; to='/'\n lastCommonSep = 0;\n }\n }\n break;\n }\n var fromCode = from.charCodeAt(fromStart + i);\n var toCode = to.charCodeAt(toStart + i);\n if (fromCode !== toCode)\n break;\n else if (fromCode === 47 /*/*/)\n lastCommonSep = i;\n }\n\n var out = '';\n // Generate the relative path based on the path difference between `to`\n // and `from`\n for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {\n if (out.length === 0)\n out += '..';\n else\n out += '/..';\n }\n }\n\n // Lastly, append the rest of the destination (`to`) path that comes after\n // the common path parts\n if (out.length > 0)\n return out + to.slice(toStart + lastCommonSep);\n else {\n toStart += lastCommonSep;\n if (to.charCodeAt(toStart) === 47 /*/*/)\n ++toStart;\n return to.slice(toStart);\n }\n },\n\n _makeLong: function _makeLong(path) {\n return path;\n },\n\n dirname: function dirname(path) {\n assertPath(path);\n if (path.length === 0) return '.';\n var code = path.charCodeAt(0);\n var hasRoot = code === 47 /*/*/;\n var end = -1;\n var matchedSlash = true;\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 1) return '//';\n return path.slice(0, end);\n },\n\n basename: function basename(path, ext) {\n if (ext !== undefined && typeof ext !== 'string') throw new TypeError('\"ext\" argument must be a string');\n assertPath(path);\n\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n\n if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n if (ext.length === path.length && ext === path) return '';\n var extIdx = ext.length - 1;\n var firstNonSlashEnd = -1;\n for (i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else {\n if (firstNonSlashEnd === -1) {\n // We saw the first non-path separator, remember this index in case\n // we need it if the extension ends up not matching\n matchedSlash = false;\n firstNonSlashEnd = i + 1;\n }\n if (extIdx >= 0) {\n // Try to match the explicit extension\n if (code === ext.charCodeAt(extIdx)) {\n if (--extIdx === -1) {\n // We matched the extension, so mark this as the end of our path\n // component\n end = i;\n }\n } else {\n // Extension does not match, so our result is the entire path\n // component\n extIdx = -1;\n end = firstNonSlashEnd;\n }\n }\n }\n }\n\n if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;\n return path.slice(start, end);\n } else {\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n\n if (end === -1) return '';\n return path.slice(start, end);\n }\n },\n\n extname: function extname(path) {\n assertPath(path);\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n startDot = i;\n else if (preDotState !== 1)\n preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n },\n\n format: function format(pathObject) {\n if (pathObject === null || typeof pathObject !== 'object') {\n throw new TypeError('The \"pathObject\" argument must be of type Object. Received type ' + typeof pathObject);\n }\n return _format('/', pathObject);\n },\n\n parse: function parse(path) {\n assertPath(path);\n\n var ret = { root: '', dir: '', base: '', ext: '', name: '' };\n if (path.length === 0) return ret;\n var code = path.charCodeAt(0);\n var isAbsolute = code === 47 /*/*/;\n var start;\n if (isAbsolute) {\n ret.root = '/';\n start = 1;\n } else {\n start = 0;\n }\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n var i = path.length - 1;\n\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n\n // Get non-dir info\n for (; i >= start; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n if (end !== -1) {\n if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);\n }\n } else {\n if (startPart === 0 && isAbsolute) {\n ret.name = path.slice(1, startDot);\n ret.base = path.slice(1, end);\n } else {\n ret.name = path.slice(startPart, startDot);\n ret.base = path.slice(startPart, end);\n }\n ret.ext = path.slice(startDot, end);\n }\n\n if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/';\n\n return ret;\n },\n\n sep: '/',\n delimiter: ':',\n win32: null,\n posix: null\n};\n\nposix.posix = posix;\n\nmodule.exports = posix;\n","module.exports = require(\"@braintree/sanitize-url\");","module.exports = require(\"d3\");","module.exports = require(\"dagre\");","module.exports = require(\"dagre-d3\");","module.exports = require(\"dagre-d3/lib/label/add-html-label.js\");","module.exports = require(\"dompurify\");","module.exports = require(\"graphlib\");","module.exports = require(\"khroma\");","module.exports = require(\"moment-mini\");","module.exports = require(\"stylis\");","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","/* (ignored) */","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the module cache\n__webpack_require__.c = __webpack_module_cache__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","","// module cache are used so entry inlining is disabled\n// startup\n// Load entry module and return exports\nvar __webpack_exports__ = __webpack_require__(__webpack_require__.s = \"./src/mermaid.js\");\n",""],"names":["addSVGAccessibilityFields","yy_parser","svg","id","insert","title_string","getAccTitle","description","getAccDescription","attr","text","sanitizeText","_sanitizeText","getConfig","title","diagramTitle","txt","clear","setAccTitle","replace","setAccDescription","setDiagramTitle","getDiagramTitle","assignWithDepth","log","theme","config","defaultConfig","Object","freeze","siteConfig","configFromInitialize","directives","currentConfig","updateCurrentConfig","siteCfg","_directives","cfg","sumOfDirectives","i","length","d","sanitize","tmpConfigFromInitialize","themeVariables","getThemeVariables","setSiteConfig","conf","saveConfigFromInitialize","updateSiteConfig","getSiteConfig","setConfig","options","keys","secure","forEach","key","debug","indexOf","addDirective","directive","fontFamily","push","reset","intersectRect","createLabel","select","evaluate","rect","parent","node","trace","shapeSvg","class","label","appendChild","labelText","labelStyle","undefined","bbox","getBBox","flowchart","htmlLabels","div","children","dv","getBoundingClientRect","width","height","padding","halfPadding","diff","JSON","stringify","style","rx","ry","x","y","rectBox","intersect","point","noteGroup","roundedWithTitle","classes","innerRect","append","divider","shapes","clusterElems","insertCluster","elem","shape","getClusterTitleWidth","removeChild","positionCluster","info","el","sanitizeTxt","applyStyle","dom","styleFn","addHtmlLabel","fo","document","createElementNS","labelClass","isNode","html","_vertexText","isTitle","vertexText","s","vertexNode","svgLabel","setAttribute","rows","split","Array","isArray","j","tspan","setAttributeNS","textContent","trim","line","curveBasis","utils","edgeLabels","terminalLabels","insertEdgeLabel","edge","labelElement","edgeLabel","startLabelLeft","startLabelElement","startEdgeLabelLeft","inner","slBox","startLeft","setTerminalWidth","startLabelRight","startEdgeLabelRight","startRight","endLabelLeft","endLabelElement","endEdgeLabelLeft","endLeft","endLabelRight","endEdgeLabelRight","endRight","value","positionEdgeLabel","paths","path","updatedPath","originalPath","pos","calcLabelPosition","calcTerminalLabelPosition","arrowTypeStart","arrowTypeEnd","outsideNode","dx","Math","abs","dy","w","h","intersection","outsidePoint","insidePoint","warn","r","Q","R","q","res","_x","_y","cutPathAtIntersect","_points","boundryNode","points","lastPointOutside","isInside","inter","pointPresent","p","find","e","insertEdge","clusterDb","diagramType","graph","pointsHasChanged","tail","v","head","slice","unshift","toCluster","fromCluster","reverse","lineData","filter","Number","isNaN","curve","lineFunction","strokeClasses","thickness","pattern","svgPath","url","state","arrowMarkerAbsolute","window","location","protocol","host","pathname","search","dagre","graphlib","insertMarkers","updateNodeBounds","clearGraphlib","adjustClustersAndEdges","findNonClusterChild","sortNodesByHierarchy","insertNode","positionNode","clearNodes","setNodeElem","clearClusters","clearEdges","recursiveRender","_elem","diagramtype","parentCluster","json","write","dir","rankdir","nodes","edges","clusters","edgePaths","data","parse","clusterData","setNode","setParent","clusterNode","o","newEl","name","layout","n","type","render","markers","circle","ellipse","polygon","intersectEllipse","intersectCircle","cx","cy","px","py","det","sqrt","intersectLine","p1","p2","q1","q2","a1","a2","b1","b2","c1","c2","r1","r2","r3","r4","denom","offset","num","sameSign","module","exports","intersectNode","intersectPolygon","polyPoints","x1","y1","intersections","minX","POSITIVE_INFINITY","minY","entry","min","left","top","sort","pdx","pdy","distp","qdx","qdy","distq","sx","sy","markerArray","markerName","extension","composition","aggregation","dependency","cross","barb","decendants","parents","isDecendant","ancenstorId","edgeInCluster","clusterId","copy","newGraph","rootId","setEdge","error","removeNode","extractDecendants","concat","validate","_id","getAnchorId","externalConnections","depth","d1","d2","removeEdge","specialId","domId","edge1","edge2","extractor","hasChildren","graphSettings","clusterGraph","Graph","multigraph","compound","setGraph","nodesep","ranksep","marginx","marginy","setDefaultEdgeLabel","sorter","result","assign","sorted","labelHelper","insertPolygonShape","note","parseMember","question","questionElem","choice","map","join","hexagon","f","m","hex","rect_left_inv_arrow","lean_right","lean_left","trapezoid","inv_trapezoid","rect_right_inv_arrow","cylinder","totalWidth","totalHeight","props","propKeys","Set","borders","applyNodePropertyBorders","delete","propKey","labelRect","strokeDashArray","addBorder","skipBorder","includes","rectWithTitle","innerLine","text2","flat","textRows","titleBox","descr","stadium","doublecircle","gap","circleGroup","outerCircle","innerCircle","subroutine","start","forkJoin","end","class_box","rowPadding","lineHeight","topLine","bottomLine","maxWidth","maxHeight","labelContainer","verticalPos","hasInterface","classData","annotations","interfaceLabelText","interfaceLabel","interfaceBBox","classTitleString","classTitleLabel","classTitleBBox","classAttributes","members","str","parsedInfo","parsedText","displayText","lbl","cssStyle","classMethods","methods","diffX","fork","nodeElems","link","target","securityLevel","linkTarget","tooltip","haveCallback","decodeEntities","_classes","element","themeCSS","maxTextSize","darkMode","logLevel","startOnLoad","deterministicIds","deterministicIDSeed","diagramPadding","nodeSpacing","rankSpacing","useMaxWidth","defaultRenderer","sequence","hideUnusedParticipants","activationWidth","diagramMarginX","diagramMarginY","actorMargin","boxMargin","boxTextMargin","noteMargin","messageMargin","messageAlign","mirrorActors","forceMenus","bottomMarginAdj","rightAngles","showSequenceNumbers","actorFontSize","actorFontFamily","actorFontWeight","noteFontSize","noteFontFamily","noteFontWeight","noteAlign","messageFontSize","messageFontFamily","messageFontWeight","wrap","wrapPadding","labelBoxWidth","labelBoxHeight","messageFont","fontSize","fontWeight","noteFont","actorFont","gantt","titleTopMargin","barHeight","barGap","topPadding","rightPadding","leftPadding","gridLineStartPadding","sectionFontSize","numberSectionStyles","axisFormat","topAxis","useWidth","journey","leftMargin","taskFontSize","taskFontFamily","taskMargin","textPlacement","actorColours","sectionFills","sectionColours","dividerMargin","sizeUnit","textHeight","titleShift","forkWidth","forkHeight","miniPadding","fontSizeFactor","labelHeight","edgeLengthFactor","compositTitleSize","radius","er","layoutDirection","minEntityWidth","minEntityHeight","entityPadding","stroke","fill","pie","requirement","rect_fill","text_color","rect_border_size","rect_border_color","rect_min_width","rect_min_height","rect_padding","line_height","gitGraph","nodeLabel","mainBranchName","mainBranchOrder","showCommitLabel","showBranches","rotateCommitLabel","c4","c4ShapeMargin","c4ShapePadding","c4ShapeInRow","nextLinePaddingX","c4BoundaryInRow","personFontSize","personFontFamily","personFontWeight","external_personFontSize","external_personFontFamily","external_personFontWeight","systemFontSize","systemFontFamily","systemFontWeight","external_systemFontSize","external_systemFontFamily","external_systemFontWeight","system_dbFontSize","system_dbFontFamily","system_dbFontWeight","external_system_dbFontSize","external_system_dbFontFamily","external_system_dbFontWeight","system_queueFontSize","system_queueFontFamily","system_queueFontWeight","external_system_queueFontSize","external_system_queueFontFamily","external_system_queueFontWeight","boundaryFontSize","boundaryFontFamily","boundaryFontWeight","containerFontSize","containerFontFamily","containerFontWeight","external_containerFontSize","external_containerFontFamily","external_containerFontWeight","container_dbFontSize","container_dbFontFamily","container_dbFontWeight","external_container_dbFontSize","external_container_dbFontFamily","external_container_dbFontWeight","container_queueFontSize","container_queueFontFamily","container_queueFontWeight","external_container_queueFontSize","external_container_queueFontFamily","external_container_queueFontWeight","componentFontSize","componentFontFamily","componentFontWeight","external_componentFontSize","external_componentFontFamily","external_componentFontWeight","component_dbFontSize","component_dbFontFamily","component_dbFontWeight","external_component_dbFontSize","external_component_dbFontFamily","external_component_dbFontWeight","component_queueFontSize","component_queueFontFamily","component_queueFontWeight","external_component_queueFontSize","external_component_queueFontFamily","external_component_queueFontWeight","personFont","external_personFont","systemFont","external_systemFont","system_dbFont","external_system_dbFont","system_queueFont","external_system_queueFont","containerFont","external_containerFont","container_dbFont","external_container_dbFont","container_queueFont","external_container_queueFont","componentFont","external_componentFont","component_dbFont","external_component_dbFont","component_queueFont","external_component_queueFont","boundaryFont","person_bg_color","person_border_color","external_person_bg_color","external_person_border_color","system_bg_color","system_border_color","system_db_bg_color","system_db_border_color","system_queue_bg_color","system_queue_border_color","external_system_bg_color","external_system_border_color","external_system_db_bg_color","external_system_db_border_color","external_system_queue_bg_color","external_system_queue_border_color","container_bg_color","container_border_color","container_db_bg_color","container_db_border_color","container_queue_bg_color","container_queue_border_color","external_container_bg_color","external_container_border_color","external_container_db_bg_color","external_container_db_border_color","external_container_queue_bg_color","external_container_queue_border_color","component_bg_color","component_border_color","component_db_bg_color","component_db_border_color","component_queue_bg_color","component_queue_border_color","external_component_bg_color","external_component_border_color","external_component_db_bg_color","external_component_db_border_color","external_component_queue_bg_color","external_component_queue_border_color","keyify","obj","prefix","reduce","configKeys","mermaidAPI","configApi","c4ShapeArray","boundaryParseStack","currentBoundaryParse","parentBoundaryParse","boundarys","alias","tags","parentBoundary","rels","wrapEnabled","c4Type","getC4Type","setC4Type","c4TypeParam","sanitizedText","parseDirective","statement","context","addRel","from","to","techn","sprite","rel","old","entries","autoWrap","addPersonOrSystem","typeC4Shape","personOrSystem","addContainer","container","addComponent","component","addPersonOrSystemBoundary","boundary","addContainerBoundary","addDeploymentNode","nodeType","popBoundaryParseStack","pop","updateElStyle","elementName","bgColor","fontColor","borderColor","shadowing","legendText","legendSprite","updateRelStyle","textColor","lineColor","offsetX","offsetY","parseInt","updateLayoutConfig","c4ShapeInRowParam","c4BoundaryInRowParam","c4ShapeInRowValue","c4BoundaryInRowValue","getC4ShapeInRow","getC4BoundaryInRow","getCurrentBoundaryParse","getParentBoundaryParse","getC4ShapeArray","getC4Shape","getC4ShapeKeys","getBoundarys","getRels","getTitle","setWrap","wrapSetting","LINETYPE","SOLID","DOTTED","NOTE","SOLID_CROSS","DOTTED_CROSS","SOLID_OPEN","DOTTED_OPEN","LOOP_START","LOOP_END","ALT_START","ALT_ELSE","ALT_END","OPT_START","OPT_END","ACTIVE_START","ACTIVE_END","PAR_START","PAR_AND","PAR_END","RECT_START","RECT_END","SOLID_POINT","DOTTED_POINT","ARROWTYPE","FILLED","OPEN","PLACEMENT","LEFTOF","RIGHTOF","OVER","setTitle","svgDraw","drawText","fixLifeLineHeights","parser","common","c4Db","wrapLabel","calculateTextWidth","calculateTextHeight","configureSvgSize","globalBoundaryMaxX","globalBoundaryMaxY","yy","Bounds","startx","stopx","starty","stopy","widthLimit","nextData","cnt","setConf","val","fun","c4Shape","_startx","margin","_stopx","_starty","_stopy","updateVal","max","cnf","c4ShapeFont","calcC4ShapeTextWH","textType","c4ShapeTextWrap","textConf","textLimitWidth","textLines","lineBreakRegex","lines","drawBoundary","diagram","bounds","boundaryTextWrap","boundaryLabelConf","drawC4ShapeArray","currentBounds","c4ShapeKeys","Y","c4ShapeTypeConf","image","c4ShapeLabelConf","c4ShapeTechnConf","rectHeight","rectWidth","c4ShapeDescrConf","drawC4Shape","bumpLastMargin","Point","getIntersectPoint","fromNode","endPoint","x2","y2","fromCenterX","fromCenterY","tanDYX","fromDYX","returnPoint","getIntersectPoints","endNode","endIntersectPoint","startPoint","drawRels","getC4ShapeObj","relTextWrap","relConf","drawInsideBoundary","parentBoundaryAlias","parentBounds","currentBoundarys","currentBoundary","currentBoundaryTextWrap","currentBoundaryLabelConf","currentBoundaryTypeConf","currentBoundaryDescrConf","setData","currentPersonOrSystemArray","currentPersonOrSystemKeys","nextCurrentBoundarys","draw","sandboxElement","root","contentDocument","body","doc","db","insertComputerIcon","insertDatabaseIcon","insertClockIcon","screenBounds","screen","availWidth","c4type","insertArrowHead","insertArrowEnd","insertArrowCrossHead","insertArrowFilledHead","box","boxHeight","boxWidth","extraVertForTitle","drawPersonOrSystemArray","getStyles","personBorder","personBkg","addFunction","sanitizeUrl","drawRect","rectData","rectElem","attrs","attrKey","drawImage","imageElem","sanitizedLink","startsWith","drawEmbeddedImage","textData","prevTextHeight","textElems","yfunc","valign","textMargin","round","anchor","dominantBaseline","alignmentBaseline","textElem","span","_groups","drawLabel","txtObject","genPoints","cut","relsElem","strokeColor","replaceAll","messageConf","_drawTextCandidateFunc","boundaryElem","fillColor","attrsValue","boundaryConf","personImg","c4ShapeElem","getNoteRect","c4ShapeFontConf","getC4ShapeFont","textFontConf","thchn","insertDynamicNumber","defs","marker","getTextObj","byText","content","g","textAttrs","_setTextAttrs","byTspan","byFo","toText","fromTextAttrsDict","hasOwnProperty","commonClear","MERMAID_DOM_ID_PREFIX","relations","classCounter","funs","splitClassNameAndType","genericType","className","addClass","classId","cssClasses","lookUpDomId","classKeys","setupToolTips","getClass","getClasses","getRelations","addRelation","relation","id1","id2","relationTitle1","relationTitle2","addAnnotation","annotation","validatedClassName","addMember","member","theClass","memberString","endsWith","substring","addMembers","cleanupLabel","substr","setCssClass","ids","match","setTooltip","setLink","linkStr","formatUrl","setClickEvent","functionName","functionArgs","setClickFunc","elemId","argList","item","charAt","querySelector","addEventListener","runFunc","bindFunctions","lineType","LINE","DOTTED_LINE","relationType","AGGREGATION","EXTENSION","COMPOSITION","DEPENDENCY","tooltipElem","selectAll","on","transition","duration","scrollX","right","scrollY","scrollTop","classed","direction","getDirection","setDirection","classDb","curveLinear","interpolateToCurve","getStylesFromArray","setupGraphViewbox","idCache","addClasses","vertex","cssClassStr","styles","radious","_shape","addRelations","defaultStyle","defaultLabelStyle","edgeData","arrowhead","getArrowMarker","type1","type2","interpolate","defaultInterpolate","arrowheadStyle","labelpos","labelType","getGraphId","foundEntry","labels","querySelectorAll","k","dim","insertBefore","firstChild","isMultiGraph","classDef","drawClass","drawEdge","svgBounds","vBox","nodeBorder","classText","mainBkg","edgeCount","getRelationType","l","labelPosition","p1_card_x","p1_card_y","p2_card_x","p2_card_y","cardinality_1_point","calcCardinalityPosition","cardinality_2_point","classInfo","isFirst","titleText2","classTitle","titleHeight","membersLine","addTspan","membersBox","methodsLine","method","classBox","childNodes","fieldRegEx","methodRegEx","fieldMatch","methodMatch","buildFieldDisplay","buildMethodDisplay","buildLegacyDisplay","visibility","fieldType","parseGenericTypes","fieldName","classifier","parseClassifier","err","methodName","parameters","returnType","memberText","methodStart","methodEnd","firstChar","textEl","tSpan","cleanedText","DOMPurify","getRows","breakToPlaceholder","removeEscapes","newStr","String","fromCharCode","_","c","removeScript","rs","idx","decodedText","sanitizeMore","level","placeholderToBreak","sanitizeTextOrArray","a","hasBreaks","test","splitBreaks","getUrl","useAbsolute","entities","relationships","Cardinality","ZERO_OR_ONE","ZERO_OR_MORE","ONE_OR_MORE","ONLY_ONE","Identification","NON_IDENTIFYING","IDENTIFYING","addEntity","attributes","getEntities","addAttributes","entityName","attribs","entity","attributeName","addRelationship","entA","rolA","entB","rSpec","entityA","roleA","entityB","relSpec","getRelationships","ERMarkers","ONLY_ONE_START","ONLY_ONE_END","ZERO_OR_ONE_START","ZERO_OR_ONE_END","ONE_OR_MORE_START","ONE_OR_MORE_END","ZERO_OR_MORE_START","ZERO_OR_MORE_END","erDb","erParser","erMarkers","drawAttributes","groupNode","entityTextNode","heightPadding","widthPadding","attrFontSize","labelBBox","attributeNodes","hasKeyType","hasComment","maxTypeWidth","maxNameWidth","maxKeyWidth","maxCommentWidth","cumulativeHeight","attrNum","attributeKeyType","attributeComment","attrPrefix","nodeHeight","typeNode","attributeType","nameNode","attributeNode","tn","nn","typeBBox","nameBBox","keyTypeNode","kn","keyTypeBBox","commentNode","cn","commentNodeBBox","widthPaddingFactor","bBox","spareColumnWidth","heightOffset","attribStyle","alignY","typeRect","nameXOffset","parseFloat","nameRect","keyTypeAndCommentXOffset","keyTypeRect","drawEntities","svgNode","firstOne","textId","textNode","entityWidth","entityHeight","rectNode","rectBBox","adjustEntities","getEdgeName","addRelationships","relationship","relCnt","drawRelationshipFromLayout","relType","cardA","cardB","len","getTotalLength","labelPoint","getPointAtLength","labelId","labelNode","directed","edgesep","firstEntity","tertiaryColor","dagreD3","addToRender","addToRenderV2","addShape","vertexCounter","vertices","subGraphs","subGraphLookup","tooltips","subCount","firstGraphFlag","version","veritceKeys","addVertex","addSingleLink","_start","_end","linktext","addLink","updateLinkInterpolate","positions","interp","updateLink","isSubstringInArray","textStyles","newStyle1","newStyle2","setClass","setClickFun","getTooltip","getVertices","getEdges","ver","setGen","addSubGraph","list","_title","uniq","prims","boolean","number","string","objs","nodeList","stmt","apply","nl","subGraph","makeUniq","getPosForId","secCount","posCrossRef","indexNodes2","count","posCount","childPos","getDepthFirstPos","indexNodes","getSubGraphs","firstGraph","destructStartLink","_str","countChar","char","destructEndLink","dots","destructLink","_startStr","startInfo","exists","allSgs","sg","allSubgraphs","lex","flowDb","flow","addVertices","vert","svgId","classStr","parentNode","addEdges","linkIdCnt","defaultStyles","linkIdBase","linkId","linkNameStart","linkNameEnd","minlen","subG","linkNode","flowChartShapes","_doc","Render","arrows","none","normal","util","clusterRects","clusterEl","xPos","baseVal","yPos","_width","cluster","te","classList","add","nodeTextColor","titleColor","arrowheadColor","edgeLabelBackground","clusterBkg","clusterBorder","border2","moment","dateFormat","todayMarker","excludes","links","accDescription","sections","tasks","currentSection","inclusiveEndDates","lastOrder","taskCnt","lastTask","lastTaskID","rawTasks","setAxisFormat","getAxisFormat","setTodayMarker","getTodayMarker","setDateFormat","enableInclusiveEndDates","endDatesAreInclusive","enableTopAxis","topAxisEnabled","getDateFormat","setIncludes","toLowerCase","getIncludes","setExcludes","getExcludes","getLinks","addSection","getSections","getTasks","allItemsPricessed","compileTasks","maxDepth","iterationCount","isInvalidDate","date","format","isoWeekday","checkTaskDates","task","manualEndTime","startTime","endTime","renderEndTime","fixTaskDates","toDate","invalid","getStartDate","prevTime","re","afterStatement","exec","latestEndingTask","findTaskById","dt","Date","setHours","mDate","isValid","durationToDate","durationStatement","relativeTime","getEndDate","inclusive","parseId","idStr","compileData","prevTask","dataStr","ds","getTaskTags","endTimeData","parseData","prevTaskId","startData","taskDb","addTask","rawTask","section","processed","raw","taskInfo","active","done","crit","milestone","order","addTaskOrg","newTask","compileTask","allProcessed","_linkStr","pushFun","open","callbackFunction","matchFound","t","regex","RegExp","shift","scaleTime","scaleLinear","interpolateHcl","axisBottom","axisTop","timeFormat","ganttDb","getElementById","parentElement","offsetWidth","taskArray","timeScale","domain","rangeRound","categories","catsUnfiltered","checkUnique","taskCompare","b","taskA","taskB","makeGant","pageWidth","pageHeight","colorScale","range","drawExcludeDays","makeGrid","drawRects","vertLabels","drawToday","theArray","theGap","theTopPad","theSidePad","theBarHeight","theColorScale","enter","rectangles","toString","secNum","taskClass","startX","endX","textWidth","taskType","each","taskRect","taskText","oldParent","Link","createElement","minTime","maxTime","excludeRanges","valueOf","clone","renderEnd","bottomXAxis","tickSize","tickFormat","call","topXAxis","numOccurances","prevGap","getCount","todayG","today","todayLine","arr","hash","prototype","getCounts","word","excludeBkgColor","sectionBkgColor","sectionBkgColor2","altSectionBkgColor","ganttFontSize","gridColor","todayLineColor","taskTextDarkColor","taskTextClickableColor","taskTextColor","taskBkgColor","taskBorderColor","taskTextOutsideColor","activeTaskBkgColor","activeTaskBorderColor","doneTaskBorderColor","doneTaskBkgColor","critBorderColor","critBkgColor","random","commits","branchesConfig","branches","curBranch","seq","getId","uniqBy","fn","recordMap","create","out","setOptions","rawOptString","message","getOptions","commit","msg","tag","commitType","NORMAL","branch","checkout","Error","token","loc","first_line","last_line","first_column","last_column","expected","merge","otherBranch","currentCommit","otherCommit","MERGE","cherryPick","sourceId","targetId","sourceCommit","sourceCommitBranch","CHERRY_PICK","upsert","newval","index","splice","prettyPrintCommitHistory","commitArr","newCommit","nextCommit","prettyPrint","getCommitsArray","mainBranch","getBranchesAsObjArray","branchesArray","values","branchConfig","getBranches","getCommits","getCurrentBranch","getHead","REVERSE","HIGHLIGHT","gitGraphParser","allCommitsDict","branchNum","branchPos","commitPos","lanes","maxPos","drawCommits","modifyGraph","gitGraphConfig","gBullets","gLabels","sortedKeys","typeClass","circle2","wrapper","labelBkg","r_x","r_y","hole","tagBbox","h2","ly","hasOverlappingCommits","commit1","commit2","allCommits","commit1Pos","commit2Pos","overlappingComits","findLane","_depth","candidate","ok","drawArrow","overlappingCommits","arc","arc2","colorClassNum","lineDef","lineY","arrow","drawArrows","gArrows","drawBranches","adjustIndexForTheme","bkg","branchLabel","commitLabelFontSize","commitLabelColor","commitLabelBackground","tagLabelFontSize","tagLabelColor","tagLabelBackground","tagLabelBorder","primaryColor","setMessage","getMessage","setInfo","inf","getInfo","infoParser","showData","setShowData","toggle","getShowData","cleanupValue","scaleOrdinal","d3pie","pieData","pieParser","legendRectSize","legendSpacing","sum","myGeneratedColors","pie1","pie2","pie3","pie4","pie5","pie6","pie7","pie8","pie9","pie10","pie11","pie12","color","dataReady","arcGenerator","innerRadius","outerRadius","toFixed","centroid","legend","horz","pieStrokeColor","pieStrokeWidth","pieOpacity","pieTitleTextSize","pieTitleTextColor","pieSectionTextColor","pieSectionTextSize","pieLegendTextColor","pieLegendTextSize","latestRequirement","requirements","latestElement","elements","RequirementType","REQUIREMENT","FUNCTIONAL_REQUIREMENT","INTERFACE_REQUIREMENT","PERFORMANCE_REQUIREMENT","PHYSICAL_REQUIREMENT","DESIGN_CONSTRAINT","RiskLevel","LOW_RISK","MED_RISK","HIGH_RISK","VerifyType","VERIFY_ANALYSIS","VERIFY_DEMONSTRATION","VERIFY_INSPECTION","VERIFY_TEST","Relationships","CONTAINS","COPIES","DERIVES","SATISFIES","VERIFIES","REFINES","TRACES","addRequirement","risk","verifyMethod","getRequirements","setNewReqId","setNewReqText","setNewReqRisk","setNewReqVerifyMethod","addElement","docRef","getElements","setNewElementType","setNewElementDocRef","src","dst","req","ReqMarkers","ARROW","insertLineEndings","containsNode","requirementDb","newRectNode","newTitleNode","txts","textStr","yPadding","linePadding","totalY","titleNode","newBodyNode","yStart","currentRow","charLimit","wrappedTxts","currentTextLen","firstPart","lastStr","addEdgeLabel","elementString","drawReqs","reqs","reqName","titleNodeInfo","bodyNode","drawElements","els","elName","relationColor","requirementBackground","requirementBorderColor","requirementBorderSize","requirementTextColor","relationLabelBackground","relationLabelColor","prevActor","actors","messages","notes","sequenceNumbersEnabled","addActor","properties","actorCnt","nextActor","activationCount","part","actor","addMessage","idFrom","idTo","answer","addSignal","messageType","getMessages","getActors","getActor","getActorKeys","enableSequenceNumbers","disableSequenceNumbers","parseMessage","AUTONUMBER","CRITICAL_START","CRITICAL_OPTION","CRITICAL_END","BREAK_START","BREAK_END","addNote","placement","addLinks","actorId","insertLinks","addALink","sep","addProperties","insertProperties","addDetails","innerHTML","details","getActorProperty","param","sequenceIndex","step","sequenceIndexStep","visible","sequenceVisible","signalType","loopText","optText","altText","parText","criticalText","optionText","breakText","sequenceDb","sequenceItems","activations","models","getHeight","loops","it","acc","actorModel","addLoop","loopModel","msgModel","noteModel","lastActor","lastLoop","lastMessage","lastNote","init","updateBounds","_self","updateFn","updateItemBounds","newActivation","actorRect","stackedSize","actorActivations","anchored","anchorElement","endActivation","lastActorActivationIdx","activation","lastIndexOf","createLoop","newLoop","endLoop","addSectionToLoop","loop","sectionTitles","getVerticalPos","bumpVerticalPos","bump","getBounds","drawNote","textObj","curr","boundMessage","textDims","calculateTextDimensions","lineStarty","totalOffset","fromBounds","toBounds","drawMessage","drawActors","actorKeys","configuration","newActors","actorKey","has","prevWidth","prevMargin","drawActor","drawActorsPopup","minMenuWidth","getRequiredPopupWidth","menuDimensions","drawPopup","activationBounds","actorObj","adjustLoopHeightForWrap","loopWidths","preMargin","postMargin","addLoopFn","heightAdjust","loopWidth","maxMessageWidthPerActor","getMaxMessageWidthPerActor","calculateActorMargins","calculateLoopBounds","insertSequenceNumber","activeEnd","activationData","drawActivation","messagesToDraw","drawLoop","drawBackgroundRect","messageModel","requiredBoxSize","actorLines","isNote","isMessage","textFont","wrappedMessage","messageDimensions","messageWidth","requiredPopupWidth","labelDimensions","labelWidth","actorToMessageWidth","prop","actDims","actorWidth","buildNoteModel","shouldWrap","textDimensions","buildMessageModel","process","fromIdx","toIdx","allBounds","boundedWidth","msgDims","stack","current","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","toAdd","enabled","stk","actorBorder","actorBkg","actorTextColor","actorLineColor","signalColor","sequenceNumberColor","signalTextColor","labelBoxBorderColor","labelBoxBkgColor","labelTextColor","loopTextColor","noteBorderColor","noteBkgColor","noteTextColor","activationBkgColor","activationBorderColor","addPopupInteraction","popupMenuUpFunc","popupMenuDownFunc","displayValue","actorClass","menuWidth","linkY","linkElem","_drawMenuItemTextCandidateFunc","popupMenu","popid","popdownMenu","popupId","pu","display","drawActorTypeParticipant","center","boxpluslineGroup","cssclass","iconSrc","drawActorTypeActor","actElem","drawLoopLine","sectionHeight","lower","set","get","size","stateDb","drawStartState","drawDivider","drawSimpleState","stateDef","drawDescrState","descriptions","isSecond","descrLine","descrBox","addTitleAndBox","altBkg","pad","dblPad","orgBox","orgWidth","orgX","titleWidth","graphBox","drawEndState","drawForkJoinState","parentId","tmp","nText","_drawLongText","_text","tHeight","textBounds","drawState","stateInfo","stateBox","titleRows","boundstmp","heightAdj","generateId","rootDoc","setRootDoc","getRootDoc","docTranslator","first","state1","state2","currentDoc","newNode","docNode","getRootDocV2","extract","addState","newDoc","states","documents","currentDocument","startCnt","endCnt","addDescription","des","saveCommon","getState","getStates","logDocuments","_id1","_id2","_descr","theState","dividerCnt","getDividerId","trimColon","nodeDb","setupNode","altFlag","getDir","nodeData","noteData","groupData","position","arrowType","setupDoc","startId","endId","defaultDir","transformationLog","renderDoc","svgWidth","getLabelWidth","domDocument","edgeFreeDoc","ranker","nodeSep","sub","boxBounds","noteDef","nodeCount","svgElem","dividers","pWidth","pShift","getAttribute","transitionColor","stateLabelColor","background","labelBackgroundColor","transitionLabelColor","tertiaryTextColor","specialStateColor","innerEndBackground","compositeBackground","stateBkg","stateBorder","compositeTitleBackground","altBackground","allItemsProcessed","updateActors","tempActors","people","unique","taskData","pieces","score","peeps","peopleList","journeyDb","drawActorLegend","person","colour","circleData","drawCircle","labelData","LEFT_MARGIN","initGraphics","actorNames","actorPos","actorName","drawTasks","fills","textColours","lastSection","sectionVHeight","taskPos","sectionNumber","drawSection","taskActors","drawTask","faceColor","fillType0","fillType1","fillType2","fillType3","fillType4","fillType5","fillType6","fillType7","actor0","actor1","actor2","actor3","actor4","actor5","d3arc","drawFace","faceData","circleElement","face","smile","startAngle","PI","endAngle","sad","ambivalent","labelMargin","taskCount","graphics","interactionFunctions","func","attachFunctions","LEVELS","fatal","setLogLevel","console","bind","time","initThrowsErrors","arguments","parseError","mermaid","sequenceConfig","callback","Node","ganttConfig","idGenerator","initIdGenerator","next","entityDecode","detectInit","svgCode","initialize","contentLoaded","setParseErrorHandler","newParseErrorHandler","compile","serialize","pkg","c4Renderer","c4Parser","classRenderer","classRendererV2","classParser","erRenderer","flowRenderer","flowRendererV2","flowParser","ganttRenderer","ganttParser","gitGraphAst","gitGraphRenderer","infoDb","infoRenderer","pieDb","pieRenderer","requirementParser","requirementRenderer","sequenceParser","sequenceRenderer","stateParser","stateRenderer","stateRendererV2","journeyRenderer","journeyParser","errorRenderer","directiveSanitizer","sanitizeCss","parseEncounteredException","graphInit","reinitialize","graphType","detectType","encodeEntities","innerTxt","isInt","_txt","cb","iframe","existingSvg","remove","userStyles","altFontFamily","stylis","selector","rules","style1","sequenceDiagram","svgEl","viewBox","btoa","ADD_TAGS","ADD_ATTR","tmpElementSelector","currentDirective","args","handleDirective","updateRendererConfigs","default","globalReset","classDiagram","stateDiagram","themes","calcThemeVariables","userOverRides","calcColors","errorBkgColor","errorTextColor","baseThemeVariables","darkThemeVariables","defaultThemeVariables","forestThemeVariables","neutralThemeVariables","base","dark","forest","neutral","darken","lighten","adjust","invert","mkBorder","Theme","primaryTextColor","secondaryColor","primaryBorderColor","secondaryBorderColor","tertiaryBorderColor","secondaryTextColor","nodeBkg","defaultLinkColor","taskTextLightColor","compositeBorder","git0","git1","git2","git3","git4","git5","git6","git7","gitInv0","gitInv1","gitInv2","gitInv3","gitInv4","gitInv5","gitInv6","gitInv7","branchLabelColor","gitBranchLabel0","gitBranchLabel1","gitBranchLabel2","gitBranchLabel3","gitBranchLabel4","gitBranchLabel5","gitBranchLabel6","gitBranchLabel7","tagBorder","overrides","updateColors","userOverrides","calculate","rgba","secondBkg","mainContrastColor","darkTextColor","border1","labelBackground","labelColor","col","contrast","critical","curveBasisClosed","curveBasisOpen","curveLinearClosed","curveMonotoneX","curveMonotoneY","curveNatural","curveStep","curveStepAfter","curveStepBefore","d3CurveTypes","directiveWithoutOpen","anyComment","inits","detectDirective","results","commentWithoutDirectives","source","lastIndex","memoize","resolver","cache","defaultCurve","curveName","toUpperCase","arrPaths","fnName","params","distance","pow","traverseEdge","prevPoint","totalDistance","remainingDistance","vectorDistance","distanceRatio","isRelationTypePresent","initialPosition","distanceToCardinalityPoint","angle","atan2","cardinalityPosition","sin","cos","terminalMarkerSize","makeid","characters","charactersLength","floor","clobber","drawSimpleText","joinWith","words","completedLines","nextLine","wordLength","nextLineLength","breakString","hyphenatedStrings","remainingWord","Boolean","currentWord","isLastWord","hyphenCharacter","currentLine","character","lineWidth","currentCharacter","isLastLine","hyphenatedNextLine","fontFamilies","dims","cheight","d3Attrs","d3Elem","calculateSvgSizeAttrs","Map","sWidth","sHeight","_label","tx","ty","deterministic","seed","now","decoder","escape","unescape","arg","kArr"],"sourceRoot":""} \ No newline at end of file diff --git a/web/_static/mermaid-js/mermaid.js b/web/_static/mermaid-js/mermaid.js new file mode 100644 index 0000000..4df7bb3 --- /dev/null +++ b/web/_static/mermaid-js/mermaid.js @@ -0,0 +1,89082 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["mermaid"] = factory(); + else + root["mermaid"] = factory(); +})(typeof self !== "undefined" ? self : this, () => { +return /******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ "./src/diagrams/c4/parser/c4Diagram.jison": +/*!************************************************!*\ + !*** ./src/diagrams/c4/parser/c4Diagram.jison ***! + \************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,6],$V1=[1,7],$V2=[1,8],$V3=[1,9],$V4=[1,16],$V5=[1,11],$V6=[1,12],$V7=[1,13],$V8=[1,14],$V9=[1,15],$Va=[1,27],$Vb=[1,33],$Vc=[1,34],$Vd=[1,35],$Ve=[1,36],$Vf=[1,37],$Vg=[1,72],$Vh=[1,73],$Vi=[1,74],$Vj=[1,75],$Vk=[1,76],$Vl=[1,77],$Vm=[1,78],$Vn=[1,38],$Vo=[1,39],$Vp=[1,40],$Vq=[1,41],$Vr=[1,42],$Vs=[1,43],$Vt=[1,44],$Vu=[1,45],$Vv=[1,46],$Vw=[1,47],$Vx=[1,48],$Vy=[1,49],$Vz=[1,50],$VA=[1,51],$VB=[1,52],$VC=[1,53],$VD=[1,54],$VE=[1,55],$VF=[1,56],$VG=[1,57],$VH=[1,59],$VI=[1,60],$VJ=[1,61],$VK=[1,62],$VL=[1,63],$VM=[1,64],$VN=[1,65],$VO=[1,66],$VP=[1,67],$VQ=[1,68],$VR=[1,69],$VS=[24,52],$VT=[24,44,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],$VU=[15,24,44,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],$VV=[1,94],$VW=[1,95],$VX=[1,96],$VY=[1,97],$VZ=[15,24,52],$V_=[7,8,9,10,18,22,25,26,27,28],$V$=[15,24,43,52],$V01=[15,24,43,52,86,87,89,90],$V11=[15,43],$V21=[44,46,47,48,49,50,51,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"mermaidDoc":4,"direction":5,"directive":6,"direction_tb":7,"direction_bt":8,"direction_rl":9,"direction_lr":10,"graphConfig":11,"openDirective":12,"typeDirective":13,"closeDirective":14,"NEWLINE":15,":":16,"argDirective":17,"open_directive":18,"type_directive":19,"arg_directive":20,"close_directive":21,"C4_CONTEXT":22,"statements":23,"EOF":24,"C4_CONTAINER":25,"C4_COMPONENT":26,"C4_DYNAMIC":27,"C4_DEPLOYMENT":28,"otherStatements":29,"diagramStatements":30,"otherStatement":31,"title":32,"accDescription":33,"acc_title":34,"acc_title_value":35,"acc_descr":36,"acc_descr_value":37,"acc_descr_multiline_value":38,"boundaryStatement":39,"boundaryStartStatement":40,"boundaryStopStatement":41,"boundaryStart":42,"LBRACE":43,"ENTERPRISE_BOUNDARY":44,"attributes":45,"SYSTEM_BOUNDARY":46,"BOUNDARY":47,"CONTAINER_BOUNDARY":48,"NODE":49,"NODE_L":50,"NODE_R":51,"RBRACE":52,"diagramStatement":53,"PERSON":54,"PERSON_EXT":55,"SYSTEM":56,"SYSTEM_DB":57,"SYSTEM_QUEUE":58,"SYSTEM_EXT":59,"SYSTEM_EXT_DB":60,"SYSTEM_EXT_QUEUE":61,"CONTAINER":62,"CONTAINER_DB":63,"CONTAINER_QUEUE":64,"CONTAINER_EXT":65,"CONTAINER_EXT_DB":66,"CONTAINER_EXT_QUEUE":67,"COMPONENT":68,"COMPONENT_DB":69,"COMPONENT_QUEUE":70,"COMPONENT_EXT":71,"COMPONENT_EXT_DB":72,"COMPONENT_EXT_QUEUE":73,"REL":74,"BIREL":75,"REL_U":76,"REL_D":77,"REL_L":78,"REL_R":79,"REL_B":80,"REL_INDEX":81,"UPDATE_EL_STYLE":82,"UPDATE_REL_STYLE":83,"UPDATE_LAYOUT_CONFIG":84,"attribute":85,"STR":86,"STR_KEY":87,"STR_VALUE":88,"ATTRIBUTE":89,"ATTRIBUTE_EMPTY":90,"$accept":0,"$end":1}, +terminals_: {2:"error",7:"direction_tb",8:"direction_bt",9:"direction_rl",10:"direction_lr",15:"NEWLINE",16:":",18:"open_directive",19:"type_directive",20:"arg_directive",21:"close_directive",22:"C4_CONTEXT",24:"EOF",25:"C4_CONTAINER",26:"C4_COMPONENT",27:"C4_DYNAMIC",28:"C4_DEPLOYMENT",32:"title",33:"accDescription",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",43:"LBRACE",44:"ENTERPRISE_BOUNDARY",46:"SYSTEM_BOUNDARY",47:"BOUNDARY",48:"CONTAINER_BOUNDARY",49:"NODE",50:"NODE_L",51:"NODE_R",52:"RBRACE",54:"PERSON",55:"PERSON_EXT",56:"SYSTEM",57:"SYSTEM_DB",58:"SYSTEM_QUEUE",59:"SYSTEM_EXT",60:"SYSTEM_EXT_DB",61:"SYSTEM_EXT_QUEUE",62:"CONTAINER",63:"CONTAINER_DB",64:"CONTAINER_QUEUE",65:"CONTAINER_EXT",66:"CONTAINER_EXT_DB",67:"CONTAINER_EXT_QUEUE",68:"COMPONENT",69:"COMPONENT_DB",70:"COMPONENT_QUEUE",71:"COMPONENT_EXT",72:"COMPONENT_EXT_DB",73:"COMPONENT_EXT_QUEUE",74:"REL",75:"BIREL",76:"REL_U",77:"REL_D",78:"REL_L",79:"REL_R",80:"REL_B",81:"REL_INDEX",82:"UPDATE_EL_STYLE",83:"UPDATE_REL_STYLE",84:"UPDATE_LAYOUT_CONFIG",86:"STR",87:"STR_KEY",88:"STR_VALUE",89:"ATTRIBUTE",90:"ATTRIBUTE_EMPTY"}, +productions_: [0,[3,1],[3,1],[3,2],[5,1],[5,1],[5,1],[5,1],[4,1],[6,4],[6,6],[12,1],[13,1],[17,1],[14,1],[11,4],[11,4],[11,4],[11,4],[11,4],[23,1],[23,1],[23,2],[29,1],[29,2],[29,3],[31,1],[31,1],[31,2],[31,2],[31,1],[39,3],[40,3],[40,3],[40,4],[42,2],[42,2],[42,2],[42,2],[42,2],[42,2],[42,2],[41,1],[30,1],[30,2],[30,3],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,1],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[53,2],[45,1],[45,2],[85,1],[85,2],[85,1],[85,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 4: + yy.setDirection('TB'); +break; +case 5: + yy.setDirection('BT'); +break; +case 6: + yy.setDirection('RL'); +break; +case 7: + yy.setDirection('LR'); +break; +case 11: + console.log("open_directive: ", $$[$0]); yy.parseDirective('%%{', 'open_directive'); +break; +case 12: + +break; +case 13: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); console.log("arg_directive: ", $$[$0]); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 14: + console.log("close_directive: ", $$[$0]); yy.parseDirective('}%%', 'close_directive', 'c4Context'); +break; +case 15: case 16: case 17: case 18: case 19: +yy.setC4Type($$[$0-3]) +break; +case 26: +yy.setTitle($$[$0].substring(6));this.$=$$[$0].substring(6); +break; +case 27: +yy.setAccDescription($$[$0].substring(15));this.$=$$[$0].substring(15); +break; +case 28: + this.$=$$[$0].trim();yy.setTitle(this.$); +break; +case 29: case 30: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 35: case 36: +console.log($$[$0-1],JSON.stringify($$[$0])); $$[$0].splice(2, 0, 'ENTERPRISE'); yy.addPersonOrSystemBoundary(...$$[$0]); this.$=$$[$0]; +break; +case 37: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystemBoundary(...$$[$0]); this.$=$$[$0]; +break; +case 38: +console.log($$[$0-1],JSON.stringify($$[$0])); $$[$0].splice(2, 0, 'CONTAINER'); yy.addContainerBoundary(...$$[$0]); this.$=$$[$0]; +break; +case 39: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addDeploymentNode('node', ...$$[$0]); this.$=$$[$0]; +break; +case 40: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addDeploymentNode('nodeL', ...$$[$0]); this.$=$$[$0]; +break; +case 41: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addDeploymentNode('nodeR', ...$$[$0]); this.$=$$[$0]; +break; +case 42: + yy.popBoundaryParseStack() +break; +case 46: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('person', ...$$[$0]); this.$=$$[$0]; +break; +case 47: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('external_person', ...$$[$0]); this.$=$$[$0]; +break; +case 48: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('system', ...$$[$0]); this.$=$$[$0]; +break; +case 49: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('system_db', ...$$[$0]); this.$=$$[$0]; +break; +case 50: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('system_queue', ...$$[$0]); this.$=$$[$0]; +break; +case 51: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('external_system', ...$$[$0]); this.$=$$[$0]; +break; +case 52: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('external_system_db', ...$$[$0]); this.$=$$[$0]; +break; +case 53: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addPersonOrSystem('external_system_queue', ...$$[$0]); this.$=$$[$0]; +break; +case 54: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('container', ...$$[$0]); this.$=$$[$0]; +break; +case 55: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('container_db', ...$$[$0]); this.$=$$[$0]; +break; +case 56: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('container_queue', ...$$[$0]); this.$=$$[$0]; +break; +case 57: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('external_container', ...$$[$0]); this.$=$$[$0]; +break; +case 58: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('external_container_db', ...$$[$0]); this.$=$$[$0]; +break; +case 59: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addContainer('external_container_queue', ...$$[$0]); this.$=$$[$0]; +break; +case 60: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('component', ...$$[$0]); this.$=$$[$0]; +break; +case 61: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('component_db', ...$$[$0]); this.$=$$[$0]; +break; +case 62: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('component_queue', ...$$[$0]); this.$=$$[$0]; +break; +case 63: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('external_component', ...$$[$0]); this.$=$$[$0]; +break; +case 64: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('external_component_db', ...$$[$0]); this.$=$$[$0]; +break; +case 65: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addComponent('external_component_queue', ...$$[$0]); this.$=$$[$0]; +break; +case 67: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel', ...$$[$0]); this.$=$$[$0]; +break; +case 68: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('birel', ...$$[$0]); this.$=$$[$0]; +break; +case 69: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel_u', ...$$[$0]); this.$=$$[$0]; +break; +case 70: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel_d', ...$$[$0]); this.$=$$[$0]; +break; +case 71: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel_l', ...$$[$0]); this.$=$$[$0]; +break; +case 72: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel_r', ...$$[$0]); this.$=$$[$0]; +break; +case 73: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.addRel('rel_b', ...$$[$0]); this.$=$$[$0]; +break; +case 74: +console.log($$[$0-1],JSON.stringify($$[$0])); $$[$0].splice(0, 1); yy.addRel('rel', ...$$[$0]); this.$=$$[$0]; +break; +case 75: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.updateElStyle('update_el_style', ...$$[$0]); this.$=$$[$0]; +break; +case 76: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.updateRelStyle('update_rel_style', ...$$[$0]); this.$=$$[$0]; +break; +case 77: +console.log($$[$0-1],JSON.stringify($$[$0])); yy.updateLayoutConfig('update_layout_config', ...$$[$0]); this.$=$$[$0]; +break; +case 78: + console.log('PUSH ATTRIBUTE: ', $$[$0]); this.$ = [$$[$0]]; +break; +case 79: + console.log('PUSH ATTRIBUTE: ', $$[$0-1]); $$[$0].unshift($$[$0-1]); this.$=$$[$0]; +break; +case 80: case 82: + this.$ = $$[$0].trim(); +break; +case 81: + console.log('kv: ', $$[$0-1], $$[$0]); let kv={}; kv[$$[$0-1].trim()]=$$[$0].trim(); this.$=kv; +break; +case 83: + this.$ = ""; +break; +} +}, +table: [{3:1,4:2,5:3,6:4,7:$V0,8:$V1,9:$V2,10:$V3,11:5,12:10,18:$V4,22:$V5,25:$V6,26:$V7,27:$V8,28:$V9},{1:[3]},{1:[2,1]},{1:[2,2]},{3:17,4:2,5:3,6:4,7:$V0,8:$V1,9:$V2,10:$V3,11:5,12:10,18:$V4,22:$V5,25:$V6,26:$V7,27:$V8,28:$V9},{1:[2,8]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{1:[2,7]},{13:18,19:[1,19]},{15:[1,20]},{15:[1,21]},{15:[1,22]},{15:[1,23]},{15:[1,24]},{19:[2,11]},{1:[2,3]},{14:25,16:[1,26],21:$Va},o([16,21],[2,12]),{23:28,29:29,30:30,31:31,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{23:79,29:29,30:30,31:31,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{23:80,29:29,30:30,31:31,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{23:81,29:29,30:30,31:31,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{23:82,29:29,30:30,31:31,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{15:[1,83]},{17:84,20:[1,85]},{15:[2,14]},{24:[1,86]},o($VS,[2,20],{53:32,39:58,40:70,42:71,30:87,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR}),o($VS,[2,21]),o($VT,[2,23],{15:[1,88]}),o($VS,[2,43],{15:[1,89]}),o($VU,[2,26]),o($VU,[2,27]),{35:[1,90]},{37:[1,91]},o($VU,[2,30]),{45:92,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:98,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:99,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:100,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:101,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:102,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:103,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:104,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:105,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:106,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:107,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:108,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:109,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:110,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:111,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:112,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:113,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:114,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:115,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:116,85:93,86:$VV,87:$VW,89:$VX,90:$VY},o($VZ,[2,66]),{45:117,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:118,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:119,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:120,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:121,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:122,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:123,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:124,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:125,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:126,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:127,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{30:128,39:58,40:70,42:71,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,53:32,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR},{15:[1,130],43:[1,129]},{45:131,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:132,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:133,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:134,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:135,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:136,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{45:137,85:93,86:$VV,87:$VW,89:$VX,90:$VY},{24:[1,138]},{24:[1,139]},{24:[1,140]},{24:[1,141]},o($V_,[2,9]),{14:142,21:$Va},{21:[2,13]},{1:[2,15]},o($VS,[2,22]),o($VT,[2,24],{31:31,29:143,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf}),o($VS,[2,44],{29:29,30:30,31:31,53:32,39:58,40:70,42:71,23:144,32:$Vb,33:$Vc,34:$Vd,36:$Ve,38:$Vf,44:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl,51:$Vm,54:$Vn,55:$Vo,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu,62:$Vv,63:$Vw,64:$Vx,65:$Vy,66:$Vz,67:$VA,68:$VB,69:$VC,70:$VD,71:$VE,72:$VF,73:$VG,74:$VH,75:$VI,76:$VJ,77:$VK,78:$VL,79:$VM,80:$VN,81:$VO,82:$VP,83:$VQ,84:$VR}),o($VU,[2,28]),o($VU,[2,29]),o($VZ,[2,46]),o($V$,[2,78],{85:93,45:145,86:$VV,87:$VW,89:$VX,90:$VY}),o($V01,[2,80]),{88:[1,146]},o($V01,[2,82]),o($V01,[2,83]),o($VZ,[2,47]),o($VZ,[2,48]),o($VZ,[2,49]),o($VZ,[2,50]),o($VZ,[2,51]),o($VZ,[2,52]),o($VZ,[2,53]),o($VZ,[2,54]),o($VZ,[2,55]),o($VZ,[2,56]),o($VZ,[2,57]),o($VZ,[2,58]),o($VZ,[2,59]),o($VZ,[2,60]),o($VZ,[2,61]),o($VZ,[2,62]),o($VZ,[2,63]),o($VZ,[2,64]),o($VZ,[2,65]),o($VZ,[2,67]),o($VZ,[2,68]),o($VZ,[2,69]),o($VZ,[2,70]),o($VZ,[2,71]),o($VZ,[2,72]),o($VZ,[2,73]),o($VZ,[2,74]),o($VZ,[2,75]),o($VZ,[2,76]),o($VZ,[2,77]),{41:147,52:[1,148]},{15:[1,149]},{43:[1,150]},o($V11,[2,35]),o($V11,[2,36]),o($V11,[2,37]),o($V11,[2,38]),o($V11,[2,39]),o($V11,[2,40]),o($V11,[2,41]),{1:[2,16]},{1:[2,17]},{1:[2,18]},{1:[2,19]},{15:[1,151]},o($VT,[2,25]),o($VS,[2,45]),o($V$,[2,79]),o($V01,[2,81]),o($VZ,[2,31]),o($VZ,[2,42]),o($V21,[2,32]),o($V21,[2,33],{15:[1,152]}),o($V_,[2,10]),o($V21,[2,34])], +defaultActions: {2:[2,1],3:[2,2],5:[2,8],6:[2,4],7:[2,5],8:[2,6],9:[2,7],16:[2,11],17:[2,3],27:[2,14],85:[2,13],86:[2,15],138:[2,16],139:[2,17],140:[2,18],141:[2,19]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 18; +break; +case 1:return 7; +break; +case 2:return 8; +break; +case 3:return 9; +break; +case 4:return 10; +break; +case 5: this.begin('type_directive'); return 19; +break; +case 6: this.popState(); this.begin('arg_directive'); return 16; +break; +case 7: this.popState(); this.popState(); return 21; +break; +case 8:return 20; +break; +case 9:return 32; +break; +case 10:return 33; +break; +case 11: this.begin("acc_title");return 34; +break; +case 12: this.popState(); return "acc_title_value"; +break; +case 13: this.begin("acc_descr");return 36; +break; +case 14: this.popState(); return "acc_descr_value"; +break; +case 15: this.begin("acc_descr_multiline"); +break; +case 16: this.popState(); +break; +case 17:return "acc_descr_multiline_value"; +break; +case 18:/* skip comments */ +break; +case 19:c /* skip comments */ +break; +case 20:return 15; +break; +case 21:/* skip whitespace */ +break; +case 22:return 22; +break; +case 23:return 25; +break; +case 24:return 26; +break; +case 25:return 27; +break; +case 26:return 28; +break; +case 27: this.begin("person_ext"); console.log('begin person_ext'); return 55; +break; +case 28: this.begin("person"); console.log('begin person'); return 54; +break; +case 29: this.begin("system_ext_queue"); console.log('begin system_ext_queue'); return 61; +break; +case 30: this.begin("system_ext_db"); console.log('begin system_ext_db'); return 60; +break; +case 31: this.begin("system_ext"); console.log('begin system_ext'); return 59; +break; +case 32: this.begin("system_queue"); console.log('begin system_queue'); return 58; +break; +case 33: this.begin("system_db"); console.log('begin system_db'); return 57; +break; +case 34: this.begin("system"); console.log('begin system'); return 56; +break; +case 35: this.begin("boundary"); console.log('begin boundary'); return 47; +break; +case 36: this.begin("enterprise_boundary"); console.log('begin enterprise_boundary'); return 44; +break; +case 37: this.begin("system_boundary"); console.log('begin system_boundary'); return 46; +break; +case 38: this.begin("container_ext_queue"); console.log('begin container_ext_queue'); return 67; +break; +case 39: this.begin("container_ext_db"); console.log('begin container_ext_db'); return 66; +break; +case 40: this.begin("container_ext"); console.log('begin container_ext'); return 65; +break; +case 41: this.begin("container_queue"); console.log('begin container_queue'); return 64; +break; +case 42: this.begin("container_db"); console.log('begin container_db'); return 63; +break; +case 43: this.begin("container"); console.log('begin container'); return 62; +break; +case 44: this.begin("container_boundary"); console.log('begin container_boundary'); return 48; +break; +case 45: this.begin("component_ext_queue"); console.log('begin component_ext_queue'); return 73; +break; +case 46: this.begin("component_ext_db"); console.log('begin component_ext_db'); return 72; +break; +case 47: this.begin("component_ext"); console.log('begin component_ext'); return 71; +break; +case 48: this.begin("component_queue"); console.log('begin component_queue'); return 70; +break; +case 49: this.begin("component_db"); console.log('begin component_db'); return 69; +break; +case 50: this.begin("component"); console.log('begin component'); return 68; +break; +case 51: this.begin("node"); console.log('begin node'); return 49; +break; +case 52: this.begin("node"); console.log('begin node'); return 49; +break; +case 53: this.begin("node_l"); console.log('begin node_l'); return 50; +break; +case 54: this.begin("node_r"); console.log('begin node_r'); return 51; +break; +case 55: this.begin("rel"); console.log('begin rel'); return 74; +break; +case 56: this.begin("birel"); console.log('begin birel'); return 75; +break; +case 57: this.begin("rel_u"); console.log('begin rel_u'); return 76; +break; +case 58: this.begin("rel_u"); console.log('begin rel_u'); return 76; +break; +case 59: this.begin("rel_d"); console.log('begin rel_d'); return 77; +break; +case 60: this.begin("rel_d"); console.log('begin rel_d'); return 77; +break; +case 61: this.begin("rel_l"); console.log('begin rel_l'); return 78; +break; +case 62: this.begin("rel_l"); console.log('begin rel_l'); return 78; +break; +case 63: this.begin("rel_r"); console.log('begin rel_r'); return 79; +break; +case 64: this.begin("rel_r"); console.log('begin rel_r'); return 79; +break; +case 65: this.begin("rel_b"); console.log('begin rel_b'); return 80; +break; +case 66: this.begin("rel_index"); console.log('begin rel_index'); return 81; +break; +case 67: this.begin("update_el_style"); console.log('begin update_el_style'); return 82; +break; +case 68: this.begin("update_rel_style"); console.log('begin update_rel_style'); return 83; +break; +case 69: this.begin("update_layout_config"); console.log('begin update_layout_config'); return 84; +break; +case 70:return "EOF_IN_STRUCT"; +break; +case 71: console.log('begin attribute with ATTRIBUTE_EMPTY'); this.begin("attribute"); return "ATTRIBUTE_EMPTY"; +break; +case 72: console.log('begin attribute'); this.begin("attribute"); +break; +case 73: console.log('STOP attribute'); this.popState();console.log('STOP diagram'); this.popState(); +break; +case 74: console.log(',,'); return 90; +break; +case 75: console.log(','); +break; +case 76: console.log('ATTRIBUTE_EMPTY'); return 90; +break; +case 77: console.log('begin string'); this.begin("string"); +break; +case 78: console.log('STOP string'); this.popState(); +break; +case 79: console.log('STR'); return "STR"; +break; +case 80: console.log('begin string_kv'); this.begin("string_kv"); +break; +case 81: console.log('STR_KEY'); this.begin("string_kv_key"); return "STR_KEY"; +break; +case 82: console.log('begin string_kv_value'); this.popState(); this.begin("string_kv_value"); +break; +case 83: console.log('STR_VALUE'); return "STR_VALUE"; +break; +case 84: console.log('STOP string_kv_value'); this.popState(); this.popState(); +break; +case 85: console.log('not STR'); return "STR"; +break; +case 86: /* this.begin("lbrace"); */ console.log('begin boundary block'); return "LBRACE"; +break; +case 87: /* this.popState(); */ console.log('STOP boundary block'); return "RBRACE"; +break; +case 88:return 'SPACE'; +break; +case 89:return 'EOL'; +break; +case 90:return 24; +break; +} +}, +rules: [/^(?:%%\{)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:title\s[^#\n;]+)/,/^(?:accDescription\s[^#\n;]+)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:C4Context\b)/,/^(?:C4Container\b)/,/^(?:C4Component\b)/,/^(?:C4Dynamic\b)/,/^(?:C4Deployment\b)/,/^(?:Person_Ext\b)/,/^(?:Person\b)/,/^(?:SystemQueue_Ext\b)/,/^(?:SystemDb_Ext\b)/,/^(?:System_Ext\b)/,/^(?:SystemQueue\b)/,/^(?:SystemDb\b)/,/^(?:System\b)/,/^(?:Boundary\b)/,/^(?:Enterprise_Boundary\b)/,/^(?:System_Boundary\b)/,/^(?:ContainerQueue_Ext\b)/,/^(?:ContainerDb_Ext\b)/,/^(?:Container_Ext\b)/,/^(?:ContainerQueue\b)/,/^(?:ContainerDb\b)/,/^(?:Container\b)/,/^(?:Container_Boundary\b)/,/^(?:ComponentQueue_Ext\b)/,/^(?:ComponentDb_Ext\b)/,/^(?:Component_Ext\b)/,/^(?:ComponentQueue\b)/,/^(?:ComponentDb\b)/,/^(?:Component\b)/,/^(?:Deployment_Node\b)/,/^(?:Node\b)/,/^(?:Node_L\b)/,/^(?:Node_R\b)/,/^(?:Rel\b)/,/^(?:BiRel\b)/,/^(?:Rel_Up\b)/,/^(?:Rel_U\b)/,/^(?:Rel_Down\b)/,/^(?:Rel_D\b)/,/^(?:Rel_Left\b)/,/^(?:Rel_L\b)/,/^(?:Rel_Right\b)/,/^(?:Rel_R\b)/,/^(?:Rel_Back\b)/,/^(?:RelIndex\b)/,/^(?:UpdateElementStyle\b)/,/^(?:UpdateRelStyle\b)/,/^(?:UpdateLayoutConfig\b)/,/^(?:$)/,/^(?:[(][ ]*[,])/,/^(?:[(])/,/^(?:[)])/,/^(?:,,)/,/^(?:,)/,/^(?:[ ]*["]["])/,/^(?:[ ]*["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[ ]*[\$])/,/^(?:[^=]*)/,/^(?:[=][ ]*["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:[^,]+)/,/^(?:\{)/,/^(?:\})/,/^(?:[\s]+)/,/^(?:[\n\r]+)/,/^(?:$)/], +conditions: {"acc_descr_multiline":{"rules":[16,17],"inclusive":false},"acc_descr":{"rules":[14],"inclusive":false},"acc_title":{"rules":[12],"inclusive":false},"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[7,8],"inclusive":false},"type_directive":{"rules":[6,7],"inclusive":false},"open_directive":{"rules":[5],"inclusive":false},"string_kv_value":{"rules":[83,84],"inclusive":false},"string_kv_key":{"rules":[82],"inclusive":false},"string_kv":{"rules":[81],"inclusive":false},"string":{"rules":[78,79],"inclusive":false},"attribute":{"rules":[73,74,75,76,77,80,85],"inclusive":false},"update_layout_config":{"rules":[70,71,72,73],"inclusive":false},"update_rel_style":{"rules":[70,71,72,73],"inclusive":false},"update_el_style":{"rules":[70,71,72,73],"inclusive":false},"rel_b":{"rules":[70,71,72,73],"inclusive":false},"rel_r":{"rules":[70,71,72,73],"inclusive":false},"rel_l":{"rules":[70,71,72,73],"inclusive":false},"rel_d":{"rules":[70,71,72,73],"inclusive":false},"rel_u":{"rules":[70,71,72,73],"inclusive":false},"rel_bi":{"rules":[],"inclusive":false},"rel":{"rules":[70,71,72,73],"inclusive":false},"node_r":{"rules":[70,71,72,73],"inclusive":false},"node_l":{"rules":[70,71,72,73],"inclusive":false},"node":{"rules":[70,71,72,73],"inclusive":false},"index":{"rules":[],"inclusive":false},"rel_index":{"rules":[70,71,72,73],"inclusive":false},"component_ext_queue":{"rules":[],"inclusive":false},"component_ext_db":{"rules":[70,71,72,73],"inclusive":false},"component_ext":{"rules":[70,71,72,73],"inclusive":false},"component_queue":{"rules":[70,71,72,73],"inclusive":false},"component_db":{"rules":[70,71,72,73],"inclusive":false},"component":{"rules":[70,71,72,73],"inclusive":false},"container_boundary":{"rules":[70,71,72,73],"inclusive":false},"container_ext_queue":{"rules":[],"inclusive":false},"container_ext_db":{"rules":[70,71,72,73],"inclusive":false},"container_ext":{"rules":[70,71,72,73],"inclusive":false},"container_queue":{"rules":[70,71,72,73],"inclusive":false},"container_db":{"rules":[70,71,72,73],"inclusive":false},"container":{"rules":[70,71,72,73],"inclusive":false},"birel":{"rules":[70,71,72,73],"inclusive":false},"system_boundary":{"rules":[70,71,72,73],"inclusive":false},"enterprise_boundary":{"rules":[70,71,72,73],"inclusive":false},"boundary":{"rules":[70,71,72,73],"inclusive":false},"system_ext_queue":{"rules":[70,71,72,73],"inclusive":false},"system_ext_db":{"rules":[70,71,72,73],"inclusive":false},"system_ext":{"rules":[70,71,72,73],"inclusive":false},"system_queue":{"rules":[70,71,72,73],"inclusive":false},"system_db":{"rules":[70,71,72,73],"inclusive":false},"system":{"rules":[70,71,72,73],"inclusive":false},"person_ext":{"rules":[70,71,72,73],"inclusive":false},"person":{"rules":[70,71,72,73],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,9,10,11,13,15,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,86,87,88,89,90],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?1da1").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/class/parser/classDiagram.jison": +/*!******************************************************!*\ + !*** ./src/diagrams/class/parser/classDiagram.jison ***! + \******************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,7],$V2=[1,8],$V3=[1,9],$V4=[1,10],$V5=[1,13],$V6=[1,12],$V7=[1,16,25],$V8=[1,20],$V9=[1,31],$Va=[1,32],$Vb=[1,33],$Vc=[1,35],$Vd=[1,38],$Ve=[1,36],$Vf=[1,37],$Vg=[1,39],$Vh=[1,40],$Vi=[1,41],$Vj=[1,42],$Vk=[1,45],$Vl=[1,46],$Vm=[1,47],$Vn=[1,48],$Vo=[16,25],$Vp=[1,62],$Vq=[1,63],$Vr=[1,64],$Vs=[1,65],$Vt=[1,66],$Vu=[1,67],$Vv=[16,25,32,44,45,53,56,57,58,59,60,61,66,68],$Vw=[16,25,30,32,44,45,49,53,56,57,58,59,60,61,66,68,83,84,85,86],$Vx=[5,8,9,10,11,16,19,23,25],$Vy=[53,83,84,85,86],$Vz=[53,60,61,83,84,85,86],$VA=[53,56,57,58,59,83,84,85,86],$VB=[16,25,32],$VC=[1,99]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"mermaidDoc":4,"statments":5,"direction":6,"directive":7,"direction_tb":8,"direction_bt":9,"direction_rl":10,"direction_lr":11,"graphConfig":12,"openDirective":13,"typeDirective":14,"closeDirective":15,"NEWLINE":16,":":17,"argDirective":18,"open_directive":19,"type_directive":20,"arg_directive":21,"close_directive":22,"CLASS_DIAGRAM":23,"statements":24,"EOF":25,"statement":26,"className":27,"alphaNumToken":28,"classLiteralName":29,"GENERICTYPE":30,"relationStatement":31,"LABEL":32,"classStatement":33,"methodStatement":34,"annotationStatement":35,"clickStatement":36,"cssClassStatement":37,"acc_title":38,"acc_title_value":39,"acc_descr":40,"acc_descr_value":41,"acc_descr_multiline_value":42,"CLASS":43,"STYLE_SEPARATOR":44,"STRUCT_START":45,"members":46,"STRUCT_STOP":47,"ANNOTATION_START":48,"ANNOTATION_END":49,"MEMBER":50,"SEPARATOR":51,"relation":52,"STR":53,"relationType":54,"lineType":55,"AGGREGATION":56,"EXTENSION":57,"COMPOSITION":58,"DEPENDENCY":59,"LINE":60,"DOTTED_LINE":61,"CALLBACK":62,"LINK":63,"LINK_TARGET":64,"CLICK":65,"CALLBACK_NAME":66,"CALLBACK_ARGS":67,"HREF":68,"CSSCLASS":69,"commentToken":70,"textToken":71,"graphCodeTokens":72,"textNoTagsToken":73,"TAGSTART":74,"TAGEND":75,"==":76,"--":77,"PCT":78,"DEFAULT":79,"SPACE":80,"MINUS":81,"keywords":82,"UNICODE_TEXT":83,"NUM":84,"ALPHA":85,"BQUOTE_STR":86,"$accept":0,"$end":1}, +terminals_: {2:"error",5:"statments",8:"direction_tb",9:"direction_bt",10:"direction_rl",11:"direction_lr",16:"NEWLINE",17:":",19:"open_directive",20:"type_directive",21:"arg_directive",22:"close_directive",23:"CLASS_DIAGRAM",25:"EOF",30:"GENERICTYPE",32:"LABEL",38:"acc_title",39:"acc_title_value",40:"acc_descr",41:"acc_descr_value",42:"acc_descr_multiline_value",43:"CLASS",44:"STYLE_SEPARATOR",45:"STRUCT_START",47:"STRUCT_STOP",48:"ANNOTATION_START",49:"ANNOTATION_END",50:"MEMBER",51:"SEPARATOR",53:"STR",56:"AGGREGATION",57:"EXTENSION",58:"COMPOSITION",59:"DEPENDENCY",60:"LINE",61:"DOTTED_LINE",62:"CALLBACK",63:"LINK",64:"LINK_TARGET",65:"CLICK",66:"CALLBACK_NAME",67:"CALLBACK_ARGS",68:"HREF",69:"CSSCLASS",72:"graphCodeTokens",74:"TAGSTART",75:"TAGEND",76:"==",77:"--",78:"PCT",79:"DEFAULT",80:"SPACE",81:"MINUS",82:"keywords",83:"UNICODE_TEXT",84:"NUM",85:"ALPHA",86:"BQUOTE_STR"}, +productions_: [0,[3,1],[3,1],[3,1],[3,2],[6,1],[6,1],[6,1],[6,1],[4,1],[7,4],[7,6],[13,1],[14,1],[18,1],[15,1],[12,4],[24,1],[24,2],[24,3],[27,1],[27,1],[27,2],[27,2],[27,2],[26,1],[26,2],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,2],[26,2],[26,1],[33,2],[33,4],[33,5],[33,7],[35,4],[46,1],[46,2],[34,1],[34,2],[34,1],[34,1],[31,3],[31,4],[31,4],[31,5],[52,3],[52,2],[52,2],[52,1],[54,1],[54,1],[54,1],[54,1],[55,1],[55,1],[36,3],[36,4],[36,3],[36,4],[36,4],[36,5],[36,3],[36,4],[36,4],[36,5],[36,3],[36,4],[36,4],[36,5],[37,3],[70,1],[70,1],[71,1],[71,1],[71,1],[71,1],[71,1],[71,1],[71,1],[73,1],[73,1],[73,1],[73,1],[28,1],[28,1],[28,1],[29,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 5: + yy.setDirection('TB'); +break; +case 6: + yy.setDirection('BT'); +break; +case 7: + yy.setDirection('RL'); +break; +case 8: + yy.setDirection('LR'); +break; +case 12: + yy.parseDirective('%%{', 'open_directive'); +break; +case 13: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 14: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 15: + yy.parseDirective('}%%', 'close_directive', 'class'); +break; +case 20: case 21: + this.$=$$[$0]; +break; +case 22: + this.$=$$[$0-1]+$$[$0]; +break; +case 23: case 24: + this.$=$$[$0-1]+'~'+$$[$0]; +break; +case 25: + yy.addRelation($$[$0]); +break; +case 26: + $$[$0-1].title = yy.cleanupLabel($$[$0]); yy.addRelation($$[$0-1]); +break; +case 34: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 35: case 36: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 37: +yy.addClass($$[$0]); +break; +case 38: +yy.addClass($$[$0-2]);yy.setCssClass($$[$0-2], $$[$0]); +break; +case 39: +/*console.log($$[$0-3],JSON.stringify($$[$0-1]));*/yy.addClass($$[$0-3]);yy.addMembers($$[$0-3],$$[$0-1]); +break; +case 40: +yy.addClass($$[$0-5]);yy.setCssClass($$[$0-5], $$[$0-3]);yy.addMembers($$[$0-5],$$[$0-1]); +break; +case 41: + yy.addAnnotation($$[$0],$$[$0-2]); +break; +case 42: + this.$ = [$$[$0]]; +break; +case 43: + $$[$0].push($$[$0-1]);this.$=$$[$0]; +break; +case 44: +/*console.log('Rel found',$$[$0]);*/ +break; +case 45: +yy.addMember($$[$0-1],yy.cleanupLabel($$[$0])); +break; +case 46: +/*console.warn('Member',$$[$0]);*/ +break; +case 47: +/*console.log('sep found',$$[$0]);*/ +break; +case 48: + this.$ = {'id1':$$[$0-2],'id2':$$[$0], relation:$$[$0-1], relationTitle1:'none', relationTitle2:'none'}; +break; +case 49: + this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-1], relationTitle1:$$[$0-2], relationTitle2:'none'} +break; +case 50: + this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-2], relationTitle1:'none', relationTitle2:$$[$0-1]}; +break; +case 51: + this.$ = {id1:$$[$0-4], id2:$$[$0], relation:$$[$0-2], relationTitle1:$$[$0-3], relationTitle2:$$[$0-1]} +break; +case 52: + this.$={type1:$$[$0-2],type2:$$[$0],lineType:$$[$0-1]}; +break; +case 53: + this.$={type1:'none',type2:$$[$0],lineType:$$[$0-1]}; +break; +case 54: + this.$={type1:$$[$0-1],type2:'none',lineType:$$[$0]}; +break; +case 55: + this.$={type1:'none',type2:'none',lineType:$$[$0]}; +break; +case 56: + this.$=yy.relationType.AGGREGATION; +break; +case 57: + this.$=yy.relationType.EXTENSION; +break; +case 58: + this.$=yy.relationType.COMPOSITION; +break; +case 59: + this.$=yy.relationType.DEPENDENCY; +break; +case 60: +this.$=yy.lineType.LINE; +break; +case 61: +this.$=yy.lineType.DOTTED_LINE; +break; +case 62: case 68: +this.$ = $$[$0-2];yy.setClickEvent($$[$0-1], $$[$0]); +break; +case 63: case 69: +this.$ = $$[$0-3];yy.setClickEvent($$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-2], $$[$0]); +break; +case 64: case 72: +this.$ = $$[$0-2];yy.setLink($$[$0-1], $$[$0]); +break; +case 65: +this.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1],$$[$0]); +break; +case 66: case 74: +this.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-2], $$[$0]); +break; +case 67: case 75: +this.$ = $$[$0-4];yy.setLink($$[$0-3], $$[$0-2], $$[$0]);yy.setTooltip($$[$0-3], $$[$0-1]); +break; +case 70: +this.$ = $$[$0-3];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]); +break; +case 71: +this.$ = $$[$0-4];yy.setClickEvent($$[$0-3], $$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-3], $$[$0]); +break; +case 73: +this.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1], $$[$0]); +break; +case 76: +yy.setCssClass($$[$0-1], $$[$0]); +break; +} +}, +table: [{3:1,4:2,5:$V0,6:4,7:5,8:$V1,9:$V2,10:$V3,11:$V4,12:6,13:11,19:$V5,23:$V6},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{3:14,4:2,5:$V0,6:4,7:5,8:$V1,9:$V2,10:$V3,11:$V4,12:6,13:11,19:$V5,23:$V6},{1:[2,9]},o($V7,[2,5]),o($V7,[2,6]),o($V7,[2,7]),o($V7,[2,8]),{14:15,20:[1,16]},{16:[1,17]},{20:[2,12]},{1:[2,4]},{15:18,17:[1,19],22:$V8},o([17,22],[2,13]),{6:30,7:29,8:$V1,9:$V2,10:$V3,11:$V4,13:11,19:$V5,24:21,26:22,27:34,28:43,29:44,31:23,33:24,34:25,35:26,36:27,37:28,38:$V9,40:$Va,42:$Vb,43:$Vc,48:$Vd,50:$Ve,51:$Vf,62:$Vg,63:$Vh,65:$Vi,69:$Vj,83:$Vk,84:$Vl,85:$Vm,86:$Vn},{16:[1,49]},{18:50,21:[1,51]},{16:[2,15]},{25:[1,52]},{16:[1,53],25:[2,17]},o($Vo,[2,25],{32:[1,54]}),o($Vo,[2,27]),o($Vo,[2,28]),o($Vo,[2,29]),o($Vo,[2,30]),o($Vo,[2,31]),o($Vo,[2,32]),o($Vo,[2,33]),{39:[1,55]},{41:[1,56]},o($Vo,[2,36]),o($Vo,[2,44],{52:57,54:60,55:61,32:[1,59],53:[1,58],56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu}),{27:68,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},o($Vo,[2,46]),o($Vo,[2,47]),{28:69,83:$Vk,84:$Vl,85:$Vm},{27:70,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},{27:71,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},{27:72,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},{53:[1,73]},o($Vv,[2,20],{28:43,29:44,27:74,30:[1,75],83:$Vk,84:$Vl,85:$Vm,86:$Vn}),o($Vv,[2,21],{30:[1,76]}),o($Vw,[2,90]),o($Vw,[2,91]),o($Vw,[2,92]),o([16,25,30,32,44,45,53,56,57,58,59,60,61,66,68],[2,93]),o($Vx,[2,10]),{15:77,22:$V8},{22:[2,14]},{1:[2,16]},{6:30,7:29,8:$V1,9:$V2,10:$V3,11:$V4,13:11,19:$V5,24:78,25:[2,18],26:22,27:34,28:43,29:44,31:23,33:24,34:25,35:26,36:27,37:28,38:$V9,40:$Va,42:$Vb,43:$Vc,48:$Vd,50:$Ve,51:$Vf,62:$Vg,63:$Vh,65:$Vi,69:$Vj,83:$Vk,84:$Vl,85:$Vm,86:$Vn},o($Vo,[2,26]),o($Vo,[2,34]),o($Vo,[2,35]),{27:79,28:43,29:44,53:[1,80],83:$Vk,84:$Vl,85:$Vm,86:$Vn},{52:81,54:60,55:61,56:$Vp,57:$Vq,58:$Vr,59:$Vs,60:$Vt,61:$Vu},o($Vo,[2,45]),{55:82,60:$Vt,61:$Vu},o($Vy,[2,55],{54:83,56:$Vp,57:$Vq,58:$Vr,59:$Vs}),o($Vz,[2,56]),o($Vz,[2,57]),o($Vz,[2,58]),o($Vz,[2,59]),o($VA,[2,60]),o($VA,[2,61]),o($Vo,[2,37],{44:[1,84],45:[1,85]}),{49:[1,86]},{53:[1,87]},{53:[1,88]},{66:[1,89],68:[1,90]},{28:91,83:$Vk,84:$Vl,85:$Vm},o($Vv,[2,22]),o($Vv,[2,23]),o($Vv,[2,24]),{16:[1,92]},{25:[2,19]},o($VB,[2,48]),{27:93,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},{27:94,28:43,29:44,53:[1,95],83:$Vk,84:$Vl,85:$Vm,86:$Vn},o($Vy,[2,54],{54:96,56:$Vp,57:$Vq,58:$Vr,59:$Vs}),o($Vy,[2,53]),{28:97,83:$Vk,84:$Vl,85:$Vm},{46:98,50:$VC},{27:100,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},o($Vo,[2,62],{53:[1,101]}),o($Vo,[2,64],{53:[1,103],64:[1,102]}),o($Vo,[2,68],{53:[1,104],67:[1,105]}),o($Vo,[2,72],{53:[1,107],64:[1,106]}),o($Vo,[2,76]),o($Vx,[2,11]),o($VB,[2,50]),o($VB,[2,49]),{27:108,28:43,29:44,83:$Vk,84:$Vl,85:$Vm,86:$Vn},o($Vy,[2,52]),o($Vo,[2,38],{45:[1,109]}),{47:[1,110]},{46:111,47:[2,42],50:$VC},o($Vo,[2,41]),o($Vo,[2,63]),o($Vo,[2,65]),o($Vo,[2,66],{64:[1,112]}),o($Vo,[2,69]),o($Vo,[2,70],{53:[1,113]}),o($Vo,[2,73]),o($Vo,[2,74],{64:[1,114]}),o($VB,[2,51]),{46:115,50:$VC},o($Vo,[2,39]),{47:[2,43]},o($Vo,[2,67]),o($Vo,[2,71]),o($Vo,[2,75]),{47:[1,116]},o($Vo,[2,40])], +defaultActions: {2:[2,1],3:[2,2],4:[2,3],6:[2,9],13:[2,12],14:[2,4],20:[2,15],51:[2,14],52:[2,16],78:[2,19],111:[2,43]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 19; +break; +case 1:return 8; +break; +case 2:return 9; +break; +case 3:return 10; +break; +case 4:return 11; +break; +case 5: this.begin('type_directive'); return 20; +break; +case 6: this.popState(); this.begin('arg_directive'); return 17; +break; +case 7: this.popState(); this.popState(); return 22; +break; +case 8:return 21; +break; +case 9:/* skip comments */ +break; +case 10:/* skip comments */ +break; +case 11: this.begin("acc_title");return 38; +break; +case 12: this.popState(); return "acc_title_value"; +break; +case 13: this.begin("acc_descr");return 40; +break; +case 14: this.popState(); return "acc_descr_value"; +break; +case 15: this.begin("acc_descr_multiline"); +break; +case 16: this.popState(); +break; +case 17:return "acc_descr_multiline_value"; +break; +case 18:return 16; +break; +case 19:/* skip whitespace */ +break; +case 20:return 23; +break; +case 21:return 23; +break; +case 22: this.begin("struct"); /*console.log('Starting struct');*/ return 45; +break; +case 23:return "EOF_IN_STRUCT"; +break; +case 24:return "OPEN_IN_STRUCT"; +break; +case 25: /*console.log('Ending struct');*/this.popState(); return 47; +break; +case 26:/* nothing */ +break; +case 27: /*console.log('lex-member: ' + yy_.yytext);*/ return "MEMBER"; +break; +case 28:return 43; +break; +case 29:return 69; +break; +case 30:return 62; +break; +case 31:return 63; +break; +case 32:return 65; +break; +case 33:return 48; +break; +case 34:return 49; +break; +case 35:this.begin("generic"); +break; +case 36:this.popState(); +break; +case 37:return "GENERICTYPE"; +break; +case 38:this.begin("string"); +break; +case 39:this.popState(); +break; +case 40:return "STR"; +break; +case 41:this.begin("bqstring"); +break; +case 42:this.popState(); +break; +case 43:return "BQUOTE_STR"; +break; +case 44:this.begin("href"); +break; +case 45:this.popState(); +break; +case 46:return 68; +break; +case 47:this.begin("callback_name"); +break; +case 48:this.popState(); +break; +case 49:this.popState(); this.begin("callback_args"); +break; +case 50:return 66; +break; +case 51:this.popState(); +break; +case 52:return 67; +break; +case 53:return 64; +break; +case 54:return 64; +break; +case 55:return 64; +break; +case 56:return 64; +break; +case 57:return 57; +break; +case 58:return 57; +break; +case 59:return 59; +break; +case 60:return 59; +break; +case 61:return 58; +break; +case 62:return 56; +break; +case 63:return 60; +break; +case 64:return 61; +break; +case 65:return 32; +break; +case 66:return 44; +break; +case 67:return 81; +break; +case 68:return 'DOT'; +break; +case 69:return 'PLUS'; +break; +case 70:return 78; +break; +case 71:return 'EQUALS'; +break; +case 72:return 'EQUALS'; +break; +case 73:return 85; +break; +case 74:return 'PUNCTUATION'; +break; +case 75:return 84; +break; +case 76:return 83; +break; +case 77:return 80; +break; +case 78:return 25; +break; +} +}, +rules: [/^(?:%%\{)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:[{])/,/^(?:$)/,/^(?:[{])/,/^(?:[}])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:class\b)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:[~])/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[`])/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:$)/], +conditions: {"acc_descr_multiline":{"rules":[16,17],"inclusive":false},"acc_descr":{"rules":[14],"inclusive":false},"acc_title":{"rules":[12],"inclusive":false},"arg_directive":{"rules":[7,8],"inclusive":false},"type_directive":{"rules":[6,7],"inclusive":false},"open_directive":{"rules":[5],"inclusive":false},"callback_args":{"rules":[51,52],"inclusive":false},"callback_name":{"rules":[48,49,50],"inclusive":false},"href":{"rules":[45,46],"inclusive":false},"struct":{"rules":[23,24,25,26,27],"inclusive":false},"generic":{"rules":[36,37],"inclusive":false},"bqstring":{"rules":[42,43],"inclusive":false},"string":{"rules":[39,40],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,9,10,11,13,15,18,19,20,21,22,28,29,30,31,32,33,34,35,38,41,44,47,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?35ed").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/er/parser/erDiagram.jison": +/*!************************************************!*\ + !*** ./src/diagrams/er/parser/erDiagram.jison ***! + \************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,5],$V2=[6,9,11,23,25,27,29,30,49],$V3=[1,17],$V4=[1,18],$V5=[1,19],$V6=[1,20],$V7=[1,21],$V8=[1,24],$V9=[1,29],$Va=[1,30],$Vb=[1,31],$Vc=[1,32],$Vd=[6,9,11,15,20,23,25,27,29,30,42,43,44,45,49],$Ve=[1,45],$Vf=[30,46,47],$Vg=[4,6,9,11,23,25,27,29,30,49],$Vh=[42,43,44,45],$Vi=[22,37],$Vj=[1,64]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"ER_DIAGRAM":4,"document":5,"EOF":6,"directive":7,"line":8,"SPACE":9,"statement":10,"NEWLINE":11,"openDirective":12,"typeDirective":13,"closeDirective":14,":":15,"argDirective":16,"entityName":17,"relSpec":18,"role":19,"BLOCK_START":20,"attributes":21,"BLOCK_STOP":22,"title":23,"title_value":24,"acc_title":25,"acc_title_value":26,"acc_descr":27,"acc_descr_value":28,"acc_descr_multiline_value":29,"ALPHANUM":30,".":31,"attribute":32,"attributeType":33,"attributeName":34,"attributeKeyType":35,"attributeComment":36,"ATTRIBUTE_WORD":37,"ATTRIBUTE_KEY":38,"COMMENT":39,"cardinality":40,"relType":41,"ZERO_OR_ONE":42,"ZERO_OR_MORE":43,"ONE_OR_MORE":44,"ONLY_ONE":45,"NON_IDENTIFYING":46,"IDENTIFYING":47,"WORD":48,"open_directive":49,"type_directive":50,"arg_directive":51,"close_directive":52,"$accept":0,"$end":1}, +terminals_: {2:"error",4:"ER_DIAGRAM",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",20:"BLOCK_START",22:"BLOCK_STOP",23:"title",24:"title_value",25:"acc_title",26:"acc_title_value",27:"acc_descr",28:"acc_descr_value",29:"acc_descr_multiline_value",30:"ALPHANUM",31:".",37:"ATTRIBUTE_WORD",38:"ATTRIBUTE_KEY",39:"COMMENT",42:"ZERO_OR_ONE",43:"ZERO_OR_MORE",44:"ONE_OR_MORE",45:"ONLY_ONE",46:"NON_IDENTIFYING",47:"IDENTIFYING",48:"WORD",49:"open_directive",50:"type_directive",51:"arg_directive",52:"close_directive"}, +productions_: [0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,5],[10,4],[10,3],[10,1],[10,2],[10,2],[10,2],[10,1],[17,1],[17,3],[21,1],[21,2],[32,2],[32,3],[32,3],[32,4],[33,1],[34,1],[35,1],[36,1],[18,3],[40,1],[40,1],[40,1],[40,1],[41,1],[41,1],[19,1],[19,1],[12,1],[13,1],[16,1],[14,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 1: + /*console.log('finished parsing');*/ +break; +case 3: + this.$ = [] +break; +case 4: +$$[$0-1].push($$[$0]);this.$ = $$[$0-1] +break; +case 5: case 6: + this.$ = $$[$0] +break; +case 7: case 8: + this.$=[]; +break; +case 12: + + yy.addEntity($$[$0-4]); + yy.addEntity($$[$0-2]); + yy.addRelationship($$[$0-4], $$[$0], $$[$0-2], $$[$0-3]); + /*console.log($$[$0-4] + $$[$0-3] + $$[$0-2] + ':' + $$[$0]);*/ + +break; +case 13: + + /* console.log('detected block'); */ + yy.addEntity($$[$0-3]); + yy.addAttributes($$[$0-3], $$[$0-1]); + /* console.log('handled block'); */ + +break; +case 14: + yy.addEntity($$[$0-2]); +break; +case 15: + yy.addEntity($$[$0]); +break; +case 16: case 17: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 18: case 19: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 20: + this.$ = $$[$0]; /*console.log('Entity: ' + $$[$0]);*/ +break; +case 21: + this.$ = $$[$0-2] + $$[$0-1] + $$[$0]; +break; +case 22: + this.$ = [$$[$0]]; +break; +case 23: + $$[$0].push($$[$0-1]); this.$=$$[$0]; +break; +case 24: + this.$ = { attributeType: $$[$0-1], attributeName: $$[$0] }; +break; +case 25: + this.$ = { attributeType: $$[$0-2], attributeName: $$[$0-1], attributeKeyType: $$[$0] }; +break; +case 26: + this.$ = { attributeType: $$[$0-2], attributeName: $$[$0-1], attributeComment: $$[$0] }; +break; +case 27: + this.$ = { attributeType: $$[$0-3], attributeName: $$[$0-2], attributeKeyType: $$[$0-1], attributeComment: $$[$0] }; +break; +case 28: case 29: case 30: + this.$=$$[$0]; +break; +case 31: + this.$=$$[$0].replace(/"/g, ''); +break; +case 32: + + this.$ = { cardA: $$[$0], relType: $$[$0-1], cardB: $$[$0-2] }; + /*console.log('relSpec: ' + $$[$0] + $$[$0-1] + $$[$0-2]);*/ + +break; +case 33: + this.$ = yy.Cardinality.ZERO_OR_ONE; +break; +case 34: + this.$ = yy.Cardinality.ZERO_OR_MORE; +break; +case 35: + this.$ = yy.Cardinality.ONE_OR_MORE; +break; +case 36: + this.$ = yy.Cardinality.ONLY_ONE; +break; +case 37: + this.$ = yy.Identification.NON_IDENTIFYING; +break; +case 38: + this.$ = yy.Identification.IDENTIFYING; +break; +case 39: + this.$ = $$[$0].replace(/"/g, ''); +break; +case 40: + this.$ = $$[$0]; +break; +case 41: + yy.parseDirective('%%{', 'open_directive'); +break; +case 42: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 43: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 44: + yy.parseDirective('}%%', 'close_directive', 'er'); +break; +} +}, +table: [{3:1,4:$V0,7:3,12:4,49:$V1},{1:[3]},o($V2,[2,3],{5:6}),{3:7,4:$V0,7:3,12:4,49:$V1},{13:8,50:[1,9]},{50:[2,41]},{6:[1,10],7:15,8:11,9:[1,12],10:13,11:[1,14],12:4,17:16,23:$V3,25:$V4,27:$V5,29:$V6,30:$V7,49:$V1},{1:[2,2]},{14:22,15:[1,23],52:$V8},o([15,52],[2,42]),o($V2,[2,8],{1:[2,1]}),o($V2,[2,4]),{7:15,10:25,12:4,17:16,23:$V3,25:$V4,27:$V5,29:$V6,30:$V7,49:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,11]),o($V2,[2,15],{18:26,40:28,20:[1,27],42:$V9,43:$Va,44:$Vb,45:$Vc}),{24:[1,33]},{26:[1,34]},{28:[1,35]},o($V2,[2,19]),o($Vd,[2,20],{31:[1,36]}),{11:[1,37]},{16:38,51:[1,39]},{11:[2,44]},o($V2,[2,5]),{17:40,30:$V7},{21:41,22:[1,42],32:43,33:44,37:$Ve},{41:46,46:[1,47],47:[1,48]},o($Vf,[2,33]),o($Vf,[2,34]),o($Vf,[2,35]),o($Vf,[2,36]),o($V2,[2,16]),o($V2,[2,17]),o($V2,[2,18]),{17:49,30:$V7},o($Vg,[2,9]),{14:50,52:$V8},{52:[2,43]},{15:[1,51]},{22:[1,52]},o($V2,[2,14]),{21:53,22:[2,22],32:43,33:44,37:$Ve},{34:54,37:[1,55]},{37:[2,28]},{40:56,42:$V9,43:$Va,44:$Vb,45:$Vc},o($Vh,[2,37]),o($Vh,[2,38]),o($Vd,[2,21]),{11:[1,57]},{19:58,30:[1,60],48:[1,59]},o($V2,[2,13]),{22:[2,23]},o($Vi,[2,24],{35:61,36:62,38:[1,63],39:$Vj}),o([22,37,38,39],[2,29]),{30:[2,32]},o($Vg,[2,10]),o($V2,[2,12]),o($V2,[2,39]),o($V2,[2,40]),o($Vi,[2,25],{36:65,39:$Vj}),o($Vi,[2,26]),o([22,37,39],[2,30]),o($Vi,[2,31]),o($Vi,[2,27])], +defaultActions: {5:[2,41],7:[2,2],24:[2,44],39:[2,43],45:[2,28],53:[2,23],56:[2,32]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin("acc_title");return 25; +break; +case 1: this.popState(); return "acc_title_value"; +break; +case 2: this.begin("acc_descr");return 27; +break; +case 3: this.popState(); return "acc_descr_value"; +break; +case 4: this.begin("acc_descr_multiline"); +break; +case 5: this.popState(); +break; +case 6:return "acc_descr_multiline_value"; +break; +case 7: this.begin('open_directive'); return 49; +break; +case 8: this.begin('type_directive'); return 50; +break; +case 9: this.popState(); this.begin('arg_directive'); return 15; +break; +case 10: this.popState(); this.popState(); return 52; +break; +case 11:return 51; +break; +case 12:/* skip comments */ +break; +case 13:/* skip comments */ +break; +case 14:return 11; +break; +case 15:/* skip whitespace */ +break; +case 16:return 9; +break; +case 17:return 48; +break; +case 18:return 4; +break; +case 19: this.begin("block"); return 20; +break; +case 20:/* skip whitespace in block */ +break; +case 21:return 38 +break; +case 22:return 37 +break; +case 23:return 39; +break; +case 24:/* nothing */ +break; +case 25: this.popState(); return 22; +break; +case 26:return yy_.yytext[0]; +break; +case 27:return 42; +break; +case 28:return 43; +break; +case 29:return 44; +break; +case 30:return 45; +break; +case 31:return 42; +break; +case 32:return 43; +break; +case 33:return 44; +break; +case 34:return 46; +break; +case 35:return 47; +break; +case 36:return 46; +break; +case 37:return 46; +break; +case 38:return 30; +break; +case 39:return yy_.yytext[0]; +break; +case 40:return 6; +break; +} +}, +rules: [/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK))\b)/i,/^(?:[A-Za-z][A-Za-z0-9\-_]*)/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\|o\b)/i,/^(?:\}o\b)/i,/^(?:\}\|)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:[A-Za-z][A-Za-z0-9\-_]*)/i,/^(?:.)/i,/^(?:$)/i], +conditions: {"acc_descr_multiline":{"rules":[5,6],"inclusive":false},"acc_descr":{"rules":[3],"inclusive":false},"acc_title":{"rules":[1],"inclusive":false},"open_directive":{"rules":[8],"inclusive":false},"type_directive":{"rules":[9,10],"inclusive":false},"arg_directive":{"rules":[10,11],"inclusive":false},"block":{"rules":[20,21,22,23,24,25,26],"inclusive":false},"INITIAL":{"rules":[0,2,4,7,12,13,14,15,16,17,18,19,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?3c87").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/flowchart/parser/flow.jison": +/*!**************************************************!*\ + !*** ./src/diagrams/flowchart/parser/flow.jison ***! + \**************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,9],$V1=[1,7],$V2=[1,6],$V3=[1,8],$V4=[1,20,21,22,23,38,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],$V5=[2,10],$V6=[1,20],$V7=[1,21],$V8=[1,22],$V9=[1,23],$Va=[1,30],$Vb=[1,32],$Vc=[1,33],$Vd=[1,34],$Ve=[1,62],$Vf=[1,48],$Vg=[1,52],$Vh=[1,36],$Vi=[1,37],$Vj=[1,38],$Vk=[1,39],$Vl=[1,40],$Vm=[1,56],$Vn=[1,63],$Vo=[1,51],$Vp=[1,53],$Vq=[1,55],$Vr=[1,59],$Vs=[1,60],$Vt=[1,41],$Vu=[1,42],$Vv=[1,43],$Vw=[1,44],$Vx=[1,61],$Vy=[1,50],$Vz=[1,54],$VA=[1,57],$VB=[1,58],$VC=[1,49],$VD=[1,66],$VE=[1,71],$VF=[1,20,21,22,23,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],$VG=[1,75],$VH=[1,74],$VI=[1,76],$VJ=[20,21,23,81,82],$VK=[1,99],$VL=[1,104],$VM=[1,107],$VN=[1,108],$VO=[1,101],$VP=[1,106],$VQ=[1,109],$VR=[1,102],$VS=[1,114],$VT=[1,113],$VU=[1,103],$VV=[1,105],$VW=[1,110],$VX=[1,111],$VY=[1,112],$VZ=[1,115],$V_=[20,21,22,23,81,82],$V$=[20,21,22,23,53,81,82],$V01=[20,21,22,23,40,52,53,55,57,59,61,63,65,66,67,69,71,73,74,76,81,82,91,95,105,106,109,111,112,122,123,124,125,126,127],$V11=[20,21,23],$V21=[20,21,23,52,66,67,81,82,91,95,105,106,109,111,112,122,123,124,125,126,127],$V31=[1,12,20,21,22,23,24,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],$V41=[52,66,67,91,95,105,106,109,111,112,122,123,124,125,126,127],$V51=[1,149],$V61=[1,157],$V71=[1,158],$V81=[1,159],$V91=[1,160],$Va1=[1,144],$Vb1=[1,145],$Vc1=[1,141],$Vd1=[1,152],$Ve1=[1,153],$Vf1=[1,154],$Vg1=[1,155],$Vh1=[1,156],$Vi1=[1,161],$Vj1=[1,162],$Vk1=[1,147],$Vl1=[1,150],$Vm1=[1,146],$Vn1=[1,143],$Vo1=[20,21,22,23,38,42,44,46,48,52,66,67,86,87,88,89,90,91,95,105,106,109,111,112,118,119,120,121,122,123,124,125,126,127],$Vp1=[1,165],$Vq1=[20,21,22,23,26,52,66,67,91,105,106,109,111,112,122,123,124,125,126,127],$Vr1=[20,21,22,23,24,26,38,40,41,42,52,56,58,60,62,64,66,67,68,70,72,73,75,77,81,82,86,87,88,89,90,91,92,95,105,106,109,111,112,113,114,122,123,124,125,126,127],$Vs1=[12,21,22,24],$Vt1=[22,106],$Vu1=[1,250],$Vv1=[1,245],$Vw1=[1,246],$Vx1=[1,254],$Vy1=[1,251],$Vz1=[1,248],$VA1=[1,247],$VB1=[1,249],$VC1=[1,252],$VD1=[1,253],$VE1=[1,255],$VF1=[1,273],$VG1=[20,21,23,106],$VH1=[20,21,22,23,66,67,86,102,105,106,109,110,111,112,113]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"mermaidDoc":4,"directive":5,"openDirective":6,"typeDirective":7,"closeDirective":8,"separator":9,":":10,"argDirective":11,"open_directive":12,"type_directive":13,"arg_directive":14,"close_directive":15,"graphConfig":16,"document":17,"line":18,"statement":19,"SEMI":20,"NEWLINE":21,"SPACE":22,"EOF":23,"GRAPH":24,"NODIR":25,"DIR":26,"FirstStmtSeperator":27,"ending":28,"endToken":29,"spaceList":30,"spaceListNewline":31,"verticeStatement":32,"styleStatement":33,"linkStyleStatement":34,"classDefStatement":35,"classStatement":36,"clickStatement":37,"subgraph":38,"text":39,"SQS":40,"SQE":41,"end":42,"direction":43,"acc_title":44,"acc_title_value":45,"acc_descr":46,"acc_descr_value":47,"acc_descr_multiline_value":48,"link":49,"node":50,"vertex":51,"AMP":52,"STYLE_SEPARATOR":53,"idString":54,"DOUBLECIRCLESTART":55,"DOUBLECIRCLEEND":56,"PS":57,"PE":58,"(-":59,"-)":60,"STADIUMSTART":61,"STADIUMEND":62,"SUBROUTINESTART":63,"SUBROUTINEEND":64,"VERTEX_WITH_PROPS_START":65,"ALPHA":66,"COLON":67,"PIPE":68,"CYLINDERSTART":69,"CYLINDEREND":70,"DIAMOND_START":71,"DIAMOND_STOP":72,"TAGEND":73,"TRAPSTART":74,"TRAPEND":75,"INVTRAPSTART":76,"INVTRAPEND":77,"linkStatement":78,"arrowText":79,"TESTSTR":80,"START_LINK":81,"LINK":82,"textToken":83,"STR":84,"keywords":85,"STYLE":86,"LINKSTYLE":87,"CLASSDEF":88,"CLASS":89,"CLICK":90,"DOWN":91,"UP":92,"textNoTags":93,"textNoTagsToken":94,"DEFAULT":95,"stylesOpt":96,"alphaNum":97,"CALLBACKNAME":98,"CALLBACKARGS":99,"HREF":100,"LINK_TARGET":101,"HEX":102,"numList":103,"INTERPOLATE":104,"NUM":105,"COMMA":106,"style":107,"styleComponent":108,"MINUS":109,"UNIT":110,"BRKT":111,"DOT":112,"PCT":113,"TAGSTART":114,"alphaNumToken":115,"idStringToken":116,"alphaNumStatement":117,"direction_tb":118,"direction_bt":119,"direction_rl":120,"direction_lr":121,"PUNCTUATION":122,"UNICODE_TEXT":123,"PLUS":124,"EQUALS":125,"MULT":126,"UNDERSCORE":127,"graphCodeTokens":128,"ARROW_CROSS":129,"ARROW_POINT":130,"ARROW_CIRCLE":131,"ARROW_OPEN":132,"QUOTE":133,"$accept":0,"$end":1}, +terminals_: {2:"error",10:":",12:"open_directive",13:"type_directive",14:"arg_directive",15:"close_directive",20:"SEMI",21:"NEWLINE",22:"SPACE",23:"EOF",24:"GRAPH",25:"NODIR",26:"DIR",38:"subgraph",40:"SQS",41:"SQE",42:"end",44:"acc_title",45:"acc_title_value",46:"acc_descr",47:"acc_descr_value",48:"acc_descr_multiline_value",52:"AMP",53:"STYLE_SEPARATOR",55:"DOUBLECIRCLESTART",56:"DOUBLECIRCLEEND",57:"PS",58:"PE",59:"(-",60:"-)",61:"STADIUMSTART",62:"STADIUMEND",63:"SUBROUTINESTART",64:"SUBROUTINEEND",65:"VERTEX_WITH_PROPS_START",66:"ALPHA",67:"COLON",68:"PIPE",69:"CYLINDERSTART",70:"CYLINDEREND",71:"DIAMOND_START",72:"DIAMOND_STOP",73:"TAGEND",74:"TRAPSTART",75:"TRAPEND",76:"INVTRAPSTART",77:"INVTRAPEND",80:"TESTSTR",81:"START_LINK",82:"LINK",84:"STR",86:"STYLE",87:"LINKSTYLE",88:"CLASSDEF",89:"CLASS",90:"CLICK",91:"DOWN",92:"UP",95:"DEFAULT",98:"CALLBACKNAME",99:"CALLBACKARGS",100:"HREF",101:"LINK_TARGET",102:"HEX",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"MINUS",110:"UNIT",111:"BRKT",112:"DOT",113:"PCT",114:"TAGSTART",118:"direction_tb",119:"direction_bt",120:"direction_rl",121:"direction_lr",122:"PUNCTUATION",123:"UNICODE_TEXT",124:"PLUS",125:"EQUALS",126:"MULT",127:"UNDERSCORE",129:"ARROW_CROSS",130:"ARROW_POINT",131:"ARROW_CIRCLE",132:"ARROW_OPEN",133:"QUOTE"}, +productions_: [0,[3,1],[3,2],[5,4],[5,6],[6,1],[7,1],[11,1],[8,1],[4,2],[17,0],[17,2],[18,1],[18,1],[18,1],[18,1],[18,1],[16,2],[16,2],[16,2],[16,3],[28,2],[28,1],[29,1],[29,1],[29,1],[27,1],[27,1],[27,2],[31,2],[31,2],[31,1],[31,1],[30,2],[30,1],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,9],[19,6],[19,4],[19,1],[19,2],[19,2],[19,1],[9,1],[9,1],[9,1],[32,3],[32,4],[32,2],[32,1],[50,1],[50,5],[50,3],[51,4],[51,4],[51,6],[51,4],[51,4],[51,4],[51,8],[51,4],[51,4],[51,4],[51,6],[51,4],[51,4],[51,4],[51,4],[51,4],[51,1],[49,2],[49,3],[49,3],[49,1],[49,3],[78,1],[79,3],[39,1],[39,2],[39,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[93,1],[93,2],[35,5],[35,5],[36,5],[37,2],[37,4],[37,3],[37,5],[37,2],[37,4],[37,4],[37,6],[37,2],[37,4],[37,2],[37,4],[37,4],[37,6],[33,5],[33,5],[34,5],[34,5],[34,9],[34,9],[34,7],[34,7],[103,1],[103,3],[96,1],[96,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[94,1],[94,1],[94,1],[94,1],[54,1],[54,2],[97,1],[97,2],[117,1],[117,1],[117,1],[117,1],[43,1],[43,1],[43,1],[43,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[115,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1],[128,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 5: + yy.parseDirective('%%{', 'open_directive'); +break; +case 6: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 7: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 8: + yy.parseDirective('}%%', 'close_directive', 'flowchart'); +break; +case 10: + this.$ = []; +break; +case 11: + + if($$[$0] !== []){ + $$[$0-1].push($$[$0]); + } + this.$=$$[$0-1]; +break; +case 12: case 82: case 84: case 96: case 152: case 154: case 155: +this.$=$$[$0]; +break; +case 19: + yy.setDirection('TB');this.$ = 'TB'; +break; +case 20: + yy.setDirection($$[$0-1]);this.$ = $$[$0-1]; +break; +case 35: + /* console.warn('finat vs', $$[$0-1].nodes); */ this.$=$$[$0-1].nodes +break; +case 36: case 37: case 38: case 39: case 40: +this.$=[]; +break; +case 41: +this.$=yy.addSubGraph($$[$0-6],$$[$0-1],$$[$0-4]); +break; +case 42: +this.$=yy.addSubGraph($$[$0-3],$$[$0-1],$$[$0-3]); +break; +case 43: +this.$=yy.addSubGraph(undefined,$$[$0-1],undefined); +break; +case 45: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 46: case 47: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 51: + /* console.warn('vs',$$[$0-2].stmt,$$[$0]); */ yy.addLink($$[$0-2].stmt,$$[$0],$$[$0-1]); this.$ = { stmt: $$[$0], nodes: $$[$0].concat($$[$0-2].nodes) } +break; +case 52: + /* console.warn('vs',$$[$0-3].stmt,$$[$0-1]); */ yy.addLink($$[$0-3].stmt,$$[$0-1],$$[$0-2]); this.$ = { stmt: $$[$0-1], nodes: $$[$0-1].concat($$[$0-3].nodes) } +break; +case 53: +/*console.warn('noda', $$[$0-1]);*/ this.$ = {stmt: $$[$0-1], nodes:$$[$0-1] } +break; +case 54: + /*console.warn('noda', $$[$0]);*/ this.$ = {stmt: $$[$0], nodes:$$[$0] } +break; +case 55: + /* console.warn('nod', $$[$0]); */ this.$ = [$$[$0]]; +break; +case 56: + this.$ = $$[$0-4].concat($$[$0]); /* console.warn('pip', $$[$0-4][0], $$[$0], this.$); */ +break; +case 57: +this.$ = [$$[$0-2]];yy.setClass($$[$0-2],$$[$0]) +break; +case 58: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'square'); +break; +case 59: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'doublecircle'); +break; +case 60: +this.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'circle'); +break; +case 61: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'ellipse'); +break; +case 62: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'stadium'); +break; +case 63: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'subroutine'); +break; +case 64: +this.$ = $$[$0-7];yy.addVertex($$[$0-7],$$[$0-1],'rect',undefined,undefined,undefined, Object.fromEntries([[$$[$0-5], $$[$0-3]]])); +break; +case 65: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'cylinder'); +break; +case 66: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'round'); +break; +case 67: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'diamond'); +break; +case 68: +this.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'hexagon'); +break; +case 69: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'odd'); +break; +case 70: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'trapezoid'); +break; +case 71: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'inv_trapezoid'); +break; +case 72: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_right'); +break; +case 73: +this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_left'); +break; +case 74: + /*console.warn('h: ', $$[$0]);*/this.$ = $$[$0];yy.addVertex($$[$0]); +break; +case 75: +$$[$0-1].text = $$[$0];this.$ = $$[$0-1]; +break; +case 76: case 77: +$$[$0-2].text = $$[$0-1];this.$ = $$[$0-2]; +break; +case 78: +this.$ = $$[$0]; +break; +case 79: +var inf = yy.destructLink($$[$0], $$[$0-2]); this.$ = {"type":inf.type,"stroke":inf.stroke,"length":inf.length,"text":$$[$0-1]}; +break; +case 80: +var inf = yy.destructLink($$[$0]);this.$ = {"type":inf.type,"stroke":inf.stroke,"length":inf.length}; +break; +case 81: +this.$ = $$[$0-1]; +break; +case 83: case 97: case 153: +this.$=$$[$0-1]+''+$$[$0]; +break; +case 98: case 99: +this.$ = $$[$0-4];yy.addClass($$[$0-2],$$[$0]); +break; +case 100: +this.$ = $$[$0-4];yy.setClass($$[$0-2], $$[$0]); +break; +case 101: case 109: +this.$ = $$[$0-1];yy.setClickEvent($$[$0-1], $$[$0]); +break; +case 102: case 110: +this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-3], $$[$0]); +break; +case 103: +this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]); +break; +case 104: +this.$ = $$[$0-4];yy.setClickEvent($$[$0-4], $$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-4], $$[$0]); +break; +case 105: case 111: +this.$ = $$[$0-1];yy.setLink($$[$0-1], $$[$0]); +break; +case 106: case 112: +this.$ = $$[$0-3];yy.setLink($$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-3], $$[$0]); +break; +case 107: case 113: +this.$ = $$[$0-3];yy.setLink($$[$0-3], $$[$0-2], $$[$0]); +break; +case 108: case 114: +this.$ = $$[$0-5];yy.setLink($$[$0-5], $$[$0-4], $$[$0]);yy.setTooltip($$[$0-5], $$[$0-2]); +break; +case 115: +this.$ = $$[$0-4];yy.addVertex($$[$0-2],undefined,undefined,$$[$0]); +break; +case 116: case 118: +this.$ = $$[$0-4];yy.updateLink($$[$0-2],$$[$0]); +break; +case 117: +this.$ = $$[$0-4];yy.updateLink([$$[$0-2]],$$[$0]); +break; +case 119: +this.$ = $$[$0-8];yy.updateLinkInterpolate([$$[$0-6]],$$[$0-2]);yy.updateLink([$$[$0-6]],$$[$0]); +break; +case 120: +this.$ = $$[$0-8];yy.updateLinkInterpolate($$[$0-6],$$[$0-2]);yy.updateLink($$[$0-6],$$[$0]); +break; +case 121: +this.$ = $$[$0-6];yy.updateLinkInterpolate([$$[$0-4]],$$[$0]); +break; +case 122: +this.$ = $$[$0-6];yy.updateLinkInterpolate($$[$0-4],$$[$0]); +break; +case 123: case 125: +this.$ = [$$[$0]] +break; +case 124: case 126: +$$[$0-2].push($$[$0]);this.$ = $$[$0-2]; +break; +case 128: +this.$ = $$[$0-1] + $$[$0]; +break; +case 150: +this.$=$$[$0] +break; +case 151: +this.$=$$[$0-1]+''+$$[$0] +break; +case 156: +this.$='v'; +break; +case 157: +this.$='-'; +break; +case 158: + this.$={stmt:'dir', value:'TB'}; +break; +case 159: + this.$={stmt:'dir', value:'BT'}; +break; +case 160: + this.$={stmt:'dir', value:'RL'}; +break; +case 161: + this.$={stmt:'dir', value:'LR'}; +break; +} +}, +table: [{3:1,4:2,5:3,6:5,12:$V0,16:4,21:$V1,22:$V2,24:$V3},{1:[3]},{1:[2,1]},{3:10,4:2,5:3,6:5,12:$V0,16:4,21:$V1,22:$V2,24:$V3},o($V4,$V5,{17:11}),{7:12,13:[1,13]},{16:14,21:$V1,22:$V2,24:$V3},{16:15,21:$V1,22:$V2,24:$V3},{25:[1,16],26:[1,17]},{13:[2,5]},{1:[2,2]},{1:[2,9],18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,43:31,44:$Vb,46:$Vc,48:$Vd,50:35,51:45,52:$Ve,54:46,66:$Vf,67:$Vg,86:$Vh,87:$Vi,88:$Vj,89:$Vk,90:$Vl,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,118:$Vt,119:$Vu,120:$Vv,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},{8:64,10:[1,65],15:$VD},o([10,15],[2,6]),o($V4,[2,17]),o($V4,[2,18]),o($V4,[2,19]),{20:[1,68],21:[1,69],22:$VE,27:67,30:70},o($VF,[2,11]),o($VF,[2,12]),o($VF,[2,13]),o($VF,[2,14]),o($VF,[2,15]),o($VF,[2,16]),{9:72,20:$VG,21:$VH,23:$VI,49:73,78:77,81:[1,78],82:[1,79]},{9:80,20:$VG,21:$VH,23:$VI},{9:81,20:$VG,21:$VH,23:$VI},{9:82,20:$VG,21:$VH,23:$VI},{9:83,20:$VG,21:$VH,23:$VI},{9:84,20:$VG,21:$VH,23:$VI},{9:86,20:$VG,21:$VH,22:[1,85],23:$VI},o($VF,[2,44]),{45:[1,87]},{47:[1,88]},o($VF,[2,47]),o($VJ,[2,54],{30:89,22:$VE}),{22:[1,90]},{22:[1,91]},{22:[1,92]},{22:[1,93]},{26:$VK,52:$VL,66:$VM,67:$VN,84:[1,97],91:$VO,97:96,98:[1,94],100:[1,95],105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($VF,[2,158]),o($VF,[2,159]),o($VF,[2,160]),o($VF,[2,161]),o($V_,[2,55],{53:[1,116]}),o($V$,[2,74],{116:129,40:[1,117],52:$Ve,55:[1,118],57:[1,119],59:[1,120],61:[1,121],63:[1,122],65:[1,123],66:$Vf,67:$Vg,69:[1,124],71:[1,125],73:[1,126],74:[1,127],76:[1,128],91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC}),o($V01,[2,150]),o($V01,[2,175]),o($V01,[2,176]),o($V01,[2,177]),o($V01,[2,178]),o($V01,[2,179]),o($V01,[2,180]),o($V01,[2,181]),o($V01,[2,182]),o($V01,[2,183]),o($V01,[2,184]),o($V01,[2,185]),o($V01,[2,186]),o($V01,[2,187]),o($V01,[2,188]),o($V01,[2,189]),o($V01,[2,190]),{9:130,20:$VG,21:$VH,23:$VI},{11:131,14:[1,132]},o($V11,[2,8]),o($V4,[2,20]),o($V4,[2,26]),o($V4,[2,27]),{21:[1,133]},o($V21,[2,34],{30:134,22:$VE}),o($VF,[2,35]),{50:135,51:45,52:$Ve,54:46,66:$Vf,67:$Vg,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},o($V31,[2,48]),o($V31,[2,49]),o($V31,[2,50]),o($V41,[2,78],{79:136,68:[1,138],80:[1,137]}),{22:$V51,24:$V61,26:$V71,38:$V81,39:139,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o([52,66,67,68,80,91,95,105,106,109,111,112,122,123,124,125,126,127],[2,80]),o($VF,[2,36]),o($VF,[2,37]),o($VF,[2,38]),o($VF,[2,39]),o($VF,[2,40]),{22:$V51,24:$V61,26:$V71,38:$V81,39:163,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($Vo1,$V5,{17:164}),o($VF,[2,45]),o($VF,[2,46]),o($VJ,[2,53],{52:$Vp1}),{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,97:166,102:[1,167],105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{95:[1,168],103:169,105:[1,170]},{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,95:[1,171],97:172,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,97:173,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V11,[2,101],{22:[1,174],99:[1,175]}),o($V11,[2,105],{22:[1,176]}),o($V11,[2,109],{115:100,117:178,22:[1,177],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ}),o($V11,[2,111],{22:[1,179]}),o($Vq1,[2,152]),o($Vq1,[2,154]),o($Vq1,[2,155]),o($Vq1,[2,156]),o($Vq1,[2,157]),o($Vr1,[2,162]),o($Vr1,[2,163]),o($Vr1,[2,164]),o($Vr1,[2,165]),o($Vr1,[2,166]),o($Vr1,[2,167]),o($Vr1,[2,168]),o($Vr1,[2,169]),o($Vr1,[2,170]),o($Vr1,[2,171]),o($Vr1,[2,172]),o($Vr1,[2,173]),o($Vr1,[2,174]),{52:$Ve,54:180,66:$Vf,67:$Vg,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},{22:$V51,24:$V61,26:$V71,38:$V81,39:181,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:182,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:184,42:$V91,52:$VL,57:[1,183],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:185,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:186,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:187,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{66:[1,188]},{22:$V51,24:$V61,26:$V71,38:$V81,39:189,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:190,42:$V91,52:$VL,66:$VM,67:$VN,71:[1,191],73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:192,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:193,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:194,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V01,[2,151]),o($Vs1,[2,3]),{8:195,15:$VD},{15:[2,7]},o($V4,[2,28]),o($V21,[2,33]),o($VJ,[2,51],{30:196,22:$VE}),o($V41,[2,75],{22:[1,197]}),{22:[1,198]},{22:$V51,24:$V61,26:$V71,38:$V81,39:199,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,82:[1,200],83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($Vr1,[2,82]),o($Vr1,[2,84]),o($Vr1,[2,140]),o($Vr1,[2,141]),o($Vr1,[2,142]),o($Vr1,[2,143]),o($Vr1,[2,144]),o($Vr1,[2,145]),o($Vr1,[2,146]),o($Vr1,[2,147]),o($Vr1,[2,148]),o($Vr1,[2,149]),o($Vr1,[2,85]),o($Vr1,[2,86]),o($Vr1,[2,87]),o($Vr1,[2,88]),o($Vr1,[2,89]),o($Vr1,[2,90]),o($Vr1,[2,91]),o($Vr1,[2,92]),o($Vr1,[2,93]),o($Vr1,[2,94]),o($Vr1,[2,95]),{9:203,20:$VG,21:$VH,22:$V51,23:$VI,24:$V61,26:$V71,38:$V81,40:[1,202],42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,204],43:31,44:$Vb,46:$Vc,48:$Vd,50:35,51:45,52:$Ve,54:46,66:$Vf,67:$Vg,86:$Vh,87:$Vi,88:$Vj,89:$Vk,90:$Vl,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,118:$Vt,119:$Vu,120:$Vv,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},{22:$VE,30:205},{22:[1,206],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:178,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:[1,207]},{22:[1,208]},{22:[1,209],106:[1,210]},o($Vt1,[2,123]),{22:[1,211]},{22:[1,212],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:178,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:[1,213],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:178,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{84:[1,214]},o($V11,[2,103],{22:[1,215]}),{84:[1,216],101:[1,217]},{84:[1,218]},o($Vq1,[2,153]),{84:[1,219],101:[1,220]},o($V_,[2,57],{116:129,52:$Ve,66:$Vf,67:$Vg,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC}),{22:$V51,24:$V61,26:$V71,38:$V81,41:[1,221],42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,56:[1,222],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:223,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,58:[1,224],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,60:[1,225],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,62:[1,226],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,64:[1,227],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{67:[1,228]},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,70:[1,229],73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,72:[1,230],73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,39:231,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,41:[1,232],42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,75:[1,233],77:[1,234],81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,75:[1,236],77:[1,235],81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{9:237,20:$VG,21:$VH,23:$VI},o($VJ,[2,52],{52:$Vp1}),o($V41,[2,77]),o($V41,[2,76]),{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,68:[1,238],73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V41,[2,79]),o($Vr1,[2,83]),{22:$V51,24:$V61,26:$V71,38:$V81,39:239,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($Vo1,$V5,{17:240}),o($VF,[2,43]),{51:241,52:$Ve,54:46,66:$Vf,67:$Vg,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:242,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:256,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:257,102:$Vy1,104:[1,258],105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:259,102:$Vy1,104:[1,260],105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{105:[1,261]},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:262,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:263,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,97:264,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V11,[2,102]),{84:[1,265]},o($V11,[2,106],{22:[1,266]}),o($V11,[2,107]),o($V11,[2,110]),o($V11,[2,112],{22:[1,267]}),o($V11,[2,113]),o($V$,[2,58]),o($V$,[2,59]),{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,58:[1,268],66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V$,[2,66]),o($V$,[2,61]),o($V$,[2,62]),o($V$,[2,63]),{66:[1,269]},o($V$,[2,65]),o($V$,[2,67]),{22:$V51,24:$V61,26:$V71,38:$V81,42:$V91,52:$VL,66:$VM,67:$VN,72:[1,270],73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V$,[2,69]),o($V$,[2,70]),o($V$,[2,72]),o($V$,[2,71]),o($V$,[2,73]),o($Vs1,[2,4]),o([22,52,66,67,91,95,105,106,109,111,112,122,123,124,125,126,127],[2,81]),{22:$V51,24:$V61,26:$V71,38:$V81,41:[1,271],42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,272],43:31,44:$Vb,46:$Vc,48:$Vd,50:35,51:45,52:$Ve,54:46,66:$Vf,67:$Vg,86:$Vh,87:$Vi,88:$Vj,89:$Vk,90:$Vl,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,118:$Vt,119:$Vu,120:$Vv,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},o($V_,[2,56]),o($V11,[2,115],{106:$VF1}),o($VG1,[2,125],{108:274,22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,102:$Vy1,105:$Vz1,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1}),o($VH1,[2,127]),o($VH1,[2,129]),o($VH1,[2,130]),o($VH1,[2,131]),o($VH1,[2,132]),o($VH1,[2,133]),o($VH1,[2,134]),o($VH1,[2,135]),o($VH1,[2,136]),o($VH1,[2,137]),o($VH1,[2,138]),o($VH1,[2,139]),o($V11,[2,116],{106:$VF1}),o($V11,[2,117],{106:$VF1}),{22:[1,275]},o($V11,[2,118],{106:$VF1}),{22:[1,276]},o($Vt1,[2,124]),o($V11,[2,98],{106:$VF1}),o($V11,[2,99],{106:$VF1}),o($V11,[2,100],{115:100,117:178,26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ}),o($V11,[2,104]),{101:[1,277]},{101:[1,278]},{58:[1,279]},{68:[1,280]},{72:[1,281]},{9:282,20:$VG,21:$VH,23:$VI},o($VF,[2,42]),{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,102:$Vy1,105:$Vz1,107:283,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},o($VH1,[2,128]),{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,97:284,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,97:285,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,115:100,117:98,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V11,[2,108]),o($V11,[2,114]),o($V$,[2,60]),{22:$V51,24:$V61,26:$V71,38:$V81,39:286,42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:140,84:$Vc1,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},o($V$,[2,68]),o($Vo1,$V5,{17:287}),o($VG1,[2,126],{108:274,22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,102:$Vy1,105:$Vz1,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1}),o($V11,[2,121],{115:100,117:178,22:[1,288],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ}),o($V11,[2,122],{115:100,117:178,22:[1,289],26:$VK,52:$VL,66:$VM,67:$VN,91:$VO,105:$VP,106:$VQ,109:$VR,111:$VS,112:$VT,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ}),{22:$V51,24:$V61,26:$V71,38:$V81,41:[1,290],42:$V91,52:$VL,66:$VM,67:$VN,73:$Va1,81:$Vb1,83:201,85:151,86:$Vd1,87:$Ve1,88:$Vf1,89:$Vg1,90:$Vh1,91:$Vi1,92:$Vj1,94:142,95:$Vk1,105:$VP,106:$VQ,109:$Vl1,111:$VS,112:$VT,113:$Vm1,114:$Vn1,115:148,122:$VU,123:$VV,124:$VW,125:$VX,126:$VY,127:$VZ},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,291],43:31,44:$Vb,46:$Vc,48:$Vd,50:35,51:45,52:$Ve,54:46,66:$Vf,67:$Vg,86:$Vh,87:$Vi,88:$Vj,89:$Vk,90:$Vl,91:$Vm,95:$Vn,105:$Vo,106:$Vp,109:$Vq,111:$Vr,112:$Vs,116:47,118:$Vt,119:$Vu,120:$Vv,121:$Vw,122:$Vx,123:$Vy,124:$Vz,125:$VA,126:$VB,127:$VC},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:292,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},{22:$Vu1,66:$Vv1,67:$Vw1,86:$Vx1,96:293,102:$Vy1,105:$Vz1,107:243,108:244,109:$VA1,110:$VB1,111:$VC1,112:$VD1,113:$VE1},o($V$,[2,64]),o($VF,[2,41]),o($V11,[2,119],{106:$VF1}),o($V11,[2,120],{106:$VF1})], +defaultActions: {2:[2,1],9:[2,5],10:[2,2],132:[2,7]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 12; +break; +case 1: this.begin('type_directive'); return 13; +break; +case 2: this.popState(); this.begin('arg_directive'); return 10; +break; +case 3: this.popState(); this.popState(); return 15; +break; +case 4:return 14; +break; +case 5:/* skip comments */ +break; +case 6:/* skip comments */ +break; +case 7: this.begin("acc_title");return 44; +break; +case 8: this.popState(); return "acc_title_value"; +break; +case 9: this.begin("acc_descr");return 46; +break; +case 10: this.popState(); return "acc_descr_value"; +break; +case 11: this.begin("acc_descr_multiline"); +break; +case 12: this.popState(); +break; +case 13:return "acc_descr_multiline_value"; +break; +case 14:this.begin("string"); +break; +case 15:this.popState(); +break; +case 16:return "STR"; +break; +case 17:return 86; +break; +case 18:return 95; +break; +case 19:return 87; +break; +case 20:return 104; +break; +case 21:return 88; +break; +case 22:return 89; +break; +case 23:this.begin("href"); +break; +case 24:this.popState(); +break; +case 25:return 100; +break; +case 26:this.begin("callbackname"); +break; +case 27:this.popState(); +break; +case 28:this.popState(); this.begin("callbackargs"); +break; +case 29:return 98; +break; +case 30:this.popState(); +break; +case 31:return 99; +break; +case 32:this.begin("click"); +break; +case 33:this.popState(); +break; +case 34:return 90; +break; +case 35:if(yy.lex.firstGraph()){this.begin("dir");} return 24; +break; +case 36:if(yy.lex.firstGraph()){this.begin("dir");} return 24; +break; +case 37:return 38; +break; +case 38:return 42; +break; +case 39:return 101; +break; +case 40:return 101; +break; +case 41:return 101; +break; +case 42:return 101; +break; +case 43: this.popState(); return 25; +break; +case 44: this.popState(); return 26; +break; +case 45: this.popState(); return 26; +break; +case 46: this.popState(); return 26; +break; +case 47: this.popState(); return 26; +break; +case 48: this.popState(); return 26; +break; +case 49: this.popState(); return 26; +break; +case 50: this.popState(); return 26; +break; +case 51: this.popState(); return 26; +break; +case 52: this.popState(); return 26; +break; +case 53: this.popState(); return 26; +break; +case 54:return 118; +break; +case 55:return 119; +break; +case 56:return 120; +break; +case 57:return 121; +break; +case 58: return 105; +break; +case 59:return 111; +break; +case 60:return 53; +break; +case 61:return 67; +break; +case 62:return 52; +break; +case 63:return 20; +break; +case 64:return 106; +break; +case 65:return 126; +break; +case 66:return 82; +break; +case 67:return 82; +break; +case 68:return 82; +break; +case 69:return 81; +break; +case 70:return 81; +break; +case 71:return 81; +break; +case 72:return 59; +break; +case 73:return 60; +break; +case 74:return 61; +break; +case 75:return 62; +break; +case 76:return 63; +break; +case 77:return 64; +break; +case 78:return 65; +break; +case 79:return 69; +break; +case 80:return 70; +break; +case 81:return 55; +break; +case 82:return 56; +break; +case 83:return 109; +break; +case 84:return 112; +break; +case 85:return 127; +break; +case 86:return 124; +break; +case 87:return 113; +break; +case 88:return 125; +break; +case 89:return 125; +break; +case 90:return 114; +break; +case 91:return 73; +break; +case 92:return 92; +break; +case 93:return 'SEP'; +break; +case 94:return 91; +break; +case 95:return 66; +break; +case 96:return 75; +break; +case 97:return 74; +break; +case 98:return 77; +break; +case 99:return 76; +break; +case 100:return 122; +break; +case 101:return 123; +break; +case 102:return 68; +break; +case 103:return 57; +break; +case 104:return 58; +break; +case 105:return 40; +break; +case 106:return 41; +break; +case 107:return 71 +break; +case 108:return 72 +break; +case 109:return 133; +break; +case 110:return 21; +break; +case 111:return 22; +break; +case 112:return 23; +break; +} +}, +rules: [/^(?:%%\{)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[^\}]%%[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/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u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/], +conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"callbackargs":{"rules":[30,31],"inclusive":false},"callbackname":{"rules":[27,28,29],"inclusive":false},"href":{"rules":[24,25],"inclusive":false},"click":{"rules":[33,34],"inclusive":false},"vertex":{"rules":[],"inclusive":false},"dir":{"rules":[43,44,45,46,47,48,49,50,51,52,53],"inclusive":false},"acc_descr_multiline":{"rules":[12,13],"inclusive":false},"acc_descr":{"rules":[10],"inclusive":false},"acc_title":{"rules":[8],"inclusive":false},"string":{"rules":[15,16],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,9,11,14,17,18,19,20,21,22,23,26,32,35,36,37,38,39,40,41,42,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?dbae").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/gantt/parser/gantt.jison": +/*!***********************************************!*\ + !*** ./src/diagrams/gantt/parser/gantt.jison ***! + \***********************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,5],$V2=[7,9,11,12,13,14,15,16,17,18,19,20,22,24,25,27,34,39],$V3=[1,15],$V4=[1,16],$V5=[1,17],$V6=[1,18],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,23],$Vc=[1,24],$Vd=[1,25],$Ve=[1,26],$Vf=[1,28],$Vg=[1,30],$Vh=[1,33],$Vi=[5,7,9,11,12,13,14,15,16,17,18,19,20,22,24,25,27,34,39]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"directive":4,"gantt":5,"document":6,"EOF":7,"line":8,"SPACE":9,"statement":10,"NL":11,"dateFormat":12,"inclusiveEndDates":13,"topAxis":14,"axisFormat":15,"excludes":16,"includes":17,"todayMarker":18,"title":19,"acc_title":20,"acc_title_value":21,"acc_descr":22,"acc_descr_value":23,"acc_descr_multiline_value":24,"section":25,"clickStatement":26,"taskTxt":27,"taskData":28,"openDirective":29,"typeDirective":30,"closeDirective":31,":":32,"argDirective":33,"click":34,"callbackname":35,"callbackargs":36,"href":37,"clickStatementDebug":38,"open_directive":39,"type_directive":40,"arg_directive":41,"close_directive":42,"$accept":0,"$end":1}, +terminals_: {2:"error",5:"gantt",7:"EOF",9:"SPACE",11:"NL",12:"dateFormat",13:"inclusiveEndDates",14:"topAxis",15:"axisFormat",16:"excludes",17:"includes",18:"todayMarker",19:"title",20:"acc_title",21:"acc_title_value",22:"acc_descr",23:"acc_descr_value",24:"acc_descr_multiline_value",25:"section",27:"taskTxt",28:"taskData",32:":",34:"click",35:"callbackname",36:"callbackargs",37:"href",39:"open_directive",40:"type_directive",41:"arg_directive",42:"close_directive"}, +productions_: [0,[3,2],[3,3],[6,0],[6,2],[8,2],[8,1],[8,1],[8,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[10,1],[10,1],[10,2],[10,1],[4,4],[4,6],[26,2],[26,3],[26,3],[26,4],[26,3],[26,4],[26,2],[38,2],[38,3],[38,3],[38,4],[38,3],[38,4],[38,2],[29,1],[30,1],[33,1],[31,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 2: + return $$[$0-1]; +break; +case 3: + this.$ = [] +break; +case 4: +$$[$0-1].push($$[$0]);this.$ = $$[$0-1] +break; +case 5: case 6: + this.$ = $$[$0] +break; +case 7: case 8: + this.$=[]; +break; +case 9: +yy.setDateFormat($$[$0].substr(11));this.$=$$[$0].substr(11); +break; +case 10: +yy.enableInclusiveEndDates();this.$=$$[$0].substr(18); +break; +case 11: +yy.TopAxis();this.$=$$[$0].substr(8); +break; +case 12: +yy.setAxisFormat($$[$0].substr(11));this.$=$$[$0].substr(11); +break; +case 13: +yy.setExcludes($$[$0].substr(9));this.$=$$[$0].substr(9); +break; +case 14: +yy.setIncludes($$[$0].substr(9));this.$=$$[$0].substr(9); +break; +case 15: +yy.setTodayMarker($$[$0].substr(12));this.$=$$[$0].substr(12); +break; +case 16: +yy.setDiagramTitle($$[$0].substr(6));this.$=$$[$0].substr(6); +break; +case 17: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 18: case 19: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 20: +yy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8); +break; +case 22: +yy.addTask($$[$0-1],$$[$0]);this.$='task'; +break; +case 26: +this.$ = $$[$0-1];yy.setClickEvent($$[$0-1], $$[$0], null); +break; +case 27: +this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]); +break; +case 28: +this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], null);yy.setLink($$[$0-2],$$[$0]); +break; +case 29: +this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-2], $$[$0-1]);yy.setLink($$[$0-3],$$[$0]); +break; +case 30: +this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0], null);yy.setLink($$[$0-2],$$[$0-1]); +break; +case 31: +this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-1], $$[$0]);yy.setLink($$[$0-3],$$[$0-2]); +break; +case 32: +this.$ = $$[$0-1];yy.setLink($$[$0-1], $$[$0]); +break; +case 33: case 39: +this.$=$$[$0-1] + ' ' + $$[$0]; +break; +case 34: case 35: case 37: +this.$=$$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0]; +break; +case 36: case 38: +this.$=$$[$0-3] + ' ' + $$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0]; +break; +case 40: + yy.parseDirective('%%{', 'open_directive'); +break; +case 41: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 42: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 43: + yy.parseDirective('}%%', 'close_directive', 'gantt'); +break; +} +}, +table: [{3:1,4:2,5:$V0,29:4,39:$V1},{1:[3]},{3:6,4:2,5:$V0,29:4,39:$V1},o($V2,[2,3],{6:7}),{30:8,40:[1,9]},{40:[2,40]},{1:[2,1]},{4:29,7:[1,10],8:11,9:[1,12],10:13,11:[1,14],12:$V3,13:$V4,14:$V5,15:$V6,16:$V7,17:$V8,18:$V9,19:$Va,20:$Vb,22:$Vc,24:$Vd,25:$Ve,26:27,27:$Vf,29:4,34:$Vg,39:$V1},{31:31,32:[1,32],42:$Vh},o([32,42],[2,41]),o($V2,[2,8],{1:[2,2]}),o($V2,[2,4]),{4:29,10:34,12:$V3,13:$V4,14:$V5,15:$V6,16:$V7,17:$V8,18:$V9,19:$Va,20:$Vb,22:$Vc,24:$Vd,25:$Ve,26:27,27:$Vf,29:4,34:$Vg,39:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,9]),o($V2,[2,10]),o($V2,[2,11]),o($V2,[2,12]),o($V2,[2,13]),o($V2,[2,14]),o($V2,[2,15]),o($V2,[2,16]),{21:[1,35]},{23:[1,36]},o($V2,[2,19]),o($V2,[2,20]),o($V2,[2,21]),{28:[1,37]},o($V2,[2,23]),{35:[1,38],37:[1,39]},{11:[1,40]},{33:41,41:[1,42]},{11:[2,43]},o($V2,[2,5]),o($V2,[2,17]),o($V2,[2,18]),o($V2,[2,22]),o($V2,[2,26],{36:[1,43],37:[1,44]}),o($V2,[2,32],{35:[1,45]}),o($Vi,[2,24]),{31:46,42:$Vh},{42:[2,42]},o($V2,[2,27],{37:[1,47]}),o($V2,[2,28]),o($V2,[2,30],{36:[1,48]}),{11:[1,49]},o($V2,[2,29]),o($V2,[2,31]),o($Vi,[2,25])], +defaultActions: {5:[2,40],6:[2,1],33:[2,43],42:[2,42]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 39; +break; +case 1: this.begin('type_directive'); return 40; +break; +case 2: this.popState(); this.begin('arg_directive'); return 32; +break; +case 3: this.popState(); this.popState(); return 42; +break; +case 4:return 41; +break; +case 5: this.begin("acc_title");return 20; +break; +case 6: this.popState(); return "acc_title_value"; +break; +case 7: this.begin("acc_descr");return 22; +break; +case 8: this.popState(); return "acc_descr_value"; +break; +case 9: this.begin("acc_descr_multiline"); +break; +case 10: this.popState(); +break; +case 11:return "acc_descr_multiline_value"; +break; +case 12:/* skip comments */ +break; +case 13:/* skip comments */ +break; +case 14:/* do nothing */ +break; +case 15:return 11; +break; +case 16:/* skip whitespace */ +break; +case 17:/* skip comments */ +break; +case 18:/* skip comments */ +break; +case 19:this.begin("href"); +break; +case 20:this.popState(); +break; +case 21:return 37; +break; +case 22:this.begin("callbackname"); +break; +case 23:this.popState(); +break; +case 24:this.popState(); this.begin("callbackargs"); +break; +case 25:return 35; +break; +case 26:this.popState(); +break; +case 27:return 36; +break; +case 28:this.begin("click"); +break; +case 29:this.popState(); +break; +case 30:return 34; +break; +case 31:return 5; +break; +case 32:return 12; +break; +case 33:return 13; +break; +case 34:return 14; +break; +case 35:return 15; +break; +case 36:return 17; +break; +case 37:return 16; +break; +case 38:return 18; +break; +case 39:return 'date'; +break; +case 40:return 19; +break; +case 41:return 'accDescription' +break; +case 42:return 25; +break; +case 43:return 27; +break; +case 44:return 28; +break; +case 45:return 32; +break; +case 46:return 7; +break; +case 47:return 'INVALID'; +break; +} +}, +rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i], +conditions: {"acc_descr_multiline":{"rules":[10,11],"inclusive":false},"acc_descr":{"rules":[8],"inclusive":false},"acc_title":{"rules":[6],"inclusive":false},"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"callbackargs":{"rules":[26,27],"inclusive":false},"callbackname":{"rules":[23,24,25],"inclusive":false},"href":{"rules":[20,21],"inclusive":false},"click":{"rules":[29,30],"inclusive":false},"INITIAL":{"rules":[0,5,7,9,12,13,14,15,16,17,18,19,22,28,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?8ed1").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/git/parser/gitGraph.jison": +/*!************************************************!*\ + !*** ./src/diagrams/git/parser/gitGraph.jison ***! + \************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,7],$V2=[1,5],$V3=[1,9],$V4=[1,6],$V5=[2,6],$V6=[1,16],$V7=[6,8,14,20,22,24,25,27,29,32,35,37,49,53],$V8=[8,14,20,22,24,25,27,29,32,35,37],$V9=[8,13,14,20,22,24,25,27,29,32,35,37],$Va=[1,26],$Vb=[6,8,14,49,53],$Vc=[8,14,53],$Vd=[1,64],$Ve=[1,65],$Vf=[1,66],$Vg=[8,14,33,36,41,53]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"eol":4,"directive":5,"GG":6,"document":7,"EOF":8,":":9,"DIR":10,"options":11,"body":12,"OPT":13,"NL":14,"line":15,"statement":16,"commitStatement":17,"mergeStatement":18,"cherryPickStatement":19,"acc_title":20,"acc_title_value":21,"acc_descr":22,"acc_descr_value":23,"acc_descr_multiline_value":24,"section":25,"branchStatement":26,"CHECKOUT":27,"ID":28,"BRANCH":29,"ORDER":30,"NUM":31,"CHERRY_PICK":32,"COMMIT_ID":33,"STR":34,"MERGE":35,"COMMIT_TAG":36,"COMMIT":37,"commit_arg":38,"COMMIT_TYPE":39,"commitType":40,"COMMIT_MSG":41,"NORMAL":42,"REVERSE":43,"HIGHLIGHT":44,"openDirective":45,"typeDirective":46,"closeDirective":47,"argDirective":48,"open_directive":49,"type_directive":50,"arg_directive":51,"close_directive":52,";":53,"$accept":0,"$end":1}, +terminals_: {2:"error",6:"GG",8:"EOF",9:":",10:"DIR",13:"OPT",14:"NL",20:"acc_title",21:"acc_title_value",22:"acc_descr",23:"acc_descr_value",24:"acc_descr_multiline_value",25:"section",27:"CHECKOUT",28:"ID",29:"BRANCH",30:"ORDER",31:"NUM",32:"CHERRY_PICK",33:"COMMIT_ID",34:"STR",35:"MERGE",36:"COMMIT_TAG",37:"COMMIT",39:"COMMIT_TYPE",41:"COMMIT_MSG",42:"NORMAL",43:"REVERSE",44:"HIGHLIGHT",49:"open_directive",50:"type_directive",51:"arg_directive",52:"close_directive",53:";"}, +productions_: [0,[3,2],[3,2],[3,3],[3,4],[3,5],[7,0],[7,2],[11,2],[11,1],[12,0],[12,2],[15,2],[15,1],[16,1],[16,1],[16,1],[16,2],[16,2],[16,1],[16,1],[16,1],[16,2],[26,2],[26,4],[19,3],[18,2],[18,4],[17,2],[17,3],[17,3],[17,5],[17,5],[17,3],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,3],[17,5],[17,5],[17,5],[17,5],[17,5],[17,5],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,7],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[17,9],[38,0],[38,1],[40,1],[40,1],[40,1],[5,3],[5,5],[45,1],[46,1],[48,1],[47,1],[4,1],[4,1],[4,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 3: + return $$[$0]; +break; +case 4: + return $$[$0-1]; +break; +case 5: +yy.setDirection($$[$0-3]); return $$[$0-1]; +break; +case 7: + yy.setOptions($$[$0-1]); this.$ = $$[$0] +break; +case 8: +$$[$0-1] +=$$[$0]; this.$=$$[$0-1] +break; +case 10: +this.$ = [] +break; +case 11: +$$[$0-1].push($$[$0]); this.$=$$[$0-1]; +break; +case 12: +this.$ =$$[$0-1] +break; +case 17: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 18: case 19: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 20: +yy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8); +break; +case 22: +yy.checkout($$[$0]) +break; +case 23: +yy.branch($$[$0]) +break; +case 24: +yy.branch($$[$0-2], $$[$0]) +break; +case 25: +yy.cherryPick($$[$0]) +break; +case 26: +yy.merge($$[$0]) +break; +case 27: +yy.merge($$[$0-2], $$[$0]) +break; +case 28: +yy.commit($$[$0]) +break; +case 29: +yy.commit('','',yy.commitType.NORMAL,$$[$0]) +break; +case 30: +yy.commit('','',$$[$0],'') +break; +case 31: +yy.commit('','',$$[$0],$$[$0-2]) +break; +case 32: +yy.commit('','',$$[$0-2],$$[$0]) +break; +case 33: +yy.commit('',$$[$0],yy.commitType.NORMAL,'') +break; +case 34: +yy.commit('',$$[$0-2],yy.commitType.NORMAL,$$[$0]) +break; +case 35: +yy.commit('',$$[$0],yy.commitType.NORMAL,$$[$0-2]) +break; +case 36: +yy.commit('',$$[$0-2],$$[$0],'') +break; +case 37: +yy.commit('',$$[$0],$$[$0-2],'') +break; +case 38: +yy.commit('',$$[$0-4],$$[$0-2],$$[$0]) +break; +case 39: +yy.commit('',$$[$0-4],$$[$0],$$[$0-2]) +break; +case 40: +yy.commit('',$$[$0-2],$$[$0-4],$$[$0]) +break; +case 41: +yy.commit('',$$[$0],$$[$0-4],$$[$0-2]) +break; +case 42: +yy.commit('',$$[$0],$$[$0-2],$$[$0-4]) +break; +case 43: +yy.commit('',$$[$0-2],$$[$0],$$[$0-4]) +break; +case 44: +yy.commit($$[$0],'',yy.commitType.NORMAL,'') +break; +case 45: +yy.commit($$[$0],'',yy.commitType.NORMAL,$$[$0-2]) +break; +case 46: +yy.commit($$[$0-2],'',yy.commitType.NORMAL,$$[$0]) +break; +case 47: +yy.commit($$[$0-2],'',$$[$0],'') +break; +case 48: +yy.commit($$[$0],'',$$[$0-2],'') +break; +case 49: +yy.commit($$[$0],$$[$0-2],yy.commitType.NORMAL,'') +break; +case 50: +yy.commit($$[$0-2],$$[$0],yy.commitType.NORMAL,'') +break; +case 51: +yy.commit($$[$0-4],'',$$[$0-2],$$[$0]) +break; +case 52: +yy.commit($$[$0-4],'',$$[$0],$$[$0-2]) +break; +case 53: +yy.commit($$[$0-2],'',$$[$0-4],$$[$0]) +break; +case 54: +yy.commit($$[$0],'',$$[$0-4],$$[$0-2]) +break; +case 55: +yy.commit($$[$0],'',$$[$0-2],$$[$0-4]) +break; +case 56: +yy.commit($$[$0-2],'',$$[$0],$$[$0-4]) +break; +case 57: +yy.commit($$[$0-4],$$[$0],$$[$0-2],'') +break; +case 58: +yy.commit($$[$0-4],$$[$0-2],$$[$0],'') +break; +case 59: +yy.commit($$[$0-2],$$[$0],$$[$0-4],'') +break; +case 60: +yy.commit($$[$0],$$[$0-2],$$[$0-4],'') +break; +case 61: +yy.commit($$[$0],$$[$0-4],$$[$0-2],'') +break; +case 62: +yy.commit($$[$0-2],$$[$0-4],$$[$0],'') +break; +case 63: +yy.commit($$[$0-4],$$[$0],yy.commitType.NORMAL,$$[$0-2]) +break; +case 64: +yy.commit($$[$0-4],$$[$0-2],yy.commitType.NORMAL,$$[$0]) +break; +case 65: +yy.commit($$[$0-2],$$[$0],yy.commitType.NORMAL,$$[$0-4]) +break; +case 66: +yy.commit($$[$0],$$[$0-2],yy.commitType.NORMAL,$$[$0-4]) +break; +case 67: +yy.commit($$[$0],$$[$0-4],yy.commitType.NORMAL,$$[$0-2]) +break; +case 68: +yy.commit($$[$0-2],$$[$0-4],yy.commitType.NORMAL,$$[$0]) +break; +case 69: +yy.commit($$[$0-6],$$[$0-4],$$[$0-2],$$[$0]) +break; +case 70: +yy.commit($$[$0-6],$$[$0-4],$$[$0],$$[$0-2]) +break; +case 71: +yy.commit($$[$0-6],$$[$0-2],$$[$0-4],$$[$0]) +break; +case 72: +yy.commit($$[$0-6],$$[$0],$$[$0-4],$$[$0-2]) +break; +case 73: +yy.commit($$[$0-6],$$[$0-2],$$[$0],$$[$0-4]) +break; +case 74: +yy.commit($$[$0-6],$$[$0],$$[$0-2],$$[$0-4]) +break; +case 75: +yy.commit($$[$0-4],$$[$0-6],$$[$0-2],$$[$0]) +break; +case 76: +yy.commit($$[$0-4],$$[$0-6],$$[$0],$$[$0-2]) +break; +case 77: +yy.commit($$[$0-2],$$[$0-6],$$[$0-4],$$[$0]) +break; +case 78: +yy.commit($$[$0],$$[$0-6],$$[$0-4],$$[$0-2]) +break; +case 79: +yy.commit($$[$0-2],$$[$0-6],$$[$0],$$[$0-4]) +break; +case 80: +yy.commit($$[$0],$$[$0-6],$$[$0-2],$$[$0-4]) +break; +case 81: +yy.commit($$[$0],$$[$0-4],$$[$0-2],$$[$0-6]) +break; +case 82: +yy.commit($$[$0-2],$$[$0-4],$$[$0],$$[$0-6]) +break; +case 83: +yy.commit($$[$0],$$[$0-2],$$[$0-4],$$[$0-6]) +break; +case 84: +yy.commit($$[$0-2],$$[$0],$$[$0-4],$$[$0-6]) +break; +case 85: +yy.commit($$[$0-4],$$[$0-2],$$[$0],$$[$0-6]) +break; +case 86: +yy.commit($$[$0-4],$$[$0],$$[$0-2],$$[$0-6]) +break; +case 87: +yy.commit($$[$0-2],$$[$0-4],$$[$0-6],$$[$0]) +break; +case 88: +yy.commit($$[$0],$$[$0-4],$$[$0-6],$$[$0-2]) +break; +case 89: +yy.commit($$[$0-2],$$[$0],$$[$0-6],$$[$0-4]) +break; +case 90: +yy.commit($$[$0],$$[$0-2],$$[$0-6],$$[$0-4]) +break; +case 91: +yy.commit($$[$0-4],$$[$0-2],$$[$0-6],$$[$0]) +break; +case 92: +yy.commit($$[$0-4],$$[$0],$$[$0-6],$$[$0-2]) +break; +case 93: +this.$ = "" +break; +case 94: +this.$=$$[$0] +break; +case 95: + this.$=yy.commitType.NORMAL; +break; +case 96: + this.$=yy.commitType.REVERSE; +break; +case 97: + this.$=yy.commitType.HIGHLIGHT; +break; +case 100: + yy.parseDirective('%%{', 'open_directive'); +break; +case 101: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 102: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 103: + yy.parseDirective('}%%', 'close_directive', 'gitGraph'); +break; +} +}, +table: [{3:1,4:2,5:3,6:$V0,8:$V1,14:$V2,45:8,49:$V3,53:$V4},{1:[3]},{3:10,4:2,5:3,6:$V0,8:$V1,14:$V2,45:8,49:$V3,53:$V4},{3:11,4:2,5:3,6:$V0,8:$V1,14:$V2,45:8,49:$V3,53:$V4},{7:12,8:$V5,9:[1,13],10:[1,14],11:15,14:$V6},o($V7,[2,104]),o($V7,[2,105]),o($V7,[2,106]),{46:17,50:[1,18]},{50:[2,100]},{1:[2,1]},{1:[2,2]},{8:[1,19]},{7:20,8:$V5,11:15,14:$V6},{9:[1,21]},o($V8,[2,10],{12:22,13:[1,23]}),o($V9,[2,9]),{9:[1,25],47:24,52:$Va},o([9,52],[2,101]),{1:[2,3]},{8:[1,27]},{7:28,8:$V5,11:15,14:$V6},{8:[2,7],14:[1,31],15:29,16:30,17:32,18:33,19:34,20:[1,35],22:[1,36],24:[1,37],25:[1,38],26:39,27:[1,40],29:[1,44],32:[1,43],35:[1,42],37:[1,41]},o($V9,[2,8]),o($Vb,[2,98]),{48:45,51:[1,46]},o($Vb,[2,103]),{1:[2,4]},{8:[1,47]},o($V8,[2,11]),{4:48,8:$V1,14:$V2,53:$V4},o($V8,[2,13]),o($Vc,[2,14]),o($Vc,[2,15]),o($Vc,[2,16]),{21:[1,49]},{23:[1,50]},o($Vc,[2,19]),o($Vc,[2,20]),o($Vc,[2,21]),{28:[1,51]},o($Vc,[2,93],{38:52,33:[1,55],34:[1,57],36:[1,53],39:[1,54],41:[1,56]}),{28:[1,58]},{33:[1,59]},{28:[1,60]},{47:61,52:$Va},{52:[2,102]},{1:[2,5]},o($V8,[2,12]),o($Vc,[2,17]),o($Vc,[2,18]),o($Vc,[2,22]),o($Vc,[2,28]),{34:[1,62]},{40:63,42:$Vd,43:$Ve,44:$Vf},{34:[1,67]},{34:[1,68]},o($Vc,[2,94]),o($Vc,[2,26],{36:[1,69]}),{34:[1,70]},o($Vc,[2,23],{30:[1,71]}),o($Vb,[2,99]),o($Vc,[2,29],{33:[1,73],39:[1,72],41:[1,74]}),o($Vc,[2,30],{33:[1,76],36:[1,75],41:[1,77]}),o($Vg,[2,95]),o($Vg,[2,96]),o($Vg,[2,97]),o($Vc,[2,33],{36:[1,78],39:[1,79],41:[1,80]}),o($Vc,[2,44],{33:[1,83],36:[1,81],39:[1,82]}),{34:[1,84]},o($Vc,[2,25]),{31:[1,85]},{40:86,42:$Vd,43:$Ve,44:$Vf},{34:[1,87]},{34:[1,88]},{34:[1,89]},{34:[1,90]},{34:[1,91]},{34:[1,92]},{40:93,42:$Vd,43:$Ve,44:$Vf},{34:[1,94]},{34:[1,95]},{40:96,42:$Vd,43:$Ve,44:$Vf},{34:[1,97]},o($Vc,[2,27]),o($Vc,[2,24]),o($Vc,[2,31],{33:[1,98],41:[1,99]}),o($Vc,[2,35],{39:[1,100],41:[1,101]}),o($Vc,[2,45],{33:[1,103],39:[1,102]}),o($Vc,[2,32],{33:[1,104],41:[1,105]}),o($Vc,[2,37],{36:[1,106],41:[1,107]}),o($Vc,[2,48],{33:[1,109],36:[1,108]}),o($Vc,[2,34],{39:[1,110],41:[1,111]}),o($Vc,[2,36],{36:[1,112],41:[1,113]}),o($Vc,[2,49],{36:[1,115],39:[1,114]}),o($Vc,[2,46],{33:[1,117],39:[1,116]}),o($Vc,[2,47],{33:[1,119],36:[1,118]}),o($Vc,[2,50],{36:[1,121],39:[1,120]}),{34:[1,122]},{34:[1,123]},{40:124,42:$Vd,43:$Ve,44:$Vf},{34:[1,125]},{40:126,42:$Vd,43:$Ve,44:$Vf},{34:[1,127]},{34:[1,128]},{34:[1,129]},{34:[1,130]},{34:[1,131]},{34:[1,132]},{34:[1,133]},{40:134,42:$Vd,43:$Ve,44:$Vf},{34:[1,135]},{34:[1,136]},{34:[1,137]},{40:138,42:$Vd,43:$Ve,44:$Vf},{34:[1,139]},{40:140,42:$Vd,43:$Ve,44:$Vf},{34:[1,141]},{34:[1,142]},{34:[1,143]},{40:144,42:$Vd,43:$Ve,44:$Vf},{34:[1,145]},o($Vc,[2,42],{41:[1,146]}),o($Vc,[2,55],{33:[1,147]}),o($Vc,[2,43],{41:[1,148]}),o($Vc,[2,66],{39:[1,149]}),o($Vc,[2,56],{33:[1,150]}),o($Vc,[2,65],{39:[1,151]}),o($Vc,[2,41],{41:[1,152]}),o($Vc,[2,54],{33:[1,153]}),o($Vc,[2,40],{41:[1,154]}),o($Vc,[2,60],{36:[1,155]}),o($Vc,[2,53],{33:[1,156]}),o($Vc,[2,59],{36:[1,157]}),o($Vc,[2,39],{41:[1,158]}),o($Vc,[2,67],{39:[1,159]}),o($Vc,[2,38],{41:[1,160]}),o($Vc,[2,61],{36:[1,161]}),o($Vc,[2,62],{36:[1,162]}),o($Vc,[2,68],{39:[1,163]}),o($Vc,[2,52],{33:[1,164]}),o($Vc,[2,63],{39:[1,165]}),o($Vc,[2,51],{33:[1,166]}),o($Vc,[2,57],{36:[1,167]}),o($Vc,[2,58],{36:[1,168]}),o($Vc,[2,64],{39:[1,169]}),{34:[1,170]},{34:[1,171]},{34:[1,172]},{40:173,42:$Vd,43:$Ve,44:$Vf},{34:[1,174]},{40:175,42:$Vd,43:$Ve,44:$Vf},{34:[1,176]},{34:[1,177]},{34:[1,178]},{34:[1,179]},{34:[1,180]},{34:[1,181]},{34:[1,182]},{40:183,42:$Vd,43:$Ve,44:$Vf},{34:[1,184]},{34:[1,185]},{34:[1,186]},{40:187,42:$Vd,43:$Ve,44:$Vf},{34:[1,188]},{40:189,42:$Vd,43:$Ve,44:$Vf},{34:[1,190]},{34:[1,191]},{34:[1,192]},{40:193,42:$Vd,43:$Ve,44:$Vf},o($Vc,[2,83]),o($Vc,[2,84]),o($Vc,[2,81]),o($Vc,[2,82]),o($Vc,[2,86]),o($Vc,[2,85]),o($Vc,[2,90]),o($Vc,[2,89]),o($Vc,[2,88]),o($Vc,[2,87]),o($Vc,[2,92]),o($Vc,[2,91]),o($Vc,[2,80]),o($Vc,[2,79]),o($Vc,[2,78]),o($Vc,[2,77]),o($Vc,[2,75]),o($Vc,[2,76]),o($Vc,[2,74]),o($Vc,[2,73]),o($Vc,[2,72]),o($Vc,[2,71]),o($Vc,[2,69]),o($Vc,[2,70])], +defaultActions: {9:[2,100],10:[2,1],11:[2,2],19:[2,3],27:[2,4],46:[2,102],47:[2,5]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 49; +break; +case 1: this.begin('type_directive'); return 50; +break; +case 2: this.popState(); this.begin('arg_directive'); return 9; +break; +case 3: this.popState(); this.popState(); return 52; +break; +case 4:return 51; +break; +case 5: this.begin("acc_title");return 20; +break; +case 6: this.popState(); return "acc_title_value"; +break; +case 7: this.begin("acc_descr");return 22; +break; +case 8: this.popState(); return "acc_descr_value"; +break; +case 9: this.begin("acc_descr_multiline"); +break; +case 10: this.popState(); +break; +case 11:return "acc_descr_multiline_value"; +break; +case 12:/*{console.log('New line');return 14;}*/ return 14; +break; +case 13:/* skip all whitespace */ +break; +case 14:/* skip comments */ +break; +case 15:/* skip comments */ +break; +case 16:return 6; +break; +case 17:return 37; +break; +case 18:return 33; +break; +case 19:return 39; +break; +case 20:return 41; +break; +case 21:return 42; +break; +case 22:return 43; +break; +case 23:return 44; +break; +case 24:return 36; +break; +case 25:return 29; +break; +case 26:return 30; +break; +case 27:return 35; +break; +case 28:return 32; +break; +case 29:return 27; +break; +case 30:return 10; +break; +case 31:return 10; +break; +case 32:return 9; +break; +case 33:return 'CARET' +break; +case 34:this.begin("options"); // +break; +case 35:this.popState(); // not used anymore in the renderer, fixed for backward compatibility +break; +case 36:return 13; // +break; +case 37:this.begin("string"); +break; +case 38:this.popState(); +break; +case 39:return 34; +break; +case 40:return 31; +break; +case 41:return 28; +break; +case 42:return 8; +break; +} +}, +rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gitGraph\b)/i,/^(?:commit\b)/i,/^(?:id:)/i,/^(?:type:)/i,/^(?:msg:)/i,/^(?:NORMAL\b)/i,/^(?:REVERSE\b)/i,/^(?:HIGHLIGHT\b)/i,/^(?:tag:)/i,/^(?:branch\b)/i,/^(?:order:)/i,/^(?:merge\b)/i,/^(?:cherry-pick\b)/i,/^(?:checkout\b)/i,/^(?:LR\b)/i,/^(?:BT\b)/i,/^(?::)/i,/^(?:\^)/i,/^(?:options\r?\n)/i,/^(?:[ \r\n\t]+end\b)/i,/^(?:[\s\S]+(?=[ \r\n\t]+end))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[0-9]+)/i,/^(?:[a-zA-Z][-_\./a-zA-Z0-9]*[-_a-zA-Z0-9])/i,/^(?:$)/i], +conditions: {"acc_descr_multiline":{"rules":[10,11],"inclusive":false},"acc_descr":{"rules":[8],"inclusive":false},"acc_title":{"rules":[6],"inclusive":false},"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"options":{"rules":[35,36],"inclusive":false},"string":{"rules":[38,39],"inclusive":false},"INITIAL":{"rules":[0,5,7,9,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,37,40,41,42],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?2b40").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/info/parser/info.jison": +/*!*********************************************!*\ + !*** ./src/diagrams/info/parser/info.jison ***! + \*********************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,9,10]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"info":4,"document":5,"EOF":6,"line":7,"statement":8,"NL":9,"showInfo":10,"$accept":0,"$end":1}, +terminals_: {2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo"}, +productions_: [0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 1: + return yy; +break; +case 4: + +break; +case 6: + yy.setInfo(true); +break; +} +}, +table: [{3:1,4:[1,2]},{1:[3]},o($V0,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8]},{1:[2,1]},o($V0,[2,3]),o($V0,[2,4]),o($V0,[2,5]),o($V0,[2,6])], +defaultActions: {4:[2,1]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { + // Pre-lexer code can go here + +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0:return 4 ; +break; +case 1:return 9 ; +break; +case 2:return 'space'; +break; +case 3:return 10; +break; +case 4:return 6 ; +break; +case 5:return 'TXT' ; +break; +} +}, +rules: [/^(?:info\b)/i,/^(?:[\s\n\r]+)/i,/^(?:[\s]+)/i,/^(?:showInfo\b)/i,/^(?:$)/i,/^(?:.)/i], +conditions: {"INITIAL":{"rules":[0,1,2,3,4,5],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?c5f1").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/pie/parser/pie.jison": +/*!*******************************************!*\ + !*** ./src/diagrams/pie/parser/pie.jison ***! + \*******************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,5],$V2=[1,6],$V3=[1,7],$V4=[1,9],$V5=[1,11,13,15,17,19,20,26,27,28,29],$V6=[2,5],$V7=[1,6,11,13,15,17,19,20,26,27,28,29],$V8=[26,27,28],$V9=[2,8],$Va=[1,18],$Vb=[1,19],$Vc=[1,20],$Vd=[1,21],$Ve=[1,22],$Vf=[1,23],$Vg=[1,28],$Vh=[6,26,27,28,29]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"eol":4,"directive":5,"PIE":6,"document":7,"showData":8,"line":9,"statement":10,"txt":11,"value":12,"title":13,"title_value":14,"acc_title":15,"acc_title_value":16,"acc_descr":17,"acc_descr_value":18,"acc_descr_multiline_value":19,"section":20,"openDirective":21,"typeDirective":22,"closeDirective":23,":":24,"argDirective":25,"NEWLINE":26,";":27,"EOF":28,"open_directive":29,"type_directive":30,"arg_directive":31,"close_directive":32,"$accept":0,"$end":1}, +terminals_: {2:"error",6:"PIE",8:"showData",11:"txt",12:"value",13:"title",14:"title_value",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",24:":",26:"NEWLINE",27:";",28:"EOF",29:"open_directive",30:"type_directive",31:"arg_directive",32:"close_directive"}, +productions_: [0,[3,2],[3,2],[3,2],[3,3],[7,0],[7,2],[9,2],[10,0],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,1],[5,3],[5,5],[4,1],[4,1],[4,1],[21,1],[22,1],[25,1],[23,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 4: +yy.setShowData(true); +break; +case 7: + this.$ = $$[$0-1] +break; +case 9: + yy.addSection($$[$0-1],yy.cleanupValue($$[$0])); +break; +case 10: + this.$=$$[$0].trim();yy.setDiagramTitle(this.$); +break; +case 11: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 12: case 13: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 14: +yy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8); +break; +case 21: + yy.parseDirective('%%{', 'open_directive'); +break; +case 22: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 23: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 24: + yy.parseDirective('}%%', 'close_directive', 'pie'); +break; +} +}, +table: [{3:1,4:2,5:3,6:$V0,21:8,26:$V1,27:$V2,28:$V3,29:$V4},{1:[3]},{3:10,4:2,5:3,6:$V0,21:8,26:$V1,27:$V2,28:$V3,29:$V4},{3:11,4:2,5:3,6:$V0,21:8,26:$V1,27:$V2,28:$V3,29:$V4},o($V5,$V6,{7:12,8:[1,13]}),o($V7,[2,18]),o($V7,[2,19]),o($V7,[2,20]),{22:14,30:[1,15]},{30:[2,21]},{1:[2,1]},{1:[2,2]},o($V8,$V9,{21:8,9:16,10:17,5:24,1:[2,3],11:$Va,13:$Vb,15:$Vc,17:$Vd,19:$Ve,20:$Vf,29:$V4}),o($V5,$V6,{7:25}),{23:26,24:[1,27],32:$Vg},o([24,32],[2,22]),o($V5,[2,6]),{4:29,26:$V1,27:$V2,28:$V3},{12:[1,30]},{14:[1,31]},{16:[1,32]},{18:[1,33]},o($V8,[2,13]),o($V8,[2,14]),o($V8,[2,15]),o($V8,$V9,{21:8,9:16,10:17,5:24,1:[2,4],11:$Va,13:$Vb,15:$Vc,17:$Vd,19:$Ve,20:$Vf,29:$V4}),o($Vh,[2,16]),{25:34,31:[1,35]},o($Vh,[2,24]),o($V5,[2,7]),o($V8,[2,9]),o($V8,[2,10]),o($V8,[2,11]),o($V8,[2,12]),{23:36,32:$Vg},{32:[2,23]},o($Vh,[2,17])], +defaultActions: {9:[2,21],10:[2,1],11:[2,2],35:[2,23]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 29; +break; +case 1: this.begin('type_directive'); return 30; +break; +case 2: this.popState(); this.begin('arg_directive'); return 24; +break; +case 3: this.popState(); this.popState(); return 32; +break; +case 4:return 31; +break; +case 5:/* skip comments */ +break; +case 6:/* skip comments */{ /*console.log('');*/ } +break; +case 7:return 26; +break; +case 8:/* do nothing */ +break; +case 9:/* ignore */ +break; +case 10: this.begin("title");return 13; +break; +case 11: this.popState(); return "title_value"; +break; +case 12: this.begin("acc_title");return 15; +break; +case 13: this.popState(); return "acc_title_value"; +break; +case 14: this.begin("acc_descr");return 17; +break; +case 15: this.popState(); return "acc_descr_value"; +break; +case 16: this.begin("acc_descr_multiline"); +break; +case 17: this.popState(); +break; +case 18:return "acc_descr_multiline_value"; +break; +case 19: this.begin("string"); +break; +case 20: this.popState(); +break; +case 21: return "txt"; +break; +case 22:return 6; +break; +case 23:return 8; +break; +case 24:return "value"; +break; +case 25:return 28; +break; +} +}, +rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?:showData\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i], +conditions: {"acc_descr_multiline":{"rules":[17,18],"inclusive":false},"acc_descr":{"rules":[15],"inclusive":false},"acc_title":{"rules":[13],"inclusive":false},"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"title":{"rules":[11],"inclusive":false},"string":{"rules":[20,21],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,12,14,16,19,22,23,24,25],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?a3fa").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/requirement/parser/requirementDiagram.jison": +/*!******************************************************************!*\ + !*** ./src/diagrams/requirement/parser/requirementDiagram.jison ***! + \******************************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,5],$V2=[1,6],$V3=[1,7],$V4=[1,8],$V5=[5,6,8,14,16,18,19,40,41,42,43,44,45,53,71,72],$V6=[1,22],$V7=[2,13],$V8=[1,26],$V9=[1,27],$Va=[1,28],$Vb=[1,29],$Vc=[1,30],$Vd=[1,31],$Ve=[1,24],$Vf=[1,32],$Vg=[1,33],$Vh=[1,36],$Vi=[71,72],$Vj=[5,8,14,16,18,19,40,41,42,43,44,45,53,60,62,71,72],$Vk=[1,56],$Vl=[1,57],$Vm=[1,58],$Vn=[1,59],$Vo=[1,60],$Vp=[1,61],$Vq=[1,62],$Vr=[62,63],$Vs=[1,74],$Vt=[1,70],$Vu=[1,71],$Vv=[1,72],$Vw=[1,73],$Vx=[1,75],$Vy=[1,79],$Vz=[1,80],$VA=[1,77],$VB=[1,78],$VC=[5,8,14,16,18,19,40,41,42,43,44,45,53,71,72]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"directive":4,"NEWLINE":5,"RD":6,"diagram":7,"EOF":8,"openDirective":9,"typeDirective":10,"closeDirective":11,":":12,"argDirective":13,"acc_title":14,"acc_title_value":15,"acc_descr":16,"acc_descr_value":17,"acc_descr_multiline_value":18,"open_directive":19,"type_directive":20,"arg_directive":21,"close_directive":22,"requirementDef":23,"elementDef":24,"relationshipDef":25,"requirementType":26,"requirementName":27,"STRUCT_START":28,"requirementBody":29,"ID":30,"COLONSEP":31,"id":32,"TEXT":33,"text":34,"RISK":35,"riskLevel":36,"VERIFYMTHD":37,"verifyType":38,"STRUCT_STOP":39,"REQUIREMENT":40,"FUNCTIONAL_REQUIREMENT":41,"INTERFACE_REQUIREMENT":42,"PERFORMANCE_REQUIREMENT":43,"PHYSICAL_REQUIREMENT":44,"DESIGN_CONSTRAINT":45,"LOW_RISK":46,"MED_RISK":47,"HIGH_RISK":48,"VERIFY_ANALYSIS":49,"VERIFY_DEMONSTRATION":50,"VERIFY_INSPECTION":51,"VERIFY_TEST":52,"ELEMENT":53,"elementName":54,"elementBody":55,"TYPE":56,"type":57,"DOCREF":58,"ref":59,"END_ARROW_L":60,"relationship":61,"LINE":62,"END_ARROW_R":63,"CONTAINS":64,"COPIES":65,"DERIVES":66,"SATISFIES":67,"VERIFIES":68,"REFINES":69,"TRACES":70,"unqString":71,"qString":72,"$accept":0,"$end":1}, +terminals_: {2:"error",5:"NEWLINE",6:"RD",8:"EOF",12:":",14:"acc_title",15:"acc_title_value",16:"acc_descr",17:"acc_descr_value",18:"acc_descr_multiline_value",19:"open_directive",20:"type_directive",21:"arg_directive",22:"close_directive",28:"STRUCT_START",30:"ID",31:"COLONSEP",33:"TEXT",35:"RISK",37:"VERIFYMTHD",39:"STRUCT_STOP",40:"REQUIREMENT",41:"FUNCTIONAL_REQUIREMENT",42:"INTERFACE_REQUIREMENT",43:"PERFORMANCE_REQUIREMENT",44:"PHYSICAL_REQUIREMENT",45:"DESIGN_CONSTRAINT",46:"LOW_RISK",47:"MED_RISK",48:"HIGH_RISK",49:"VERIFY_ANALYSIS",50:"VERIFY_DEMONSTRATION",51:"VERIFY_INSPECTION",52:"VERIFY_TEST",53:"ELEMENT",56:"TYPE",58:"DOCREF",60:"END_ARROW_L",62:"LINE",63:"END_ARROW_R",64:"CONTAINS",65:"COPIES",66:"DERIVES",67:"SATISFIES",68:"VERIFIES",69:"REFINES",70:"TRACES",71:"unqString",72:"qString"}, +productions_: [0,[3,3],[3,2],[3,4],[4,3],[4,5],[4,2],[4,2],[4,1],[9,1],[10,1],[13,1],[11,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[23,5],[29,5],[29,5],[29,5],[29,5],[29,2],[29,1],[26,1],[26,1],[26,1],[26,1],[26,1],[26,1],[36,1],[36,1],[36,1],[38,1],[38,1],[38,1],[38,1],[24,5],[55,5],[55,5],[55,2],[55,1],[25,5],[25,5],[61,1],[61,1],[61,1],[61,1],[61,1],[61,1],[61,1],[27,1],[27,1],[32,1],[32,1],[34,1],[34,1],[54,1],[54,1],[57,1],[57,1],[59,1],[59,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 6: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 7: case 8: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 9: + yy.parseDirective('%%{', 'open_directive'); +break; +case 10: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 11: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 12: + yy.parseDirective('}%%', 'close_directive', 'pie'); +break; +case 13: + this.$ = [] +break; +case 19: + yy.addRequirement($$[$0-3], $$[$0-4]) +break; +case 20: + yy.setNewReqId($$[$0-2]); +break; +case 21: + yy.setNewReqText($$[$0-2]); +break; +case 22: + yy.setNewReqRisk($$[$0-2]); +break; +case 23: + yy.setNewReqVerifyMethod($$[$0-2]); +break; +case 26: + this.$=yy.RequirementType.REQUIREMENT; +break; +case 27: + this.$=yy.RequirementType.FUNCTIONAL_REQUIREMENT; +break; +case 28: + this.$=yy.RequirementType.INTERFACE_REQUIREMENT; +break; +case 29: + this.$=yy.RequirementType.PERFORMANCE_REQUIREMENT; +break; +case 30: + this.$=yy.RequirementType.PHYSICAL_REQUIREMENT; +break; +case 31: + this.$=yy.RequirementType.DESIGN_CONSTRAINT; +break; +case 32: + this.$=yy.RiskLevel.LOW_RISK; +break; +case 33: + this.$=yy.RiskLevel.MED_RISK; +break; +case 34: + this.$=yy.RiskLevel.HIGH_RISK; +break; +case 35: + this.$=yy.VerifyType.VERIFY_ANALYSIS; +break; +case 36: + this.$=yy.VerifyType.VERIFY_DEMONSTRATION; +break; +case 37: + this.$=yy.VerifyType.VERIFY_INSPECTION; +break; +case 38: + this.$=yy.VerifyType.VERIFY_TEST; +break; +case 39: + yy.addElement($$[$0-3]) +break; +case 40: + yy.setNewElementType($$[$0-2]); +break; +case 41: + yy.setNewElementDocRef($$[$0-2]); +break; +case 44: + yy.addRelationship($$[$0-2], $$[$0], $$[$0-4]) +break; +case 45: + yy.addRelationship($$[$0-2], $$[$0-4], $$[$0]) +break; +case 46: + this.$=yy.Relationships.CONTAINS; +break; +case 47: + this.$=yy.Relationships.COPIES; +break; +case 48: + this.$=yy.Relationships.DERIVES; +break; +case 49: + this.$=yy.Relationships.SATISFIES; +break; +case 50: + this.$=yy.Relationships.VERIFIES; +break; +case 51: + this.$=yy.Relationships.REFINES; +break; +case 52: + this.$=yy.Relationships.TRACES; +break; +} +}, +table: [{3:1,4:2,6:$V0,9:4,14:$V1,16:$V2,18:$V3,19:$V4},{1:[3]},{3:10,4:2,5:[1,9],6:$V0,9:4,14:$V1,16:$V2,18:$V3,19:$V4},{5:[1,11]},{10:12,20:[1,13]},{15:[1,14]},{17:[1,15]},o($V5,[2,8]),{20:[2,9]},{3:16,4:2,6:$V0,9:4,14:$V1,16:$V2,18:$V3,19:$V4},{1:[2,2]},{4:21,5:$V6,7:17,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{11:34,12:[1,35],22:$Vh},o([12,22],[2,10]),o($V5,[2,6]),o($V5,[2,7]),{1:[2,1]},{8:[1,37]},{4:21,5:$V6,7:38,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{4:21,5:$V6,7:39,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{4:21,5:$V6,7:40,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{4:21,5:$V6,7:41,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{4:21,5:$V6,7:42,8:$V7,9:4,14:$V1,16:$V2,18:$V3,19:$V4,23:18,24:19,25:20,26:23,32:25,40:$V8,41:$V9,42:$Va,43:$Vb,44:$Vc,45:$Vd,53:$Ve,71:$Vf,72:$Vg},{27:43,71:[1,44],72:[1,45]},{54:46,71:[1,47],72:[1,48]},{60:[1,49],62:[1,50]},o($Vi,[2,26]),o($Vi,[2,27]),o($Vi,[2,28]),o($Vi,[2,29]),o($Vi,[2,30]),o($Vi,[2,31]),o($Vj,[2,55]),o($Vj,[2,56]),o($V5,[2,4]),{13:51,21:[1,52]},o($V5,[2,12]),{1:[2,3]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{8:[2,17]},{8:[2,18]},{28:[1,53]},{28:[2,53]},{28:[2,54]},{28:[1,54]},{28:[2,59]},{28:[2,60]},{61:55,64:$Vk,65:$Vl,66:$Vm,67:$Vn,68:$Vo,69:$Vp,70:$Vq},{61:63,64:$Vk,65:$Vl,66:$Vm,67:$Vn,68:$Vo,69:$Vp,70:$Vq},{11:64,22:$Vh},{22:[2,11]},{5:[1,65]},{5:[1,66]},{62:[1,67]},o($Vr,[2,46]),o($Vr,[2,47]),o($Vr,[2,48]),o($Vr,[2,49]),o($Vr,[2,50]),o($Vr,[2,51]),o($Vr,[2,52]),{63:[1,68]},o($V5,[2,5]),{5:$Vs,29:69,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},{5:$Vy,39:$Vz,55:76,56:$VA,58:$VB},{32:81,71:$Vf,72:$Vg},{32:82,71:$Vf,72:$Vg},o($VC,[2,19]),{31:[1,83]},{31:[1,84]},{31:[1,85]},{31:[1,86]},{5:$Vs,29:87,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},o($VC,[2,25]),o($VC,[2,39]),{31:[1,88]},{31:[1,89]},{5:$Vy,39:$Vz,55:90,56:$VA,58:$VB},o($VC,[2,43]),o($VC,[2,44]),o($VC,[2,45]),{32:91,71:$Vf,72:$Vg},{34:92,71:[1,93],72:[1,94]},{36:95,46:[1,96],47:[1,97],48:[1,98]},{38:99,49:[1,100],50:[1,101],51:[1,102],52:[1,103]},o($VC,[2,24]),{57:104,71:[1,105],72:[1,106]},{59:107,71:[1,108],72:[1,109]},o($VC,[2,42]),{5:[1,110]},{5:[1,111]},{5:[2,57]},{5:[2,58]},{5:[1,112]},{5:[2,32]},{5:[2,33]},{5:[2,34]},{5:[1,113]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[2,38]},{5:[1,114]},{5:[2,61]},{5:[2,62]},{5:[1,115]},{5:[2,63]},{5:[2,64]},{5:$Vs,29:116,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},{5:$Vs,29:117,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},{5:$Vs,29:118,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},{5:$Vs,29:119,30:$Vt,33:$Vu,35:$Vv,37:$Vw,39:$Vx},{5:$Vy,39:$Vz,55:120,56:$VA,58:$VB},{5:$Vy,39:$Vz,55:121,56:$VA,58:$VB},o($VC,[2,20]),o($VC,[2,21]),o($VC,[2,22]),o($VC,[2,23]),o($VC,[2,40]),o($VC,[2,41])], +defaultActions: {8:[2,9],10:[2,2],16:[2,1],37:[2,3],38:[2,14],39:[2,15],40:[2,16],41:[2,17],42:[2,18],44:[2,53],45:[2,54],47:[2,59],48:[2,60],52:[2,11],93:[2,57],94:[2,58],96:[2,32],97:[2,33],98:[2,34],100:[2,35],101:[2,36],102:[2,37],103:[2,38],105:[2,61],106:[2,62],108:[2,63],109:[2,64]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 19; +break; +case 1: this.begin('type_directive'); return 20; +break; +case 2: this.popState(); this.begin('arg_directive'); return 12; +break; +case 3: this.popState(); this.popState(); return 22; +break; +case 4:return 21; +break; +case 5:return 'title'; +break; +case 6: this.begin("acc_title");return 14; +break; +case 7: this.popState(); return "acc_title_value"; +break; +case 8: this.begin("acc_descr");return 16; +break; +case 9: this.popState(); return "acc_descr_value"; +break; +case 10: this.begin("acc_descr_multiline"); +break; +case 11: this.popState(); +break; +case 12:return "acc_descr_multiline_value"; +break; +case 13:return 5; +break; +case 14:/* skip all whitespace */ +break; +case 15:/* skip comments */ +break; +case 16:/* skip comments */ +break; +case 17:return 8; +break; +case 18:return 6; +break; +case 19:return 28; +break; +case 20:return 39; +break; +case 21:return 31; +break; +case 22:return 30; +break; +case 23:return 33; +break; +case 24:return 35; +break; +case 25:return 37; +break; +case 26:return 40; +break; +case 27:return 41; +break; +case 28:return 42; +break; +case 29:return 43; +break; +case 30:return 44; +break; +case 31:return 45; +break; +case 32:return 46; +break; +case 33:return 47; +break; +case 34:return 48; +break; +case 35:return 49; +break; +case 36:return 50; +break; +case 37:return 51; +break; +case 38:return 52; +break; +case 39:return 53; +break; +case 40:return 64; +break; +case 41:return 65; +break; +case 42:return 66; +break; +case 43:return 67; +break; +case 44:return 68; +break; +case 45:return 69; +break; +case 46:return 70; +break; +case 47:return 56; +break; +case 48:return 58; +break; +case 49:return 60; +break; +case 50:return 63; +break; +case 51:return 62; +break; +case 52: this.begin("string"); +break; +case 53: this.popState(); +break; +case 54: return "qString"; +break; +case 55: yy_.yytext = yy_.yytext.trim(); return 71; +break; +} +}, +rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^\r\n\{\<\>\-\=]*)/i], +conditions: {"acc_descr_multiline":{"rules":[11,12],"inclusive":false},"acc_descr":{"rules":[9],"inclusive":false},"acc_title":{"rules":[7],"inclusive":false},"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"unqString":{"rules":[],"inclusive":false},"token":{"rules":[],"inclusive":false},"string":{"rules":[53,54],"inclusive":false},"INITIAL":{"rules":[0,5,6,8,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,55],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?ebf4").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/sequence/parser/sequenceDiagram.jison": +/*!************************************************************!*\ + !*** ./src/diagrams/sequence/parser/sequenceDiagram.jison ***! + \************************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,18],$V8=[1,19],$V9=[1,21],$Va=[1,22],$Vb=[1,23],$Vc=[1,29],$Vd=[1,30],$Ve=[1,31],$Vf=[1,32],$Vg=[1,33],$Vh=[1,34],$Vi=[1,35],$Vj=[1,36],$Vk=[1,37],$Vl=[1,38],$Vm=[1,39],$Vn=[1,40],$Vo=[1,43],$Vp=[1,44],$Vq=[1,45],$Vr=[1,46],$Vs=[1,47],$Vt=[1,48],$Vu=[1,51],$Vv=[1,4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,51,52,53,58,59,60,61,69,79],$Vw=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,53,58,59,60,61,69,79],$Vx=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,52,53,58,59,60,61,69,79],$Vy=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,51,53,58,59,60,61,69,79],$Vz=[4,5,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,53,58,59,60,61,69,79],$VA=[67,68,69],$VB=[1,121],$VC=[1,4,5,7,16,20,22,25,26,32,33,34,36,38,39,40,41,42,43,45,47,49,50,51,52,53,58,59,60,61,69,79]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"SPACE":4,"NEWLINE":5,"directive":6,"SD":7,"document":8,"line":9,"statement":10,"openDirective":11,"typeDirective":12,"closeDirective":13,":":14,"argDirective":15,"participant":16,"actor":17,"AS":18,"restOfLine":19,"participant_actor":20,"signal":21,"autonumber":22,"NUM":23,"off":24,"activate":25,"deactivate":26,"note_statement":27,"links_statement":28,"link_statement":29,"properties_statement":30,"details_statement":31,"title":32,"legacy_title":33,"acc_title":34,"acc_title_value":35,"acc_descr":36,"acc_descr_value":37,"acc_descr_multiline_value":38,"loop":39,"end":40,"rect":41,"opt":42,"alt":43,"else_sections":44,"par":45,"par_sections":46,"critical":47,"option_sections":48,"break":49,"option":50,"and":51,"else":52,"note":53,"placement":54,"text2":55,"over":56,"actor_pair":57,"links":58,"link":59,"properties":60,"details":61,"spaceList":62,",":63,"left_of":64,"right_of":65,"signaltype":66,"+":67,"-":68,"ACTOR":69,"SOLID_OPEN_ARROW":70,"DOTTED_OPEN_ARROW":71,"SOLID_ARROW":72,"DOTTED_ARROW":73,"SOLID_CROSS":74,"DOTTED_CROSS":75,"SOLID_POINT":76,"DOTTED_POINT":77,"TXT":78,"open_directive":79,"type_directive":80,"arg_directive":81,"close_directive":82,"$accept":0,"$end":1}, +terminals_: {2:"error",4:"SPACE",5:"NEWLINE",7:"SD",14:":",16:"participant",18:"AS",19:"restOfLine",20:"participant_actor",22:"autonumber",23:"NUM",24:"off",25:"activate",26:"deactivate",32:"title",33:"legacy_title",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",39:"loop",40:"end",41:"rect",42:"opt",43:"alt",45:"par",47:"critical",49:"break",50:"option",51:"and",52:"else",53:"note",56:"over",58:"links",59:"link",60:"properties",61:"details",63:",",64:"left_of",65:"right_of",67:"+",68:"-",69:"ACTOR",70:"SOLID_OPEN_ARROW",71:"DOTTED_OPEN_ARROW",72:"SOLID_ARROW",73:"DOTTED_ARROW",74:"SOLID_CROSS",75:"DOTTED_CROSS",76:"SOLID_POINT",77:"DOTTED_POINT",78:"TXT",79:"open_directive",80:"type_directive",81:"arg_directive",82:"close_directive"}, +productions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[6,4],[6,6],[10,5],[10,3],[10,5],[10,3],[10,2],[10,4],[10,3],[10,3],[10,2],[10,3],[10,3],[10,2],[10,2],[10,2],[10,2],[10,2],[10,1],[10,1],[10,2],[10,2],[10,1],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,4],[10,1],[48,1],[48,4],[46,1],[46,4],[44,1],[44,4],[27,4],[27,4],[28,3],[29,3],[30,3],[31,3],[62,2],[62,1],[57,3],[57,1],[54,1],[54,1],[21,5],[21,5],[21,4],[17,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[55,1],[11,1],[12,1],[15,1],[13,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 4: + yy.apply($$[$0]);return $$[$0]; +break; +case 5: + this.$ = [] +break; +case 6: +$$[$0-1].push($$[$0]);this.$ = $$[$0-1] +break; +case 7: case 8: + this.$ = $$[$0] +break; +case 9: + this.$=[]; +break; +case 12: +$$[$0-3].type='addParticipant';$$[$0-3].description=yy.parseMessage($$[$0-1]); this.$=$$[$0-3]; +break; +case 13: +$$[$0-1].type='addParticipant';this.$=$$[$0-1]; +break; +case 14: +$$[$0-3].type='addActor';$$[$0-3].description=yy.parseMessage($$[$0-1]); this.$=$$[$0-3]; +break; +case 15: +$$[$0-1].type='addActor'; this.$=$$[$0-1]; +break; +case 17: + this.$= {type:'sequenceIndex',sequenceIndex: Number($$[$0-2]), sequenceIndexStep:Number($$[$0-1]), sequenceVisible:true, signalType:yy.LINETYPE.AUTONUMBER}; +break; +case 18: + this.$ = {type:'sequenceIndex',sequenceIndex: Number($$[$0-1]), sequenceIndexStep:1, sequenceVisible:true, signalType:yy.LINETYPE.AUTONUMBER}; +break; +case 19: + this.$ = {type:'sequenceIndex', sequenceVisible:false, signalType:yy.LINETYPE.AUTONUMBER}; +break; +case 20: +this.$ = {type:'sequenceIndex', sequenceVisible:true, signalType:yy.LINETYPE.AUTONUMBER}; +break; +case 21: +this.$={type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]}; +break; +case 22: +this.$={type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-1]}; +break; +case 28: +yy.setDiagramTitle($$[$0].substring(6));this.$=$$[$0].substring(6); +break; +case 29: +yy.setDiagramTitle($$[$0].substring(7));this.$=$$[$0].substring(7); +break; +case 30: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 31: case 32: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 33: + + $$[$0-1].unshift({type: 'loopStart', loopText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.LOOP_START}); + $$[$0-1].push({type: 'loopEnd', loopText:$$[$0-2], signalType: yy.LINETYPE.LOOP_END}); + this.$=$$[$0-1]; +break; +case 34: + + $$[$0-1].unshift({type: 'rectStart', color:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.RECT_START }); + $$[$0-1].push({type: 'rectEnd', color:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.RECT_END }); + this.$=$$[$0-1]; +break; +case 35: + + $$[$0-1].unshift({type: 'optStart', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.OPT_START}); + $$[$0-1].push({type: 'optEnd', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.OPT_END}); + this.$=$$[$0-1]; +break; +case 36: + + // Alt start + $$[$0-1].unshift({type: 'altStart', altText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.ALT_START}); + // Content in alt is already in $$[$0-1] + // End + $$[$0-1].push({type: 'altEnd', signalType: yy.LINETYPE.ALT_END}); + this.$=$$[$0-1]; +break; +case 37: + + // Parallel start + $$[$0-1].unshift({type: 'parStart', parText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.PAR_START}); + // Content in par is already in $$[$0-1] + // End + $$[$0-1].push({type: 'parEnd', signalType: yy.LINETYPE.PAR_END}); + this.$=$$[$0-1]; +break; +case 38: + + // critical start + $$[$0-1].unshift({type: 'criticalStart', criticalText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.CRITICAL_START}); + // Content in critical is already in $$[$0-1] + // critical end + $$[$0-1].push({type: 'criticalEnd', signalType: yy.LINETYPE.CRITICAL_END}); + this.$=$$[$0-1]; +break; +case 39: + + $$[$0-1].unshift({type: 'breakStart', breakText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.BREAK_START}); + $$[$0-1].push({type: 'breakEnd', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.BREAK_END}); + this.$=$$[$0-1]; +break; +case 42: + this.$ = $$[$0-3].concat([{type: 'option', optionText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.CRITICAL_OPTION}, $$[$0]]); +break; +case 44: + this.$ = $$[$0-3].concat([{type: 'and', parText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.PAR_AND}, $$[$0]]); +break; +case 46: + this.$ = $$[$0-3].concat([{type: 'else', altText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.ALT_ELSE}, $$[$0]]); +break; +case 47: + + this.$ = [$$[$0-1], {type:'addNote', placement:$$[$0-2], actor:$$[$0-1].actor, text:$$[$0]}]; +break; +case 48: + + // Coerce actor_pair into a [to, from, ...] array + $$[$0-2] = [].concat($$[$0-1], $$[$0-1]).slice(0, 2); + $$[$0-2][0] = $$[$0-2][0].actor; + $$[$0-2][1] = $$[$0-2][1].actor; + this.$ = [$$[$0-1], {type:'addNote', placement:yy.PLACEMENT.OVER, actor:$$[$0-2].slice(0, 2), text:$$[$0]}]; +break; +case 49: + + this.$ = [$$[$0-1], {type:'addLinks', actor:$$[$0-1].actor, text:$$[$0]}]; + +break; +case 50: + + this.$ = [$$[$0-1], {type:'addALink', actor:$$[$0-1].actor, text:$$[$0]}]; + +break; +case 51: + + this.$ = [$$[$0-1], {type:'addProperties', actor:$$[$0-1].actor, text:$$[$0]}]; + +break; +case 52: + + this.$ = [$$[$0-1], {type:'addDetails', actor:$$[$0-1].actor, text:$$[$0]}]; + +break; +case 55: + this.$ = [$$[$0-2], $$[$0]]; +break; +case 56: + this.$ = $$[$0]; +break; +case 57: + this.$ = yy.PLACEMENT.LEFTOF; +break; +case 58: + this.$ = yy.PLACEMENT.RIGHTOF; +break; +case 59: + this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]}, + {type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]} + ] +break; +case 60: + this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]}, + {type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-4]} + ] +break; +case 61: + this.$ = [$$[$0-3],$$[$0-1],{type: 'addMessage', from:$$[$0-3].actor, to:$$[$0-1].actor, signalType:$$[$0-2], msg:$$[$0]}] +break; +case 62: +this.$={ type: 'addParticipant', actor:$$[$0]} +break; +case 63: + this.$ = yy.LINETYPE.SOLID_OPEN; +break; +case 64: + this.$ = yy.LINETYPE.DOTTED_OPEN; +break; +case 65: + this.$ = yy.LINETYPE.SOLID; +break; +case 66: + this.$ = yy.LINETYPE.DOTTED; +break; +case 67: + this.$ = yy.LINETYPE.SOLID_CROSS; +break; +case 68: + this.$ = yy.LINETYPE.DOTTED_CROSS; +break; +case 69: + this.$ = yy.LINETYPE.SOLID_POINT; +break; +case 70: + this.$ = yy.LINETYPE.DOTTED_POINT; +break; +case 71: +this.$ = yy.parseMessage($$[$0].trim().substring(1)) +break; +case 72: + yy.parseDirective('%%{', 'open_directive'); +break; +case 73: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 74: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 75: + yy.parseDirective('}%%', 'close_directive', 'sequence'); +break; +} +}, +table: [{3:1,4:$V0,5:$V1,6:4,7:$V2,11:6,79:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,11:6,79:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,11:6,79:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,11:6,79:$V3},o([1,4,5,16,20,22,25,26,32,33,34,36,38,39,41,42,43,45,47,49,53,58,59,60,61,69,79],$V4,{8:11}),{12:12,80:[1,13]},{80:[2,72]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{13:49,14:[1,50],82:$Vu},o([14,82],[2,73]),o($Vv,[2,6]),{6:41,10:52,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},o($Vv,[2,8]),o($Vv,[2,9]),{17:53,69:$Vt},{17:54,69:$Vt},{5:[1,55]},{5:[1,58],23:[1,56],24:[1,57]},{17:59,69:$Vt},{17:60,69:$Vt},{5:[1,61]},{5:[1,62]},{5:[1,63]},{5:[1,64]},{5:[1,65]},o($Vv,[2,28]),o($Vv,[2,29]),{35:[1,66]},{37:[1,67]},o($Vv,[2,32]),{19:[1,68]},{19:[1,69]},{19:[1,70]},{19:[1,71]},{19:[1,72]},{19:[1,73]},{19:[1,74]},o($Vv,[2,40]),{66:75,70:[1,76],71:[1,77],72:[1,78],73:[1,79],74:[1,80],75:[1,81],76:[1,82],77:[1,83]},{54:84,56:[1,85],64:[1,86],65:[1,87]},{17:88,69:$Vt},{17:89,69:$Vt},{17:90,69:$Vt},{17:91,69:$Vt},o([5,18,63,70,71,72,73,74,75,76,77,78],[2,62]),{5:[1,92]},{15:93,81:[1,94]},{5:[2,75]},o($Vv,[2,7]),{5:[1,96],18:[1,95]},{5:[1,98],18:[1,97]},o($Vv,[2,16]),{5:[1,100],23:[1,99]},{5:[1,101]},o($Vv,[2,20]),{5:[1,102]},{5:[1,103]},o($Vv,[2,23]),o($Vv,[2,24]),o($Vv,[2,25]),o($Vv,[2,26]),o($Vv,[2,27]),o($Vv,[2,30]),o($Vv,[2,31]),o($Vw,$V4,{8:104}),o($Vw,$V4,{8:105}),o($Vw,$V4,{8:106}),o($Vx,$V4,{44:107,8:108}),o($Vy,$V4,{46:109,8:110}),o($Vz,$V4,{48:111,8:112}),o($Vw,$V4,{8:113}),{17:116,67:[1,114],68:[1,115],69:$Vt},o($VA,[2,63]),o($VA,[2,64]),o($VA,[2,65]),o($VA,[2,66]),o($VA,[2,67]),o($VA,[2,68]),o($VA,[2,69]),o($VA,[2,70]),{17:117,69:$Vt},{17:119,57:118,69:$Vt},{69:[2,57]},{69:[2,58]},{55:120,78:$VB},{55:122,78:$VB},{55:123,78:$VB},{55:124,78:$VB},o($VC,[2,10]),{13:125,82:$Vu},{82:[2,74]},{19:[1,126]},o($Vv,[2,13]),{19:[1,127]},o($Vv,[2,15]),{5:[1,128]},o($Vv,[2,18]),o($Vv,[2,19]),o($Vv,[2,21]),o($Vv,[2,22]),{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[1,129],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[1,130],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[1,131],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{40:[1,132]},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[2,45],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,52:[1,133],53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{40:[1,134]},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[2,43],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,51:[1,135],53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{40:[1,136]},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[2,41],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,50:[1,137],53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{4:$V5,5:$V6,6:41,9:14,10:16,11:6,16:$V7,17:42,20:$V8,21:20,22:$V9,25:$Va,26:$Vb,27:24,28:25,29:26,30:27,31:28,32:$Vc,33:$Vd,34:$Ve,36:$Vf,38:$Vg,39:$Vh,40:[1,138],41:$Vi,42:$Vj,43:$Vk,45:$Vl,47:$Vm,49:$Vn,53:$Vo,58:$Vp,59:$Vq,60:$Vr,61:$Vs,69:$Vt,79:$V3},{17:139,69:$Vt},{17:140,69:$Vt},{55:141,78:$VB},{55:142,78:$VB},{55:143,78:$VB},{63:[1,144],78:[2,56]},{5:[2,49]},{5:[2,71]},{5:[2,50]},{5:[2,51]},{5:[2,52]},{5:[1,145]},{5:[1,146]},{5:[1,147]},o($Vv,[2,17]),o($Vv,[2,33]),o($Vv,[2,34]),o($Vv,[2,35]),o($Vv,[2,36]),{19:[1,148]},o($Vv,[2,37]),{19:[1,149]},o($Vv,[2,38]),{19:[1,150]},o($Vv,[2,39]),{55:151,78:$VB},{55:152,78:$VB},{5:[2,61]},{5:[2,47]},{5:[2,48]},{17:153,69:$Vt},o($VC,[2,11]),o($Vv,[2,12]),o($Vv,[2,14]),o($Vx,$V4,{8:108,44:154}),o($Vy,$V4,{8:110,46:155}),o($Vz,$V4,{8:112,48:156}),{5:[2,59]},{5:[2,60]},{78:[2,55]},{40:[2,46]},{40:[2,44]},{40:[2,42]}], +defaultActions: {7:[2,72],8:[2,1],9:[2,2],10:[2,3],51:[2,75],86:[2,57],87:[2,58],94:[2,74],120:[2,49],121:[2,71],122:[2,50],123:[2,51],124:[2,52],141:[2,61],142:[2,47],143:[2,48],151:[2,59],152:[2,60],153:[2,55],154:[2,46],155:[2,44],156:[2,42]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 79; +break; +case 1: this.begin('type_directive'); return 80; +break; +case 2: this.popState(); this.begin('arg_directive'); return 14; +break; +case 3: this.popState(); this.popState(); return 82; +break; +case 4:return 81; +break; +case 5:return 5; +break; +case 6:/* skip all whitespace */ +break; +case 7:/* skip same-line whitespace */ +break; +case 8:/* skip comments */ +break; +case 9:/* skip comments */ +break; +case 10:/* skip comments */ +break; +case 11:return 23; +break; +case 12: this.begin('ID'); return 16; +break; +case 13: this.begin('ID'); return 20; +break; +case 14: yy_.yytext = yy_.yytext.trim(); this.begin('ALIAS'); return 69; +break; +case 15: this.popState(); this.popState(); this.begin('LINE'); return 18; +break; +case 16: this.popState(); this.popState(); return 5; +break; +case 17: this.begin('LINE'); return 39; +break; +case 18: this.begin('LINE'); return 41; +break; +case 19: this.begin('LINE'); return 42; +break; +case 20: this.begin('LINE'); return 43; +break; +case 21: this.begin('LINE'); return 52; +break; +case 22: this.begin('LINE'); return 45; +break; +case 23: this.begin('LINE'); return 51; +break; +case 24: this.begin('LINE'); return 47; +break; +case 25: this.begin('LINE'); return 50; +break; +case 26: this.begin('LINE'); return 49; +break; +case 27: this.popState(); return 19; +break; +case 28:return 40; +break; +case 29:return 64; +break; +case 30:return 65; +break; +case 31:return 58; +break; +case 32:return 59; +break; +case 33:return 60; +break; +case 34:return 61; +break; +case 35:return 56; +break; +case 36:return 53; +break; +case 37: this.begin('ID'); return 25; +break; +case 38: this.begin('ID'); return 26; +break; +case 39:return 32; +break; +case 40:return 33; +break; +case 41: this.begin("acc_title");return 34; +break; +case 42: this.popState(); return "acc_title_value"; +break; +case 43: this.begin("acc_descr");return 36; +break; +case 44: this.popState(); return "acc_descr_value"; +break; +case 45: this.begin("acc_descr_multiline"); +break; +case 46: this.popState(); +break; +case 47:return "acc_descr_multiline_value"; +break; +case 48:return 7; +break; +case 49:return 22; +break; +case 50:return 24; +break; +case 51:return 63; +break; +case 52:return 5; +break; +case 53: yy_.yytext = yy_.yytext.trim(); return 69; +break; +case 54:return 72; +break; +case 55:return 73; +break; +case 56:return 70; +break; +case 57:return 71; +break; +case 58:return 74; +break; +case 59:return 75; +break; +case 60:return 76; +break; +case 61:return 77; +break; +case 62:return 78; +break; +case 63:return 67; +break; +case 64:return 68; +break; +case 65:return 5; +break; +case 66:return 'INVALID'; +break; +} +}, +rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i], +conditions: {"acc_descr_multiline":{"rules":[46,47],"inclusive":false},"acc_descr":{"rules":[44],"inclusive":false},"acc_title":{"rules":[42],"inclusive":false},"open_directive":{"rules":[1,8],"inclusive":false},"type_directive":{"rules":[2,3,8],"inclusive":false},"arg_directive":{"rules":[3,4,8],"inclusive":false},"ID":{"rules":[7,8,14],"inclusive":false},"ALIAS":{"rules":[7,8,15,16],"inclusive":false},"LINE":{"rules":[7,8,27],"inclusive":false},"INITIAL":{"rules":[0,5,6,8,9,10,11,12,13,17,18,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,45,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?e940").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/state/parser/stateDiagram.jison": +/*!******************************************************!*\ + !*** ./src/diagrams/state/parser/stateDiagram.jison ***! + \******************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,33],$Vc=[1,23],$Vd=[1,24],$Ve=[1,25],$Vf=[1,26],$Vg=[1,27],$Vh=[1,30],$Vi=[1,31],$Vj=[1,32],$Vk=[1,35],$Vl=[1,36],$Vm=[1,37],$Vn=[1,38],$Vo=[1,34],$Vp=[1,41],$Vq=[1,4,5,14,15,17,19,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50],$Vr=[1,4,5,12,13,14,15,17,19,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50],$Vs=[1,4,5,7,14,15,17,19,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50],$Vt=[4,5,14,15,17,19,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"SPACE":4,"NL":5,"directive":6,"SD":7,"document":8,"line":9,"statement":10,"idStatement":11,"DESCR":12,"-->":13,"HIDE_EMPTY":14,"scale":15,"WIDTH":16,"COMPOSIT_STATE":17,"STRUCT_START":18,"STRUCT_STOP":19,"STATE_DESCR":20,"AS":21,"ID":22,"FORK":23,"JOIN":24,"CHOICE":25,"CONCURRENT":26,"note":27,"notePosition":28,"NOTE_TEXT":29,"direction":30,"acc_title":31,"acc_title_value":32,"acc_descr":33,"acc_descr_value":34,"acc_descr_multiline_value":35,"openDirective":36,"typeDirective":37,"closeDirective":38,":":39,"argDirective":40,"direction_tb":41,"direction_bt":42,"direction_rl":43,"direction_lr":44,"eol":45,";":46,"EDGE_STATE":47,"left_of":48,"right_of":49,"open_directive":50,"type_directive":51,"arg_directive":52,"close_directive":53,"$accept":0,"$end":1}, +terminals_: {2:"error",4:"SPACE",5:"NL",7:"SD",12:"DESCR",13:"-->",14:"HIDE_EMPTY",15:"scale",16:"WIDTH",17:"COMPOSIT_STATE",18:"STRUCT_START",19:"STRUCT_STOP",20:"STATE_DESCR",21:"AS",22:"ID",23:"FORK",24:"JOIN",25:"CHOICE",26:"CONCURRENT",27:"note",29:"NOTE_TEXT",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",39:":",41:"direction_tb",42:"direction_bt",43:"direction_rl",44:"direction_lr",46:";",47:"EDGE_STATE",48:"left_of",49:"right_of",50:"open_directive",51:"type_directive",52:"arg_directive",53:"close_directive"}, +productions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,1],[10,2],[10,1],[10,4],[10,3],[10,6],[10,1],[10,1],[10,1],[10,1],[10,4],[10,4],[10,1],[10,1],[10,2],[10,2],[10,1],[6,3],[6,5],[30,1],[30,1],[30,1],[30,1],[45,1],[45,1],[11,1],[11,1],[28,1],[28,1],[36,1],[37,1],[40,1],[38,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 4: + /*console.warn('Root document', $$[$0]);*/ yy.setRootDoc($$[$0]);return $$[$0]; +break; +case 5: + this.$ = [] +break; +case 6: + + if($$[$0]!='nl'){ + $$[$0-1].push($$[$0]);this.$ = $$[$0-1] + } + // console.warn('Got document',$$[$0-1], $$[$0]); + +break; +case 7: case 8: + this.$ = $$[$0] +break; +case 9: + this.$='nl'; +break; +case 10: + /*console.warn('got id and descr', $$[$0]);*/this.$={ stmt: 'state', id: $$[$0], type: 'default', description: ''}; +break; +case 11: + /*console.warn('got id and descr', $$[$0-1], $$[$0].trim());*/this.$={ stmt: 'state', id: $$[$0-1], type: 'default', description: yy.trimColon($$[$0])}; +break; +case 12: + + /*console.warn('got id', $$[$0-2]);yy.addRelation($$[$0-2], $$[$0]);*/ + this.$={ stmt: 'relation', state1: { stmt: 'state', id: $$[$0-2], type: 'default', description: '' }, state2:{ stmt: 'state', id: $$[$0] ,type: 'default', description: ''}}; + +break; +case 13: + + /*yy.addRelation($$[$0-3], $$[$0-1], $$[$0].substr(1).trim());*/ + this.$={ stmt: 'relation', state1: { stmt: 'state', id: $$[$0-3], type: 'default', description: '' }, state2:{ stmt: 'state', id: $$[$0-1] ,type: 'default', description: ''}, description: $$[$0].substr(1).trim()}; + +break; +case 17: + + /* console.warn('Adding document for state without id ', $$[$0-3]);*/ + this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: '', doc: $$[$0-1] } + +break; +case 18: + + var id=$$[$0]; + var description = $$[$0-2].trim(); + if($$[$0].match(':')){ + var parts = $$[$0].split(':'); + id=parts[0]; + description = [description, parts[1]]; + } + this.$={stmt: 'state', id: id, type: 'default', description: description}; + + +break; +case 19: + + // console.warn('Adding document for state with id zxzx', $$[$0-3], $$[$0-2], yy.getDirection()); yy.addDocument($$[$0-3]); + this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: $$[$0-5], doc: $$[$0-1] } + +break; +case 20: + + this.$={ stmt: 'state', id: $$[$0], type: 'fork' } + +break; +case 21: + + this.$={ stmt: 'state', id: $$[$0], type: 'join' } + +break; +case 22: + + this.$={ stmt: 'state', id: $$[$0], type: 'choice' } + +break; +case 23: + + this.$={ stmt: 'state', id: yy.getDividerId(), type: 'divider' } + +break; +case 24: + + /* console.warn('got NOTE, position: ', $$[$0-2].trim(), 'id = ', $$[$0-1].trim(), 'note: ', $$[$0]);*/ + this.$={ stmt: 'state', id: $$[$0-1].trim(), note:{position: $$[$0-2].trim(), text: $$[$0].trim()}}; + +break; +case 28: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 29: case 30: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 33: + yy.setDirection('TB');this.$={stmt:'dir', value:'TB'}; +break; +case 34: + yy.setDirection('BT');this.$={stmt:'dir', value:'BT'}; +break; +case 35: + yy.setDirection('RL'); this.$={stmt:'dir', value:'RL'}; +break; +case 36: + yy.setDirection('LR');this.$={stmt:'dir', value:'LR'}; +break; +case 39: case 40: +this.$=$$[$0]; +break; +case 43: + yy.parseDirective('%%{', 'open_directive'); +break; +case 44: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 45: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 46: + yy.parseDirective('}%%', 'close_directive', 'state'); +break; +} +}, +table: [{3:1,4:$V0,5:$V1,6:4,7:$V2,36:6,50:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,36:6,50:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,36:6,50:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,36:6,50:$V3},o([1,4,5,14,15,17,20,22,23,24,25,26,27,31,33,35,41,42,43,44,47,50],$V4,{8:11}),{37:12,51:[1,13]},{51:[2,43]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:$Vh,33:$Vi,35:$Vj,36:6,41:$Vk,42:$Vl,43:$Vm,44:$Vn,47:$Vo,50:$V3},{38:39,39:[1,40],53:$Vp},o([39,53],[2,44]),o($Vq,[2,6]),{6:28,10:42,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:$Vh,33:$Vi,35:$Vj,36:6,41:$Vk,42:$Vl,43:$Vm,44:$Vn,47:$Vo,50:$V3},o($Vq,[2,8]),o($Vq,[2,9]),o($Vq,[2,10],{12:[1,43],13:[1,44]}),o($Vq,[2,14]),{16:[1,45]},o($Vq,[2,16],{18:[1,46]}),{21:[1,47]},o($Vq,[2,20]),o($Vq,[2,21]),o($Vq,[2,22]),o($Vq,[2,23]),{28:48,29:[1,49],48:[1,50],49:[1,51]},o($Vq,[2,26]),o($Vq,[2,27]),{32:[1,52]},{34:[1,53]},o($Vq,[2,30]),o($Vr,[2,39]),o($Vr,[2,40]),o($Vq,[2,33]),o($Vq,[2,34]),o($Vq,[2,35]),o($Vq,[2,36]),o($Vs,[2,31]),{40:54,52:[1,55]},o($Vs,[2,46]),o($Vq,[2,7]),o($Vq,[2,11]),{11:56,22:$Vb,47:$Vo},o($Vq,[2,15]),o($Vt,$V4,{8:57}),{22:[1,58]},{22:[1,59]},{21:[1,60]},{22:[2,41]},{22:[2,42]},o($Vq,[2,28]),o($Vq,[2,29]),{38:61,53:$Vp},{53:[2,45]},o($Vq,[2,12],{12:[1,62]}),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,63],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:$Vh,33:$Vi,35:$Vj,36:6,41:$Vk,42:$Vl,43:$Vm,44:$Vn,47:$Vo,50:$V3},o($Vq,[2,18],{18:[1,64]}),{29:[1,65]},{22:[1,66]},o($Vs,[2,32]),o($Vq,[2,13]),o($Vq,[2,17]),o($Vt,$V4,{8:67}),o($Vq,[2,24]),o($Vq,[2,25]),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,68],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:$Vh,33:$Vi,35:$Vj,36:6,41:$Vk,42:$Vl,43:$Vm,44:$Vn,47:$Vo,50:$V3},o($Vq,[2,19])], +defaultActions: {7:[2,43],8:[2,1],9:[2,2],10:[2,3],50:[2,41],51:[2,42],55:[2,45]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0:return 41; +break; +case 1:return 42; +break; +case 2:return 43; +break; +case 3:return 44; +break; +case 4: this.begin('open_directive'); return 50; +break; +case 5: this.begin('type_directive'); return 51; +break; +case 6: this.popState(); this.begin('arg_directive'); return 39; +break; +case 7: this.popState(); this.popState(); return 53; +break; +case 8:return 52; +break; +case 9:/* skip comments */ +break; +case 10:/* skip comments */{ /*console.log('Crap after close');*/ } +break; +case 11:return 5; +break; +case 12:/* skip all whitespace */ +break; +case 13:/* skip same-line whitespace */ +break; +case 14:/* skip comments */ +break; +case 15:/* skip comments */ +break; +case 16: this.pushState('SCALE'); /* console.log('Got scale', yy_.yytext);*/ return 15; +break; +case 17:return 16; +break; +case 18:this.popState(); +break; +case 19: this.begin("acc_title");return 31; +break; +case 20: this.popState(); return "acc_title_value"; +break; +case 21: this.begin("acc_descr");return 33; +break; +case 22: this.popState(); return "acc_descr_value"; +break; +case 23: this.begin("acc_descr_multiline"); +break; +case 24: this.popState(); +break; +case 25:return "acc_descr_multiline_value"; +break; +case 26: /*console.log('Starting STATE zxzx'+yy.getDirection());*/this.pushState('STATE'); +break; +case 27:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim(); /*console.warn('Fork Fork: ',yy_.yytext);*/return 23; +break; +case 28:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24; +break; +case 29:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25; +break; +case 30:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Fork: ',yy_.yytext);*/return 23; +break; +case 31:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24; +break; +case 32:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25; +break; +case 33: return 41; +break; +case 34: return 42; +break; +case 35: return 43; +break; +case 36: return 44; +break; +case 37: /*console.log('Starting STATE_STRING zxzx');*/this.begin("STATE_STRING"); +break; +case 38:this.popState();this.pushState('STATE_ID');return "AS"; +break; +case 39:this.popState();/* console.log('STATE_ID', yy_.yytext);*/return "ID"; +break; +case 40:this.popState(); +break; +case 41: /*console.log('Long description:', yy_.yytext);*/return "STATE_DESCR"; +break; +case 42:/*console.log('COMPOSIT_STATE', yy_.yytext);*/return 17; +break; +case 43:this.popState(); +break; +case 44:this.popState();this.pushState('struct'); /*console.log('begin struct', yy_.yytext);*/return 18; +break; +case 45: /*console.log('Ending struct');*/ this.popState(); return 19; +break; +case 46:/* nothing */ +break; +case 47: this.begin('NOTE'); return 27; +break; +case 48: this.popState();this.pushState('NOTE_ID');return 48; +break; +case 49: this.popState();this.pushState('NOTE_ID');return 49; +break; +case 50: this.popState();this.pushState('FLOATING_NOTE'); +break; +case 51:this.popState();this.pushState('FLOATING_NOTE_ID');return "AS"; +break; +case 52:/**/ +break; +case 53: /*console.log('Floating note text: ', yy_.yytext);*/return "NOTE_TEXT"; +break; +case 54:this.popState();/*console.log('Floating note ID', yy_.yytext);*/return "ID"; +break; +case 55: this.popState();this.pushState('NOTE_TEXT');/*console.log('Got ID for note', yy_.yytext);*/return 22; +break; +case 56: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.substr(2).trim();return 29; +break; +case 57: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.slice(0,-8).trim();return 29; +break; +case 58: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7; +break; +case 59: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7; +break; +case 60: /*console.log('HIDE_EMPTY', yy_.yytext,'#');*/return 14; +break; +case 61: /*console.log('EDGE_STATE=',yy_.yytext);*/ return 47; +break; +case 62: /*console.log('=>ID=',yy_.yytext);*/ return 22; +break; +case 63: yy_.yytext = yy_.yytext.trim(); /*console.log('Descr = ', yy_.yytext);*/ return 12; +break; +case 64:return 13; +break; +case 65:return 26; +break; +case 66:return 5; +break; +case 67:return 'INVALID'; +break; +} +}, +rules: [/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?:$)/i,/^(?:.)/i], +conditions: {"LINE":{"rules":[13,14],"inclusive":false},"close_directive":{"rules":[13,14],"inclusive":false},"arg_directive":{"rules":[7,8,13,14],"inclusive":false},"type_directive":{"rules":[6,7,13,14],"inclusive":false},"open_directive":{"rules":[5,13,14],"inclusive":false},"struct":{"rules":[13,14,26,33,34,35,36,45,46,47,61,62,63,64,65],"inclusive":false},"FLOATING_NOTE_ID":{"rules":[54],"inclusive":false},"FLOATING_NOTE":{"rules":[51,52,53],"inclusive":false},"NOTE_TEXT":{"rules":[56,57],"inclusive":false},"NOTE_ID":{"rules":[55],"inclusive":false},"NOTE":{"rules":[48,49,50],"inclusive":false},"acc_descr_multiline":{"rules":[24,25],"inclusive":false},"acc_descr":{"rules":[22],"inclusive":false},"acc_title":{"rules":[20],"inclusive":false},"SCALE":{"rules":[17,18],"inclusive":false},"ALIAS":{"rules":[],"inclusive":false},"STATE_ID":{"rules":[39],"inclusive":false},"STATE_STRING":{"rules":[40,41],"inclusive":false},"FORK_STATE":{"rules":[],"inclusive":false},"STATE":{"rules":[13,14,27,28,29,30,31,32,37,38,42,43,44],"inclusive":false},"ID":{"rules":[13,14],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,9,10,11,12,14,15,16,19,21,23,26,44,47,58,59,60,61,62,63,64,66,67],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?a3b8").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./src/diagrams/user-journey/parser/journey.jison": +/*!********************************************************!*\ + !*** ./src/diagrams/user-journey/parser/journey.jison ***! + \********************************************************/ +/***/ ((module, exports, __webpack_require__) => { + +/* module decorator */ module = __webpack_require__.nmd(module); +/* parser generated by jison 0.4.18 */ +/* + Returns a Parser object of the following structure: + + Parser: { + yy: {} + } + + Parser.prototype: { + yy: {}, + trace: function(), + symbols_: {associative list: name ==> number}, + terminals_: {associative list: number ==> name}, + productions_: [...], + performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), + table: [...], + defaultActions: {...}, + parseError: function(str, hash), + parse: function(input), + + lexer: { + EOF: 1, + parseError: function(str, hash), + setInput: function(input), + input: function(), + unput: function(str), + more: function(), + less: function(n), + pastInput: function(), + upcomingInput: function(), + showPosition: function(), + test_match: function(regex_match_array, rule_index), + next: function(), + lex: function(), + begin: function(condition), + popState: function(), + _currentRules: function(), + topState: function(), + pushState: function(condition), + + options: { + ranges: boolean (optional: true ==> token location info will include a .range[] member) + flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) + backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) + }, + + performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), + rules: [...], + conditions: {associative list: name ==> set}, + } + } + + + token location info (@$, _$, etc.): { + first_line: n, + last_line: n, + first_column: n, + last_column: n, + range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) + } + + + the parseError function receives a 'hash' object with these members for lexer and parser errors: { + text: (matched text) + token: (the produced terminal token, if any) + line: (yylineno) + } + while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { + loc: (yylloc) + expected: (string describing the set of expected tokens) + recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) + } +*/ +var parser = (function(){ +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,5],$V2=[6,9,11,17,18,20,22,23,24,26],$V3=[1,15],$V4=[1,16],$V5=[1,17],$V6=[1,18],$V7=[1,19],$V8=[1,20],$V9=[1,24],$Va=[4,6,9,11,17,18,20,22,23,24,26]; +var parser = {trace: function trace () { }, +yy: {}, +symbols_: {"error":2,"start":3,"journey":4,"document":5,"EOF":6,"directive":7,"line":8,"SPACE":9,"statement":10,"NEWLINE":11,"openDirective":12,"typeDirective":13,"closeDirective":14,":":15,"argDirective":16,"title":17,"acc_title":18,"acc_title_value":19,"acc_descr":20,"acc_descr_value":21,"acc_descr_multiline_value":22,"section":23,"taskName":24,"taskData":25,"open_directive":26,"type_directive":27,"arg_directive":28,"close_directive":29,"$accept":0,"$end":1}, +terminals_: {2:"error",4:"journey",6:"EOF",9:"SPACE",11:"NEWLINE",15:":",17:"title",18:"acc_title",19:"acc_title_value",20:"acc_descr",21:"acc_descr_value",22:"acc_descr_multiline_value",23:"section",24:"taskName",25:"taskData",26:"open_directive",27:"type_directive",28:"arg_directive",29:"close_directive"}, +productions_: [0,[3,3],[3,2],[5,0],[5,2],[8,2],[8,1],[8,1],[8,1],[7,4],[7,6],[10,1],[10,2],[10,2],[10,1],[10,1],[10,2],[10,1],[12,1],[13,1],[16,1],[14,1]], +performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { +/* this == yyval */ + +var $0 = $$.length - 1; +switch (yystate) { +case 1: + return $$[$0-1]; +break; +case 3: + this.$ = [] +break; +case 4: +$$[$0-1].push($$[$0]);this.$ = $$[$0-1] +break; +case 5: case 6: + this.$ = $$[$0] +break; +case 7: case 8: + this.$=[]; +break; +case 11: +yy.setDiagramTitle($$[$0].substr(6));this.$=$$[$0].substr(6); +break; +case 12: + this.$=$$[$0].trim();yy.setAccTitle(this.$); +break; +case 13: case 14: + this.$=$$[$0].trim();yy.setAccDescription(this.$); +break; +case 15: +yy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8); +break; +case 16: +yy.addTask($$[$0-1], $$[$0]);this.$='task'; +break; +case 18: + yy.parseDirective('%%{', 'open_directive'); +break; +case 19: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 20: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 21: + yy.parseDirective('}%%', 'close_directive', 'journey'); +break; +} +}, +table: [{3:1,4:$V0,7:3,12:4,26:$V1},{1:[3]},o($V2,[2,3],{5:6}),{3:7,4:$V0,7:3,12:4,26:$V1},{13:8,27:[1,9]},{27:[2,18]},{6:[1,10],7:21,8:11,9:[1,12],10:13,11:[1,14],12:4,17:$V3,18:$V4,20:$V5,22:$V6,23:$V7,24:$V8,26:$V1},{1:[2,2]},{14:22,15:[1,23],29:$V9},o([15,29],[2,19]),o($V2,[2,8],{1:[2,1]}),o($V2,[2,4]),{7:21,10:25,12:4,17:$V3,18:$V4,20:$V5,22:$V6,23:$V7,24:$V8,26:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,11]),{19:[1,26]},{21:[1,27]},o($V2,[2,14]),o($V2,[2,15]),{25:[1,28]},o($V2,[2,17]),{11:[1,29]},{16:30,28:[1,31]},{11:[2,21]},o($V2,[2,5]),o($V2,[2,12]),o($V2,[2,13]),o($V2,[2,16]),o($Va,[2,9]),{14:32,29:$V9},{29:[2,20]},{11:[1,33]},o($Va,[2,10])], +defaultActions: {5:[2,18],7:[2,2],24:[2,21],31:[2,20]}, +parseError: function parseError (str, hash) { + if (hash.recoverable) { + this.trace(str); + } else { + var error = new Error(str); + error.hash = hash; + throw error; + } +}, +parse: function parse(input) { + var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; + var args = lstack.slice.call(arguments, 1); + var lexer = Object.create(this.lexer); + var sharedState = { yy: {} }; + for (var k in this.yy) { + if (Object.prototype.hasOwnProperty.call(this.yy, k)) { + sharedState.yy[k] = this.yy[k]; + } + } + lexer.setInput(input, sharedState.yy); + sharedState.yy.lexer = lexer; + sharedState.yy.parser = this; + if (typeof lexer.yylloc == 'undefined') { + lexer.yylloc = {}; + } + var yyloc = lexer.yylloc; + lstack.push(yyloc); + var ranges = lexer.options && lexer.options.ranges; + if (typeof sharedState.yy.parseError === 'function') { + this.parseError = sharedState.yy.parseError; + } else { + this.parseError = Object.getPrototypeOf(this).parseError; + } + function popStack(n) { + stack.length = stack.length - 2 * n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + function lex() { + var token; + token = tstack.pop() || lexer.lex() || EOF; + if (typeof token !== 'number') { + if (token instanceof Array) { + tstack = token; + token = tstack.pop(); + } + token = self.symbols_[token] || token; + } + return token; + } + var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; + while (true) { + state = stack[stack.length - 1]; + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol === null || typeof symbol == 'undefined') { + symbol = lex(); + } + action = table[state] && table[state][symbol]; + } + if (typeof action === 'undefined' || !action.length || !action[0]) { + var errStr = ''; + expected = []; + for (p in table[state]) { + if (this.terminals_[p] && p > TERROR) { + expected.push('\'' + this.terminals_[p] + '\''); + } + } + if (lexer.showPosition) { + errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + } else { + errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + } + this.parseError(errStr, { + text: lexer.match, + token: this.terminals_[symbol] || symbol, + line: lexer.yylineno, + loc: yyloc, + expected: expected + }); + } + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); + } + switch (action[0]) { + case 1: + stack.push(symbol); + vstack.push(lexer.yytext); + lstack.push(lexer.yylloc); + stack.push(action[1]); + symbol = null; + if (!preErrorSymbol) { + yyleng = lexer.yyleng; + yytext = lexer.yytext; + yylineno = lexer.yylineno; + yyloc = lexer.yylloc; + if (recovering > 0) { + recovering--; + } + } else { + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + case 2: + len = this.productions_[action[1]][1]; + yyval.$ = vstack[vstack.length - len]; + yyval._$ = { + first_line: lstack[lstack.length - (len || 1)].first_line, + last_line: lstack[lstack.length - 1].last_line, + first_column: lstack[lstack.length - (len || 1)].first_column, + last_column: lstack[lstack.length - 1].last_column + }; + if (ranges) { + yyval._$.range = [ + lstack[lstack.length - (len || 1)].range[0], + lstack[lstack.length - 1].range[1] + ]; + } + r = this.performAction.apply(yyval, [ + yytext, + yyleng, + yylineno, + sharedState.yy, + action[1], + vstack, + lstack + ].concat(args)); + if (typeof r !== 'undefined') { + return r; + } + if (len) { + stack = stack.slice(0, -1 * len * 2); + vstack = vstack.slice(0, -1 * len); + lstack = lstack.slice(0, -1 * len); + } + stack.push(this.productions_[action[1]][0]); + vstack.push(yyval.$); + lstack.push(yyval._$); + newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; + stack.push(newState); + break; + case 3: + return true; + } + } + return true; +}}; + +/* generated by jison-lex 0.3.4 */ +var lexer = (function(){ +var lexer = ({ + +EOF:1, + +parseError:function parseError(str, hash) { + if (this.yy.parser) { + this.yy.parser.parseError(str, hash); + } else { + throw new Error(str); + } + }, + +// resets the lexer, sets new input +setInput:function (input, yy) { + this.yy = yy || this.yy || {}; + this._input = input; + this._more = this._backtrack = this.done = false; + this.yylineno = this.yyleng = 0; + this.yytext = this.matched = this.match = ''; + this.conditionStack = ['INITIAL']; + this.yylloc = { + first_line: 1, + first_column: 0, + last_line: 1, + last_column: 0 + }; + if (this.options.ranges) { + this.yylloc.range = [0,0]; + } + this.offset = 0; + return this; + }, + +// consumes and returns one char from the input +input:function () { + var ch = this._input[0]; + this.yytext += ch; + this.yyleng++; + this.offset++; + this.match += ch; + this.matched += ch; + var lines = ch.match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno++; + this.yylloc.last_line++; + } else { + this.yylloc.last_column++; + } + if (this.options.ranges) { + this.yylloc.range[1]++; + } + + this._input = this._input.slice(1); + return ch; + }, + +// unshifts one char (or a string) into the input +unput:function (ch) { + var len = ch.length; + var lines = ch.split(/(?:\r\n?|\n)/g); + + this._input = ch + this._input; + this.yytext = this.yytext.substr(0, this.yytext.length - len); + //this.yyleng -= len; + this.offset -= len; + var oldLines = this.match.split(/(?:\r\n?|\n)/g); + this.match = this.match.substr(0, this.match.length - 1); + this.matched = this.matched.substr(0, this.matched.length - 1); + + if (lines.length - 1) { + this.yylineno -= lines.length - 1; + } + var r = this.yylloc.range; + + this.yylloc = { + first_line: this.yylloc.first_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.first_column, + last_column: lines ? + (lines.length === oldLines.length ? this.yylloc.first_column : 0) + + oldLines[oldLines.length - lines.length].length - lines[0].length : + this.yylloc.first_column - len + }; + + if (this.options.ranges) { + this.yylloc.range = [r[0], r[0] + this.yyleng - len]; + } + this.yyleng = this.yytext.length; + return this; + }, + +// When called from action, caches matched text and appends it on next action +more:function () { + this._more = true; + return this; + }, + +// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. +reject:function () { + if (this.options.backtrack_lexer) { + this._backtrack = true; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + + } + return this; + }, + +// retain first n characters of the match +less:function (n) { + this.unput(this.match.slice(n)); + }, + +// displays already matched input, i.e. for error messages +pastInput:function () { + var past = this.matched.substr(0, this.matched.length - this.match.length); + return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); + }, + +// displays upcoming input, i.e. for error messages +upcomingInput:function () { + var next = this.match; + if (next.length < 20) { + next += this._input.substr(0, 20-next.length); + } + return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); + }, + +// displays the character position where the lexing error occurred, i.e. for error messages +showPosition:function () { + var pre = this.pastInput(); + var c = new Array(pre.length + 1).join("-"); + return pre + this.upcomingInput() + "\n" + c + "^"; + }, + +// test the lexed token: return FALSE when not a match, otherwise return token +test_match:function(match, indexed_rule) { + var token, + lines, + backup; + + if (this.options.backtrack_lexer) { + // save context + backup = { + yylineno: this.yylineno, + yylloc: { + first_line: this.yylloc.first_line, + last_line: this.last_line, + first_column: this.yylloc.first_column, + last_column: this.yylloc.last_column + }, + yytext: this.yytext, + match: this.match, + matches: this.matches, + matched: this.matched, + yyleng: this.yyleng, + offset: this.offset, + _more: this._more, + _input: this._input, + yy: this.yy, + conditionStack: this.conditionStack.slice(0), + done: this.done + }; + if (this.options.ranges) { + backup.yylloc.range = this.yylloc.range.slice(0); + } + } + + lines = match[0].match(/(?:\r\n?|\n).*/g); + if (lines) { + this.yylineno += lines.length; + } + this.yylloc = { + first_line: this.yylloc.last_line, + last_line: this.yylineno + 1, + first_column: this.yylloc.last_column, + last_column: lines ? + lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : + this.yylloc.last_column + match[0].length + }; + this.yytext += match[0]; + this.match += match[0]; + this.matches = match; + this.yyleng = this.yytext.length; + if (this.options.ranges) { + this.yylloc.range = [this.offset, this.offset += this.yyleng]; + } + this._more = false; + this._backtrack = false; + this._input = this._input.slice(match[0].length); + this.matched += match[0]; + token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); + if (this.done && this._input) { + this.done = false; + } + if (token) { + return token; + } else if (this._backtrack) { + // recover context + for (var k in backup) { + this[k] = backup[k]; + } + return false; // rule action called reject() implying the next rule should be tested instead. + } + return false; + }, + +// return next match in input +next:function () { + if (this.done) { + return this.EOF; + } + if (!this._input) { + this.done = true; + } + + var token, + match, + tempMatch, + index; + if (!this._more) { + this.yytext = ''; + this.match = ''; + } + var rules = this._currentRules(); + for (var i = 0; i < rules.length; i++) { + tempMatch = this._input.match(this.rules[rules[i]]); + if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { + match = tempMatch; + index = i; + if (this.options.backtrack_lexer) { + token = this.test_match(tempMatch, rules[i]); + if (token !== false) { + return token; + } else if (this._backtrack) { + match = false; + continue; // rule action called reject() implying a rule MISmatch. + } else { + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + } else if (!this.options.flex) { + break; + } + } + } + if (match) { + token = this.test_match(match, rules[index]); + if (token !== false) { + return token; + } + // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) + return false; + } + if (this._input === "") { + return this.EOF; + } else { + return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { + text: "", + token: null, + line: this.yylineno + }); + } + }, + +// return next match that has a token +lex:function lex () { + var r = this.next(); + if (r) { + return r; + } else { + return this.lex(); + } + }, + +// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) +begin:function begin (condition) { + this.conditionStack.push(condition); + }, + +// pop the previously active lexer condition state off the condition stack +popState:function popState () { + var n = this.conditionStack.length - 1; + if (n > 0) { + return this.conditionStack.pop(); + } else { + return this.conditionStack[0]; + } + }, + +// produce the lexer rule set which is active for the currently active lexer condition state +_currentRules:function _currentRules () { + if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { + return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; + } else { + return this.conditions["INITIAL"].rules; + } + }, + +// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available +topState:function topState (n) { + n = this.conditionStack.length - 1 - Math.abs(n || 0); + if (n >= 0) { + return this.conditionStack[n]; + } else { + return "INITIAL"; + } + }, + +// alias for begin(condition) +pushState:function pushState (condition) { + this.begin(condition); + }, + +// return the number of states currently on the stack +stateStackSize:function stateStackSize() { + return this.conditionStack.length; + }, +options: {"case-insensitive":true}, +performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { +var YYSTATE=YY_START; +switch($avoiding_name_collisions) { +case 0: this.begin('open_directive'); return 26; +break; +case 1: this.begin('type_directive'); return 27; +break; +case 2: this.popState(); this.begin('arg_directive'); return 15; +break; +case 3: this.popState(); this.popState(); return 29; +break; +case 4:return 28; +break; +case 5:/* skip comments */ +break; +case 6:/* skip comments */ +break; +case 7:return 11; +break; +case 8:/* skip whitespace */ +break; +case 9:/* skip comments */ +break; +case 10:return 4; +break; +case 11:return 17; +break; +case 12: this.begin("acc_title");return 18; +break; +case 13: this.popState(); return "acc_title_value"; +break; +case 14: this.begin("acc_descr");return 20; +break; +case 15: this.popState(); return "acc_descr_value"; +break; +case 16: this.begin("acc_descr_multiline"); +break; +case 17: this.popState(); +break; +case 18:return "acc_descr_multiline_value"; +break; +case 19:return 23; +break; +case 20:return 24; +break; +case 21:return 25; +break; +case 22:return 15; +break; +case 23:return 6; +break; +case 24:return 'INVALID'; +break; +} +}, +rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i], +conditions: {"open_directive":{"rules":[1],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"acc_descr_multiline":{"rules":[17,18],"inclusive":false},"acc_descr":{"rules":[15],"inclusive":false},"acc_title":{"rules":[13],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,11,12,14,16,19,20,21,22,23,24],"inclusive":true}} +}); +return lexer; +})(); +parser.lexer = lexer; +function Parser () { + this.yy = {}; +} +Parser.prototype = parser;parser.Parser = Parser; +return new Parser; +})(); + + +if (true) { +exports.parser = parser; +exports.Parser = parser.Parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); }; +exports.main = function commonjsMain (args) { + if (!args[1]) { + console.log('Usage: '+args[0]+' FILE'); + process.exit(1); + } + var source = (__webpack_require__(/*! fs */ "?0f62").readFileSync)((__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize)(args[1]), "utf8"); + return exports.parser.parse(source); +}; +if ( true && __webpack_require__.c[__webpack_require__.s] === module) { + exports.main(process.argv.slice(1)); +} +} + +/***/ }), + +/***/ "./node_modules/@braintree/sanitize-url/dist/index.js": +/*!************************************************************!*\ + !*** ./node_modules/@braintree/sanitize-url/dist/index.js ***! + \************************************************************/ +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.sanitizeUrl = void 0; +var invalidProtocolRegex = /^([^\w]*)(javascript|data|vbscript)/im; +var htmlEntitiesRegex = /&#(\w+)(^\w|;)?/g; +var ctrlCharactersRegex = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim; +var urlSchemeRegex = /^([^:]+):/gm; +var relativeFirstCharacters = [".", "/"]; +function isRelativeUrlWithoutProtocol(url) { + return relativeFirstCharacters.indexOf(url[0]) > -1; +} +// adapted from https://stackoverflow.com/a/29824550/2601552 +function decodeHtmlCharacters(str) { + return str.replace(htmlEntitiesRegex, function (match, dec) { + return String.fromCharCode(dec); + }); +} +function sanitizeUrl(url) { + var sanitizedUrl = decodeHtmlCharacters(url || "") + .replace(ctrlCharactersRegex, "") + .trim(); + if (!sanitizedUrl) { + return "about:blank"; + } + if (isRelativeUrlWithoutProtocol(sanitizedUrl)) { + return sanitizedUrl; + } + var urlSchemeParseResults = sanitizedUrl.match(urlSchemeRegex); + if (!urlSchemeParseResults) { + return sanitizedUrl; + } + var urlScheme = urlSchemeParseResults[0]; + if (invalidProtocolRegex.test(urlScheme)) { + return "about:blank"; + } + return sanitizedUrl; +} +exports.sanitizeUrl = sanitizeUrl; + + +/***/ }), + +/***/ "./src/accessibility.js": +/*!******************************!*\ + !*** ./src/accessibility.js ***! + \******************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ addSVGAccessibilityFields) +/* harmony export */ }); +/** + * This method will add a basic title and description element to a chart. The yy parser will need to + * respond to getAccTitle and getAccDescription, where the title is the title element on the chart, + * which is generally not displayed and the accDescription is the description element on the chart, + * which is never displayed. + * + * The following charts display their title as a visual and accessibility element: gantt + * + * @param yy_parser + * @param svg + * @param id + */ +function addSVGAccessibilityFields(yy_parser, svg, id) { + if (typeof svg.insert === 'undefined') { + return; + } + + var title_string = yy_parser.getAccTitle(); + var description = yy_parser.getAccDescription(); + svg.attr('role', 'img').attr('aria-labelledby', 'chart-title-' + id + ' chart-desc-' + id); + svg.insert('desc', ':first-child').attr('id', 'chart-desc-' + id).text(description); + svg.insert('title', ':first-child').attr('id', 'chart-title-' + id).text(title_string); +} + +/***/ }), + +/***/ "./src/commonDb.js": +/*!*************************!*\ + !*** ./src/commonDb.js ***! + \*************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "clear": () => (/* binding */ clear), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "getAccDescription": () => (/* binding */ getAccDescription), +/* harmony export */ "getAccTitle": () => (/* binding */ getAccTitle), +/* harmony export */ "getDiagramTitle": () => (/* binding */ getDiagramTitle), +/* harmony export */ "setAccDescription": () => (/* binding */ setAccDescription), +/* harmony export */ "setAccTitle": () => (/* binding */ setAccTitle), +/* harmony export */ "setDiagramTitle": () => (/* binding */ setDiagramTitle) +/* harmony export */ }); +/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diagrams/common/common */ "./src/diagrams/common/common.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./config */ "./src/config.js"); + + +var title = ''; +var diagramTitle = ''; +var description = ''; + +var sanitizeText = function sanitizeText(txt) { + return (0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_0__.sanitizeText)(txt, (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)()); +}; + +var clear = function clear() { + title = ''; + description = ''; + diagramTitle = ''; +}; +var setAccTitle = function setAccTitle(txt) { + title = sanitizeText(txt).replace(/^\s+/g, ''); +}; +var getAccTitle = function getAccTitle() { + return title || diagramTitle; +}; +var setAccDescription = function setAccDescription(txt) { + description = sanitizeText(txt).replace(/\n\s+/g, '\n'); +}; +var getAccDescription = function getAccDescription() { + return description; +}; +var setDiagramTitle = function setDiagramTitle(txt) { + diagramTitle = sanitizeText(txt); +}; +var getDiagramTitle = function getDiagramTitle() { + return diagramTitle; +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + setAccTitle: setAccTitle, + getAccTitle: getAccTitle, + setDiagramTitle: setDiagramTitle, + getDiagramTitle: getDiagramTitle, + getAccDescription: getAccDescription, + setAccDescription: setAccDescription, + clear: clear +}); + +/***/ }), + +/***/ "./src/config.js": +/*!***********************!*\ + !*** ./src/config.js ***! + \***********************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "addDirective": () => (/* binding */ addDirective), +/* harmony export */ "defaultConfig": () => (/* binding */ defaultConfig), +/* harmony export */ "getConfig": () => (/* binding */ getConfig), +/* harmony export */ "getSiteConfig": () => (/* binding */ getSiteConfig), +/* harmony export */ "reset": () => (/* binding */ reset), +/* harmony export */ "sanitize": () => (/* binding */ sanitize), +/* harmony export */ "saveConfigFromInitialize": () => (/* binding */ saveConfigFromInitialize), +/* harmony export */ "setConfig": () => (/* binding */ setConfig), +/* harmony export */ "setSiteConfig": () => (/* binding */ setSiteConfig), +/* harmony export */ "updateCurrentConfig": () => (/* binding */ updateCurrentConfig), +/* harmony export */ "updateSiteConfig": () => (/* binding */ updateSiteConfig) +/* harmony export */ }); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./src/utils.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./logger */ "./src/logger.js"); +/* harmony import */ var _themes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./themes */ "./src/themes/index.js"); +/* harmony import */ var _defaultConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultConfig */ "./src/defaultConfig.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + + + + + +var defaultConfig = Object.freeze(_defaultConfig__WEBPACK_IMPORTED_MODULE_0__["default"]); +var siteConfig = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, defaultConfig); +var configFromInitialize; +var directives = []; +var currentConfig = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, defaultConfig); +var updateCurrentConfig = function updateCurrentConfig(siteCfg, _directives) { + // start with config beeing the siteConfig + var cfg = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, siteCfg); // let sCfg = assignWithDepth(defaultConfig, siteConfigDelta); + // Join directives + + var sumOfDirectives = {}; + + for (var i = 0; i < _directives.length; i++) { + var d = _directives[i]; + sanitize(d); // Apply the data from the directive where the the overrides the themeVariables + + sumOfDirectives = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(sumOfDirectives, d); + } + + cfg = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(cfg, sumOfDirectives); + + if (sumOfDirectives.theme && _themes__WEBPACK_IMPORTED_MODULE_2__["default"][sumOfDirectives.theme]) { + var tmpConfigFromInitialize = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, configFromInitialize); + var themeVariables = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(tmpConfigFromInitialize.themeVariables || {}, sumOfDirectives.themeVariables); + cfg.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_2__["default"][cfg.theme].getThemeVariables(themeVariables); + } + + currentConfig = cfg; + return cfg; +}; +/** + * ## setSiteConfig + * + * | Function | Description | Type | Values | + * | ------------- | ------------------------------------- | ----------- | --------------------------------------- | + * | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array | + * + * **Notes:** Sets the siteConfig. The siteConfig is a protected configuration for repeat use. Calls + * to reset() will reset the currentConfig to siteConfig. Calls to reset(configApi.defaultConfig) + * will reset siteConfig and currentConfig to the defaultConfig Note: currentConfig is set in this + * function _Default value: At default, will mirror Global Config_ + * + * @param conf - The base currentConfig to use as siteConfig + * @returns {object} - The siteConfig + */ + +var setSiteConfig = function setSiteConfig(conf) { + siteConfig = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, defaultConfig); + siteConfig = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(siteConfig, conf); + + if (conf.theme && _themes__WEBPACK_IMPORTED_MODULE_2__["default"][conf.theme]) { + siteConfig.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_2__["default"][conf.theme].getThemeVariables(conf.themeVariables); + } + + currentConfig = updateCurrentConfig(siteConfig, directives); + return siteConfig; +}; +var saveConfigFromInitialize = function saveConfigFromInitialize(conf) { + configFromInitialize = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, conf); +}; +var updateSiteConfig = function updateSiteConfig(conf) { + siteConfig = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(siteConfig, conf); + updateCurrentConfig(siteConfig, directives); + return siteConfig; +}; +/** + * ## getSiteConfig + * + * | Function | Description | Type | Values | + * | ------------- | ------------------------------------------------- | ----------- | -------------------------------- | + * | setSiteConfig | Returns the current siteConfig base configuration | Get Request | Returns Any Values in siteConfig | + * + * **Notes**: Returns **any** values in siteConfig. + * + * @returns {object} - The siteConfig + */ + +var getSiteConfig = function getSiteConfig() { + return (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, siteConfig); +}; +/** + * ## setConfig + * + * | Function | Description | Type | Values | + * | ------------- | ------------------------------------- | ----------- | --------------------------------------- | + * | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array | + * + * **Notes**: Sets the currentConfig. The parameter conf is sanitized based on the siteConfig.secure + * keys. Any values found in conf with key found in siteConfig.secure will be replaced with the + * corresponding siteConfig value. + * + * @param {any} conf - The potential currentConfig + * @returns {any} - The currentConfig merged with the sanitized conf + */ + +var setConfig = function setConfig(conf) { + // sanitize(conf); + // Object.keys(conf).forEach(key => { + // const manipulator = manipulators[key]; + // conf[key] = manipulator ? manipulator(conf[key]) : conf[key]; + // }); + (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)(currentConfig, conf); + return getConfig(); +}; +/** + * ## getConfig + * + * | Function | Description | Type | Return Values | + * | --------- | ------------------------- | ----------- | ------------------------------ | + * | getConfig | Obtains the currentConfig | Get Request | Any Values from current Config | + * + * **Notes**: Returns **any** the currentConfig + * + * @returns {any} - The currentConfig + */ + +var getConfig = function getConfig() { + return (0,_utils__WEBPACK_IMPORTED_MODULE_1__.assignWithDepth)({}, currentConfig); +}; +/** + * ## sanitize + * + * | Function | Description | Type | Values | + * | -------- | -------------------------------------- | ----------- | ------ | + * | sanitize | Sets the siteConfig to desired values. | Put Request | None | + * + * Ensures options parameter does not attempt to override siteConfig secure keys **Notes**: modifies + * options in-place + * + * @param {any} options - The potential setConfig parameter + */ + +var sanitize = function sanitize(options) { + // Checking that options are not in the list of excluded options + Object.keys(siteConfig.secure).forEach(function (key) { + if (typeof options[siteConfig.secure[key]] !== 'undefined') { + // DO NOT attempt to print options[siteConfig.secure[key]] within `${}` as a malicious script + // can exploit the logger's attempt to stringify the value and execute arbitrary code + _logger__WEBPACK_IMPORTED_MODULE_3__.log.debug("Denied attempt to modify a secure key ".concat(siteConfig.secure[key]), options[siteConfig.secure[key]]); + delete options[siteConfig.secure[key]]; + } + }); // Check that there no attempts of prototype pollution + + Object.keys(options).forEach(function (key) { + if (key.indexOf('__') === 0) { + delete options[key]; + } + }); // Check that there no attempts of xss, there should be no tags at all in the directive + // blocking data urls as base64 urls can contain svgs with inline script tags + + Object.keys(options).forEach(function (key) { + if (typeof options[key] === 'string') { + if (options[key].indexOf('<') > -1 || options[key].indexOf('>') > -1 || options[key].indexOf('url(data:') > -1) { + delete options[key]; + } + } + + if (_typeof(options[key]) === 'object') { + sanitize(options[key]); + } + }); +}; +/** + * Pushes in a directive to the configuration + * + * @param {object} directive The directive to push in + */ + +var addDirective = function addDirective(directive) { + if (directive.fontFamily) { + if (!directive.themeVariables) { + directive.themeVariables = { + fontFamily: directive.fontFamily + }; + } else { + if (!directive.themeVariables.fontFamily) { + directive.themeVariables = { + fontFamily: directive.fontFamily + }; + } + } + } + + directives.push(directive); + updateCurrentConfig(siteConfig, directives); +}; +/** + * ## reset + * + * | Function | Description | Type | Required | Values | + * | -------- | ---------------------------- | ----------- | -------- | ------ | + * | reset | Resets currentConfig to conf | Put Request | Required | None | + * + * ## conf + * + * | Parameter | Description | Type | Required | Values | + * | --------- | -------------------------------------------------------------- | ---------- | -------- | -------------------------------------------- | + * | conf | base set of values, which currentConfig could be **reset** to. | Dictionary | Required | Any Values, with respect to the secure Array | + * + * **Notes**: (default: current siteConfig ) (optional, default `getSiteConfig()`) + */ + +var reset = function reset() { + // Replace current config with siteConfig + directives = []; + updateCurrentConfig(siteConfig, directives); +}; + +/***/ }), + +/***/ "./src/dagre-wrapper/clusters.js": +/*!***************************************!*\ + !*** ./src/dagre-wrapper/clusters.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "clear": () => (/* binding */ clear), +/* harmony export */ "getClusterTitleWidth": () => (/* binding */ getClusterTitleWidth), +/* harmony export */ "insertCluster": () => (/* binding */ insertCluster), +/* harmony export */ "positionCluster": () => (/* binding */ positionCluster) +/* harmony export */ }); +/* harmony import */ var _intersect_intersect_rect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./intersect/intersect-rect */ "./src/dagre-wrapper/intersect/intersect-rect.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); +/* harmony import */ var _createLabel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./createLabel */ "./src/dagre-wrapper/createLabel.js"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "./node_modules/d3/src/index.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../config */ "./src/config.js"); +/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js"); + + + + + + + +var rect = function rect(parent, node) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Creating subgraph rect for ', node.id, node); // Add outer g element + + var shapeSvg = parent.insert('g').attr('class', 'cluster' + (node.class ? ' ' + node.class : '')).attr('id', node.id); // add the rect + + var rect = shapeSvg.insert('rect', ':first-child'); // Create the label and insert it after the rect + + var label = shapeSvg.insert('g').attr('class', 'cluster-label'); + var text = label.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_2__["default"])(node.labelText, node.labelStyle, undefined, true)); // Get the size of the label + + var bbox = text.getBBox(); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_4__.getConfig)().flowchart.htmlLabels)) { + var div = text.children[0]; + var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(text); + bbox = div.getBoundingClientRect(); + dv.attr('width', bbox.width); + dv.attr('height', bbox.height); + } + + var padding = 0 * node.padding; + var halfPadding = padding / 2; + var width = node.width <= bbox.width + padding ? bbox.width + padding : node.width; + + if (node.width <= bbox.width + padding) { + node.diff = (bbox.width - node.width) / 2 - node.padding / 2; + } else { + node.diff = -node.padding / 2; + } + + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Data ', node, JSON.stringify(node)); // center the rect around its coordinate + + rect.attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('x', node.x - width / 2).attr('y', node.y - node.height / 2 - halfPadding).attr('width', width).attr('height', node.height + padding); // Center the label + + label.attr('transform', 'translate(' + (node.x - bbox.width / 2) + ', ' + (node.y - node.height / 2 + node.padding / 3) + ')'); + var rectBox = rect.node().getBBox(); + node.width = rectBox.width; + node.height = rectBox.height; + + node.intersect = function (point) { + return (0,_intersect_intersect_rect__WEBPACK_IMPORTED_MODULE_5__["default"])(node, point); + }; + + return shapeSvg; +}; +/** + * Non visible cluster where the note is group with its + * + * @param {any} parent + * @param {any} node + * @returns {any} ShapeSvg + */ + + +var noteGroup = function noteGroup(parent, node) { + // Add outer g element + var shapeSvg = parent.insert('g').attr('class', 'note-cluster').attr('id', node.id); // add the rect + + var rect = shapeSvg.insert('rect', ':first-child'); + var padding = 0 * node.padding; + var halfPadding = padding / 2; // center the rect around its coordinate + + rect.attr('rx', node.rx).attr('ry', node.ry).attr('x', node.x - node.width / 2 - halfPadding).attr('y', node.y - node.height / 2 - halfPadding).attr('width', node.width + padding).attr('height', node.height + padding).attr('fill', 'none'); + var rectBox = rect.node().getBBox(); + node.width = rectBox.width; + node.height = rectBox.height; + + node.intersect = function (point) { + return (0,_intersect_intersect_rect__WEBPACK_IMPORTED_MODULE_5__["default"])(node, point); + }; + + return shapeSvg; +}; + +var roundedWithTitle = function roundedWithTitle(parent, node) { + // Add outer g element + var shapeSvg = parent.insert('g').attr('class', node.classes).attr('id', node.id); // add the rect + + var rect = shapeSvg.insert('rect', ':first-child'); // Create the label and insert it after the rect + + var label = shapeSvg.insert('g').attr('class', 'cluster-label'); + var innerRect = shapeSvg.append('rect'); + var text = label.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_2__["default"])(node.labelText, node.labelStyle, undefined, true)); // Get the size of the label + + var bbox = text.getBBox(); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_4__.getConfig)().flowchart.htmlLabels)) { + var div = text.children[0]; + var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(text); + bbox = div.getBoundingClientRect(); + dv.attr('width', bbox.width); + dv.attr('height', bbox.height); + } + + bbox = text.getBBox(); + var padding = 0 * node.padding; + var halfPadding = padding / 2; + var width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width; + + if (node.width <= bbox.width + node.padding) { + node.diff = (bbox.width + node.padding * 0 - node.width) / 2; + } else { + node.diff = -node.padding / 2; + } // center the rect around its coordinate + + + rect.attr('class', 'outer').attr('x', node.x - width / 2 - halfPadding).attr('y', node.y - node.height / 2 - halfPadding).attr('width', width + padding).attr('height', node.height + padding); + innerRect.attr('class', 'inner').attr('x', node.x - width / 2 - halfPadding).attr('y', node.y - node.height / 2 - halfPadding + bbox.height - 1).attr('width', width + padding).attr('height', node.height + padding - bbox.height - 3); // Center the label + + label.attr('transform', 'translate(' + (node.x - bbox.width / 2) + ', ' + (node.y - node.height / 2 - node.padding / 3 + ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_4__.getConfig)().flowchart.htmlLabels) ? 5 : 3)) + ')'); + var rectBox = rect.node().getBBox(); + node.height = rectBox.height; + + node.intersect = function (point) { + return (0,_intersect_intersect_rect__WEBPACK_IMPORTED_MODULE_5__["default"])(node, point); + }; + + return shapeSvg; +}; + +var divider = function divider(parent, node) { + // Add outer g element + var shapeSvg = parent.insert('g').attr('class', node.classes).attr('id', node.id); // add the rect + + var rect = shapeSvg.insert('rect', ':first-child'); + var padding = 0 * node.padding; + var halfPadding = padding / 2; // center the rect around its coordinate + + rect.attr('class', 'divider').attr('x', node.x - node.width / 2 - halfPadding).attr('y', node.y - node.height / 2).attr('width', node.width + padding).attr('height', node.height + padding); + var rectBox = rect.node().getBBox(); + node.width = rectBox.width; + node.height = rectBox.height; + node.diff = -node.padding / 2; + + node.intersect = function (point) { + return (0,_intersect_intersect_rect__WEBPACK_IMPORTED_MODULE_5__["default"])(node, point); + }; + + return shapeSvg; +}; + +var shapes = { + rect: rect, + roundedWithTitle: roundedWithTitle, + noteGroup: noteGroup, + divider: divider +}; +var clusterElems = {}; +var insertCluster = function insertCluster(elem, node) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Inserting cluster'); + var shape = node.shape || 'rect'; + clusterElems[node.id] = shapes[shape](elem, node); +}; +var getClusterTitleWidth = function getClusterTitleWidth(elem, node) { + var label = (0,_createLabel__WEBPACK_IMPORTED_MODULE_2__["default"])(node.labelText, node.labelStyle, undefined, true); + elem.node().appendChild(label); + var width = label.getBBox().width; + elem.node().removeChild(label); + return width; +}; +var clear = function clear() { + clusterElems = {}; +}; +var positionCluster = function positionCluster(node) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Position cluster (' + node.id + ', ' + node.x + ', ' + node.y + ')'); + var el = clusterElems[node.id]; + el.attr('transform', 'translate(' + node.x + ', ' + node.y + ')'); +}; + +/***/ }), + +/***/ "./src/dagre-wrapper/createLabel.js": +/*!******************************************!*\ + !*** ./src/dagre-wrapper/createLabel.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "./node_modules/d3/src/index.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config */ "./src/config.js"); +/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + + + // eslint-disable-line + + + + +var sanitizeTxt = function sanitizeTxt(txt) { + return (0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.sanitizeText)(txt, (0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)()); +}; +/** + * @param dom + * @param styleFn + */ + + +function applyStyle(dom, styleFn) { + if (styleFn) { + dom.attr('style', styleFn); + } +} +/** + * @param {any} node + * @returns {SVGForeignObjectElement} Node + */ + + +function addHtmlLabel(node) { + var fo = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(document.createElementNS('http://www.w3.org/2000/svg', 'foreignObject')); + var div = fo.append('xhtml:div'); + var label = node.label; + var labelClass = node.isNode ? 'nodeLabel' : 'edgeLabel'; + div.html('' + label + ''); + applyStyle(div, node.labelStyle); + div.style('display', 'inline-block'); // Fix for firefox + + div.style('white-space', 'nowrap'); + div.attr('xmlns', 'http://www.w3.org/1999/xhtml'); + return fo.node(); +} + +var createLabel = function createLabel(_vertexText, style, isTitle, isNode) { + var vertexText = _vertexText || ''; + if (_typeof(vertexText) === 'object') vertexText = vertexText[0]; + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { + // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that? + vertexText = vertexText.replace(/\\n|\n/g, '
'); + _logger__WEBPACK_IMPORTED_MODULE_3__.log.info('vertexText' + vertexText); + var node = { + isNode: isNode, + label: vertexText.replace(/fa[lrsb]?:fa-[\w-]+/g, function (s) { + return ""); + }), + labelStyle: style.replace('fill:', 'color:') + }; + var vertexNode = addHtmlLabel(node); // vertexNode.parentNode.removeChild(vertexNode); + + return vertexNode; + } else { + var svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text'); + svgLabel.setAttribute('style', style.replace('color:', 'fill:')); + var rows = []; + + if (typeof vertexText === 'string') { + rows = vertexText.split(/\\n|\n|/gi); + } else if (Array.isArray(vertexText)) { + rows = vertexText; + } else { + rows = []; + } + + for (var j = 0; j < rows.length; j++) { + var tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); + tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve'); + tspan.setAttribute('dy', '1em'); + tspan.setAttribute('x', '0'); + + if (isTitle) { + tspan.setAttribute('class', 'title-row'); + } else { + tspan.setAttribute('class', 'row'); + } + + tspan.textContent = rows[j].trim(); + svgLabel.appendChild(tspan); + } + + return svgLabel; + } +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (createLabel); + +/***/ }), + +/***/ "./src/dagre-wrapper/edges.js": +/*!************************************!*\ + !*** ./src/dagre-wrapper/edges.js ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "clear": () => (/* binding */ clear), +/* harmony export */ "insertEdge": () => (/* binding */ insertEdge), +/* harmony export */ "insertEdgeLabel": () => (/* binding */ insertEdgeLabel), +/* harmony export */ "intersection": () => (/* binding */ intersection), +/* harmony export */ "positionEdgeLabel": () => (/* binding */ positionEdgeLabel) +/* harmony export */ }); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); +/* harmony import */ var _createLabel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./createLabel */ "./src/dagre-wrapper/createLabel.js"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "./node_modules/d3/src/index.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config */ "./src/config.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils */ "./src/utils.js"); +/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js"); + // eslint-disable-line + + + + + + +var edgeLabels = {}; +var terminalLabels = {}; +var clear = function clear() { + edgeLabels = {}; + terminalLabels = {}; +}; +var insertEdgeLabel = function insertEdgeLabel(elem, edge) { + // Create the actual text element + var labelElement = (0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])(edge.label, edge.labelStyle); // Create outer g, edgeLabel, this will be positioned after graph layout + + var edgeLabel = elem.insert('g').attr('class', 'edgeLabel'); // Create inner g, label, this will be positioned now for centering the text + + var label = edgeLabel.insert('g').attr('class', 'label'); + label.node().appendChild(labelElement); // Center the label + + var bbox = labelElement.getBBox(); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_3__.getConfig)().flowchart.htmlLabels)) { + var div = labelElement.children[0]; + var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(labelElement); + bbox = div.getBoundingClientRect(); + dv.attr('width', bbox.width); + dv.attr('height', bbox.height); + } + + label.attr('transform', 'translate(' + -bbox.width / 2 + ', ' + -bbox.height / 2 + ')'); // Make element accessible by id for positioning + + edgeLabels[edge.id] = edgeLabel; // Update the abstract data of the edge with the new information about its width and height + + edge.width = bbox.width; + edge.height = bbox.height; + var fo; + + if (edge.startLabelLeft) { + // Create the actual text element + var startLabelElement = (0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])(edge.startLabelLeft, edge.labelStyle); + var startEdgeLabelLeft = elem.insert('g').attr('class', 'edgeTerminals'); + var inner = startEdgeLabelLeft.insert('g').attr('class', 'inner'); + fo = inner.node().appendChild(startLabelElement); + var slBox = startLabelElement.getBBox(); + inner.attr('transform', 'translate(' + -slBox.width / 2 + ', ' + -slBox.height / 2 + ')'); + + if (!terminalLabels[edge.id]) { + terminalLabels[edge.id] = {}; + } + + terminalLabels[edge.id].startLeft = startEdgeLabelLeft; + setTerminalWidth(fo, edge.startLabelLeft); + } + + if (edge.startLabelRight) { + // Create the actual text element + var _startLabelElement = (0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])(edge.startLabelRight, edge.labelStyle); + + var startEdgeLabelRight = elem.insert('g').attr('class', 'edgeTerminals'); + + var _inner = startEdgeLabelRight.insert('g').attr('class', 'inner'); + + fo = startEdgeLabelRight.node().appendChild(_startLabelElement); + + _inner.node().appendChild(_startLabelElement); + + var _slBox = _startLabelElement.getBBox(); + + _inner.attr('transform', 'translate(' + -_slBox.width / 2 + ', ' + -_slBox.height / 2 + ')'); + + if (!terminalLabels[edge.id]) { + terminalLabels[edge.id] = {}; + } + + terminalLabels[edge.id].startRight = startEdgeLabelRight; + setTerminalWidth(fo, edge.startLabelRight); + } + + if (edge.endLabelLeft) { + // Create the actual text element + var endLabelElement = (0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])(edge.endLabelLeft, edge.labelStyle); + var endEdgeLabelLeft = elem.insert('g').attr('class', 'edgeTerminals'); + + var _inner2 = endEdgeLabelLeft.insert('g').attr('class', 'inner'); + + fo = _inner2.node().appendChild(endLabelElement); + + var _slBox2 = endLabelElement.getBBox(); + + _inner2.attr('transform', 'translate(' + -_slBox2.width / 2 + ', ' + -_slBox2.height / 2 + ')'); + + endEdgeLabelLeft.node().appendChild(endLabelElement); + + if (!terminalLabels[edge.id]) { + terminalLabels[edge.id] = {}; + } + + terminalLabels[edge.id].endLeft = endEdgeLabelLeft; + setTerminalWidth(fo, edge.endLabelLeft); + } + + if (edge.endLabelRight) { + // Create the actual text element + var _endLabelElement = (0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])(edge.endLabelRight, edge.labelStyle); + + var endEdgeLabelRight = elem.insert('g').attr('class', 'edgeTerminals'); + + var _inner3 = endEdgeLabelRight.insert('g').attr('class', 'inner'); + + fo = _inner3.node().appendChild(_endLabelElement); + + var _slBox3 = _endLabelElement.getBBox(); + + _inner3.attr('transform', 'translate(' + -_slBox3.width / 2 + ', ' + -_slBox3.height / 2 + ')'); + + endEdgeLabelRight.node().appendChild(_endLabelElement); + + if (!terminalLabels[edge.id]) { + terminalLabels[edge.id] = {}; + } + + terminalLabels[edge.id].endRight = endEdgeLabelRight; + setTerminalWidth(fo, edge.endLabelRight); + } +}; +/** + * @param {any} fo + * @param {any} value + */ + +function setTerminalWidth(fo, value) { + if ((0,_config__WEBPACK_IMPORTED_MODULE_3__.getConfig)().flowchart.htmlLabels && fo) { + fo.style.width = value.length * 9 + 'px'; + fo.style.height = '12px'; + } +} + +var positionEdgeLabel = function positionEdgeLabel(edge, paths) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Moving label abc78 ', edge.id, edge.label, edgeLabels[edge.id]); + var path = paths.updatedPath ? paths.updatedPath : paths.originalPath; + + if (edge.label) { + var el = edgeLabels[edge.id]; + var x = edge.x; + var y = edge.y; + + if (path) { + // // debugger; + var pos = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcLabelPosition(path); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Moving label from (', x, ',', y, ') to (', pos.x, ',', pos.y, ') abc78'); // x = pos.x; + // y = pos.y; + } + + el.attr('transform', 'translate(' + x + ', ' + y + ')'); + } //let path = paths.updatedPath ? paths.updatedPath : paths.originalPath; + + + if (edge.startLabelLeft) { + var _el = terminalLabels[edge.id].startLeft; + var _x2 = edge.x; + var _y2 = edge.y; + + if (path) { + // debugger; + var _pos = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, 'start_left', path); + + _x2 = _pos.x; + _y2 = _pos.y; + } + + _el.attr('transform', 'translate(' + _x2 + ', ' + _y2 + ')'); + } + + if (edge.startLabelRight) { + var _el2 = terminalLabels[edge.id].startRight; + var _x3 = edge.x; + var _y3 = edge.y; + + if (path) { + // debugger; + var _pos2 = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcTerminalLabelPosition(edge.arrowTypeStart ? 10 : 0, 'start_right', path); + + _x3 = _pos2.x; + _y3 = _pos2.y; + } + + _el2.attr('transform', 'translate(' + _x3 + ', ' + _y3 + ')'); + } + + if (edge.endLabelLeft) { + var _el3 = terminalLabels[edge.id].endLeft; + var _x4 = edge.x; + var _y4 = edge.y; + + if (path) { + // debugger; + var _pos3 = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, 'end_left', path); + + _x4 = _pos3.x; + _y4 = _pos3.y; + } + + _el3.attr('transform', 'translate(' + _x4 + ', ' + _y4 + ')'); + } + + if (edge.endLabelRight) { + var _el4 = terminalLabels[edge.id].endRight; + var _x5 = edge.x; + var _y5 = edge.y; + + if (path) { + // debugger; + var _pos4 = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcTerminalLabelPosition(edge.arrowTypeEnd ? 10 : 0, 'end_right', path); + + _x5 = _pos4.x; + _y5 = _pos4.y; + } + + _el4.attr('transform', 'translate(' + _x5 + ', ' + _y5 + ')'); + } +}; + +var outsideNode = function outsideNode(node, point) { + // log.warn('Checking bounds ', node, point); + var x = node.x; + var y = node.y; + var dx = Math.abs(point.x - x); + var dy = Math.abs(point.y - y); + var w = node.width / 2; + var h = node.height / 2; + + if (dx >= w || dy >= h) { + return true; + } + + return false; +}; + +var intersection = function intersection(node, outsidePoint, insidePoint) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn("intersection calc abc89:\n outsidePoint: ".concat(JSON.stringify(outsidePoint), "\n insidePoint : ").concat(JSON.stringify(insidePoint), "\n node : x:").concat(node.x, " y:").concat(node.y, " w:").concat(node.width, " h:").concat(node.height)); + var x = node.x; + var y = node.y; + var dx = Math.abs(x - insidePoint.x); // const dy = Math.abs(y - insidePoint.y); + + var w = node.width / 2; + var r = insidePoint.x < outsidePoint.x ? w - dx : w + dx; + var h = node.height / 2; // const edges = { + // x1: x - w, + // x2: x + w, + // y1: y - h, + // y2: y + h + // }; + // if ( + // outsidePoint.x === edges.x1 || + // outsidePoint.x === edges.x2 || + // outsidePoint.y === edges.y1 || + // outsidePoint.y === edges.y2 + // ) { + // log.warn('abc89 calc equals on edge', outsidePoint, edges); + // return outsidePoint; + // } + + var Q = Math.abs(outsidePoint.y - insidePoint.y); + var R = Math.abs(outsidePoint.x - insidePoint.x); // log.warn(); + + if (Math.abs(y - outsidePoint.y) * w > Math.abs(x - outsidePoint.x) * h) { + // eslint-disable-line + // Intersection is top or bottom of rect. + // let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y; + var q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y; + r = R * q / Q; + var res = { + x: insidePoint.x < outsidePoint.x ? insidePoint.x + r : insidePoint.x - R + r, + y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q + }; + + if (r === 0) { + res.x = outsidePoint.x; + res.y = outsidePoint.y; + } + + if (R === 0) { + res.x = outsidePoint.x; + } + + if (Q === 0) { + res.y = outsidePoint.y; + } + + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn("abc89 topp/bott calc, Q ".concat(Q, ", q ").concat(q, ", R ").concat(R, ", r ").concat(r), res); + return res; + } else { + // Intersection onn sides of rect + if (insidePoint.x < outsidePoint.x) { + r = outsidePoint.x - w - x; + } else { + // r = outsidePoint.x - w - x; + r = x - w - outsidePoint.x; + } + + var _q = Q * r / R; // OK let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x + dx - w; + // OK let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : outsidePoint.x + r; + + + var _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x - R + r; // let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : outsidePoint.x + r; + + + var _y = insidePoint.y < outsidePoint.y ? insidePoint.y + _q : insidePoint.y - _q; + + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn("sides calc abc89, Q ".concat(Q, ", q ").concat(_q, ", R ").concat(R, ", r ").concat(r), { + _x: _x, + _y: _y + }); + + if (r === 0) { + _x = outsidePoint.x; + _y = outsidePoint.y; + } + + if (R === 0) { + _x = outsidePoint.x; + } + + if (Q === 0) { + _y = outsidePoint.y; + } + + return { + x: _x, + y: _y + }; + } +}; +/** + * This function will page a path and node where the last point(s) in the path is inside the node + * and return an update path ending by the border of the node. + * + * @param {Array} _points + * @param {any} boundryNode + * @returns {Array} Points + */ + +var cutPathAtIntersect = function cutPathAtIntersect(_points, boundryNode) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 cutPathAtIntersect', _points, boundryNode); + var points = []; + var lastPointOutside = _points[0]; + var isInside = false; + + _points.forEach(function (point) { + // const node = clusterDb[edge.toCluster].node; + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('abc88 checking point', point, boundryNode); // check if point is inside the boundry rect + + if (!outsideNode(boundryNode, point) && !isInside) { + // First point inside the rect found + // Calc the intersection coord between the point anf the last point outside the rect + var inter = intersection(boundryNode, lastPointOutside, point); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 inside', point, lastPointOutside, inter); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 intersection', inter); // // Check case where the intersection is the same as the last point + + var pointPresent = false; + points.forEach(function (p) { + pointPresent = pointPresent || p.x === inter.x && p.y === inter.y; + }); // // if (!pointPresent) { + + if (!points.find(function (e) { + return e.x === inter.x && e.y === inter.y; + })) { + points.push(inter); + } else { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 no intersect', inter, points); + } // points.push(inter); + + + isInside = true; + } else { + // Outside + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 outside', point, lastPointOutside); + lastPointOutside = point; // points.push(point); + + if (!isInside) points.push(point); + } + }); + + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('abc88 returning points', points); + return points; +}; //(edgePaths, e, edge, clusterDb, diagramtype, graph) + + +var insertEdge = function insertEdge(elem, e, edge, clusterDb, diagramType, graph) { + var points = edge.points; + var pointsHasChanged = false; + var tail = graph.node(e.v); + var head = graph.node(e.w); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('abc88 InsertEdge: ', edge); + + if (head.intersect && tail.intersect) { + points = points.slice(1, edge.points.length - 1); + points.unshift(tail.intersect(points[0])); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Last point', points[points.length - 1], head, head.intersect(points[points.length - 1])); + points.push(head.intersect(points[points.length - 1])); + } + + if (edge.toCluster) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('to cluster abc88', clusterDb[edge.toCluster]); + points = cutPathAtIntersect(edge.points, clusterDb[edge.toCluster].node); // log.trace('edge', edge); + // points = []; + // let lastPointOutside; // = edge.points[0]; + // let isInside = false; + // edge.points.forEach(point => { + // const node = clusterDb[edge.toCluster].node; + // log.warn('checking from', edge.fromCluster, point, node); + // if (!outsideNode(node, point) && !isInside) { + // log.trace('inside', edge.toCluster, point, lastPointOutside); + // // First point inside the rect + // const inter = intersection(node, lastPointOutside, point); + // let pointPresent = false; + // points.forEach(p => { + // pointPresent = pointPresent || (p.x === inter.x && p.y === inter.y); + // }); + // // if (!pointPresent) { + // if (!points.find(e => e.x === inter.x && e.y === inter.y)) { + // points.push(inter); + // } else { + // log.warn('no intersect', inter, points); + // } + // isInside = true; + // } else { + // // outside + // lastPointOutside = point; + // if (!isInside) points.push(point); + // } + // }); + + pointsHasChanged = true; + } + + if (edge.fromCluster) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('from cluster abc88', clusterDb[edge.fromCluster]); + points = cutPathAtIntersect(points.reverse(), clusterDb[edge.fromCluster].node).reverse(); + pointsHasChanged = true; + } // The data for our line + + + var lineData = points.filter(function (p) { + return !Number.isNaN(p.y); + }); // This is the accessor function we talked about above + + var curve; // Currently only flowcharts get the curve from the settings, perhaps this should + // be expanded to a common setting? Restricting it for now in order not to cause side-effects that + // have not been thought through + + if (diagramType === 'graph' || diagramType === 'flowchart') { + curve = edge.curve || d3__WEBPACK_IMPORTED_MODULE_0__.curveBasis; + } else { + curve = d3__WEBPACK_IMPORTED_MODULE_0__.curveBasis; + } // curve = curveLinear; + + + var lineFunction = (0,d3__WEBPACK_IMPORTED_MODULE_0__.line)().x(function (d) { + return d.x; + }).y(function (d) { + return d.y; + }).curve(curve); // Contruct stroke classes based on properties + + var strokeClasses; + + switch (edge.thickness) { + case 'normal': + strokeClasses = 'edge-thickness-normal'; + break; + + case 'thick': + strokeClasses = 'edge-thickness-thick'; + break; + + default: + strokeClasses = ''; + } + + switch (edge.pattern) { + case 'solid': + strokeClasses += ' edge-pattern-solid'; + break; + + case 'dotted': + strokeClasses += ' edge-pattern-dotted'; + break; + + case 'dashed': + strokeClasses += ' edge-pattern-dashed'; + break; + } + + var svgPath = elem.append('path').attr('d', lineFunction(lineData)).attr('id', edge.id).attr('class', ' ' + strokeClasses + (edge.classes ? ' ' + edge.classes : '')).attr('style', edge.style); // DEBUG code, adds a red circle at each edge coordinate + // edge.points.forEach(point => { + // elem + // .append('circle') + // .style('stroke', 'red') + // .style('fill', 'red') + // .attr('r', 1) + // .attr('cx', point.x) + // .attr('cy', point.y); + // }); + + var url = ''; + + if ((0,_config__WEBPACK_IMPORTED_MODULE_3__.getConfig)().state.arrowMarkerAbsolute) { + url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search; + url = url.replace(/\(/g, '\\('); + url = url.replace(/\)/g, '\\)'); + } + + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('arrowTypeStart', edge.arrowTypeStart); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('arrowTypeEnd', edge.arrowTypeEnd); + + switch (edge.arrowTypeStart) { + case 'arrow_cross': + svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-crossStart' + ')'); + break; + + case 'arrow_point': + svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-pointStart' + ')'); + break; + + case 'arrow_barb': + svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-barbStart' + ')'); + break; + + case 'arrow_circle': + svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-circleStart' + ')'); + break; + + case 'aggregation': + svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-aggregationStart' + ')'); + break; + + case 'extension': + svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-extensionStart' + ')'); + break; + + case 'composition': + svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-compositionStart' + ')'); + break; + + case 'dependency': + svgPath.attr('marker-start', 'url(' + url + '#' + diagramType + '-dependencyStart' + ')'); + break; + + default: + } + + switch (edge.arrowTypeEnd) { + case 'arrow_cross': + svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-crossEnd' + ')'); + break; + + case 'arrow_point': + svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-pointEnd' + ')'); + break; + + case 'arrow_barb': + svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-barbEnd' + ')'); + break; + + case 'arrow_circle': + svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-circleEnd' + ')'); + break; + + case 'aggregation': + svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-aggregationEnd' + ')'); + break; + + case 'extension': + svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-extensionEnd' + ')'); + break; + + case 'composition': + svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-compositionEnd' + ')'); + break; + + case 'dependency': + svgPath.attr('marker-end', 'url(' + url + '#' + diagramType + '-dependencyEnd' + ')'); + break; + + default: + } + + var paths = {}; + + if (pointsHasChanged) { + paths.updatedPath = points; + } + + paths.originalPath = edge.points; + return paths; +}; + +/***/ }), + +/***/ "./src/dagre-wrapper/index.js": +/*!************************************!*\ + !*** ./src/dagre-wrapper/index.js ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "render": () => (/* binding */ render) +/* harmony export */ }); +/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dagre */ "./node_modules/dagre/index.js"); +/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! graphlib */ "./node_modules/graphlib/index.js"); +/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _markers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./markers */ "./src/dagre-wrapper/markers.js"); +/* harmony import */ var _shapes_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shapes/util */ "./src/dagre-wrapper/shapes/util.js"); +/* harmony import */ var _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mermaid-graphlib */ "./src/dagre-wrapper/mermaid-graphlib.js"); +/* harmony import */ var _nodes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./nodes */ "./src/dagre-wrapper/nodes.js"); +/* harmony import */ var _clusters__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./clusters */ "./src/dagre-wrapper/clusters.js"); +/* harmony import */ var _edges__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./edges */ "./src/dagre-wrapper/edges.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); + + + + + + + + + + +var recursiveRender = function recursiveRender(_elem, graph, diagramtype, parentCluster) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Graph in recursive render: XXX', graphlib__WEBPACK_IMPORTED_MODULE_1___default().json.write(graph), parentCluster); + var dir = graph.graph().rankdir; + _logger__WEBPACK_IMPORTED_MODULE_2__.log.trace('Dir in recursive render - dir:', dir); + + var elem = _elem.insert('g').attr('class', 'root'); // eslint-disable-line + + + if (!graph.nodes()) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('No nodes found for', graph); + } else { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Recursive render XXX', graph.nodes()); + } + + if (graph.edges().length > 0) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.trace('Recursive edges', graph.edge(graph.edges()[0])); + } + + var clusters = elem.insert('g').attr('class', 'clusters'); // eslint-disable-line + + var edgePaths = elem.insert('g').attr('class', 'edgePaths'); + var edgeLabels = elem.insert('g').attr('class', 'edgeLabels'); + var nodes = elem.insert('g').attr('class', 'nodes'); // Insert nodes, this will insert them into the dom and each node will get a size. The size is updated + // to the abstract node and is later used by dagre for the layout + + graph.nodes().forEach(function (v) { + var node = graph.node(v); + + if (typeof parentCluster !== 'undefined') { + var data = JSON.parse(JSON.stringify(parentCluster.clusterData)); // data.clusterPositioning = true; + + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Setting data for cluster XXX (', v, ') ', data, parentCluster); + graph.setNode(parentCluster.id, data); + + if (!graph.parent(v)) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.trace('Setting parent', v, parentCluster.id); + graph.setParent(v, parentCluster.id, data); + } + } + + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('(Insert) Node XXX' + v + ': ' + JSON.stringify(graph.node(v))); + + if (node && node.clusterNode) { + // const children = graph.children(v); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Cluster identified', v, node.width, graph.node(v)); + var o = recursiveRender(nodes, node.graph, diagramtype, graph.node(v)); + var newEl = o.elem; + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, newEl); + node.diff = o.diff || 0; + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Node bounds (abc123)', v, node, node.width, node.x, node.y); + (0,_nodes__WEBPACK_IMPORTED_MODULE_4__.setNodeElem)(newEl, node); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.warn('Recursive render complete ', newEl, node); + } else { + if (graph.children(v).length > 0) { + // This is a cluster but not to be rendered recursively + // Render as before + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Cluster - the non recursive path XXX', v, node.id, node, graph); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info((0,_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.findNonClusterChild)(node.id, graph)); + _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb[node.id] = { + id: (0,_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.findNonClusterChild)(node.id, graph), + node: node + }; // insertCluster(clusters, graph.node(v)); + } else { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Node - the non recursive path', v, node.id, node); + (0,_nodes__WEBPACK_IMPORTED_MODULE_4__.insertNode)(nodes, graph.node(v), dir); + } + } + }); // Insert labels, this will insert them into the dom so that the width can be calculated + // Also figure out which edges point to/from clusters and adjust them accordingly + // Edges from/to clusters really points to the first child in the cluster. + // TODO: pick optimal child in the cluster to us as link anchor + + graph.edges().forEach(function (e) { + var edge = graph.edge(e.v, e.w, e.name); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e)); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Edge ' + e.v + ' -> ' + e.w + ': ', e, ' ', JSON.stringify(graph.edge(e))); // Check if link is either from or to a cluster + + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Fix', _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb, 'ids:', e.v, e.w, 'Translateing: ', _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb[e.v], _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb[e.w]); + (0,_edges__WEBPACK_IMPORTED_MODULE_6__.insertEdgeLabel)(edgeLabels, edge); + }); + graph.edges().forEach(function (e) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e)); + }); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('#############################################'); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('### Layout ###'); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('#############################################'); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info(graph); + dagre__WEBPACK_IMPORTED_MODULE_0___default().layout(graph); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Graph after layout:', graphlib__WEBPACK_IMPORTED_MODULE_1___default().json.write(graph)); // Move the nodes to the correct place + + var diff = 0; + (0,_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.sortNodesByHierarchy)(graph).forEach(function (v) { + var node = graph.node(v); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Position ' + v + ': ' + JSON.stringify(graph.node(v))); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Position ' + v + ': (' + node.x, ',' + node.y, ') width: ', node.width, ' height: ', node.height); + + if (node && node.clusterNode) { + // clusterDb[node.id].node = node; + (0,_nodes__WEBPACK_IMPORTED_MODULE_4__.positionNode)(node); + } else { + // Non cluster node + if (graph.children(v).length > 0) { + // A cluster in the non-recursive way + // positionCluster(node); + (0,_clusters__WEBPACK_IMPORTED_MODULE_7__.insertCluster)(clusters, node); + _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb[node.id].node = node; + } else { + (0,_nodes__WEBPACK_IMPORTED_MODULE_4__.positionNode)(node); + } + } + }); // Move the edge labels to the correct place after layout + + graph.edges().forEach(function (e) { + var edge = graph.edge(e); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(edge), edge); + var paths = (0,_edges__WEBPACK_IMPORTED_MODULE_6__.insertEdge)(edgePaths, e, edge, _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clusterDb, diagramtype, graph); + (0,_edges__WEBPACK_IMPORTED_MODULE_6__.positionEdgeLabel)(edge, paths); + }); + graph.nodes().forEach(function (v) { + var n = graph.node(v); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info(v, n.type, n.diff); + + if (n.type === 'group') { + diff = n.diff; + } + }); + return { + elem: elem, + diff: diff + }; +}; + +var render = function render(elem, graph, markers, diagramtype, id) { + (0,_markers__WEBPACK_IMPORTED_MODULE_8__["default"])(elem, markers, diagramtype, id); + (0,_nodes__WEBPACK_IMPORTED_MODULE_4__.clear)(); + (0,_edges__WEBPACK_IMPORTED_MODULE_6__.clear)(); + (0,_clusters__WEBPACK_IMPORTED_MODULE_7__.clear)(); + (0,_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.clear)(); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.warn('Graph at first:', graphlib__WEBPACK_IMPORTED_MODULE_1___default().json.write(graph)); + (0,_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_5__.adjustClustersAndEdges)(graph); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.warn('Graph after:', graphlib__WEBPACK_IMPORTED_MODULE_1___default().json.write(graph)); // log.warn('Graph ever after:', graphlib.json.write(graph.node('A').graph)); + + recursiveRender(elem, graph, diagramtype); +}; // const shapeDefinitions = {}; +// export const addShape = ({ shapeType: fun }) => { +// shapeDefinitions[shapeType] = fun; +// }; +// const arrowDefinitions = {}; +// export const addArrow = ({ arrowType: fun }) => { +// arrowDefinitions[arrowType] = fun; +// }; + +/***/ }), + +/***/ "./src/dagre-wrapper/intersect/index.js": +/*!**********************************************!*\ + !*** ./src/dagre-wrapper/intersect/index.js ***! + \**********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _intersect_node_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./intersect-node.js */ "./src/dagre-wrapper/intersect/intersect-node.js"); +/* harmony import */ var _intersect_node_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_intersect_node_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _intersect_circle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./intersect-circle.js */ "./src/dagre-wrapper/intersect/intersect-circle.js"); +/* harmony import */ var _intersect_ellipse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./intersect-ellipse.js */ "./src/dagre-wrapper/intersect/intersect-ellipse.js"); +/* harmony import */ var _intersect_polygon_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./intersect-polygon.js */ "./src/dagre-wrapper/intersect/intersect-polygon.js"); +/* harmony import */ var _intersect_rect_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./intersect-rect.js */ "./src/dagre-wrapper/intersect/intersect-rect.js"); +/* + * Borrowed with love from from dagrge-d3. Many thanks to cpettitt! + */ + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + node: (_intersect_node_js__WEBPACK_IMPORTED_MODULE_0___default()), + circle: _intersect_circle_js__WEBPACK_IMPORTED_MODULE_1__["default"], + ellipse: _intersect_ellipse_js__WEBPACK_IMPORTED_MODULE_2__["default"], + polygon: _intersect_polygon_js__WEBPACK_IMPORTED_MODULE_3__["default"], + rect: _intersect_rect_js__WEBPACK_IMPORTED_MODULE_4__["default"] +}); + +/***/ }), + +/***/ "./src/dagre-wrapper/intersect/intersect-circle.js": +/*!*********************************************************!*\ + !*** ./src/dagre-wrapper/intersect/intersect-circle.js ***! + \*********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _intersect_ellipse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./intersect-ellipse */ "./src/dagre-wrapper/intersect/intersect-ellipse.js"); + +/** + * @param node + * @param rx + * @param point + */ + +function intersectCircle(node, rx, point) { + return (0,_intersect_ellipse__WEBPACK_IMPORTED_MODULE_0__["default"])(node, rx, rx, point); +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (intersectCircle); + +/***/ }), + +/***/ "./src/dagre-wrapper/intersect/intersect-ellipse.js": +/*!**********************************************************!*\ + !*** ./src/dagre-wrapper/intersect/intersect-ellipse.js ***! + \**********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/** + * @param node + * @param rx + * @param ry + * @param point + */ +function intersectEllipse(node, rx, ry, point) { + // Formulae from: https://mathworld.wolfram.com/Ellipse-LineIntersection.html + var cx = node.x; + var cy = node.y; + var px = cx - point.x; + var py = cy - point.y; + var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px); + var dx = Math.abs(rx * ry * px / det); + + if (point.x < cx) { + dx = -dx; + } + + var dy = Math.abs(rx * ry * py / det); + + if (point.y < cy) { + dy = -dy; + } + + return { + x: cx + dx, + y: cy + dy + }; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (intersectEllipse); + +/***/ }), + +/***/ "./src/dagre-wrapper/intersect/intersect-line.js": +/*!*******************************************************!*\ + !*** ./src/dagre-wrapper/intersect/intersect-line.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/** + * Returns the point at which two lines, p and q, intersect or returns undefined if they do not intersect. + * + * @param p1 + * @param p2 + * @param q1 + * @param q2 + */ +function intersectLine(p1, p2, q1, q2) { + // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994, + // p7 and p473. + var a1, a2, b1, b2, c1, c2; + var r1, r2, r3, r4; + var denom, offset, num; + var x, y; // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x + + // b1 y + c1 = 0. + + a1 = p2.y - p1.y; + b1 = p1.x - p2.x; + c1 = p2.x * p1.y - p1.x * p2.y; // Compute r3 and r4. + + r3 = a1 * q1.x + b1 * q1.y + c1; + r4 = a1 * q2.x + b1 * q2.y + c1; // Check signs of r3 and r4. If both point 3 and point 4 lie on + // same side of line 1, the line segments do not intersect. + + if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) { + return; + } // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0 + + + a2 = q2.y - q1.y; + b2 = q1.x - q2.x; + c2 = q2.x * q1.y - q1.x * q2.y; // Compute r1 and r2 + + r1 = a2 * p1.x + b2 * p1.y + c2; + r2 = a2 * p2.x + b2 * p2.y + c2; // Check signs of r1 and r2. If both point 1 and point 2 lie + // on same side of second line segment, the line segments do + // not intersect. + + if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) { + return; + } // Line segments intersect: compute intersection point. + + + denom = a1 * b2 - a2 * b1; + + if (denom === 0) { + return; + } + + offset = Math.abs(denom / 2); // The denom/2 is to get rounding instead of truncating. It + // is added or subtracted to the numerator, depending upon the + // sign of the numerator. + + num = b1 * c2 - b2 * c1; + x = num < 0 ? (num - offset) / denom : (num + offset) / denom; + num = a2 * c1 - a1 * c2; + y = num < 0 ? (num - offset) / denom : (num + offset) / denom; + return { + x: x, + y: y + }; +} +/** + * @param r1 + * @param r2 + */ + + +function sameSign(r1, r2) { + return r1 * r2 > 0; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (intersectLine); + +/***/ }), + +/***/ "./src/dagre-wrapper/intersect/intersect-node.js": +/*!*******************************************************!*\ + !*** ./src/dagre-wrapper/intersect/intersect-node.js ***! + \*******************************************************/ +/***/ ((module) => { + +module.exports = intersectNode; +/** + * @param node + * @param point + */ + +function intersectNode(node, point) { + // console.info('Intersect Node'); + return node.intersect(point); +} + +/***/ }), + +/***/ "./src/dagre-wrapper/intersect/intersect-polygon.js": +/*!**********************************************************!*\ + !*** ./src/dagre-wrapper/intersect/intersect-polygon.js ***! + \**********************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _intersect_line__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./intersect-line */ "./src/dagre-wrapper/intersect/intersect-line.js"); +/* eslint "no-console": off */ + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (intersectPolygon); +/** + * Returns the point ({x, y}) at which the point argument intersects with the node argument assuming + * that it has the shape specified by polygon. + * + * @param node + * @param polyPoints + * @param point + */ + +function intersectPolygon(node, polyPoints, point) { + var x1 = node.x; + var y1 = node.y; + var intersections = []; + var minX = Number.POSITIVE_INFINITY; + var minY = Number.POSITIVE_INFINITY; + + if (typeof polyPoints.forEach === 'function') { + polyPoints.forEach(function (entry) { + minX = Math.min(minX, entry.x); + minY = Math.min(minY, entry.y); + }); + } else { + minX = Math.min(minX, polyPoints.x); + minY = Math.min(minY, polyPoints.y); + } + + var left = x1 - node.width / 2 - minX; + var top = y1 - node.height / 2 - minY; + + for (var i = 0; i < polyPoints.length; i++) { + var p1 = polyPoints[i]; + var p2 = polyPoints[i < polyPoints.length - 1 ? i + 1 : 0]; + var intersect = (0,_intersect_line__WEBPACK_IMPORTED_MODULE_0__["default"])(node, point, { + x: left + p1.x, + y: top + p1.y + }, { + x: left + p2.x, + y: top + p2.y + }); + + if (intersect) { + intersections.push(intersect); + } + } + + if (!intersections.length) { + // console.log('NO INTERSECTION FOUND, RETURN NODE CENTER', node); + return node; + } + + if (intersections.length > 1) { + // More intersections, find the one nearest to edge end point + intersections.sort(function (p, q) { + var pdx = p.x - point.x; + var pdy = p.y - point.y; + var distp = Math.sqrt(pdx * pdx + pdy * pdy); + var qdx = q.x - point.x; + var qdy = q.y - point.y; + var distq = Math.sqrt(qdx * qdx + qdy * qdy); + return distp < distq ? -1 : distp === distq ? 0 : 1; + }); + } + + return intersections[0]; +} + +/***/ }), + +/***/ "./src/dagre-wrapper/intersect/intersect-rect.js": +/*!*******************************************************!*\ + !*** ./src/dagre-wrapper/intersect/intersect-rect.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +var intersectRect = function intersectRect(node, point) { + var x = node.x; + var y = node.y; // Rectangle intersection algorithm from: + // https://math.stackexchange.com/questions/108113/find-edge-between-two-boxes + + var dx = point.x - x; + var dy = point.y - y; + var w = node.width / 2; + var h = node.height / 2; + var sx, sy; + + if (Math.abs(dy) * w > Math.abs(dx) * h) { + // Intersection is top or bottom of rect. + if (dy < 0) { + h = -h; + } + + sx = dy === 0 ? 0 : h * dx / dy; + sy = h; + } else { + // Intersection is left or right of rect. + if (dx < 0) { + w = -w; + } + + sx = w; + sy = dx === 0 ? 0 : w * dy / dx; + } + + return { + x: x + sx, + y: y + sy + }; +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (intersectRect); + +/***/ }), + +/***/ "./src/dagre-wrapper/markers.js": +/*!**************************************!*\ + !*** ./src/dagre-wrapper/markers.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); +/** Setup arrow head and define the marker. The result is appended to the svg. */ + // Only add the number of markers that the diagram needs + +var insertMarkers = function insertMarkers(elem, markerArray, type, id) { + markerArray.forEach(function (markerName) { + markers[markerName](elem, type, id); + }); +}; + +var extension = function extension(elem, type, id) { + _logger__WEBPACK_IMPORTED_MODULE_0__.log.trace('Making markers for ', id); + elem.append('defs').append('marker').attr('id', type + '-extensionStart').attr('class', 'marker extension ' + type).attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 1,7 L18,13 V 1 Z'); + elem.append('defs').append('marker').attr('id', type + '-extensionEnd').attr('class', 'marker extension ' + type).attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead +}; + +var composition = function composition(elem, type) { + elem.append('defs').append('marker').attr('id', type + '-compositionStart').attr('class', 'marker composition ' + type).attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); + elem.append('defs').append('marker').attr('id', type + '-compositionEnd').attr('class', 'marker composition ' + type).attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); +}; + +var aggregation = function aggregation(elem, type) { + elem.append('defs').append('marker').attr('id', type + '-aggregationStart').attr('class', 'marker aggregation ' + type).attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); + elem.append('defs').append('marker').attr('id', type + '-aggregationEnd').attr('class', 'marker aggregation ' + type).attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); +}; + +var dependency = function dependency(elem, type) { + elem.append('defs').append('marker').attr('id', type + '-dependencyStart').attr('class', 'marker dependency ' + type).attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z'); + elem.append('defs').append('marker').attr('id', type + '-dependencyEnd').attr('class', 'marker dependency ' + type).attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z'); +}; + +var point = function point(elem, type) { + elem.append('marker').attr('id', type + '-pointEnd').attr('class', 'marker ' + type).attr('viewBox', '0 0 10 10').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 12).attr('markerHeight', 12).attr('orient', 'auto').append('path').attr('d', 'M 0 0 L 10 5 L 0 10 z').attr('class', 'arrowMarkerPath').style('stroke-width', 1).style('stroke-dasharray', '1,0'); + elem.append('marker').attr('id', type + '-pointStart').attr('class', 'marker ' + type).attr('viewBox', '0 0 10 10').attr('refX', 0).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 12).attr('markerHeight', 12).attr('orient', 'auto').append('path').attr('d', 'M 0 5 L 10 10 L 10 0 z').attr('class', 'arrowMarkerPath').style('stroke-width', 1).style('stroke-dasharray', '1,0'); +}; + +var circle = function circle(elem, type) { + elem.append('marker').attr('id', type + '-circleEnd').attr('class', 'marker ' + type).attr('viewBox', '0 0 10 10').attr('refX', 11).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 11).attr('markerHeight', 11).attr('orient', 'auto').append('circle').attr('cx', '5').attr('cy', '5').attr('r', '5').attr('class', 'arrowMarkerPath').style('stroke-width', 1).style('stroke-dasharray', '1,0'); + elem.append('marker').attr('id', type + '-circleStart').attr('class', 'marker ' + type).attr('viewBox', '0 0 10 10').attr('refX', -1).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 11).attr('markerHeight', 11).attr('orient', 'auto').append('circle').attr('cx', '5').attr('cy', '5').attr('r', '5').attr('class', 'arrowMarkerPath').style('stroke-width', 1).style('stroke-dasharray', '1,0'); +}; + +var cross = function cross(elem, type) { + elem.append('marker').attr('id', type + '-crossEnd').attr('class', 'marker cross ' + type).attr('viewBox', '0 0 11 11').attr('refX', 12).attr('refY', 5.2).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 11).attr('markerHeight', 11).attr('orient', 'auto').append('path') // .attr('stroke', 'black') + .attr('d', 'M 1,1 l 9,9 M 10,1 l -9,9').attr('class', 'arrowMarkerPath').style('stroke-width', 2).style('stroke-dasharray', '1,0'); + elem.append('marker').attr('id', type + '-crossStart').attr('class', 'marker cross ' + type).attr('viewBox', '0 0 11 11').attr('refX', -1).attr('refY', 5.2).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 11).attr('markerHeight', 11).attr('orient', 'auto').append('path') // .attr('stroke', 'black') + .attr('d', 'M 1,1 l 9,9 M 10,1 l -9,9').attr('class', 'arrowMarkerPath').style('stroke-width', 2).style('stroke-dasharray', '1,0'); +}; + +var barb = function barb(elem, type) { + elem.append('defs').append('marker').attr('id', type + '-barbEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 14).attr('markerUnits', 'strokeWidth').attr('orient', 'auto').append('path').attr('d', 'M 19,7 L9,13 L14,7 L9,1 Z'); +}; // TODO rename the class diagram markers to something shape descriptive and semantic free + + +var markers = { + extension: extension, + composition: composition, + aggregation: aggregation, + dependency: dependency, + point: point, + circle: circle, + cross: cross, + barb: barb +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (insertMarkers); + +/***/ }), + +/***/ "./src/dagre-wrapper/mermaid-graphlib.js": +/*!***********************************************!*\ + !*** ./src/dagre-wrapper/mermaid-graphlib.js ***! + \***********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "adjustClustersAndEdges": () => (/* binding */ adjustClustersAndEdges), +/* harmony export */ "clear": () => (/* binding */ clear), +/* harmony export */ "clusterDb": () => (/* binding */ clusterDb), +/* harmony export */ "extractDecendants": () => (/* binding */ extractDecendants), +/* harmony export */ "extractor": () => (/* binding */ extractor), +/* harmony export */ "findNonClusterChild": () => (/* binding */ findNonClusterChild), +/* harmony export */ "sortNodesByHierarchy": () => (/* binding */ sortNodesByHierarchy), +/* harmony export */ "validate": () => (/* binding */ validate) +/* harmony export */ }); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); +/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! graphlib */ "./node_modules/graphlib/index.js"); +/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_0__); +/** Decorates with functions required by mermaids dagre-wrapper. */ + + +var clusterDb = {}; +var decendants = {}; +var parents = {}; +var clear = function clear() { + decendants = {}; + parents = {}; + clusterDb = {}; +}; + +var isDecendant = function isDecendant(id, ancenstorId) { + // if (id === ancenstorId) return true; + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('In isDecendant', ancenstorId, ' ', id, ' = ', decendants[ancenstorId].indexOf(id) >= 0); + if (decendants[ancenstorId].indexOf(id) >= 0) return true; + return false; +}; + +var edgeInCluster = function edgeInCluster(edge, clusterId) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Decendants of ', clusterId, ' is ', decendants[clusterId]); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Edge is ', edge); // Edges to/from the cluster is not in the cluster, they are in the parent + + if (edge.v === clusterId) return false; + if (edge.w === clusterId) return false; + + if (!decendants[clusterId]) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Tilt, ', clusterId, ',not in decendants'); + return false; + } + + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Here '); + if (decendants[clusterId].indexOf(edge.v) >= 0) return true; + if (isDecendant(edge.v, clusterId)) return true; + if (isDecendant(edge.w, clusterId)) return true; + if (decendants[clusterId].indexOf(edge.w) >= 0) return true; + return false; +}; + +var copy = function copy(clusterId, graph, newGraph, rootId) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Copying children of ', clusterId, 'root', rootId, 'data', graph.node(clusterId), rootId); + var nodes = graph.children(clusterId) || []; // Include cluster node if it is not the root + + if (clusterId !== rootId) { + nodes.push(clusterId); + } + + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Copying (nodes) clusterId', clusterId, 'nodes', nodes); + nodes.forEach(function (node) { + if (graph.children(node).length > 0) { + copy(node, graph, newGraph, rootId); + } else { + var data = graph.node(node); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('cp ', node, ' to ', rootId, ' with parent ', clusterId); //,node, data, ' parent is ', clusterId); + + newGraph.setNode(node, data); + + if (rootId !== graph.parent(node)) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Setting parent', node, graph.parent(node)); + newGraph.setParent(node, graph.parent(node)); + } + + if (clusterId !== rootId && node !== clusterId) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Setting parent', node, clusterId); + newGraph.setParent(node, clusterId); + } else { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('In copy ', clusterId, 'root', rootId, 'data', graph.node(clusterId), rootId); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Not Setting parent for node=', node, 'cluster!==rootId', clusterId !== rootId, 'node!==clusterId', node !== clusterId); + } + + var edges = graph.edges(node); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Copying Edges', edges); + edges.forEach(function (edge) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Edge', edge); + var data = graph.edge(edge.v, edge.w, edge.name); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Edge data', data, rootId); + + try { + // Do not copy edges in and out of the root cluster, they belong to the parent graph + if (edgeInCluster(edge, rootId)) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Copying as ', edge.v, edge.w, data, edge.name); + newGraph.setEdge(edge.v, edge.w, data, edge.name); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('newGraph edges ', newGraph.edges(), newGraph.edge(newGraph.edges()[0])); + } else { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Skipping copy of edge ', edge.v, '-->', edge.w, ' rootId: ', rootId, ' clusterId:', clusterId); + } + } catch (e) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.error(e); + } + }); + } + + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Removing node', node); + graph.removeNode(node); + }); +}; + +var extractDecendants = function extractDecendants(id, graph) { + // log.debug('Extracting ', id); + var children = graph.children(id); + var res = [].concat(children); + + for (var i = 0; i < children.length; i++) { + parents[children[i]] = id; + res = res.concat(extractDecendants(children[i], graph)); + } + + return res; +}; +/** + * Validates the graph, checking that all parent child relation points to existing nodes and that + * edges between nodes also ia correct. When not correct the function logs the discrepancies. + * + * @param graph + */ + +var validate = function validate(graph) { + var edges = graph.edges(); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Edges: ', edges); + + for (var i = 0; i < edges.length; i++) { + if (graph.children(edges[i].v).length > 0) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('The node ', edges[i].v, ' is part of and edge even though it has children'); + return false; + } + + if (graph.children(edges[i].w).length > 0) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('The node ', edges[i].w, ' is part of and edge even though it has children'); + return false; + } + } + + return true; +}; +/** + * Finds a child that is not a cluster. When faking a edge between a node and a cluster. + * + * @param {Finds a} id + * @param {any} graph + */ + +var findNonClusterChild = function findNonClusterChild(id, graph) { + // const node = graph.node(id); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Searching', id); // const children = graph.children(id).reverse(); + + var children = graph.children(id); //.reverse(); + + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Searching children of id ', id, children); + + if (children.length < 1) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('This is a valid node', id); + return id; + } + + for (var i = 0; i < children.length; i++) { + var _id = findNonClusterChild(children[i], graph); + + if (_id) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace('Found replacement for', id, ' => ', _id); + return _id; + } + } +}; + +var getAnchorId = function getAnchorId(id) { + if (!clusterDb[id]) { + return id; + } // If the cluster has no external connections + + + if (!clusterDb[id].externalConnections) { + return id; + } // Return the replacement node + + + if (clusterDb[id]) { + return clusterDb[id].id; + } + + return id; +}; + +var adjustClustersAndEdges = function adjustClustersAndEdges(graph, depth) { + if (!graph || depth > 10) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Opting out, no graph '); + return; + } else { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Opting in, graph '); + } // Go through the nodes and for each cluster found, save a replacement node, this can be used when + // faking a link to a cluster + + + graph.nodes().forEach(function (id) { + var children = graph.children(id); + + if (children.length > 0) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Cluster identified', id, ' Replacement id in edges: ', findNonClusterChild(id, graph)); + decendants[id] = extractDecendants(id, graph); + clusterDb[id] = { + id: findNonClusterChild(id, graph), + clusterData: graph.node(id) + }; + } + }); // Check incoming and outgoing edges for each cluster + + graph.nodes().forEach(function (id) { + var children = graph.children(id); + var edges = graph.edges(); + + if (children.length > 0) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Cluster identified', id, decendants); + edges.forEach(function (edge) { + // log.debug('Edge, decendants: ', edge, decendants[id]); + // Check if any edge leaves the cluster (not the actual cluster, thats a link from the box) + if (edge.v !== id && edge.w !== id) { + // Any edge where either the one of the nodes is decending to the cluster but not the other + // if (decendants[id].indexOf(edge.v) < 0 && decendants[id].indexOf(edge.w) < 0) { + var d1 = isDecendant(edge.v, id); + var d2 = isDecendant(edge.w, id); // d1 xor d2 - if either d1 is true and d2 is false or the other way around + + if (d1 ^ d2) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Edge: ', edge, ' leaves cluster ', id); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Decendants of XXX ', id, ': ', decendants[id]); + clusterDb[id].externalConnections = true; + } + } + }); + } else { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Not a cluster ', id, decendants); + } + }); // For clusters with incoming and/or outgoing edges translate those edges to a real node + // in the cluster in order to fake the edge + + graph.edges().forEach(function (e) { + var edge = graph.edge(e); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e)); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(graph.edge(e))); + var v = e.v; + var w = e.w; // Check if link is either from or to a cluster + + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Fix XXX', clusterDb, 'ids:', e.v, e.w, 'Translateing: ', clusterDb[e.v], ' --- ', clusterDb[e.w]); + + if (clusterDb[e.v] && clusterDb[e.w] && clusterDb[e.v] === clusterDb[e.w]) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Fixing and trixing link to self - removing XXX', e.v, e.w, e.name); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Fixing and trixing - removing XXX', e.v, e.w, e.name); + v = getAnchorId(e.v); + w = getAnchorId(e.w); + graph.removeEdge(e.v, e.w, e.name); + var specialId = e.w + '---' + e.v; + graph.setNode(specialId, { + domId: specialId, + id: specialId, + labelStyle: '', + labelText: edge.label, + padding: 0, + shape: 'labelRect', + style: '' + }); + var edge1 = JSON.parse(JSON.stringify(edge)); + var edge2 = JSON.parse(JSON.stringify(edge)); + edge1.label = ''; + edge1.arrowTypeEnd = 'none'; + edge2.label = ''; + edge1.fromCluster = e.v; + edge2.toCluster = e.v; + graph.setEdge(v, specialId, edge1, e.name + '-cyclic-special'); + graph.setEdge(specialId, w, edge2, e.name + '-cyclic-special'); + } else if (clusterDb[e.v] || clusterDb[e.w]) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Fixing and trixing - removing XXX', e.v, e.w, e.name); + v = getAnchorId(e.v); + w = getAnchorId(e.w); + graph.removeEdge(e.v, e.w, e.name); + if (v !== e.v) edge.fromCluster = e.v; + if (w !== e.w) edge.toCluster = e.w; + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Fix Replacing with XXX', v, w, e.name); + graph.setEdge(v, w, edge, e.name); + } + }); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Adjusted Graph', graphlib__WEBPACK_IMPORTED_MODULE_0___default().json.write(graph)); + extractor(graph, 0); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.trace(clusterDb); // Remove references to extracted cluster + // graph.edges().forEach(edge => { + // if (isDecendant(edge.v, clusterId) || isDecendant(edge.w, clusterId)) { + // graph.removeEdge(edge); + // } + // }); +}; +var extractor = function extractor(graph, depth) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('extractor - ', depth, graphlib__WEBPACK_IMPORTED_MODULE_0___default().json.write(graph), graph.children('D')); + + if (depth > 10) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.error('Bailing out'); + return; + } // For clusters without incoming and/or outgoing edges, create a new cluster-node + // containing the nodes and edges in the custer in a new graph + // for (let i = 0;) + + + var nodes = graph.nodes(); + var hasChildren = false; + + for (var i = 0; i < nodes.length; i++) { + var node = nodes[i]; + var children = graph.children(node); + hasChildren = hasChildren || children.length > 0; + } + + if (!hasChildren) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Done, no node has children', graph.nodes()); + return; + } // const clusters = Object.keys(clusterDb); + // clusters.forEach(clusterId => { + + + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Nodes = ', nodes, depth); + + for (var _i = 0; _i < nodes.length; _i++) { + var _node = nodes[_i]; + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Extracting node', _node, clusterDb, clusterDb[_node] && !clusterDb[_node].externalConnections, !graph.parent(_node), graph.node(_node), graph.children('D'), ' Depth ', depth); // Note that the node might have been removed after the Object.keys call so better check + // that it still is in the game + + if (!clusterDb[_node]) { + // Skip if the node is not a cluster + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Not a cluster', _node, depth); // break; + } else if (!clusterDb[_node].externalConnections && // !graph.parent(node) && + graph.children(_node) && graph.children(_node).length > 0) { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Cluster without external connections, without a parent and with children', _node, depth); + var graphSettings = graph.graph(); + var dir = graphSettings.rankdir === 'TB' ? 'LR' : 'TB'; + + if (clusterDb[_node]) { + if (clusterDb[_node].clusterData && clusterDb[_node].clusterData.dir) { + dir = clusterDb[_node].clusterData.dir; + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Fixing dir', clusterDb[_node].clusterData.dir, dir); + } + } + + var clusterGraph = new (graphlib__WEBPACK_IMPORTED_MODULE_0___default().Graph)({ + multigraph: true, + compound: true + }).setGraph({ + rankdir: dir, + // Todo: set proper spacing + nodesep: 50, + ranksep: 50, + marginx: 8, + marginy: 8 + }).setDefaultEdgeLabel(function () { + return {}; + }); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Old graph before copy', graphlib__WEBPACK_IMPORTED_MODULE_0___default().json.write(graph)); + copy(_node, graph, clusterGraph, _node); + graph.setNode(_node, { + clusterNode: true, + id: _node, + clusterData: clusterDb[_node].clusterData, + labelText: clusterDb[_node].labelText, + graph: clusterGraph + }); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('New graph after copy node: (', _node, ')', graphlib__WEBPACK_IMPORTED_MODULE_0___default().json.write(clusterGraph)); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug('Old graph after copy', graphlib__WEBPACK_IMPORTED_MODULE_0___default().json.write(graph)); + } else { + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('Cluster ** ', _node, ' **not meeting the criteria !externalConnections:', !clusterDb[_node].externalConnections, ' no parent: ', !graph.parent(_node), ' children ', graph.children(_node) && graph.children(_node).length > 0, graph.children('D'), depth); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.debug(clusterDb); + } + } + + nodes = graph.nodes(); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn('New list of nodes', nodes); + + for (var _i2 = 0; _i2 < nodes.length; _i2++) { + var _node2 = nodes[_i2]; + var data = graph.node(_node2); + _logger__WEBPACK_IMPORTED_MODULE_1__.log.warn(' Now next level', _node2, data); + + if (data.clusterNode) { + extractor(data.graph, depth + 1); + } + } +}; + +var sorter = function sorter(graph, nodes) { + if (nodes.length === 0) return []; + var result = Object.assign(nodes); + nodes.forEach(function (node) { + var children = graph.children(node); + var sorted = sorter(graph, children); + result = result.concat(sorted); + }); + return result; +}; + +var sortNodesByHierarchy = function sortNodesByHierarchy(graph) { + return sorter(graph, graph.children()); +}; + +/***/ }), + +/***/ "./src/dagre-wrapper/nodes.js": +/*!************************************!*\ + !*** ./src/dagre-wrapper/nodes.js ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "clear": () => (/* binding */ clear), +/* harmony export */ "insertNode": () => (/* binding */ insertNode), +/* harmony export */ "positionNode": () => (/* binding */ positionNode), +/* harmony export */ "setNodeElem": () => (/* binding */ setNodeElem) +/* harmony export */ }); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "./node_modules/d3/src/index.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); +/* harmony import */ var _shapes_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shapes/util */ "./src/dagre-wrapper/shapes/util.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config */ "./src/config.js"); +/* harmony import */ var _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./intersect/index.js */ "./src/dagre-wrapper/intersect/index.js"); +/* harmony import */ var _createLabel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./createLabel */ "./src/dagre-wrapper/createLabel.js"); +/* harmony import */ var _shapes_note__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./shapes/note */ "./src/dagre-wrapper/shapes/note.js"); +/* harmony import */ var _diagrams_class_svgDraw__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../diagrams/class/svgDraw */ "./src/diagrams/class/svgDraw.js"); +/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + + + // eslint-disable-line + + + + + + + + + +var sanitizeText = function sanitizeText(txt) { + return (0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.sanitizeText)(txt, (0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)()); +}; + +var question = function question(parent, node) { + var _labelHelper = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper.shapeSvg, + bbox = _labelHelper.bbox; + + var w = bbox.width + node.padding; + var h = bbox.height + node.padding; + var s = w + h; + var points = [{ + x: s / 2, + y: 0 + }, { + x: s, + y: -s / 2 + }, { + x: s / 2, + y: -s + }, { + x: 0, + y: -s / 2 + }]; + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Question main (Circle)'); + var questionElem = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, s, s, points); + questionElem.attr('style', node.style); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, questionElem); + + node.intersect = function (point) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('Intersect called'); + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var choice = function choice(parent, node) { + var shapeSvg = parent.insert('g').attr('class', 'node default').attr('id', node.domId || node.id); + var s = 28; + var points = [{ + x: 0, + y: s / 2 + }, { + x: s / 2, + y: 0 + }, { + x: 0, + y: -s / 2 + }, { + x: -s / 2, + y: 0 + }]; + var choice = shapeSvg.insert('polygon', ':first-child').attr('points', points.map(function (d) { + return d.x + ',' + d.y; + }).join(' ')); // center the circle around its coordinate + + choice.attr('class', 'state-start').attr('r', 7).attr('width', 28).attr('height', 28); + node.width = 28; + node.height = 28; + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].circle(node, 14, point); + }; + + return shapeSvg; +}; + +var hexagon = function hexagon(parent, node) { + var _labelHelper2 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper2.shapeSvg, + bbox = _labelHelper2.bbox; + + var f = 4; + var h = bbox.height + node.padding; + var m = h / f; + var w = bbox.width + 2 * m + node.padding; + var points = [{ + x: m, + y: 0 + }, { + x: w - m, + y: 0 + }, { + x: w, + y: -h / 2 + }, { + x: w - m, + y: -h + }, { + x: m, + y: -h + }, { + x: 0, + y: -h / 2 + }]; + var hex = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); + hex.attr('style', node.style); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, hex); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var rect_left_inv_arrow = function rect_left_inv_arrow(parent, node) { + var _labelHelper3 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper3.shapeSvg, + bbox = _labelHelper3.bbox; + + var w = bbox.width + node.padding; + var h = bbox.height + node.padding; + var points = [{ + x: -h / 2, + y: 0 + }, { + x: w, + y: 0 + }, { + x: w, + y: -h + }, { + x: -h / 2, + y: -h + }, { + x: 0, + y: -h / 2 + }]; + var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); + el.attr('style', node.style); + node.width = w + h; + node.height = h; + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var lean_right = function lean_right(parent, node) { + var _labelHelper4 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper4.shapeSvg, + bbox = _labelHelper4.bbox; + + var w = bbox.width + node.padding; + var h = bbox.height + node.padding; + var points = [{ + x: -2 * h / 6, + y: 0 + }, { + x: w - h / 6, + y: 0 + }, { + x: w + 2 * h / 6, + y: -h + }, { + x: h / 6, + y: -h + }]; + var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); + el.attr('style', node.style); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var lean_left = function lean_left(parent, node) { + var _labelHelper5 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper5.shapeSvg, + bbox = _labelHelper5.bbox; + + var w = bbox.width + node.padding; + var h = bbox.height + node.padding; + var points = [{ + x: 2 * h / 6, + y: 0 + }, { + x: w + h / 6, + y: 0 + }, { + x: w - 2 * h / 6, + y: -h + }, { + x: -h / 6, + y: -h + }]; + var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); + el.attr('style', node.style); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var trapezoid = function trapezoid(parent, node) { + var _labelHelper6 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper6.shapeSvg, + bbox = _labelHelper6.bbox; + + var w = bbox.width + node.padding; + var h = bbox.height + node.padding; + var points = [{ + x: -2 * h / 6, + y: 0 + }, { + x: w + 2 * h / 6, + y: 0 + }, { + x: w - h / 6, + y: -h + }, { + x: h / 6, + y: -h + }]; + var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); + el.attr('style', node.style); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var inv_trapezoid = function inv_trapezoid(parent, node) { + var _labelHelper7 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper7.shapeSvg, + bbox = _labelHelper7.bbox; + + var w = bbox.width + node.padding; + var h = bbox.height + node.padding; + var points = [{ + x: h / 6, + y: 0 + }, { + x: w - h / 6, + y: 0 + }, { + x: w + 2 * h / 6, + y: -h + }, { + x: -2 * h / 6, + y: -h + }]; + var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); + el.attr('style', node.style); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var rect_right_inv_arrow = function rect_right_inv_arrow(parent, node) { + var _labelHelper8 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper8.shapeSvg, + bbox = _labelHelper8.bbox; + + var w = bbox.width + node.padding; + var h = bbox.height + node.padding; + var points = [{ + x: 0, + y: 0 + }, { + x: w + h / 2, + y: 0 + }, { + x: w, + y: -h / 2 + }, { + x: w + h / 2, + y: -h + }, { + x: 0, + y: -h + }]; + var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); + el.attr('style', node.style); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var cylinder = function cylinder(parent, node) { + var _labelHelper9 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper9.shapeSvg, + bbox = _labelHelper9.bbox; + + var w = bbox.width + node.padding; + var rx = w / 2; + var ry = rx / (2.5 + w / 50); + var h = bbox.height + ry + node.padding; + var shape = 'M 0,' + ry + ' a ' + rx + ',' + ry + ' 0,0,0 ' + w + ' 0 a ' + rx + ',' + ry + ' 0,0,0 ' + -w + ' 0 l 0,' + h + ' a ' + rx + ',' + ry + ' 0,0,0 ' + w + ' 0 l 0,' + -h; + var el = shapeSvg.attr('label-offset-y', ry).insert('path', ':first-child').attr('style', node.style).attr('d', shape).attr('transform', 'translate(' + -w / 2 + ',' + -(h / 2 + ry) + ')'); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); + + node.intersect = function (point) { + var pos = _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); + var x = pos.x - node.x; + + if (rx != 0 && (Math.abs(x) < node.width / 2 || Math.abs(x) == node.width / 2 && Math.abs(pos.y - node.y) > node.height / 2 - ry)) { + // ellipsis equation: x*x / a*a + y*y / b*b = 1 + // solve for y to get adjustion value for pos.y + var y = ry * ry * (1 - x * x / (rx * rx)); + if (y != 0) y = Math.sqrt(y); + y = ry - y; + if (point.y - node.y > 0) y = -y; + pos.y += y; + } + + return pos; + }; + + return shapeSvg; +}; + +var rect = function rect(parent, node) { + var _labelHelper10 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, 'node ' + node.classes, true), + shapeSvg = _labelHelper10.shapeSvg, + bbox = _labelHelper10.bbox, + halfPadding = _labelHelper10.halfPadding; + + _logger__WEBPACK_IMPORTED_MODULE_4__.log.trace('Classes = ', node.classes); // add the rect + + var rect = shapeSvg.insert('rect', ':first-child'); + var totalWidth = bbox.width + node.padding; + var totalHeight = bbox.height + node.padding; + rect.attr('class', 'basic label-container').attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('x', -bbox.width / 2 - halfPadding).attr('y', -bbox.height / 2 - halfPadding).attr('width', totalWidth).attr('height', totalHeight); + + if (node.props) { + var propKeys = new Set(Object.keys(node.props)); + + if (node.props.borders) { + applyNodePropertyBorders(rect, node.props.borders, totalWidth, totalHeight); + propKeys.delete('borders'); + } + + propKeys.forEach(function (propKey) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn("Unknown node property ".concat(propKey)); + }); + } + + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, rect); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); + }; + + return shapeSvg; +}; + +var labelRect = function labelRect(parent, node) { + var _labelHelper11 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, 'label', true), + shapeSvg = _labelHelper11.shapeSvg, + bbox = _labelHelper11.bbox, + halfPadding = _labelHelper11.halfPadding; + + _logger__WEBPACK_IMPORTED_MODULE_4__.log.trace('Classes = ', node.classes); // add the rect + + var rect = shapeSvg.insert('rect', ':first-child'); // Hide the rect we are only after the label + + var totalWidth = 0; + var totalHeight = 0; + rect.attr('width', totalWidth).attr('height', totalHeight); + shapeSvg.attr('class', 'label edgeLabel'); + + if (node.props) { + var propKeys = new Set(Object.keys(node.props)); + + if (node.props.borders) { + applyNodePropertyBorders(rect, node.props.borders, totalWidth, totalHeight); + propKeys.delete('borders'); + } + + propKeys.forEach(function (propKey) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn("Unknown node property ".concat(propKey)); + }); + } + + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, rect); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); + }; + + return shapeSvg; +}; +/** + * @param rect + * @param borders + * @param totalWidth + * @param totalHeight + */ + + +function applyNodePropertyBorders(rect, borders, totalWidth, totalHeight) { + var strokeDashArray = []; + + var addBorder = function addBorder(length) { + strokeDashArray.push(length); + strokeDashArray.push(0); + }; + + var skipBorder = function skipBorder(length) { + strokeDashArray.push(0); + strokeDashArray.push(length); + }; + + if (borders.includes('t')) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('add top border'); + addBorder(totalWidth); + } else { + skipBorder(totalWidth); + } + + if (borders.includes('r')) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('add right border'); + addBorder(totalHeight); + } else { + skipBorder(totalHeight); + } + + if (borders.includes('b')) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('add bottom border'); + addBorder(totalWidth); + } else { + skipBorder(totalWidth); + } + + if (borders.includes('l')) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('add left border'); + addBorder(totalHeight); + } else { + skipBorder(totalHeight); + } + + rect.attr('stroke-dasharray', strokeDashArray.join(' ')); +} + +var rectWithTitle = function rectWithTitle(parent, node) { + // const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, 'node ' + node.classes); + var classes; + + if (!node.classes) { + classes = 'node default'; + } else { + classes = 'node ' + node.classes; + } // Add outer g element + + + var shapeSvg = parent.insert('g').attr('class', classes).attr('id', node.domId || node.id); // Create the title label and insert it after the rect + + var rect = shapeSvg.insert('rect', ':first-child'); // const innerRect = shapeSvg.insert('rect'); + + var innerLine = shapeSvg.insert('line'); + var label = shapeSvg.insert('g').attr('class', 'label'); + var text2 = node.labelText.flat ? node.labelText.flat() : node.labelText; // const text2 = typeof text2prim === 'object' ? text2prim[0] : text2prim; + + var title = ''; + + if (_typeof(text2) === 'object') { + title = text2[0]; + } else { + title = text2; + } + + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Label text abc79', title, text2, _typeof(text2) === 'object'); + var text = label.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(title, node.labelStyle, true, true)); + var bbox = { + width: 0, + height: 0 + }; + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { + var div = text.children[0]; + var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(text); + bbox = div.getBoundingClientRect(); + dv.attr('width', bbox.width); + dv.attr('height', bbox.height); + } + + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Text 2', text2); + var textRows = text2.slice(1, text2.length); + var titleBox = text.getBBox(); + var descr = label.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(textRows.join ? textRows.join('
') : textRows, node.labelStyle, true, true)); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { + var _div = descr.children[0]; + + var _dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(descr); + + bbox = _div.getBoundingClientRect(); + + _dv.attr('width', bbox.width); + + _dv.attr('height', bbox.height); + } // bbox = label.getBBox(); + // log.info(descr); + + + var halfPadding = node.padding / 2; + (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(descr).attr('transform', 'translate( ' + ( // (titleBox.width - bbox.width) / 2 + + bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ', ' + (titleBox.height + halfPadding + 5) + ')'); + (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(text).attr('transform', 'translate( ' + ( // (titleBox.width - bbox.width) / 2 + + bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + ', ' + 0 + ')'); // Get the size of the label + // Bounding box for title and text + + bbox = label.node().getBBox(); // Center the label + + label.attr('transform', 'translate(' + -bbox.width / 2 + ', ' + (-bbox.height / 2 - halfPadding + 3) + ')'); + rect.attr('class', 'outer title-state').attr('x', -bbox.width / 2 - halfPadding).attr('y', -bbox.height / 2 - halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding); + innerLine.attr('class', 'divider').attr('x1', -bbox.width / 2 - halfPadding).attr('x2', bbox.width / 2 + halfPadding).attr('y1', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding).attr('y2', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, rect); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); + }; + + return shapeSvg; +}; + +var stadium = function stadium(parent, node) { + var _labelHelper12 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper12.shapeSvg, + bbox = _labelHelper12.bbox; + + var h = bbox.height + node.padding; + var w = bbox.width + h / 4 + node.padding; // add the rect + + var rect = shapeSvg.insert('rect', ':first-child').attr('style', node.style).attr('rx', h / 2).attr('ry', h / 2).attr('x', -w / 2).attr('y', -h / 2).attr('width', w).attr('height', h); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, rect); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); + }; + + return shapeSvg; +}; + +var circle = function circle(parent, node) { + var _labelHelper13 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper13.shapeSvg, + bbox = _labelHelper13.bbox, + halfPadding = _labelHelper13.halfPadding; + + var circle = shapeSvg.insert('circle', ':first-child'); // center the circle around its coordinate + + circle.attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('r', bbox.width / 2 + halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Circle main'); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, circle); + + node.intersect = function (point) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('Circle intersect', node, bbox.width / 2 + halfPadding, point); + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].circle(node, bbox.width / 2 + halfPadding, point); + }; + + return shapeSvg; +}; + +var doublecircle = function doublecircle(parent, node) { + var _labelHelper14 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper14.shapeSvg, + bbox = _labelHelper14.bbox, + halfPadding = _labelHelper14.halfPadding; + + var gap = 5; + var circleGroup = shapeSvg.insert('g', ':first-child'); + var outerCircle = circleGroup.insert('circle'); + var innerCircle = circleGroup.insert('circle'); // center the circle around its coordinate + + outerCircle.attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('r', bbox.width / 2 + halfPadding + gap).attr('width', bbox.width + node.padding + gap * 2).attr('height', bbox.height + node.padding + gap * 2); + innerCircle.attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('r', bbox.width / 2 + halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('DoubleCircle main'); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, outerCircle); + + node.intersect = function (point) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.info('DoubleCircle intersect', node, bbox.width / 2 + halfPadding + gap, point); + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].circle(node, bbox.width / 2 + halfPadding + gap, point); + }; + + return shapeSvg; +}; + +var subroutine = function subroutine(parent, node) { + var _labelHelper15 = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.labelHelper)(parent, node, undefined, true), + shapeSvg = _labelHelper15.shapeSvg, + bbox = _labelHelper15.bbox; + + var w = bbox.width + node.padding; + var h = bbox.height + node.padding; + var points = [{ + x: 0, + y: 0 + }, { + x: w, + y: 0 + }, { + x: w, + y: -h + }, { + x: 0, + y: -h + }, { + x: 0, + y: 0 + }, { + x: -8, + y: 0 + }, { + x: w + 8, + y: 0 + }, { + x: w + 8, + y: -h + }, { + x: -8, + y: -h + }, { + x: -8, + y: 0 + }]; + var el = (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.insertPolygonShape)(shapeSvg, w, h, points); + el.attr('style', node.style); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, el); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].polygon(node, points, point); + }; + + return shapeSvg; +}; + +var start = function start(parent, node) { + var shapeSvg = parent.insert('g').attr('class', 'node default').attr('id', node.domId || node.id); + var circle = shapeSvg.insert('circle', ':first-child'); // center the circle around its coordinate + + circle.attr('class', 'state-start').attr('r', 7).attr('width', 14).attr('height', 14); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, circle); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].circle(node, 7, point); + }; + + return shapeSvg; +}; + +var forkJoin = function forkJoin(parent, node, dir) { + var shapeSvg = parent.insert('g').attr('class', 'node default').attr('id', node.domId || node.id); + var width = 70; + var height = 10; + + if (dir === 'LR') { + width = 10; + height = 70; + } + + var shape = shapeSvg.append('rect').attr('x', -1 * width / 2).attr('y', -1 * height / 2).attr('width', width).attr('height', height).attr('class', 'fork-join'); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, shape); + node.height = node.height + node.padding / 2; + node.width = node.width + node.padding / 2; + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); + }; + + return shapeSvg; +}; + +var end = function end(parent, node) { + var shapeSvg = parent.insert('g').attr('class', 'node default').attr('id', node.domId || node.id); + var innerCircle = shapeSvg.insert('circle', ':first-child'); + var circle = shapeSvg.insert('circle', ':first-child'); + circle.attr('class', 'state-start').attr('r', 7).attr('width', 14).attr('height', 14); + innerCircle.attr('class', 'state-end').attr('r', 5).attr('width', 10).attr('height', 10); + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, circle); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].circle(node, 7, point); + }; + + return shapeSvg; +}; + +var class_box = function class_box(parent, node) { + var halfPadding = node.padding / 2; + var rowPadding = 4; + var lineHeight = 8; + var classes; + + if (!node.classes) { + classes = 'node default'; + } else { + classes = 'node ' + node.classes; + } // Add outer g element + + + var shapeSvg = parent.insert('g').attr('class', classes).attr('id', node.domId || node.id); // Create the title label and insert it after the rect + + var rect = shapeSvg.insert('rect', ':first-child'); + var topLine = shapeSvg.insert('line'); + var bottomLine = shapeSvg.insert('line'); + var maxWidth = 0; + var maxHeight = rowPadding; + var labelContainer = shapeSvg.insert('g').attr('class', 'label'); + var verticalPos = 0; + var hasInterface = node.classData.annotations && node.classData.annotations[0]; // 1. Create the labels + + var interfaceLabelText = node.classData.annotations[0] ? '«' + node.classData.annotations[0] + '»' : ''; + var interfaceLabel = labelContainer.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(interfaceLabelText, node.labelStyle, true, true)); + var interfaceBBox = interfaceLabel.getBBox(); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { + var div = interfaceLabel.children[0]; + var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(interfaceLabel); + interfaceBBox = div.getBoundingClientRect(); + dv.attr('width', interfaceBBox.width); + dv.attr('height', interfaceBBox.height); + } + + if (node.classData.annotations[0]) { + maxHeight += interfaceBBox.height + rowPadding; + maxWidth += interfaceBBox.width; + } + + var classTitleString = node.classData.id; + + if (node.classData.type !== undefined && node.classData.type !== '') { + if ((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels) { + classTitleString += '<' + node.classData.type + '>'; + } else { + classTitleString += '<' + node.classData.type + '>'; + } + } + + var classTitleLabel = labelContainer.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(classTitleString, node.labelStyle, true, true)); + (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(classTitleLabel).attr('class', 'classTitle'); + var classTitleBBox = classTitleLabel.getBBox(); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { + var _div2 = classTitleLabel.children[0]; + + var _dv2 = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(classTitleLabel); + + classTitleBBox = _div2.getBoundingClientRect(); + + _dv2.attr('width', classTitleBBox.width); + + _dv2.attr('height', classTitleBBox.height); + } + + maxHeight += classTitleBBox.height + rowPadding; + + if (classTitleBBox.width > maxWidth) { + maxWidth = classTitleBBox.width; + } + + var classAttributes = []; + node.classData.members.forEach(function (str) { + var parsedInfo = (0,_diagrams_class_svgDraw__WEBPACK_IMPORTED_MODULE_7__.parseMember)(str); + var parsedText = parsedInfo.displayText; + + if ((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels) { + parsedText = parsedText.replace(//g, '>'); + } + + var lbl = labelContainer.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(parsedText, parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle, true, true)); + var bbox = lbl.getBBox(); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { + var _div3 = lbl.children[0]; + + var _dv3 = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(lbl); + + bbox = _div3.getBoundingClientRect(); + + _dv3.attr('width', bbox.width); + + _dv3.attr('height', bbox.height); + } + + if (bbox.width > maxWidth) { + maxWidth = bbox.width; + } + + maxHeight += bbox.height + rowPadding; + classAttributes.push(lbl); + }); + maxHeight += lineHeight; + var classMethods = []; + node.classData.methods.forEach(function (str) { + var parsedInfo = (0,_diagrams_class_svgDraw__WEBPACK_IMPORTED_MODULE_7__.parseMember)(str); + var displayText = parsedInfo.displayText; + + if ((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels) { + displayText = displayText.replace(//g, '>'); + } + + var lbl = labelContainer.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_6__["default"])(displayText, parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle, true, true)); + var bbox = lbl.getBBox(); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().flowchart.htmlLabels)) { + var _div4 = lbl.children[0]; + + var _dv4 = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(lbl); + + bbox = _div4.getBoundingClientRect(); + + _dv4.attr('width', bbox.width); + + _dv4.attr('height', bbox.height); + } + + if (bbox.width > maxWidth) { + maxWidth = bbox.width; + } + + maxHeight += bbox.height + rowPadding; + classMethods.push(lbl); + }); + maxHeight += lineHeight; // 2. Position the labels + // position the interface label + + if (hasInterface) { + var _diffX = (maxWidth - interfaceBBox.width) / 2; + + (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(interfaceLabel).attr('transform', 'translate( ' + (-1 * maxWidth / 2 + _diffX) + ', ' + -1 * maxHeight / 2 + ')'); + verticalPos = interfaceBBox.height + rowPadding; + } // Position the class title label + + + var diffX = (maxWidth - classTitleBBox.width) / 2; + (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(classTitleLabel).attr('transform', 'translate( ' + (-1 * maxWidth / 2 + diffX) + ', ' + (-1 * maxHeight / 2 + verticalPos) + ')'); + verticalPos += classTitleBBox.height + rowPadding; + topLine.attr('class', 'divider').attr('x1', -maxWidth / 2 - halfPadding).attr('x2', maxWidth / 2 + halfPadding).attr('y1', -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr('y2', -maxHeight / 2 - halfPadding + lineHeight + verticalPos); + verticalPos += lineHeight; + classAttributes.forEach(function (lbl) { + (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(lbl).attr('transform', 'translate( ' + -maxWidth / 2 + ', ' + (-1 * maxHeight / 2 + verticalPos + lineHeight / 2) + ')'); + verticalPos += classTitleBBox.height + rowPadding; + }); + verticalPos += lineHeight; + bottomLine.attr('class', 'divider').attr('x1', -maxWidth / 2 - halfPadding).attr('x2', maxWidth / 2 + halfPadding).attr('y1', -maxHeight / 2 - halfPadding + lineHeight + verticalPos).attr('y2', -maxHeight / 2 - halfPadding + lineHeight + verticalPos); + verticalPos += lineHeight; + classMethods.forEach(function (lbl) { + (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(lbl).attr('transform', 'translate( ' + -maxWidth / 2 + ', ' + (-1 * maxHeight / 2 + verticalPos) + ')'); + verticalPos += classTitleBBox.height + rowPadding; + }); // + // let bbox; + // if (evaluate(getConfig().flowchart.htmlLabels)) { + // const div = interfaceLabel.children[0]; + // const dv = select(interfaceLabel); + // bbox = div.getBoundingClientRect(); + // dv.attr('width', bbox.width); + // dv.attr('height', bbox.height); + // } + // bbox = labelContainer.getBBox(); + // log.info('Text 2', text2); + // const textRows = text2.slice(1, text2.length); + // let titleBox = text.getBBox(); + // const descr = label + // .node() + // .appendChild(createLabel(textRows.join('
'), node.labelStyle, true, true)); + // if (evaluate(getConfig().flowchart.htmlLabels)) { + // const div = descr.children[0]; + // const dv = select(descr); + // bbox = div.getBoundingClientRect(); + // dv.attr('width', bbox.width); + // dv.attr('height', bbox.height); + // } + // // bbox = label.getBBox(); + // // log.info(descr); + // select(descr).attr( + // 'transform', + // 'translate( ' + + // // (titleBox.width - bbox.width) / 2 + + // (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + + // ', ' + + // (titleBox.height + halfPadding + 5) + + // ')' + // ); + // select(text).attr( + // 'transform', + // 'translate( ' + + // // (titleBox.width - bbox.width) / 2 + + // (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + + // ', ' + + // 0 + + // ')' + // ); + // // Get the size of the label + // // Bounding box for title and text + // bbox = label.node().getBBox(); + // // Center the label + // label.attr( + // 'transform', + // 'translate(' + -bbox.width / 2 + ', ' + (-bbox.height / 2 - halfPadding + 3) + ')' + // ); + + rect.attr('class', 'outer title-state').attr('x', -maxWidth / 2 - halfPadding).attr('y', -(maxHeight / 2) - halfPadding).attr('width', maxWidth + node.padding).attr('height', maxHeight + node.padding); // innerLine + // .attr('class', 'divider') + // .attr('x1', -bbox.width / 2 - halfPadding) + // .attr('x2', bbox.width / 2 + halfPadding) + // .attr('y1', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding) + // .attr('y2', -bbox.height / 2 - halfPadding + titleBox.height + halfPadding); + + (0,_shapes_util__WEBPACK_IMPORTED_MODULE_3__.updateNodeBounds)(node, rect); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].rect(node, point); + }; + + return shapeSvg; +}; + +var shapes = { + question: question, + rect: rect, + labelRect: labelRect, + rectWithTitle: rectWithTitle, + choice: choice, + circle: circle, + doublecircle: doublecircle, + stadium: stadium, + hexagon: hexagon, + rect_left_inv_arrow: rect_left_inv_arrow, + lean_right: lean_right, + lean_left: lean_left, + trapezoid: trapezoid, + inv_trapezoid: inv_trapezoid, + rect_right_inv_arrow: rect_right_inv_arrow, + cylinder: cylinder, + start: start, + end: end, + note: _shapes_note__WEBPACK_IMPORTED_MODULE_8__["default"], + subroutine: subroutine, + fork: forkJoin, + join: forkJoin, + class_box: class_box +}; +var nodeElems = {}; +var insertNode = function insertNode(elem, node, dir) { + var newEl; + var el; // Add link when appropriate + + if (node.link) { + var target; + + if ((0,_config__WEBPACK_IMPORTED_MODULE_2__.getConfig)().securityLevel === 'sandbox') { + target = '_top'; + } else if (node.linkTarget) { + target = node.linkTarget || '_blank'; + } + + newEl = elem.insert('svg:a').attr('xlink:href', node.link).attr('target', target); + el = shapes[node.shape](newEl, node, dir); + } else { + el = shapes[node.shape](elem, node, dir); + newEl = el; + } + + if (node.tooltip) { + el.attr('title', node.tooltip); + } + + if (node.class) { + el.attr('class', 'node default ' + node.class); + } + + nodeElems[node.id] = newEl; + + if (node.haveCallback) { + nodeElems[node.id].attr('class', nodeElems[node.id].attr('class') + ' clickable'); + } +}; +var setNodeElem = function setNodeElem(elem, node) { + nodeElems[node.id] = elem; +}; +var clear = function clear() { + nodeElems = {}; +}; +var positionNode = function positionNode(node) { + var el = nodeElems[node.id]; + _logger__WEBPACK_IMPORTED_MODULE_4__.log.trace('Transforming node', node.diff, node, 'translate(' + (node.x - node.width / 2 - 5) + ', ' + node.width / 2 + ')'); + var padding = 8; + var diff = node.diff || 0; + + if (node.clusterNode) { + el.attr('transform', 'translate(' + (node.x + diff - node.width / 2) + ', ' + (node.y - node.height / 2 - padding) + ')'); + } else { + el.attr('transform', 'translate(' + node.x + ', ' + node.y + ')'); + } + + return diff; +}; + +/***/ }), + +/***/ "./src/dagre-wrapper/shapes/note.js": +/*!******************************************!*\ + !*** ./src/dagre-wrapper/shapes/note.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "./src/dagre-wrapper/shapes/util.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); +/* harmony import */ var _intersect_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../intersect/index.js */ "./src/dagre-wrapper/intersect/index.js"); + + // eslint-disable-line + + + +var note = function note(parent, node) { + var _labelHelper = (0,_util__WEBPACK_IMPORTED_MODULE_0__.labelHelper)(parent, node, 'node ' + node.classes, true), + shapeSvg = _labelHelper.shapeSvg, + bbox = _labelHelper.bbox, + halfPadding = _labelHelper.halfPadding; + + _logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Classes = ', node.classes); // add the rect + + var rect = shapeSvg.insert('rect', ':first-child'); + rect.attr('rx', node.rx).attr('ry', node.ry).attr('x', -bbox.width / 2 - halfPadding).attr('y', -bbox.height / 2 - halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding); + (0,_util__WEBPACK_IMPORTED_MODULE_0__.updateNodeBounds)(node, rect); + + node.intersect = function (point) { + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].rect(node, point); + }; + + return shapeSvg; +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (note); + +/***/ }), + +/***/ "./src/dagre-wrapper/shapes/util.js": +/*!******************************************!*\ + !*** ./src/dagre-wrapper/shapes/util.js ***! + \******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "insertPolygonShape": () => (/* binding */ insertPolygonShape), +/* harmony export */ "labelHelper": () => (/* binding */ labelHelper), +/* harmony export */ "updateNodeBounds": () => (/* binding */ updateNodeBounds) +/* harmony export */ }); +/* harmony import */ var _createLabel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../createLabel */ "./src/dagre-wrapper/createLabel.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js"); +/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "./node_modules/d3/src/index.js"); +/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../diagrams/common/common */ "./src/diagrams/common/common.js"); + + + + + +var labelHelper = function labelHelper(parent, node, _classes, isNode) { + var classes; + + if (!_classes) { + classes = 'node default'; + } else { + classes = _classes; + } // Add outer g element + + + var shapeSvg = parent.insert('g').attr('class', classes).attr('id', node.domId || node.id); // Create the label and insert it after the rect + + var label = shapeSvg.insert('g').attr('class', 'label').attr('style', node.labelStyle); + var labelText = typeof node.labelText === 'string' ? node.labelText : node.labelText[0]; + var text = label.node().appendChild((0,_createLabel__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__.sanitizeText)((0,_mermaidAPI__WEBPACK_IMPORTED_MODULE_3__.decodeEntities)(labelText), (0,_config__WEBPACK_IMPORTED_MODULE_4__.getConfig)()), node.labelStyle, false, isNode)); // Get the size of the label + + var bbox = text.getBBox(); + + if ((0,_diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__.evaluate)((0,_config__WEBPACK_IMPORTED_MODULE_4__.getConfig)().flowchart.htmlLabels)) { + var div = text.children[0]; + var dv = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(text); + bbox = div.getBoundingClientRect(); + dv.attr('width', bbox.width); + dv.attr('height', bbox.height); + } + + var halfPadding = node.padding / 2; // Center the label + + label.attr('transform', 'translate(' + -bbox.width / 2 + ', ' + -bbox.height / 2 + ')'); + return { + shapeSvg: shapeSvg, + bbox: bbox, + halfPadding: halfPadding, + label: label + }; +}; +var updateNodeBounds = function updateNodeBounds(node, element) { + var bbox = element.node().getBBox(); + node.width = bbox.width; + node.height = bbox.height; +}; +/** + * @param parent + * @param w + * @param h + * @param points + */ + +function insertPolygonShape(parent, w, h, points) { + return parent.insert('polygon', ':first-child').attr('points', points.map(function (d) { + return d.x + ',' + d.y; + }).join(' ')).attr('class', 'label-container').attr('transform', 'translate(' + -w / 2 + ',' + h / 2 + ')'); +} + +/***/ }), + +/***/ "./src/defaultConfig.js": +/*!******************************!*\ + !*** ./src/defaultConfig.js ***! + \******************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "configKeys": () => (/* binding */ configKeys), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./themes */ "./src/themes/index.js"); +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + + +/** + * **Configuration methods in Mermaid version 8.6.0 have been updated, to learn more[[click + * here](8.6.0_docs.md)].** + * + * ## **What follows are config instructions for older versions** + * + * These are the default options which can be overridden with the initialization call like so: + * + * **Example 1:**

 mermaid.initialize({ flowchart:{ htmlLabels: false } }); 
+ * + * **Example 2:**
  
+ * + * A summary of all options and their defaults is found [here](#mermaidapi-configuration-defaults). + * A description of each option follows below. + * + * @name Configuration + */ + +var config = { + /** + * Theme , the CSS style sheet + * + * | Parameter | Description | Type | Required | Values | + * | --------- | --------------- | ------ | -------- | ---------------------------------------------- | + * | theme | Built in Themes | string | Optional | 'default', 'forest', 'dark', 'neutral', 'null' | + * + * **Notes:** To disable any pre-defined mermaid theme, use "null".
 "theme": "forest",
+   * "themeCSS": ".node rect { fill: red; }" 
+ */ + theme: 'default', + themeVariables: _themes__WEBPACK_IMPORTED_MODULE_0__["default"]["default"].getThemeVariables(), + themeCSS: undefined, + + /* **maxTextSize** - The maximum allowed size of the users text diagram */ + maxTextSize: 50000, + darkMode: false, + + /** + * | Parameter | Description | Type | Required | Values | + * | ---------- | ------------------------------------------------------ | ------ | -------- | --------------------------- | + * | fontFamily | specifies the font to be used in the rendered diagrams | string | Required | Any Possible CSS FontFamily | + * + * **Notes:** Default value: '"trebuchet ms", verdana, arial, sans-serif;'. + */ + fontFamily: '"trebuchet ms", verdana, arial, sans-serif;', + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ----------------------------------------------------- | ---------------- | -------- | ------------- | + * | logLevel | This option decides the amount of logging to be used. | string \| number | Required | 1, 2, 3, 4, 5 | + * + * **Notes:** + * + * - Debug: 1 + * - Info: 2 + * - Warn: 3 + * - Error: 4 + * - Fatal: 5 (default) + */ + logLevel: 5, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------- | --------------------------------- | ------ | -------- | ------------------------------- | + * | securitylevel | Level of trust for parsed diagram | string | Required | 'strict', 'loose', 'antiscript' | + * + * **Notes**: + * + * - **strict**: (**default**) tags in text are encoded, click functionality is disabled + * - **loose**: tags in text are allowed, click functionality is enabled + * - **antiscript**: html tags in text are allowed, (only script element is removed), click + * functionality is enabled + */ + securityLevel: 'strict', + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | -------------------------------------------- | ------- | -------- | ----------- | + * | startOnLoad | Dictates whether mermaid starts on Page load | boolean | Required | true, false | + * + * **Notes:** Default value: true + */ + startOnLoad: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------------- | ---------------------------------------------------------------------------- | ------- | -------- | ----------- | + * | arrowMarkerAbsolute | Controls whether or arrow markers in html code are absolute paths or anchors | boolean | Required | true, false | + * + * **Notes**: + * + * This matters if you are using base tag settings. + * + * Default value: false + */ + arrowMarkerAbsolute: false, + + /** + * This option controls which currentConfig keys are considered _secure_ and can only be changed + * via call to mermaidAPI.initialize. Calls to mermaidAPI.reinitialize cannot make changes to the + * `secure` keys in the current currentConfig. This prevents malicious graph directives from + * overriding a site's default security. + * + * **Notes**: + * + * Default value: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'] + */ + secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'], + + /** + * This option controls if the generated ids of nodes in the SVG are generated randomly or based + * on a seed. If set to false, the IDs are generated based on the current date and thus are not + * deterministic. This is the default behaviour. + * + * **Notes**: + * + * This matters if your files are checked into sourcecontrol e.g. git and should not change unless + * content is changed. + * + * Default value: false + */ + deterministicIds: false, + + /** + * This option is the optional seed for deterministic ids. if set to undefined but + * deterministicIds is true, a simple number iterator is used. You can set this attribute to base + * the seed on a static string. + */ + deterministicIDSeed: undefined, + + /** The object containing configurations specific for flowcharts */ + flowchart: { + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ----------------------------------------------- | ------- | -------- | ------------------ | + * | diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value | + * + * **Notes:** + * + * The amount of padding around the diagram as a whole so that embedded diagrams have margins, + * expressed in pixels + * + * Default value: 8 + */ + diagramPadding: 8, + + /** + * | Parameter | Description | Type | Required | Values | + * | ---------- | -------------------------------------------------------------------------------------------- | ------- | -------- | ----------- | + * | htmlLabels | Flag for setting whether or not a html tag should be used for rendering labels on the edges. | boolean | Required | true, false | + * + * **Notes:** Default value: true. + */ + htmlLabels: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | --------------------------------------------------- | ------- | -------- | ------------------- | + * | nodeSpacing | Defines the spacing between nodes on the same level | Integer | Required | Any positive Number | + * + * **Notes:** + * + * Pertains to horizontal spacing for TB (top to bottom) or BT (bottom to top) graphs, and the + * vertical spacing for LR as well as RL graphs.** + * + * Default value: 50 + */ + nodeSpacing: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------------------------------------------------- | ------- | -------- | ------------------- | + * | rankSpacing | Defines the spacing between nodes on different levels | Integer | Required | Any Positive Number | + * + * **Notes**: + * + * Pertains to vertical spacing for TB (top to bottom) or BT (bottom to top), and the horizontal + * spacing for LR as well as RL graphs. + * + * Default value 50 + */ + rankSpacing: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | -------------------------------------------------- | ------ | -------- | ----------------------------- | + * | curve | Defines how mermaid renders curves for flowcharts. | string | Required | 'basis', 'linear', 'cardinal' | + * + * **Notes:** + * + * Default Value: 'basis' + */ + curve: 'basis', + // Only used in new experimental rendering + // represents the padding between the labels and the shape + padding: 15, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See notes | boolean | 4 | true, false | + * + * **Notes:** + * + * When this flag is set the height and width is set to 100% and is then scaling with the + * available space if not the absolute space required is used. + * + * Default value: true + */ + useMaxWidth: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------- | ------- | -------- | ----------------------- | + * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper | + * + * **Notes:** + * + * Decides which rendering engine that is to be used for the rendering. Legal values are: + * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid + * + * Default value: 'dagre-d3' + */ + defaultRenderer: 'dagre-d3' + }, + + /** The object containing configurations specific for sequence diagrams */ + sequence: { + hideUnusedParticipants: false, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ---------------------------- | ------- | -------- | ------------------ | + * | activationWidth | Width of the activation rect | Integer | Required | Any Positive Value | + * + * **Notes:** Default value :10 + */ + activationWidth: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ + diagramMarginX: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ------------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginY | Margin to the over and under the sequence diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ + diagramMarginY: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | --------------------- | ------- | -------- | ------------------ | + * | actorMargin | Margin between actors | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ + actorMargin: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | -------------------- | ------- | -------- | ------------------ | + * | width | Width of actor boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 150 + */ + width: 150, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | --------------------- | ------- | -------- | ------------------ | + * | height | Height of actor boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 65 + */ + height: 65, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ------------------------ | ------- | -------- | ------------------ | + * | boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ + boxMargin: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------- | -------------------------------------------- | ------- | -------- | ------------------ | + * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 5 + */ + boxTextMargin: 5, + + /** + * | Parameter | Description | Type | Required | Values | + * | ---------- | ------------------- | ------- | -------- | ------------------ | + * | noteMargin | margin around notes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ + noteMargin: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------- | ---------------------- | ------- | -------- | ------------------ | + * | messageMargin | Space between messages | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 35 + */ + messageMargin: 35, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------ | --------------------------- | ------ | -------- | ------------------------- | + * | messageAlign | Multiline message alignment | string | Required | 'left', 'center', 'right' | + * + * **Notes:** Default value: 'center' + */ + messageAlign: 'center', + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------ | --------------------------- | ------- | -------- | ----------- | + * | mirrorActors | Mirror actors under diagram | boolean | Required | true, false | + * + * **Notes:** Default value: true + */ + mirrorActors: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | ---------- | ----------------------------------------------------------------------- | ------- | -------- | ----------- | + * | forceMenus | forces actor popup menus to always be visible (to support E2E testing). | Boolean | Required | True, False | + * + * **Notes:** + * + * Default value: false. + */ + forceMenus: false, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ------------------------------------------ | ------- | -------- | ------------------ | + * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | Required | Any Positive Value | + * + * **Notes:** + * + * Depending on css styling this might need adjustment. + * + * Default value: 1 + */ + bottomMarginAdj: 1, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See Notes | boolean | Required | true, false | + * + * **Notes:** When this flag is set to true, the height and width is set to 100% and is then + * scaling with the available space. If set to false, the absolute space required is used. + * + * Default value: true + */ + useMaxWidth: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ------------------------------------ | ------- | -------- | ----------- | + * | rightAngles | display curve arrows as right angles | boolean | Required | true, false | + * + * **Notes:** + * + * This will display arrows that start and begin at the same node as right angles, rather than a curve + * + * Default value: false + */ + rightAngles: false, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------------- | ------------------------------- | ------- | -------- | ----------- | + * | showSequenceNumbers | This will show the node numbers | boolean | Required | true, false | + * + * **Notes:** Default value: false + */ + showSequenceNumbers: false, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------- | -------------------------------------------------- | ------- | -------- | ------------------ | + * | actorFontSize | This sets the font size of the actor's description | Integer | Require | Any Positive Value | + * + * **Notes:** **Default value 14**.. + */ + actorFontSize: 14, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ---------------------------------------------------- | ------ | -------- | --------------------------- | + * | actorFontFamily | This sets the font family of the actor's description | string | Required | Any Possible CSS FontFamily | + * + * **Notes:** Default value: "'Open Sans", sans-serif' + */ + actorFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of the actor's description + * + * **Notes:** Default value: 400. + */ + actorFontWeight: 400, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------ | ----------------------------------------------- | ------- | -------- | ------------------ | + * | noteFontSize | This sets the font size of actor-attached notes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 14 + */ + noteFontSize: 14, + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | -------------------------------------------------- | ------ | -------- | --------------------------- | + * | noteFontFamily | This sets the font family of actor-attached notes. | string | Required | Any Possible CSS FontFamily | + * + * **Notes:** Default value: ''"trebuchet ms", verdana, arial, sans-serif' + */ + noteFontFamily: '"trebuchet ms", verdana, arial, sans-serif', + + /** + * This sets the font weight of the note's description + * + * **Notes:** Default value: 400 + */ + noteFontWeight: 400, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ---------------------------------------------------- | ------ | -------- | ------------------------- | + * | noteAlign | This sets the text alignment of actor-attached notes | string | required | 'left', 'center', 'right' | + * + * **Notes:** Default value: 'center' + */ + noteAlign: 'center', + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------------------------------------- | ------- | -------- | ------------------- | + * | messageFontSize | This sets the font size of actor messages | Integer | Required | Any Positive Number | + * + * **Notes:** Default value: 16 + */ + messageFontSize: 16, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------------- | ------------------------------------------- | ------ | -------- | --------------------------- | + * | messageFontFamily | This sets the font family of actor messages | string | Required | Any Possible CSS FontFamily | + * + * **Notes:** Default value: '"trebuchet ms", verdana, arial, sans-serif' + */ + messageFontFamily: '"trebuchet ms", verdana, arial, sans-serif', + + /** + * This sets the font weight of the message's description + * + * **Notes:** Default value: 400. + */ + messageFontWeight: 400, + + /** + * This sets the auto-wrap state for the diagram + * + * **Notes:** Default value: false. + */ + wrap: false, + + /** + * This sets the auto-wrap padding for the diagram (sides only) + * + * **Notes:** Default value: 0. + */ + wrapPadding: 10, + + /** + * This sets the width of the loop-box (loop, alt, opt, par) + * + * **Notes:** Default value: 50. + */ + labelBoxWidth: 50, + + /** + * This sets the height of the loop-box (loop, alt, opt, par) + * + * **Notes:** Default value: 20. + */ + labelBoxHeight: 20, + messageFont: function messageFont() { + return { + fontFamily: this.messageFontFamily, + fontSize: this.messageFontSize, + fontWeight: this.messageFontWeight + }; + }, + noteFont: function noteFont() { + return { + fontFamily: this.noteFontFamily, + fontSize: this.noteFontSize, + fontWeight: this.noteFontWeight + }; + }, + actorFont: function actorFont() { + return { + fontFamily: this.actorFontFamily, + fontSize: this.actorFontSize, + fontWeight: this.actorFontWeight + }; + } + }, + + /** The object containing configurations specific for gantt diagrams */ + gantt: { + /** + * ### titleTopMargin + * + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | + * | titleTopMargin | Margin top for the text over the gantt diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 25 + */ + titleTopMargin: 25, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ----------------------------------- | ------- | -------- | ------------------ | + * | barHeight | The height of the bars in the graph | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 20 + */ + barHeight: 20, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ---------------------------------------------------------------- | ------- | -------- | ------------------ | + * | barGap | The margin between the different activities in the gantt diagram | Integer | Optional | Any Positive Value | + * + * **Notes:** Default value: 4 + */ + barGap: 4, + + /** + * | Parameter | Description | Type | Required | Values | + * | ---------- | -------------------------------------------------------------------------- | ------- | -------- | ------------------ | + * | topPadding | Margin between title and gantt diagram and between axis and gantt diagram. | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ + topPadding: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------ | ----------------------------------------------------------------------- | ------- | -------- | ------------------ | + * | rightPadding | The space allocated for the section name to the right of the activities | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 75 + */ + rightPadding: 75, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ---------------------------------------------------------------------- | ------- | -------- | ------------------ | + * | leftPadding | The space allocated for the section name to the left of the activities | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 75 + */ + leftPadding: 75, + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------------- | -------------------------------------------- | ------- | -------- | ------------------ | + * | gridLineStartPadding | Vertical starting position of the grid lines | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 35 + */ + gridLineStartPadding: 35, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ----------- | ------- | -------- | ------------------ | + * | fontSize | Font size | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 11 + */ + fontSize: 11, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ---------------------- | ------- | -------- | ------------------ | + * | sectionFontSize | Font size for sections | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 11 + */ + sectionFontSize: 11, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------------- | ---------------------------------------- | ------- | -------- | ------------------ | + * | numberSectionStyles | The number of alternating section styles | Integer | 4 | Any Positive Value | + * + * **Notes:** Default value: 4 + */ + numberSectionStyles: 4, + + /** + * | Parameter | Description | Type | Required | Values | + * | ---------- | --------------------------- | ---- | -------- | ---------------- | + * | axisFormat | Datetime format of the axis | 3 | Required | Date in yy-mm-dd | + * + * **Notes:** + * + * This might need adjustment to match your locale and preferences + * + * Default value: '%Y-%m-%d'. + */ + axisFormat: '%Y-%m-%d', + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See notes | boolean | 4 | true, false | + * + * **Notes:** + * + * When this flag is set the height and width is set to 100% and is then scaling with the + * available space if not the absolute space required is used. + * + * Default value: true + */ + useMaxWidth: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ----------- | ------- | -------- | ----------- | + * | topAxis | See notes | Boolean | 4 | True, False | + * + * **Notes:** when this flag is set date labels will be added to the top of the chart + * + * **Default value false**. + */ + topAxis: false, + useWidth: undefined + }, + + /** The object containing configurations specific for journey diagrams */ + journey: { + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ + diagramMarginX: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | -------------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginY | Margin to the over and under the sequence diagram. | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ + diagramMarginY: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | --------------------- | ------- | -------- | ------------------ | + * | actorMargin | Margin between actors | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ + leftMargin: 150, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | -------------------- | ------- | -------- | ------------------ | + * | width | Width of actor boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 150 + */ + width: 150, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | --------------------- | ------- | -------- | ------------------ | + * | height | Height of actor boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 65 + */ + height: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ------------------------ | ------- | -------- | ------------------ | + * | boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ + boxMargin: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------- | -------------------------------------------- | ------- | -------- | ------------------ | + * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 5 + */ + boxTextMargin: 5, + + /** + * | Parameter | Description | Type | Required | Values | + * | ---------- | ------------------- | ------- | -------- | ------------------ | + * | noteMargin | Margin around notes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ + noteMargin: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------- | ----------------------- | ------- | -------- | ------------------ | + * | messageMargin | Space between messages. | Integer | Required | Any Positive Value | + * + * **Notes:** + * + * Space between messages. + * + * Default value: 35 + */ + messageMargin: 35, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------ | --------------------------- | ---- | -------- | ------------------------- | + * | messageAlign | Multiline message alignment | 3 | 4 | 'left', 'center', 'right' | + * + * **Notes:** Default value: 'center' + */ + messageAlign: 'center', + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ------------------------------------------ | ------- | -------- | ------------------ | + * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | 4 | Any Positive Value | + * + * **Notes:** + * + * Depending on css styling this might need adjustment. + * + * Default value: 1 + */ + bottomMarginAdj: 1, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See notes | boolean | 4 | true, false | + * + * **Notes:** + * + * When this flag is set the height and width is set to 100% and is then scaling with the + * available space if not the absolute space required is used. + * + * Default value: true + */ + useMaxWidth: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | --------------------------------- | ---- | -------- | ----------- | + * | rightAngles | Curved Arrows become Right Angles | 3 | 4 | true, false | + * + * **Notes:** + * + * This will display arrows that start and begin at the same node as right angles, rather than a curves + * + * Default value: false + */ + rightAngles: false, + taskFontSize: 14, + taskFontFamily: '"Open Sans", sans-serif', + taskMargin: 50, + // width of activation box + activationWidth: 10, + // text placement as: tspan | fo | old only text as before + textPlacement: 'fo', + actorColours: ['#8FBC8F', '#7CFC00', '#00FFFF', '#20B2AA', '#B0E0E6', '#FFFFE0'], + sectionFills: ['#191970', '#8B008B', '#4B0082', '#2F4F4F', '#800000', '#8B4513', '#00008B'], + sectionColours: ['#fff'] + }, + class: { + arrowMarkerAbsolute: false, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See notes | boolean | 4 | true, false | + * + * **Notes:** + * + * When this flag is set the height and width is set to 100% and is then scaling with the + * available space if not the absolute space required is used. + * + * Default value: true + */ + useMaxWidth: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------- | ------- | -------- | ----------------------- | + * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper | + * + * **Notes**: + * + * Decides which rendering engine that is to be used for the rendering. Legal values are: + * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid + * + * Default value: 'dagre-d3' + */ + defaultRenderer: 'dagre-wrapper' + }, + state: { + dividerMargin: 10, + sizeUnit: 5, + padding: 8, + textHeight: 10, + titleShift: -15, + noteMargin: 10, + forkWidth: 70, + forkHeight: 7, + // Used + miniPadding: 2, + // Font size factor, this is used to guess the width of the edges labels before rendering by dagre + // layout. This might need updating if/when switching font + fontSizeFactor: 5.02, + fontSize: 24, + labelHeight: 16, + edgeLengthFactor: '20', + compositTitleSize: 35, + radius: 5, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See notes | boolean | 4 | true, false | + * + * **Notes:** + * + * When this flag is set the height and width is set to 100% and is then scaling with the + * available space if not the absolute space required is used. + * + * Default value: true + */ + useMaxWidth: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------- | ------- | -------- | ----------------------- | + * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper | + * + * **Notes:** + * + * Decides which rendering engine that is to be used for the rendering. Legal values are: + * dagre-d3 dagre-wrapper - wrapper for dagre implemented in mermaid + * + * Default value: 'dagre-d3' + */ + defaultRenderer: 'dagre-wrapper' + }, + + /** The object containing configurations specific for entity relationship diagrams */ + er: { + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ----------------------------------------------- | ------- | -------- | ------------------ | + * | diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value | + * + * **Notes:** + * + * The amount of padding around the diagram as a whole so that embedded diagrams have margins, + * expressed in pixels + * + * Default value: 20 + */ + diagramPadding: 20, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ---------------------------------------- | ------ | -------- | ---------------------- | + * | layoutDirection | Directional bias for layout of entities. | string | Required | "TB", "BT", "LR", "RL" | + * + * **Notes:** + * + * 'TB' for Top-Bottom, 'BT'for Bottom-Top, 'LR' for Left-Right, or 'RL' for Right to Left. + * + * T = top, B = bottom, L = left, and R = right. + * + * Default value: 'TB' + */ + layoutDirection: 'TB', + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------- | ------- | -------- | ------------------ | + * | minEntityWidth | The minimum width of an entity box | Integer | Required | Any Positive Value | + * + * **Notes:** Expressed in pixels. Default value: 100 + */ + minEntityWidth: 100, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------------------------------- | ------- | -------- | ------------------ | + * | minEntityHeight | The minimum height of an entity box | Integer | 4 | Any Positive Value | + * + * **Notes:** Expressed in pixels Default value: 75 + */ + minEntityHeight: 75, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------- | ------------------------------------------------------------ | ------- | -------- | ------------------ | + * | entityPadding | Minimum internal padding between text in box and box borders | Integer | 4 | Any Positive Value | + * + * **Notes:** + * + * The minimum internal padding between text in an entity box and the enclosing box borders, + * expressed in pixels. + * + * Default value: 15 + */ + entityPadding: 15, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ----------------------------------- | ------ | -------- | -------------------- | + * | stroke | Stroke color of box edges and lines | string | 4 | Any recognized color | + * + * **Notes:** Default value: 'gray' + */ + stroke: 'gray', + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | -------------------------- | ------ | -------- | -------------------- | + * | fill | Fill color of entity boxes | string | 4 | Any recognized color | + * + * **Notes:** Default value: 'honeydew' + */ + fill: 'honeydew', + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ------------------- | ------- | -------- | ------------------ | + * | fontSize | Font Size in pixels | Integer | | Any Positive Value | + * + * **Notes:** + * + * Font size (expressed as an integer representing a number of pixels) Default value: 12 + */ + fontSize: 12, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See Notes | boolean | Required | true, false | + * + * **Notes:** + * + * When this flag is set to true, the diagram width is locked to 100% and scaled based on + * available space. If set to false, the diagram reserves its absolute width. + * + * Default value: true + */ + useMaxWidth: true + }, + + /** The object containing configurations specific for pie diagrams */ + pie: { + useWidth: undefined, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See Notes | boolean | Required | true, false | + * + * **Notes:** + * + * When this flag is set to true, the diagram width is locked to 100% and scaled based on + * available space. If set to false, the diagram reserves its absolute width. + * + * Default value: true + */ + useMaxWidth: true + }, + + /** The object containing configurations specific for req diagrams */ + requirement: { + useWidth: undefined, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See Notes | boolean | Required | true, false | + * + * **Notes:** + * + * When this flag is set to true, the diagram width is locked to 100% and scaled based on + * available space. If set to false, the diagram reserves its absolute width. + * + * Default value: true + */ + useMaxWidth: true, + rect_fill: '#f9f9f9', + text_color: '#333', + rect_border_size: '0.5px', + rect_border_color: '#bbb', + rect_min_width: 200, + rect_min_height: 200, + fontSize: 14, + rect_padding: 10, + line_height: 20 + }, + gitGraph: { + diagramPadding: 8, + nodeLabel: { + width: 75, + height: 100, + x: -25, + y: 0 + }, + mainBranchName: 'main', + mainBranchOrder: 0, + showCommitLabel: true, + showBranches: true, + rotateCommitLabel: true + }, + + /** The object containing configurations specific for c4 diagrams */ + c4: { + useWidth: undefined, + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginX | Margin to the right and left of the c4 diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ + diagramMarginX: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ------------------------------------------- | ------- | -------- | ------------------ | + * | diagramMarginY | Margin to the over and under the c4 diagram | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ + diagramMarginY: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------- | --------------------- | ------- | -------- | ------------------ | + * | c4ShapeMargin | Margin between shapes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 50 + */ + c4ShapeMargin: 50, + + /** + * | Parameter | Description | Type | Required | Values | + * | -------------- | ---------------------- | ------- | -------- | ------------------ | + * | c4ShapePadding | Padding between shapes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 20 + */ + c4ShapePadding: 20, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | --------------------- | ------- | -------- | ------------------ | + * | width | Width of person boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 216 + */ + width: 216, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ---------------------- | ------- | -------- | ------------------ | + * | height | Height of person boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 60 + */ + height: 60, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------- | ------------------- | ------- | -------- | ------------------ | + * | boxMargin | Margin around boxes | Integer | Required | Any Positive Value | + * + * **Notes:** Default value: 10 + */ + boxMargin: 10, + + /** + * | Parameter | Description | Type | Required | Values | + * | ----------- | ----------- | ------- | -------- | ----------- | + * | useMaxWidth | See Notes | boolean | Required | true, false | + * + * **Notes:** When this flag is set to true, the height and width is set to 100% and is then + * scaling with the available space. If set to false, the absolute space required is used. + * + * Default value: true + */ + useMaxWidth: true, + + /** + * | Parameter | Description | Type | Required | Values | + * | ------------ | ----------- | ------- | -------- | ------------------ | + * | c4ShapeInRow | See Notes | Integer | Required | Any Positive Value | + * + * **Notes:** How many shapes to place in each row. + * + * Default value: 4 + */ + c4ShapeInRow: 4, + nextLinePaddingX: 0, + + /** + * | Parameter | Description | Type | Required | Values | + * | --------------- | ----------- | ------- | -------- | ------------------ | + * | c4BoundaryInRow | See Notes | Integer | Required | Any Positive Value | + * + * **Notes:** How many boundarys to place in each row. + * + * Default value: 2 + */ + c4BoundaryInRow: 2, + + /** + * This sets the font size of Person shape for the diagram + * + * **Notes:** Default value: 14. + */ + personFontSize: 14, + + /** + * This sets the font family of Person shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + personFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Person shape for the diagram + * + * **Notes:** Default value: normal. + */ + personFontWeight: 'normal', + + /** + * This sets the font size of External Person shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_personFontSize: 14, + + /** + * This sets the font family of External Person shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_personFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External Person shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_personFontWeight: 'normal', + + /** + * This sets the font size of System shape for the diagram + * + * **Notes:** Default value: 14. + */ + systemFontSize: 14, + + /** + * This sets the font family of System shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + systemFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of System shape for the diagram + * + * **Notes:** Default value: normal. + */ + systemFontWeight: 'normal', + + /** + * This sets the font size of External System shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_systemFontSize: 14, + + /** + * This sets the font family of External System shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_systemFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External System shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_systemFontWeight: 'normal', + + /** + * This sets the font size of System DB shape for the diagram + * + * **Notes:** Default value: 14. + */ + system_dbFontSize: 14, + + /** + * This sets the font family of System DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + system_dbFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of System DB shape for the diagram + * + * **Notes:** Default value: normal. + */ + system_dbFontWeight: 'normal', + + /** + * This sets the font size of External System DB shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_system_dbFontSize: 14, + + /** + * This sets the font family of External System DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_system_dbFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External System DB shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_system_dbFontWeight: 'normal', + + /** + * This sets the font size of System Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ + system_queueFontSize: 14, + + /** + * This sets the font family of System Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + system_queueFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of System Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ + system_queueFontWeight: 'normal', + + /** + * This sets the font size of External System Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_system_queueFontSize: 14, + + /** + * This sets the font family of External System Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_system_queueFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External System Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_system_queueFontWeight: 'normal', + + /** + * This sets the font size of Boundary shape for the diagram + * + * **Notes:** Default value: 14. + */ + boundaryFontSize: 14, + + /** + * This sets the font family of Boundary shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + boundaryFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Boundary shape for the diagram + * + * **Notes:** Default value: normal. + */ + boundaryFontWeight: 'normal', + + /** + * This sets the font size of Message shape for the diagram + * + * **Notes:** Default value: 12. + */ + messageFontSize: 12, + + /** + * This sets the font family of Message shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + messageFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Message shape for the diagram + * + * **Notes:** Default value: normal. + */ + messageFontWeight: 'normal', + + /** + * This sets the font size of Container shape for the diagram + * + * **Notes:** Default value: 14. + */ + containerFontSize: 14, + + /** + * This sets the font family of Container shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + containerFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Container shape for the diagram + * + * **Notes:** Default value: normal. + */ + containerFontWeight: 'normal', + + /** + * This sets the font size of External Container shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_containerFontSize: 14, + + /** + * This sets the font family of External Container shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_containerFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External Container shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_containerFontWeight: 'normal', + + /** + * This sets the font size of Container DB shape for the diagram + * + * **Notes:** Default value: 14. + */ + container_dbFontSize: 14, + + /** + * This sets the font family of Container DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + container_dbFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Container DB shape for the diagram + * + * **Notes:** Default value: normal. + */ + container_dbFontWeight: 'normal', + + /** + * This sets the font size of External Container DB shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_container_dbFontSize: 14, + + /** + * This sets the font family of External Container DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_container_dbFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External Container DB shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_container_dbFontWeight: 'normal', + + /** + * This sets the font size of Container Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ + container_queueFontSize: 14, + + /** + * This sets the font family of Container Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + container_queueFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Container Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ + container_queueFontWeight: 'normal', + + /** + * This sets the font size of External Container Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_container_queueFontSize: 14, + + /** + * This sets the font family of External Container Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_container_queueFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External Container Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_container_queueFontWeight: 'normal', + + /** + * This sets the font size of Component shape for the diagram + * + * **Notes:** Default value: 14. + */ + componentFontSize: 14, + + /** + * This sets the font family of Component shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + componentFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Component shape for the diagram + * + * **Notes:** Default value: normal. + */ + componentFontWeight: 'normal', + + /** + * This sets the font size of External Component shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_componentFontSize: 14, + + /** + * This sets the font family of External Component shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_componentFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External Component shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_componentFontWeight: 'normal', + + /** + * This sets the font size of Component DB shape for the diagram + * + * **Notes:** Default value: 14. + */ + component_dbFontSize: 14, + + /** + * This sets the font family of Component DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + component_dbFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Component DB shape for the diagram + * + * **Notes:** Default value: normal. + */ + component_dbFontWeight: 'normal', + + /** + * This sets the font size of External Component DB shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_component_dbFontSize: 14, + + /** + * This sets the font family of External Component DB shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_component_dbFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External Component DB shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_component_dbFontWeight: 'normal', + + /** + * This sets the font size of Component Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ + component_queueFontSize: 14, + + /** + * This sets the font family of Component Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + component_queueFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of Component Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ + component_queueFontWeight: 'normal', + + /** + * This sets the font size of External Component Queue shape for the diagram + * + * **Notes:** Default value: 14. + */ + external_component_queueFontSize: 14, + + /** + * This sets the font family of External Component Queue shape for the diagram + * + * **Notes:** Default value: "Open Sans", sans-serif. + */ + external_component_queueFontFamily: '"Open Sans", sans-serif', + + /** + * This sets the font weight of External Component Queue shape for the diagram + * + * **Notes:** Default value: normal. + */ + external_component_queueFontWeight: 'normal', + + /** + * This sets the auto-wrap state for the diagram + * + * **Notes:** Default value: true. + */ + wrap: true, + + /** + * This sets the auto-wrap padding for the diagram (sides only) + * + * **Notes:** Default value: 0. + */ + wrapPadding: 10, + personFont: function personFont() { + return { + fontFamily: this.personFontFamily, + fontSize: this.personFontSize, + fontWeight: this.personFontWeight + }; + }, + external_personFont: function external_personFont() { + return { + fontFamily: this.external_personFontFamily, + fontSize: this.external_personFontSize, + fontWeight: this.external_personFontWeight + }; + }, + systemFont: function systemFont() { + return { + fontFamily: this.systemFontFamily, + fontSize: this.systemFontSize, + fontWeight: this.systemFontWeight + }; + }, + external_systemFont: function external_systemFont() { + return { + fontFamily: this.external_systemFontFamily, + fontSize: this.external_systemFontSize, + fontWeight: this.external_systemFontWeight + }; + }, + system_dbFont: function system_dbFont() { + return { + fontFamily: this.system_dbFontFamily, + fontSize: this.system_dbFontSize, + fontWeight: this.system_dbFontWeight + }; + }, + external_system_dbFont: function external_system_dbFont() { + return { + fontFamily: this.external_system_dbFontFamily, + fontSize: this.external_system_dbFontSize, + fontWeight: this.external_system_dbFontWeight + }; + }, + system_queueFont: function system_queueFont() { + return { + fontFamily: this.system_queueFontFamily, + fontSize: this.system_queueFontSize, + fontWeight: this.system_queueFontWeight + }; + }, + external_system_queueFont: function external_system_queueFont() { + return { + fontFamily: this.external_system_queueFontFamily, + fontSize: this.external_system_queueFontSize, + fontWeight: this.external_system_queueFontWeight + }; + }, + containerFont: function containerFont() { + return { + fontFamily: this.containerFontFamily, + fontSize: this.containerFontSize, + fontWeight: this.containerFontWeight + }; + }, + external_containerFont: function external_containerFont() { + return { + fontFamily: this.external_containerFontFamily, + fontSize: this.external_containerFontSize, + fontWeight: this.external_containerFontWeight + }; + }, + container_dbFont: function container_dbFont() { + return { + fontFamily: this.container_dbFontFamily, + fontSize: this.container_dbFontSize, + fontWeight: this.container_dbFontWeight + }; + }, + external_container_dbFont: function external_container_dbFont() { + return { + fontFamily: this.external_container_dbFontFamily, + fontSize: this.external_container_dbFontSize, + fontWeight: this.external_container_dbFontWeight + }; + }, + container_queueFont: function container_queueFont() { + return { + fontFamily: this.container_queueFontFamily, + fontSize: this.container_queueFontSize, + fontWeight: this.container_queueFontWeight + }; + }, + external_container_queueFont: function external_container_queueFont() { + return { + fontFamily: this.external_container_queueFontFamily, + fontSize: this.external_container_queueFontSize, + fontWeight: this.external_container_queueFontWeight + }; + }, + componentFont: function componentFont() { + return { + fontFamily: this.componentFontFamily, + fontSize: this.componentFontSize, + fontWeight: this.componentFontWeight + }; + }, + external_componentFont: function external_componentFont() { + return { + fontFamily: this.external_componentFontFamily, + fontSize: this.external_componentFontSize, + fontWeight: this.external_componentFontWeight + }; + }, + component_dbFont: function component_dbFont() { + return { + fontFamily: this.component_dbFontFamily, + fontSize: this.component_dbFontSize, + fontWeight: this.component_dbFontWeight + }; + }, + external_component_dbFont: function external_component_dbFont() { + return { + fontFamily: this.external_component_dbFontFamily, + fontSize: this.external_component_dbFontSize, + fontWeight: this.external_component_dbFontWeight + }; + }, + component_queueFont: function component_queueFont() { + return { + fontFamily: this.component_queueFontFamily, + fontSize: this.component_queueFontSize, + fontWeight: this.component_queueFontWeight + }; + }, + external_component_queueFont: function external_component_queueFont() { + return { + fontFamily: this.external_component_queueFontFamily, + fontSize: this.external_component_queueFontSize, + fontWeight: this.external_component_queueFontWeight + }; + }, + boundaryFont: function boundaryFont() { + return { + fontFamily: this.boundaryFontFamily, + fontSize: this.boundaryFontSize, + fontWeight: this.boundaryFontWeight + }; + }, + messageFont: function messageFont() { + return { + fontFamily: this.messageFontFamily, + fontSize: this.messageFontSize, + fontWeight: this.messageFontWeight + }; + }, + // ' Colors + // ' ################################## + person_bg_color: '#08427B', + person_border_color: '#073B6F', + external_person_bg_color: '#686868', + external_person_border_color: '#8A8A8A', + system_bg_color: '#1168BD', + system_border_color: '#3C7FC0', + system_db_bg_color: '#1168BD', + system_db_border_color: '#3C7FC0', + system_queue_bg_color: '#1168BD', + system_queue_border_color: '#3C7FC0', + external_system_bg_color: '#999999', + external_system_border_color: '#8A8A8A', + external_system_db_bg_color: '#999999', + external_system_db_border_color: '#8A8A8A', + external_system_queue_bg_color: '#999999', + external_system_queue_border_color: '#8A8A8A', + container_bg_color: '#438DD5', + container_border_color: '#3C7FC0', + container_db_bg_color: '#438DD5', + container_db_border_color: '#3C7FC0', + container_queue_bg_color: '#438DD5', + container_queue_border_color: '#3C7FC0', + external_container_bg_color: '#B3B3B3', + external_container_border_color: '#A6A6A6', + external_container_db_bg_color: '#B3B3B3', + external_container_db_border_color: '#A6A6A6', + external_container_queue_bg_color: '#B3B3B3', + external_container_queue_border_color: '#A6A6A6', + component_bg_color: '#85BBF0', + component_border_color: '#78A8D8', + component_db_bg_color: '#85BBF0', + component_db_border_color: '#78A8D8', + component_queue_bg_color: '#85BBF0', + component_queue_border_color: '#78A8D8', + external_component_bg_color: '#CCCCCC', + external_component_border_color: '#BFBFBF', + external_component_db_bg_color: '#CCCCCC', + external_component_db_border_color: '#BFBFBF', + external_component_queue_bg_color: '#CCCCCC', + external_component_queue_border_color: '#BFBFBF' + } +}; +config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute; +config.gitGraph.arrowMarkerAbsolute = config.arrowMarkerAbsolute; + +var keyify = function keyify(obj) { + var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + return Object.keys(obj).reduce(function (res, el) { + if (Array.isArray(obj[el])) { + return res; + } else if (_typeof(obj[el]) === 'object' && obj[el] !== null) { + return [].concat(_toConsumableArray(res), [prefix + el], _toConsumableArray(keyify(obj[el], ''))); + } + + return [].concat(_toConsumableArray(res), [prefix + el]); + }, []); +}; + +var configKeys = keyify(config, ''); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (config); + +/***/ }), + +/***/ "./src/diagrams/c4/c4Db.js": +/*!*********************************!*\ + !*** ./src/diagrams/c4/c4Db.js ***! + \*********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "ARROWTYPE": () => (/* binding */ ARROWTYPE), +/* harmony export */ "LINETYPE": () => (/* binding */ LINETYPE), +/* harmony export */ "PLACEMENT": () => (/* binding */ PLACEMENT), +/* harmony export */ "addComponent": () => (/* binding */ addComponent), +/* harmony export */ "addContainer": () => (/* binding */ addContainer), +/* harmony export */ "addContainerBoundary": () => (/* binding */ addContainerBoundary), +/* harmony export */ "addDeploymentNode": () => (/* binding */ addDeploymentNode), +/* harmony export */ "addPersonOrSystem": () => (/* binding */ addPersonOrSystem), +/* harmony export */ "addPersonOrSystemBoundary": () => (/* binding */ addPersonOrSystemBoundary), +/* harmony export */ "addRel": () => (/* binding */ addRel), +/* harmony export */ "autoWrap": () => (/* binding */ autoWrap), +/* harmony export */ "clear": () => (/* binding */ clear), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "getBoundarys": () => (/* binding */ getBoundarys), +/* harmony export */ "getC4BoundaryInRow": () => (/* binding */ getC4BoundaryInRow), +/* harmony export */ "getC4Shape": () => (/* binding */ getC4Shape), +/* harmony export */ "getC4ShapeArray": () => (/* binding */ getC4ShapeArray), +/* harmony export */ "getC4ShapeInRow": () => (/* binding */ getC4ShapeInRow), +/* harmony export */ "getC4ShapeKeys": () => (/* binding */ getC4ShapeKeys), +/* harmony export */ "getC4Type": () => (/* binding */ getC4Type), +/* harmony export */ "getCurrentBoundaryParse": () => (/* binding */ getCurrentBoundaryParse), +/* harmony export */ "getParentBoundaryParse": () => (/* binding */ getParentBoundaryParse), +/* harmony export */ "getRels": () => (/* binding */ getRels), +/* harmony export */ "getTitle": () => (/* binding */ getTitle), +/* harmony export */ "parseDirective": () => (/* binding */ parseDirective), +/* harmony export */ "popBoundaryParseStack": () => (/* binding */ popBoundaryParseStack), +/* harmony export */ "setC4Type": () => (/* binding */ setC4Type), +/* harmony export */ "setTitle": () => (/* binding */ setTitle), +/* harmony export */ "setWrap": () => (/* binding */ setWrap), +/* harmony export */ "updateElStyle": () => (/* binding */ updateElStyle), +/* harmony export */ "updateLayoutConfig": () => (/* binding */ updateLayoutConfig), +/* harmony export */ "updateRelStyle": () => (/* binding */ updateRelStyle) +/* harmony export */ }); +/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../config */ "./src/config.js"); +/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); +/* harmony import */ var _commonDb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../commonDb */ "./src/commonDb.js"); +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + + + + + + +var c4ShapeArray = []; +var boundaryParseStack = ['']; +var currentBoundaryParse = 'global'; +var parentBoundaryParse = ''; +var boundarys = [{ + alias: 'global', + label: { + text: 'global' + }, + type: { + text: 'global' + }, + tags: null, + link: null, + parentBoundary: '' +}]; +var rels = []; +var title = ''; +var wrapEnabled = false; +var description = ''; +var c4ShapeInRow = 4; +var c4BoundaryInRow = 2; +var c4Type; +var getC4Type = function getC4Type() { + return c4Type; +}; +var setC4Type = function setC4Type(c4TypeParam) { + var sanitizedText = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.sanitizeText)(c4TypeParam, _config__WEBPACK_IMPORTED_MODULE_1__.getConfig()); + c4Type = sanitizedText; +}; +var parseDirective = function parseDirective(statement, context, type) { + _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"].parseDirective(this, statement, context, type); +}; //type, from, to, label, ?techn, ?descr, ?sprite, ?tags, $link + +var addRel = function addRel(type, from, to, label, techn, descr, sprite, tags, link) { + // Don't allow label nulling + if (type === undefined || type === null || from === undefined || from === null || to === undefined || to === null || label === undefined || label === null) return; + var rel = {}; + var old = rels.find(function (rel) { + return rel.from === from && rel.to === to; + }); + + if (old) { + rel = old; + } else { + rels.push(rel); + } + + rel.type = type; + rel.from = from; + rel.to = to; + rel.label = { + text: label + }; + + if (techn === undefined || techn === null) { + rel.techn = { + text: '' + }; + } else { + if (_typeof(techn) === 'object') { + var _Object$entries$ = _slicedToArray(Object.entries(techn)[0], 2), + key = _Object$entries$[0], + value = _Object$entries$[1]; + + rel[key] = { + text: value + }; + } else { + rel.techn = { + text: techn + }; + } + } + + if (descr === undefined || descr === null) { + rel.descr = { + text: '' + }; + } else { + if (_typeof(descr) === 'object') { + var _Object$entries$2 = _slicedToArray(Object.entries(descr)[0], 2), + _key = _Object$entries$2[0], + _value = _Object$entries$2[1]; + + rel[_key] = { + text: _value + }; + } else { + rel.descr = { + text: descr + }; + } + } + + if (_typeof(sprite) === 'object') { + var _Object$entries$3 = _slicedToArray(Object.entries(sprite)[0], 2), + _key2 = _Object$entries$3[0], + _value2 = _Object$entries$3[1]; + + rel[_key2] = _value2; + } else { + rel.sprite = sprite; + } + + if (_typeof(tags) === 'object') { + var _Object$entries$4 = _slicedToArray(Object.entries(tags)[0], 2), + _key3 = _Object$entries$4[0], + _value3 = _Object$entries$4[1]; + + rel[_key3] = _value3; + } else { + rel.tags = tags; + } + + if (_typeof(link) === 'object') { + var _Object$entries$5 = _slicedToArray(Object.entries(link)[0], 2), + _key4 = _Object$entries$5[0], + _value4 = _Object$entries$5[1]; + + rel[_key4] = _value4; + } else { + rel.link = link; + } + + rel.wrap = autoWrap(); +}; //type, alias, label, ?descr, ?sprite, ?tags, $link + +var addPersonOrSystem = function addPersonOrSystem(typeC4Shape, alias, label, descr, sprite, tags, link) { + // Don't allow label nulling + if (alias === null || label === null) return; + var personOrSystem = {}; + var old = c4ShapeArray.find(function (personOrSystem) { + return personOrSystem.alias === alias; + }); + + if (old && alias === old.alias) { + personOrSystem = old; + } else { + personOrSystem.alias = alias; + c4ShapeArray.push(personOrSystem); + } // Don't allow null labels, either + + + if (label === undefined || label === null) { + personOrSystem.label = { + text: '' + }; + } else { + personOrSystem.label = { + text: label + }; + } + + if (descr === undefined || descr === null) { + personOrSystem.descr = { + text: '' + }; + } else { + if (_typeof(descr) === 'object') { + var _Object$entries$6 = _slicedToArray(Object.entries(descr)[0], 2), + key = _Object$entries$6[0], + value = _Object$entries$6[1]; + + personOrSystem[key] = { + text: value + }; + } else { + personOrSystem.descr = { + text: descr + }; + } + } + + if (_typeof(sprite) === 'object') { + var _Object$entries$7 = _slicedToArray(Object.entries(sprite)[0], 2), + _key5 = _Object$entries$7[0], + _value5 = _Object$entries$7[1]; + + personOrSystem[_key5] = _value5; + } else { + personOrSystem.sprite = sprite; + } + + if (_typeof(tags) === 'object') { + var _Object$entries$8 = _slicedToArray(Object.entries(tags)[0], 2), + _key6 = _Object$entries$8[0], + _value6 = _Object$entries$8[1]; + + personOrSystem[_key6] = _value6; + } else { + personOrSystem.tags = tags; + } + + if (_typeof(link) === 'object') { + var _Object$entries$9 = _slicedToArray(Object.entries(link)[0], 2), + _key7 = _Object$entries$9[0], + _value7 = _Object$entries$9[1]; + + personOrSystem[_key7] = _value7; + } else { + personOrSystem.link = link; + } + + personOrSystem.typeC4Shape = { + text: typeC4Shape + }; + personOrSystem.parentBoundary = currentBoundaryParse; + personOrSystem.wrap = autoWrap(); +}; //type, alias, label, ?techn, ?descr ?sprite, ?tags, $link + +var addContainer = function addContainer(typeC4Shape, alias, label, techn, descr, sprite, tags, link) { + // Don't allow label nulling + if (alias === null || label === null) return; + var container = {}; + var old = c4ShapeArray.find(function (container) { + return container.alias === alias; + }); + + if (old && alias === old.alias) { + container = old; + } else { + container.alias = alias; + c4ShapeArray.push(container); + } // Don't allow null labels, either + + + if (label === undefined || label === null) { + container.label = { + text: '' + }; + } else { + container.label = { + text: label + }; + } + + if (techn === undefined || techn === null) { + container.techn = { + text: '' + }; + } else { + if (_typeof(techn) === 'object') { + var _Object$entries$10 = _slicedToArray(Object.entries(techn)[0], 2), + key = _Object$entries$10[0], + value = _Object$entries$10[1]; + + container[key] = { + text: value + }; + } else { + container.techn = { + text: techn + }; + } + } + + if (descr === undefined || descr === null) { + container.descr = { + text: '' + }; + } else { + if (_typeof(descr) === 'object') { + var _Object$entries$11 = _slicedToArray(Object.entries(descr)[0], 2), + _key8 = _Object$entries$11[0], + _value8 = _Object$entries$11[1]; + + container[_key8] = { + text: _value8 + }; + } else { + container.descr = { + text: descr + }; + } + } + + if (_typeof(sprite) === 'object') { + var _Object$entries$12 = _slicedToArray(Object.entries(sprite)[0], 2), + _key9 = _Object$entries$12[0], + _value9 = _Object$entries$12[1]; + + container[_key9] = _value9; + } else { + container.sprite = sprite; + } + + if (_typeof(tags) === 'object') { + var _Object$entries$13 = _slicedToArray(Object.entries(tags)[0], 2), + _key10 = _Object$entries$13[0], + _value10 = _Object$entries$13[1]; + + container[_key10] = _value10; + } else { + container.tags = tags; + } + + if (_typeof(link) === 'object') { + var _Object$entries$14 = _slicedToArray(Object.entries(link)[0], 2), + _key11 = _Object$entries$14[0], + _value11 = _Object$entries$14[1]; + + container[_key11] = _value11; + } else { + container.link = link; + } + + container.wrap = autoWrap(); + container.typeC4Shape = { + text: typeC4Shape + }; + container.parentBoundary = currentBoundaryParse; +}; //type, alias, label, ?techn, ?descr ?sprite, ?tags, $link + +var addComponent = function addComponent(typeC4Shape, alias, label, techn, descr, sprite, tags, link) { + // Don't allow label nulling + if (alias === null || label === null) return; + var component = {}; + var old = c4ShapeArray.find(function (component) { + return component.alias === alias; + }); + + if (old && alias === old.alias) { + component = old; + } else { + component.alias = alias; + c4ShapeArray.push(component); + } // Don't allow null labels, either + + + if (label === undefined || label === null) { + component.label = { + text: '' + }; + } else { + component.label = { + text: label + }; + } + + if (techn === undefined || techn === null) { + component.techn = { + text: '' + }; + } else { + if (_typeof(techn) === 'object') { + var _Object$entries$15 = _slicedToArray(Object.entries(techn)[0], 2), + key = _Object$entries$15[0], + value = _Object$entries$15[1]; + + component[key] = { + text: value + }; + } else { + component.techn = { + text: techn + }; + } + } + + if (descr === undefined || descr === null) { + component.descr = { + text: '' + }; + } else { + if (_typeof(descr) === 'object') { + var _Object$entries$16 = _slicedToArray(Object.entries(descr)[0], 2), + _key12 = _Object$entries$16[0], + _value12 = _Object$entries$16[1]; + + component[_key12] = { + text: _value12 + }; + } else { + component.descr = { + text: descr + }; + } + } + + if (_typeof(sprite) === 'object') { + var _Object$entries$17 = _slicedToArray(Object.entries(sprite)[0], 2), + _key13 = _Object$entries$17[0], + _value13 = _Object$entries$17[1]; + + component[_key13] = _value13; + } else { + component.sprite = sprite; + } + + if (_typeof(tags) === 'object') { + var _Object$entries$18 = _slicedToArray(Object.entries(tags)[0], 2), + _key14 = _Object$entries$18[0], + _value14 = _Object$entries$18[1]; + + component[_key14] = _value14; + } else { + component.tags = tags; + } + + if (_typeof(link) === 'object') { + var _Object$entries$19 = _slicedToArray(Object.entries(link)[0], 2), + _key15 = _Object$entries$19[0], + _value15 = _Object$entries$19[1]; + + component[_key15] = _value15; + } else { + component.link = link; + } + + component.wrap = autoWrap(); + component.typeC4Shape = { + text: typeC4Shape + }; + component.parentBoundary = currentBoundaryParse; +}; //alias, label, ?type, ?tags, $link + +var addPersonOrSystemBoundary = function addPersonOrSystemBoundary(alias, label, type, tags, link) { + // if (parentBoundary === null) return; + // Don't allow label nulling + if (alias === null || label === null) return; + var boundary = {}; + var old = boundarys.find(function (boundary) { + return boundary.alias === alias; + }); + + if (old && alias === old.alias) { + boundary = old; + } else { + boundary.alias = alias; + boundarys.push(boundary); + } // Don't allow null labels, either + + + if (label === undefined || label === null) { + boundary.label = { + text: '' + }; + } else { + boundary.label = { + text: label + }; + } + + if (type === undefined || type === null) { + boundary.type = { + text: 'system' + }; + } else { + if (_typeof(type) === 'object') { + var _Object$entries$20 = _slicedToArray(Object.entries(type)[0], 2), + key = _Object$entries$20[0], + value = _Object$entries$20[1]; + + boundary[key] = { + text: value + }; + } else { + boundary.type = { + text: type + }; + } + } + + if (_typeof(tags) === 'object') { + var _Object$entries$21 = _slicedToArray(Object.entries(tags)[0], 2), + _key16 = _Object$entries$21[0], + _value16 = _Object$entries$21[1]; + + boundary[_key16] = _value16; + } else { + boundary.tags = tags; + } + + if (_typeof(link) === 'object') { + var _Object$entries$22 = _slicedToArray(Object.entries(link)[0], 2), + _key17 = _Object$entries$22[0], + _value17 = _Object$entries$22[1]; + + boundary[_key17] = _value17; + } else { + boundary.link = link; + } + + boundary.parentBoundary = currentBoundaryParse; + boundary.wrap = autoWrap(); + parentBoundaryParse = currentBoundaryParse; + currentBoundaryParse = alias; + boundaryParseStack.push(parentBoundaryParse); +}; //alias, label, ?type, ?tags, $link + +var addContainerBoundary = function addContainerBoundary(alias, label, type, tags, link) { + // if (parentBoundary === null) return; + // Don't allow label nulling + if (alias === null || label === null) return; + var boundary = {}; + var old = boundarys.find(function (boundary) { + return boundary.alias === alias; + }); + + if (old && alias === old.alias) { + boundary = old; + } else { + boundary.alias = alias; + boundarys.push(boundary); + } // Don't allow null labels, either + + + if (label === undefined || label === null) { + boundary.label = { + text: '' + }; + } else { + boundary.label = { + text: label + }; + } + + if (type === undefined || type === null) { + boundary.type = { + text: 'container' + }; + } else { + if (_typeof(type) === 'object') { + var _Object$entries$23 = _slicedToArray(Object.entries(type)[0], 2), + key = _Object$entries$23[0], + value = _Object$entries$23[1]; + + boundary[key] = { + text: value + }; + } else { + boundary.type = { + text: type + }; + } + } + + if (_typeof(tags) === 'object') { + var _Object$entries$24 = _slicedToArray(Object.entries(tags)[0], 2), + _key18 = _Object$entries$24[0], + _value18 = _Object$entries$24[1]; + + boundary[_key18] = _value18; + } else { + boundary.tags = tags; + } + + if (_typeof(link) === 'object') { + var _Object$entries$25 = _slicedToArray(Object.entries(link)[0], 2), + _key19 = _Object$entries$25[0], + _value19 = _Object$entries$25[1]; + + boundary[_key19] = _value19; + } else { + boundary.link = link; + } + + boundary.parentBoundary = currentBoundaryParse; + boundary.wrap = autoWrap(); + parentBoundaryParse = currentBoundaryParse; + currentBoundaryParse = alias; + boundaryParseStack.push(parentBoundaryParse); +}; //alias, label, ?type, ?descr, ?sprite, ?tags, $link + +var addDeploymentNode = function addDeploymentNode(nodeType, alias, label, type, descr, sprite, tags, link) { + // if (parentBoundary === null) return; + // Don't allow label nulling + if (alias === null || label === null) return; + var boundary = {}; + var old = boundarys.find(function (boundary) { + return boundary.alias === alias; + }); + + if (old && alias === old.alias) { + boundary = old; + } else { + boundary.alias = alias; + boundarys.push(boundary); + } // Don't allow null labels, either + + + if (label === undefined || label === null) { + boundary.label = { + text: '' + }; + } else { + boundary.label = { + text: label + }; + } + + if (type === undefined || type === null) { + boundary.type = { + text: 'node' + }; + } else { + if (_typeof(type) === 'object') { + var _Object$entries$26 = _slicedToArray(Object.entries(type)[0], 2), + key = _Object$entries$26[0], + value = _Object$entries$26[1]; + + boundary[key] = { + text: value + }; + } else { + boundary.type = { + text: type + }; + } + } + + if (descr === undefined || descr === null) { + boundary.descr = { + text: '' + }; + } else { + if (_typeof(descr) === 'object') { + var _Object$entries$27 = _slicedToArray(Object.entries(descr)[0], 2), + _key20 = _Object$entries$27[0], + _value20 = _Object$entries$27[1]; + + boundary[_key20] = { + text: _value20 + }; + } else { + boundary.descr = { + text: descr + }; + } + } + + if (_typeof(tags) === 'object') { + var _Object$entries$28 = _slicedToArray(Object.entries(tags)[0], 2), + _key21 = _Object$entries$28[0], + _value21 = _Object$entries$28[1]; + + boundary[_key21] = _value21; + } else { + boundary.tags = tags; + } + + if (_typeof(link) === 'object') { + var _Object$entries$29 = _slicedToArray(Object.entries(link)[0], 2), + _key22 = _Object$entries$29[0], + _value22 = _Object$entries$29[1]; + + boundary[_key22] = _value22; + } else { + boundary.link = link; + } + + boundary.nodeType = nodeType; + boundary.parentBoundary = currentBoundaryParse; + boundary.wrap = autoWrap(); + parentBoundaryParse = currentBoundaryParse; + currentBoundaryParse = alias; + boundaryParseStack.push(parentBoundaryParse); +}; +var popBoundaryParseStack = function popBoundaryParseStack() { + currentBoundaryParse = parentBoundaryParse; + boundaryParseStack.pop(); + parentBoundaryParse = boundaryParseStack.pop(); + boundaryParseStack.push(parentBoundaryParse); +}; //elementName, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape, ?sprite, ?techn, ?legendText, ?legendSprite + +var updateElStyle = function updateElStyle(typeC4Shape, elementName, bgColor, fontColor, borderColor, shadowing, shape, sprite, techn, legendText, legendSprite) { + var old = c4ShapeArray.find(function (element) { + return element.alias === elementName; + }); + + if (old === undefined) { + old = boundarys.find(function (element) { + return element.alias === elementName; + }); + + if (old === undefined) { + return; + } + } + + if (bgColor !== undefined && bgColor !== null) { + if (_typeof(bgColor) === 'object') { + var _Object$entries$30 = _slicedToArray(Object.entries(bgColor)[0], 2), + key = _Object$entries$30[0], + value = _Object$entries$30[1]; + + old[key] = value; + } else { + old.bgColor = bgColor; + } + } + + if (fontColor !== undefined && fontColor !== null) { + if (_typeof(fontColor) === 'object') { + var _Object$entries$31 = _slicedToArray(Object.entries(fontColor)[0], 2), + _key23 = _Object$entries$31[0], + _value23 = _Object$entries$31[1]; + + old[_key23] = _value23; + } else { + old.fontColor = fontColor; + } + } + + if (borderColor !== undefined && borderColor !== null) { + if (_typeof(borderColor) === 'object') { + var _Object$entries$32 = _slicedToArray(Object.entries(borderColor)[0], 2), + _key24 = _Object$entries$32[0], + _value24 = _Object$entries$32[1]; + + old[_key24] = _value24; + } else { + old.borderColor = borderColor; + } + } + + if (shadowing !== undefined && shadowing !== null) { + if (_typeof(shadowing) === 'object') { + var _Object$entries$33 = _slicedToArray(Object.entries(shadowing)[0], 2), + _key25 = _Object$entries$33[0], + _value25 = _Object$entries$33[1]; + + old[_key25] = _value25; + } else { + old.shadowing = shadowing; + } + } + + if (shape !== undefined && shape !== null) { + if (_typeof(shape) === 'object') { + var _Object$entries$34 = _slicedToArray(Object.entries(shape)[0], 2), + _key26 = _Object$entries$34[0], + _value26 = _Object$entries$34[1]; + + old[_key26] = _value26; + } else { + old.shape = shape; + } + } + + if (sprite !== undefined && sprite !== null) { + if (_typeof(sprite) === 'object') { + var _Object$entries$35 = _slicedToArray(Object.entries(sprite)[0], 2), + _key27 = _Object$entries$35[0], + _value27 = _Object$entries$35[1]; + + old[_key27] = _value27; + } else { + old.sprite = sprite; + } + } + + if (techn !== undefined && techn !== null) { + if (_typeof(techn) === 'object') { + var _Object$entries$36 = _slicedToArray(Object.entries(techn)[0], 2), + _key28 = _Object$entries$36[0], + _value28 = _Object$entries$36[1]; + + old[_key28] = _value28; + } else { + old.techn = techn; + } + } + + if (legendText !== undefined && legendText !== null) { + if (_typeof(legendText) === 'object') { + var _Object$entries$37 = _slicedToArray(Object.entries(legendText)[0], 2), + _key29 = _Object$entries$37[0], + _value29 = _Object$entries$37[1]; + + old[_key29] = _value29; + } else { + old.legendText = legendText; + } + } + + if (legendSprite !== undefined && legendSprite !== null) { + if (_typeof(legendSprite) === 'object') { + var _Object$entries$38 = _slicedToArray(Object.entries(legendSprite)[0], 2), + _key30 = _Object$entries$38[0], + _value30 = _Object$entries$38[1]; + + old[_key30] = _value30; + } else { + old.legendSprite = legendSprite; + } + } +}; //textColor, lineColor, ?offsetX, ?offsetY + +var updateRelStyle = function updateRelStyle(typeC4Shape, from, to, textColor, lineColor, offsetX, offsetY) { + var old = rels.find(function (rel) { + return rel.from === from && rel.to === to; + }); + + if (old === undefined) { + return; + } + + if (textColor !== undefined && textColor !== null) { + if (_typeof(textColor) === 'object') { + var _Object$entries$39 = _slicedToArray(Object.entries(textColor)[0], 2), + key = _Object$entries$39[0], + value = _Object$entries$39[1]; + + old[key] = value; + } else { + old.textColor = textColor; + } + } + + if (lineColor !== undefined && lineColor !== null) { + if (_typeof(lineColor) === 'object') { + var _Object$entries$40 = _slicedToArray(Object.entries(lineColor)[0], 2), + _key31 = _Object$entries$40[0], + _value31 = _Object$entries$40[1]; + + old[_key31] = _value31; + } else { + old.lineColor = lineColor; + } + } + + if (offsetX !== undefined && offsetX !== null) { + if (_typeof(offsetX) === 'object') { + var _Object$entries$41 = _slicedToArray(Object.entries(offsetX)[0], 2), + _key32 = _Object$entries$41[0], + _value32 = _Object$entries$41[1]; + + old[_key32] = parseInt(_value32); + } else { + old.offsetX = parseInt(offsetX); + } + } + + if (offsetY !== undefined && offsetY !== null) { + if (_typeof(offsetY) === 'object') { + var _Object$entries$42 = _slicedToArray(Object.entries(offsetY)[0], 2), + _key33 = _Object$entries$42[0], + _value33 = _Object$entries$42[1]; + + old[_key33] = parseInt(_value33); + } else { + old.offsetY = parseInt(offsetY); + } + } +}; //?c4ShapeInRow, ?c4BoundaryInRow + +var updateLayoutConfig = function updateLayoutConfig(typeC4Shape, c4ShapeInRowParam, c4BoundaryInRowParam) { + var c4ShapeInRowValue = c4ShapeInRow; + var c4BoundaryInRowValue = c4BoundaryInRow; + + if (_typeof(c4ShapeInRowParam) === 'object') { + var _Object$entries$43 = _slicedToArray(Object.entries(c4ShapeInRowParam)[0], 2), + key = _Object$entries$43[0], + value = _Object$entries$43[1]; + + c4ShapeInRowValue = parseInt(value); + } else { + c4ShapeInRowValue = parseInt(c4ShapeInRowParam); + } + + if (_typeof(c4BoundaryInRowParam) === 'object') { + var _Object$entries$44 = _slicedToArray(Object.entries(c4BoundaryInRowParam)[0], 2), + _key34 = _Object$entries$44[0], + _value34 = _Object$entries$44[1]; + + c4BoundaryInRowValue = parseInt(_value34); + } else { + c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam); + } + + if (c4ShapeInRowValue >= 1) c4ShapeInRow = c4ShapeInRowValue; + if (c4BoundaryInRowValue >= 1) c4BoundaryInRow = c4BoundaryInRowValue; +}; +var getC4ShapeInRow = function getC4ShapeInRow() { + return c4ShapeInRow; +}; +var getC4BoundaryInRow = function getC4BoundaryInRow() { + return c4BoundaryInRow; +}; +var getCurrentBoundaryParse = function getCurrentBoundaryParse() { + return currentBoundaryParse; +}; +var getParentBoundaryParse = function getParentBoundaryParse() { + return parentBoundaryParse; +}; +var getC4ShapeArray = function getC4ShapeArray(parentBoundary) { + if (parentBoundary === undefined || parentBoundary === null) return c4ShapeArray;else return c4ShapeArray.filter(function (personOrSystem) { + return personOrSystem.parentBoundary === parentBoundary; + }); +}; +var getC4Shape = function getC4Shape(alias) { + return c4ShapeArray.find(function (personOrSystem) { + return personOrSystem.alias === alias; + }); +}; +var getC4ShapeKeys = function getC4ShapeKeys(parentBoundary) { + return Object.keys(getC4ShapeArray(parentBoundary)); +}; +var getBoundarys = function getBoundarys(parentBoundary) { + if (parentBoundary === undefined || parentBoundary === null) return boundarys;else return boundarys.filter(function (boundary) { + return boundary.parentBoundary === parentBoundary; + }); +}; +var getRels = function getRels() { + return rels; +}; +var getTitle = function getTitle() { + return title; +}; +var setWrap = function setWrap(wrapSetting) { + wrapEnabled = wrapSetting; +}; +var autoWrap = function autoWrap() { + return wrapEnabled; +}; +var clear = function clear() { + c4ShapeArray = []; + boundarys = [{ + alias: 'global', + label: { + text: 'global' + }, + type: { + text: 'global' + }, + tags: null, + link: null, + parentBoundary: '' + }]; + parentBoundaryParse = ''; + currentBoundaryParse = 'global'; + boundaryParseStack = ['']; + rels = []; + boundaryParseStack = ['']; + title = ''; + wrapEnabled = false; + description = ''; + c4ShapeInRow = 4; + c4BoundaryInRow = 2; +}; +var LINETYPE = { + SOLID: 0, + DOTTED: 1, + NOTE: 2, + SOLID_CROSS: 3, + DOTTED_CROSS: 4, + SOLID_OPEN: 5, + DOTTED_OPEN: 6, + LOOP_START: 10, + LOOP_END: 11, + ALT_START: 12, + ALT_ELSE: 13, + ALT_END: 14, + OPT_START: 15, + OPT_END: 16, + ACTIVE_START: 17, + ACTIVE_END: 18, + PAR_START: 19, + PAR_AND: 20, + PAR_END: 21, + RECT_START: 22, + RECT_END: 23, + SOLID_POINT: 24, + DOTTED_POINT: 25 +}; +var ARROWTYPE = { + FILLED: 0, + OPEN: 1 +}; +var PLACEMENT = { + LEFTOF: 0, + RIGHTOF: 1, + OVER: 2 +}; +var setTitle = function setTitle(txt) { + var sanitizedText = (0,_common_common__WEBPACK_IMPORTED_MODULE_0__.sanitizeText)(txt, _config__WEBPACK_IMPORTED_MODULE_1__.getConfig()); + title = sanitizedText; +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + addPersonOrSystem: addPersonOrSystem, + addPersonOrSystemBoundary: addPersonOrSystemBoundary, + addContainer: addContainer, + addContainerBoundary: addContainerBoundary, + addComponent: addComponent, + addDeploymentNode: addDeploymentNode, + popBoundaryParseStack: popBoundaryParseStack, + addRel: addRel, + updateElStyle: updateElStyle, + updateRelStyle: updateRelStyle, + updateLayoutConfig: updateLayoutConfig, + autoWrap: autoWrap, + setWrap: setWrap, + getC4ShapeArray: getC4ShapeArray, + getC4Shape: getC4Shape, + getC4ShapeKeys: getC4ShapeKeys, + getBoundarys: getBoundarys, + getCurrentBoundaryParse: getCurrentBoundaryParse, + getParentBoundaryParse: getParentBoundaryParse, + getRels: getRels, + getTitle: getTitle, + getC4Type: getC4Type, + getC4ShapeInRow: getC4ShapeInRow, + getC4BoundaryInRow: getC4BoundaryInRow, + setAccTitle: _commonDb__WEBPACK_IMPORTED_MODULE_3__.setAccTitle, + getAccTitle: _commonDb__WEBPACK_IMPORTED_MODULE_3__.getAccTitle, + getAccDescription: _commonDb__WEBPACK_IMPORTED_MODULE_3__.getAccDescription, + setAccDescription: _commonDb__WEBPACK_IMPORTED_MODULE_3__.setAccDescription, + parseDirective: parseDirective, + getConfig: function getConfig() { + return _config__WEBPACK_IMPORTED_MODULE_1__.getConfig().c4; + }, + clear: clear, + LINETYPE: LINETYPE, + ARROWTYPE: ARROWTYPE, + PLACEMENT: PLACEMENT, + setTitle: setTitle, + setC4Type: setC4Type // apply, + +}); + +/***/ }), + +/***/ "./src/diagrams/c4/c4Renderer.js": +/*!***************************************!*\ + !*** ./src/diagrams/c4/c4Renderer.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "draw": () => (/* binding */ draw), +/* harmony export */ "drawBoundary": () => (/* binding */ drawBoundary), +/* harmony export */ "drawC4ShapeArray": () => (/* binding */ drawC4ShapeArray), +/* harmony export */ "drawRels": () => (/* binding */ drawRels), +/* harmony export */ "setConf": () => (/* binding */ setConf) +/* harmony export */ }); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "./node_modules/d3/src/index.js"); +/* harmony import */ var _svgDraw__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./svgDraw */ "./src/diagrams/c4/svgDraw.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); +/* harmony import */ var _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parser/c4Diagram */ "./src/diagrams/c4/parser/c4Diagram.jison"); +/* harmony import */ var _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); +/* harmony import */ var _c4Db__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./c4Db */ "./src/diagrams/c4/c4Db.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../config */ "./src/config.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); +/* harmony import */ var _accessibility__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../accessibility */ "./src/accessibility.js"); +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + + + + + + + + + + +var globalBoundaryMaxX = 0, + globalBoundaryMaxY = 0; +var c4ShapeInRow = 4; +var c4BoundaryInRow = 2; +_parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy = _c4Db__WEBPACK_IMPORTED_MODULE_2__["default"]; +var conf = {}; + +var Bounds = /*#__PURE__*/function () { + function Bounds() { + _classCallCheck(this, Bounds); + + this.name = ''; + this.data = {}; + this.data.startx = undefined; + this.data.stopx = undefined; + this.data.starty = undefined; + this.data.stopy = undefined; + this.data.widthLimit = undefined; + this.nextData = {}; + this.nextData.startx = undefined; + this.nextData.stopx = undefined; + this.nextData.starty = undefined; + this.nextData.stopy = undefined; + this.nextData.cnt = 0; + setConf(_parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getConfig()); + } + + _createClass(Bounds, [{ + key: "setData", + value: function setData(startx, stopx, starty, stopy) { + this.nextData.startx = this.data.startx = startx; + this.nextData.stopx = this.data.stopx = stopx; + this.nextData.starty = this.data.starty = starty; + this.nextData.stopy = this.data.stopy = stopy; + } + }, { + key: "updateVal", + value: function updateVal(obj, key, val, fun) { + if (typeof obj[key] === 'undefined') { + obj[key] = val; + } else { + obj[key] = fun(val, obj[key]); + } + } + }, { + key: "insert", + value: function insert(c4Shape) { + this.nextData.cnt = this.nextData.cnt + 1; + + var _startx = this.nextData.startx === this.nextData.stopx ? this.nextData.stopx + c4Shape.margin : this.nextData.stopx + c4Shape.margin * 2; + + var _stopx = _startx + c4Shape.width; + + var _starty = this.nextData.starty + c4Shape.margin * 2; + + var _stopy = _starty + c4Shape.height; + + if (_startx >= this.data.widthLimit || _stopx >= this.data.widthLimit || this.nextData.cnt > c4ShapeInRow) { + _startx = this.nextData.startx + c4Shape.margin + conf.nextLinePaddingX; + _starty = this.nextData.stopy + c4Shape.margin * 2; + this.nextData.stopx = _stopx = _startx + c4Shape.width; + this.nextData.starty = this.nextData.stopy; + this.nextData.stopy = _stopy = _starty + c4Shape.height; + this.nextData.cnt = 1; + } + + c4Shape.x = _startx; + c4Shape.y = _starty; + this.updateVal(this.data, 'startx', _startx, Math.min); + this.updateVal(this.data, 'starty', _starty, Math.min); + this.updateVal(this.data, 'stopx', _stopx, Math.max); + this.updateVal(this.data, 'stopy', _stopy, Math.max); + this.updateVal(this.nextData, 'startx', _startx, Math.min); + this.updateVal(this.nextData, 'starty', _starty, Math.min); + this.updateVal(this.nextData, 'stopx', _stopx, Math.max); + this.updateVal(this.nextData, 'stopy', _stopy, Math.max); + } + }, { + key: "init", + value: function init() { + this.name = ''; + this.data = { + startx: undefined, + stopx: undefined, + starty: undefined, + stopy: undefined, + widthLimit: undefined + }; + this.nextData = { + startx: undefined, + stopx: undefined, + starty: undefined, + stopy: undefined, + cnt: 0 + }; + setConf(_parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getConfig()); + } + }, { + key: "bumpLastMargin", + value: function bumpLastMargin(margin) { + this.data.stopx += margin; + this.data.stopy += margin; + } + }]); + + return Bounds; +}(); + +var setConf = function setConf(cnf) { + (0,_utils__WEBPACK_IMPORTED_MODULE_3__.assignWithDepth)(conf, cnf); + + if (cnf.fontFamily) { + conf.personFontFamily = conf.systemFontFamily = conf.messageFontFamily = cnf.fontFamily; + } + + if (cnf.fontSize) { + conf.personFontSize = conf.systemFontSize = conf.messageFontSize = cnf.fontSize; + } + + if (cnf.fontWeight) { + conf.personFontWeight = conf.systemFontWeight = conf.messageFontWeight = cnf.fontWeight; + } +}; + +var c4ShapeFont = function c4ShapeFont(cnf, typeC4Shape) { + return { + fontFamily: cnf[typeC4Shape + 'FontFamily'], + fontSize: cnf[typeC4Shape + 'FontSize'], + fontWeight: cnf[typeC4Shape + 'FontWeight'] + }; +}; + +var boundaryFont = function boundaryFont(cnf) { + return { + fontFamily: cnf.boundaryFontFamily, + fontSize: cnf.boundaryFontSize, + fontWeight: cnf.boundaryFontWeight + }; +}; + +var messageFont = function messageFont(cnf) { + return { + fontFamily: cnf.messageFontFamily, + fontSize: cnf.messageFontSize, + fontWeight: cnf.messageFontWeight + }; +}; +/** + * @param textType + * @param c4Shape + * @param c4ShapeTextWrap + * @param textConf + * @param textLimitWidth + */ + + +function calcC4ShapeTextWH(textType, c4Shape, c4ShapeTextWrap, textConf, textLimitWidth) { + if (!c4Shape[textType].width) { + if (c4ShapeTextWrap) { + c4Shape[textType].text = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.wrapLabel)(c4Shape[textType].text, textLimitWidth, textConf); + c4Shape[textType].textLines = c4Shape[textType].text.split(_common_common__WEBPACK_IMPORTED_MODULE_4__["default"].lineBreakRegex).length; // c4Shape[textType].width = calculateTextWidth(c4Shape[textType].text, textConf); + + c4Shape[textType].width = textLimitWidth; // c4Shape[textType].height = c4Shape[textType].textLines * textConf.fontSize; + + c4Shape[textType].height = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.calculateTextHeight)(c4Shape[textType].text, textConf); + } else { + var lines = c4Shape[textType].text.split(_common_common__WEBPACK_IMPORTED_MODULE_4__["default"].lineBreakRegex); + c4Shape[textType].textLines = lines.length; + var lineHeight = 0; + c4Shape[textType].height = 0; + c4Shape[textType].width = 0; + + for (var i = 0; i < lines.length; i++) { + c4Shape[textType].width = Math.max((0,_utils__WEBPACK_IMPORTED_MODULE_3__.calculateTextWidth)(lines[i], textConf), c4Shape[textType].width); + lineHeight = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.calculateTextHeight)(lines[i], textConf); + c4Shape[textType].height = c4Shape[textType].height + lineHeight; + } // c4Shapes[textType].height = c4Shapes[textType].textLines * textConf.fontSize; + + } + } +} + +var drawBoundary = function drawBoundary(diagram, boundary, bounds) { + boundary.x = bounds.data.startx; + boundary.y = bounds.data.starty; + boundary.width = bounds.data.stopx - bounds.data.startx; + boundary.height = bounds.data.stopy - bounds.data.starty; + boundary.label.y = conf.c4ShapeMargin - 35; + var boundaryTextWrap = boundary.wrap && conf.wrap; + var boundaryLabelConf = boundaryFont(conf); + boundaryLabelConf.fontSize = boundaryLabelConf.fontSize + 2; + boundaryLabelConf.fontWeight = 'bold'; + var textLimitWidth = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.calculateTextWidth)(boundary.label.text, boundaryLabelConf); + calcC4ShapeTextWH('label', boundary, boundaryTextWrap, boundaryLabelConf, textLimitWidth); + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].drawBoundary(diagram, boundary, conf); +}; +var drawC4ShapeArray = function drawC4ShapeArray(currentBounds, diagram, c4ShapeArray, c4ShapeKeys) { + // Upper Y is relative point + var Y = 0; // Draw the c4ShapeArray + + for (var i = 0; i < c4ShapeKeys.length; i++) { + Y = 0; + var c4Shape = c4ShapeArray[c4ShapeKeys[i]]; // calc c4 shape type width and height + + var c4ShapeTypeConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text); + c4ShapeTypeConf.fontSize = c4ShapeTypeConf.fontSize - 2; + c4Shape.typeC4Shape.width = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.calculateTextWidth)('<<' + c4Shape.typeC4Shape.text + '>>', c4ShapeTypeConf); + c4Shape.typeC4Shape.height = c4ShapeTypeConf.fontSize + 2; + c4Shape.typeC4Shape.Y = conf.c4ShapePadding; + Y = c4Shape.typeC4Shape.Y + c4Shape.typeC4Shape.height - 4; // set image width and height c4Shape.x + c4Shape.width / 2 - 24, c4Shape.y + 28 + // let imageWidth = 0, + // imageHeight = 0, + // imageY = 0; + // + + c4Shape.image = { + width: 0, + height: 0, + Y: 0 + }; + + switch (c4Shape.typeC4Shape.text) { + case 'person': + case 'external_person': + c4Shape.image.width = 48; + c4Shape.image.height = 48; + c4Shape.image.Y = Y; + Y = c4Shape.image.Y + c4Shape.image.height; + break; + } + + if (c4Shape.sprite) { + c4Shape.image.width = 48; + c4Shape.image.height = 48; + c4Shape.image.Y = Y; + Y = c4Shape.image.Y + c4Shape.image.height; + } // Y = conf.c4ShapePadding + c4Shape.image.height; + + + var c4ShapeTextWrap = c4Shape.wrap && conf.wrap; + var textLimitWidth = conf.width - conf.c4ShapePadding * 2; + var c4ShapeLabelConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text); + c4ShapeLabelConf.fontSize = c4ShapeLabelConf.fontSize + 2; + c4ShapeLabelConf.fontWeight = 'bold'; + calcC4ShapeTextWH('label', c4Shape, c4ShapeTextWrap, c4ShapeLabelConf, textLimitWidth); + c4Shape['label'].Y = Y + 8; + Y = c4Shape['label'].Y + c4Shape['label'].height; + + if (c4Shape.type && c4Shape.type.text !== '') { + c4Shape.type.text = '[' + c4Shape.type.text + ']'; + + var _c4ShapeTypeConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text); + + calcC4ShapeTextWH('type', c4Shape, c4ShapeTextWrap, _c4ShapeTypeConf, textLimitWidth); + c4Shape['type'].Y = Y + 5; + Y = c4Shape['type'].Y + c4Shape['type'].height; + } else if (c4Shape.techn && c4Shape.techn.text !== '') { + c4Shape.techn.text = '[' + c4Shape.techn.text + ']'; + var c4ShapeTechnConf = c4ShapeFont(conf, c4Shape.techn.text); + calcC4ShapeTextWH('techn', c4Shape, c4ShapeTextWrap, c4ShapeTechnConf, textLimitWidth); + c4Shape['techn'].Y = Y + 5; + Y = c4Shape['techn'].Y + c4Shape['techn'].height; + } + + var rectHeight = Y; + var rectWidth = c4Shape.label.width; + + if (c4Shape.descr && c4Shape.descr.text !== '') { + var c4ShapeDescrConf = c4ShapeFont(conf, c4Shape.typeC4Shape.text); + calcC4ShapeTextWH('descr', c4Shape, c4ShapeTextWrap, c4ShapeDescrConf, textLimitWidth); + c4Shape['descr'].Y = Y + 20; + Y = c4Shape['descr'].Y + c4Shape['descr'].height; + rectWidth = Math.max(c4Shape.label.width, c4Shape.descr.width); + rectHeight = Y - c4Shape['descr'].textLines * 5; + } + + rectWidth = rectWidth + conf.c4ShapePadding; // let rectHeight = + + c4Shape.width = Math.max(c4Shape.width || conf.width, rectWidth, conf.width); + c4Shape.height = Math.max(c4Shape.height || conf.height, rectHeight, conf.height); + c4Shape.margin = c4Shape.margin || conf.c4ShapeMargin; + currentBounds.insert(c4Shape); + var height = _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].drawC4Shape(diagram, c4Shape, conf); + } + + currentBounds.bumpLastMargin(conf.c4ShapeMargin); +}; + +var Point = /*#__PURE__*/_createClass(function Point(x, y) { + _classCallCheck(this, Point); + + this.x = x; + this.y = y; +}); +/* * * + * Get the intersection of the line between the center point of a rectangle and a point outside the rectangle. + * Algorithm idea. + * Using a point outside the rectangle as the coordinate origin, the graph is divided into four quadrants, and each quadrant is divided into two cases, with separate treatment on the coordinate axes + * 1. The case of coordinate axes. + * 1. The case of the negative x-axis + * 2. The case of the positive x-axis + * 3. The case of the positive y-axis + * 4. The negative y-axis case + * 2. Quadrant cases. + * 2.1. first quadrant: the case where the line intersects the left side of the rectangle; the case where it intersects the lower side of the rectangle + * 2.2. second quadrant: the case where the line intersects the right side of the rectangle; the case where it intersects the lower edge of the rectangle + * 2.3. third quadrant: the case where the line intersects the right side of the rectangle; the case where it intersects the upper edge of the rectangle + * 2.4. fourth quadrant: the case where the line intersects the left side of the rectangle; the case where it intersects the upper side of the rectangle + * + */ + + +var getIntersectPoint = function getIntersectPoint(fromNode, endPoint) { + var x1 = fromNode.x; + var y1 = fromNode.y; + var x2 = endPoint.x; + var y2 = endPoint.y; + var fromCenterX = x1 + fromNode.width / 2; + var fromCenterY = y1 + fromNode.height / 2; + var dx = Math.abs(x1 - x2); + var dy = Math.abs(y1 - y2); + var tanDYX = dy / dx; + var fromDYX = fromNode.height / fromNode.width; + var returnPoint = null; + + if (y1 == y2 && x1 < x2) { + returnPoint = new Point(x1 + fromNode.width, fromCenterY); + } else if (y1 == y2 && x1 > x2) { + returnPoint = new Point(x1, fromCenterY); + } else if (x1 == x2 && y1 < y2) { + returnPoint = new Point(fromCenterX, y1 + fromNode.height); + } else if (x1 == x2 && y1 > y2) { + returnPoint = new Point(fromCenterX, y1); + } + + if (x1 > x2 && y1 < y2) { + if (fromDYX >= tanDYX) { + returnPoint = new Point(x1, fromCenterY + tanDYX * fromNode.width / 2); + } else { + returnPoint = new Point(fromCenterX - dx / dy * fromNode.height / 2, y1 + fromNode.height); + } + } else if (x1 < x2 && y1 < y2) { + // + if (fromDYX >= tanDYX) { + returnPoint = new Point(x1 + fromNode.width, fromCenterY + tanDYX * fromNode.width / 2); + } else { + returnPoint = new Point(fromCenterX + dx / dy * fromNode.height / 2, y1 + fromNode.height); + } + } else if (x1 < x2 && y1 > y2) { + if (fromDYX >= tanDYX) { + returnPoint = new Point(x1 + fromNode.width, fromCenterY - tanDYX * fromNode.width / 2); + } else { + returnPoint = new Point(fromCenterX + fromNode.height / 2 * dx / dy, y1); + } + } else if (x1 > x2 && y1 > y2) { + if (fromDYX >= tanDYX) { + returnPoint = new Point(x1, fromCenterY - fromNode.width / 2 * tanDYX); + } else { + returnPoint = new Point(fromCenterX - fromNode.height / 2 * dx / dy, y1); + } + } + + return returnPoint; +}; + +var getIntersectPoints = function getIntersectPoints(fromNode, endNode) { + var endIntersectPoint = { + x: 0, + y: 0 + }; + endIntersectPoint.x = endNode.x + endNode.width / 2; + endIntersectPoint.y = endNode.y + endNode.height / 2; + var startPoint = getIntersectPoint(fromNode, endIntersectPoint); + endIntersectPoint.x = fromNode.x + fromNode.width / 2; + endIntersectPoint.y = fromNode.y + fromNode.height / 2; + var endPoint = getIntersectPoint(endNode, endIntersectPoint); + return { + startPoint: startPoint, + endPoint: endPoint + }; +}; + +var drawRels = function drawRels(diagram, rels, getC4ShapeObj) { + var i = 0; + + var _iterator = _createForOfIteratorHelper(rels), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var rel = _step.value; + i = i + 1; + var relTextWrap = rel.wrap && conf.wrap; + var relConf = messageFont(conf); + var diagramType = _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getC4Type(); + if (diagramType === 'C4Dynamic') rel.label.text = i + ': ' + rel.label.text; + var textLimitWidth = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.calculateTextWidth)(rel.label.text, relConf); + calcC4ShapeTextWH('label', rel, relTextWrap, relConf, textLimitWidth); + + if (rel.techn && rel.techn.text !== '') { + textLimitWidth = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.calculateTextWidth)(rel.techn.text, relConf); + calcC4ShapeTextWH('techn', rel, relTextWrap, relConf, textLimitWidth); + } + + if (rel.descr && rel.descr.text !== '') { + textLimitWidth = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.calculateTextWidth)(rel.descr.text, relConf); + calcC4ShapeTextWH('descr', rel, relTextWrap, relConf, textLimitWidth); + } + + var fromNode = getC4ShapeObj(rel.from); + var endNode = getC4ShapeObj(rel.to); + var points = getIntersectPoints(fromNode, endNode); + rel.startPoint = points.startPoint; + rel.endPoint = points.endPoint; + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].drawRels(diagram, rels, conf); +}; +/** + * @param diagram + * @param parentBoundaryAlias + * @param parentBounds + * @param currentBoundarys + */ + +function drawInsideBoundary(diagram, parentBoundaryAlias, parentBounds, currentBoundarys) { + var currentBounds = new Bounds(); // Calculate the width limit of the boundar. label/type 的长度, + + currentBounds.data.widthLimit = parentBounds.data.widthLimit / Math.min(c4BoundaryInRow, currentBoundarys.length); // Math.min( + // conf.width * conf.c4ShapeInRow + conf.c4ShapeMargin * conf.c4ShapeInRow * 2, + // parentBounds.data.widthLimit / Math.min(conf.c4BoundaryInRow, currentBoundarys.length) + // ); + + for (var i = 0; i < currentBoundarys.length; i++) { + var currentBoundary = currentBoundarys[i]; + var Y = 0; + currentBoundary.image = { + width: 0, + height: 0, + Y: 0 + }; + + if (currentBoundary.sprite) { + currentBoundary.image.width = 48; + currentBoundary.image.height = 48; + currentBoundary.image.Y = Y; + Y = currentBoundary.image.Y + currentBoundary.image.height; + } + + var currentBoundaryTextWrap = currentBoundary.wrap && conf.wrap; + var currentBoundaryLabelConf = boundaryFont(conf); + currentBoundaryLabelConf.fontSize = currentBoundaryLabelConf.fontSize + 2; + currentBoundaryLabelConf.fontWeight = 'bold'; + calcC4ShapeTextWH('label', currentBoundary, currentBoundaryTextWrap, currentBoundaryLabelConf, currentBounds.data.widthLimit); + currentBoundary['label'].Y = Y + 8; + Y = currentBoundary['label'].Y + currentBoundary['label'].height; + + if (currentBoundary.type && currentBoundary.type.text !== '') { + currentBoundary.type.text = '[' + currentBoundary.type.text + ']'; + var currentBoundaryTypeConf = boundaryFont(conf); + calcC4ShapeTextWH('type', currentBoundary, currentBoundaryTextWrap, currentBoundaryTypeConf, currentBounds.data.widthLimit); + currentBoundary['type'].Y = Y + 5; + Y = currentBoundary['type'].Y + currentBoundary['type'].height; + } + + if (currentBoundary.descr && currentBoundary.descr.text !== '') { + var currentBoundaryDescrConf = boundaryFont(conf); + currentBoundaryDescrConf.fontSize = currentBoundaryDescrConf.fontSize - 2; + calcC4ShapeTextWH('descr', currentBoundary, currentBoundaryTextWrap, currentBoundaryDescrConf, currentBounds.data.widthLimit); + currentBoundary['descr'].Y = Y + 20; + Y = currentBoundary['descr'].Y + currentBoundary['descr'].height; + } + + if (i == 0 || i % c4BoundaryInRow === 0) { + // Calculate the drawing start point of the currentBoundarys. + var _x = parentBounds.data.startx + conf.diagramMarginX; + + var _y = parentBounds.data.stopy + conf.diagramMarginY + Y; + + currentBounds.setData(_x, _x, _y, _y); + } else { + // Calculate the drawing start point of the currentBoundarys. + var _x2 = currentBounds.data.stopx !== currentBounds.data.startx ? currentBounds.data.stopx + conf.diagramMarginX : currentBounds.data.startx; + + var _y2 = currentBounds.data.starty; + currentBounds.setData(_x2, _x2, _y2, _y2); + } + + currentBounds.name = currentBoundary.alias; + var currentPersonOrSystemArray = _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getC4ShapeArray(currentBoundary.alias); + var currentPersonOrSystemKeys = _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getC4ShapeKeys(currentBoundary.alias); + + if (currentPersonOrSystemKeys.length > 0) { + drawC4ShapeArray(currentBounds, diagram, currentPersonOrSystemArray, currentPersonOrSystemKeys); + } + + parentBoundaryAlias = currentBoundary.alias; + var nextCurrentBoundarys = _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getBoundarys(parentBoundaryAlias); + + if (nextCurrentBoundarys.length > 0) { + // draw boundary inside currentBoundary + // bounds.init(); + // parentBoundaryWidthLimit = bounds.data.stopx - bounds.startx; + drawInsideBoundary(diagram, parentBoundaryAlias, currentBounds, nextCurrentBoundarys); + } // draw boundary + + + if (currentBoundary.alias !== 'global') drawBoundary(diagram, currentBoundary, currentBounds); + parentBounds.data.stopy = Math.max(currentBounds.data.stopy + conf.c4ShapeMargin, parentBounds.data.stopy); + parentBounds.data.stopx = Math.max(currentBounds.data.stopx + conf.c4ShapeMargin, parentBounds.data.stopx); + globalBoundaryMaxX = Math.max(globalBoundaryMaxX, parentBounds.data.stopx); + globalBoundaryMaxY = Math.max(globalBoundaryMaxY, parentBounds.data.stopy); + } +} +/** + * Draws a sequenceDiagram in the tag with id: id based on the graph definition in text. + * + * @param {any} text + * @param {any} id + */ + + +var draw = function draw(text, id) { + conf = _config__WEBPACK_IMPORTED_MODULE_6__.getConfig().c4; + var securityLevel = _config__WEBPACK_IMPORTED_MODULE_6__.getConfig().securityLevel; // Handle root and Document for when rendering in sanbox mode + + var sandboxElement; + + if (securityLevel === 'sandbox') { + sandboxElement = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('#i' + id); + } + + var root = securityLevel === 'sandbox' ? (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(sandboxElement.nodes()[0].contentDocument.body) : (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('body'); + var doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; + var db = _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy; + _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.clear(); + _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.setWrap(conf.wrap); + _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.parse(text + '\n'); + c4ShapeInRow = db.getC4ShapeInRow(); + c4BoundaryInRow = db.getC4BoundaryInRow(); + _logger__WEBPACK_IMPORTED_MODULE_7__.log.debug("C:".concat(JSON.stringify(conf, null, 2))); + var diagram = securityLevel === 'sandbox' ? root.select("[id=\"".concat(id, "\"]")) : (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)("[id=\"".concat(id, "\"]")); + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].insertComputerIcon(diagram); + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].insertDatabaseIcon(diagram); + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].insertClockIcon(diagram); + var screenBounds = new Bounds(); + screenBounds.setData(conf.diagramMarginX, conf.diagramMarginX, conf.diagramMarginY, conf.diagramMarginY); + screenBounds.data.widthLimit = screen.availWidth; + globalBoundaryMaxX = conf.diagramMarginX; + globalBoundaryMaxY = conf.diagramMarginY; + var title = _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getTitle(); + var c4type = _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getC4Type(); + var currentBoundarys = _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getBoundarys(''); // switch (c4type) { + // case 'C4Context': + + drawInsideBoundary(diagram, '', screenBounds, currentBoundarys); // break; + // } + // The arrow head definition is attached to the svg once + + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].insertArrowHead(diagram); + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].insertArrowEnd(diagram); + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].insertArrowCrossHead(diagram); + _svgDraw__WEBPACK_IMPORTED_MODULE_5__["default"].insertArrowFilledHead(diagram); + drawRels(diagram, _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getRels(), _parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getC4Shape); + screenBounds.data.stopx = globalBoundaryMaxX; + screenBounds.data.stopy = globalBoundaryMaxY; + var box = screenBounds.data; // Make sure the height of the diagram supports long menus. + + var boxHeight = box.stopy - box.starty; + var height = boxHeight + 2 * conf.diagramMarginY; // Make sure the width of the diagram supports wide menus. + + var boxWidth = box.stopx - box.startx; + var width = boxWidth + 2 * conf.diagramMarginX; + + if (title) { + diagram.append('text').text(title).attr('x', (box.stopx - box.startx) / 2 - 4 * conf.diagramMarginX).attr('y', box.starty + conf.diagramMarginY); + } + + (0,_utils__WEBPACK_IMPORTED_MODULE_3__.configureSvgSize)(diagram, height, width, conf.useMaxWidth); + var extraVertForTitle = title ? 60 : 0; + diagram.attr('viewBox', box.startx - conf.diagramMarginX + ' -' + (conf.diagramMarginY + extraVertForTitle) + ' ' + width + ' ' + (height + extraVertForTitle)); + (0,_accessibility__WEBPACK_IMPORTED_MODULE_8__["default"])(_parser_c4Diagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy, diagram, id); + _logger__WEBPACK_IMPORTED_MODULE_7__.log.debug("models:", box); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + drawPersonOrSystemArray: drawC4ShapeArray, + drawBoundary: drawBoundary, + setConf: setConf, + draw: draw +}); + +/***/ }), + +/***/ "./src/diagrams/c4/styles.js": +/*!***********************************!*\ + !*** ./src/diagrams/c4/styles.js ***! + \***********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +var getStyles = function getStyles(options) { + return ".person {\n stroke: ".concat(options.personBorder, ";\n fill: ").concat(options.personBkg, ";\n }\n"); +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getStyles); + +/***/ }), + +/***/ "./src/diagrams/c4/svgDraw.js": +/*!************************************!*\ + !*** ./src/diagrams/c4/svgDraw.js ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "drawC4Shape": () => (/* binding */ drawC4Shape), +/* harmony export */ "drawEmbeddedImage": () => (/* binding */ drawEmbeddedImage), +/* harmony export */ "drawImage": () => (/* binding */ drawImage), +/* harmony export */ "drawLabel": () => (/* binding */ drawLabel), +/* harmony export */ "drawRect": () => (/* binding */ drawRect), +/* harmony export */ "drawRels": () => (/* binding */ drawRels), +/* harmony export */ "drawText": () => (/* binding */ drawText), +/* harmony export */ "getNoteRect": () => (/* binding */ getNoteRect), +/* harmony export */ "getTextObj": () => (/* binding */ getTextObj), +/* harmony export */ "insertArrowCrossHead": () => (/* binding */ insertArrowCrossHead), +/* harmony export */ "insertArrowEnd": () => (/* binding */ insertArrowEnd), +/* harmony export */ "insertArrowFilledHead": () => (/* binding */ insertArrowFilledHead), +/* harmony export */ "insertArrowHead": () => (/* binding */ insertArrowHead), +/* harmony export */ "insertClockIcon": () => (/* binding */ insertClockIcon), +/* harmony export */ "insertComputerIcon": () => (/* binding */ insertComputerIcon), +/* harmony export */ "insertDatabaseIcon": () => (/* binding */ insertDatabaseIcon), +/* harmony export */ "insertDynamicNumber": () => (/* binding */ insertDynamicNumber) +/* harmony export */ }); +/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); +/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @braintree/sanitize-url */ "./node_modules/@braintree/sanitize-url/dist/index.js"); +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + + + +var drawRect = function drawRect(elem, rectData) { + var rectElem = elem.append('rect'); + rectElem.attr('x', rectData.x); + rectElem.attr('y', rectData.y); + rectElem.attr('fill', rectData.fill); + rectElem.attr('stroke', rectData.stroke); + rectElem.attr('width', rectData.width); + rectElem.attr('height', rectData.height); + rectElem.attr('rx', rectData.rx); + rectElem.attr('ry', rectData.ry); + + if (rectData.attrs !== 'undefined' && rectData.attrs !== null) { + for (var attrKey in rectData.attrs) { + rectElem.attr(attrKey, rectData.attrs[attrKey]); + } + } + + if (rectData.class !== 'undefined') { + rectElem.attr('class', rectData.class); + } + + return rectElem; +}; +var drawImage = function drawImage(elem, width, height, x, y, link) { + var imageElem = elem.append('image'); + imageElem.attr('width', width); + imageElem.attr('height', height); + imageElem.attr('x', x); + imageElem.attr('y', y); + var sanitizedLink = link.startsWith('data:image/png;base64') ? link : (0,_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__.sanitizeUrl)(link); + imageElem.attr('xlink:href', sanitizedLink); +}; +var drawEmbeddedImage = function drawEmbeddedImage(elem, x, y, link) { + var imageElem = elem.append('use'); + imageElem.attr('x', x); + imageElem.attr('y', y); + var sanitizedLink = (0,_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__.sanitizeUrl)(link); + imageElem.attr('xlink:href', '#' + sanitizedLink); +}; +var drawText = function drawText(elem, textData) { + var prevTextHeight = 0, + textHeight = 0; + var lines = textData.text.split(_common_common__WEBPACK_IMPORTED_MODULE_1__["default"].lineBreakRegex); + var textElems = []; + var dy = 0; + + var yfunc = function yfunc() { + return textData.y; + }; + + if (typeof textData.valign !== 'undefined' && typeof textData.textMargin !== 'undefined' && textData.textMargin > 0) { + switch (textData.valign) { + case 'top': + case 'start': + yfunc = function yfunc() { + return Math.round(textData.y + textData.textMargin); + }; + + break; + + case 'middle': + case 'center': + yfunc = function yfunc() { + return Math.round(textData.y + (prevTextHeight + textHeight + textData.textMargin) / 2); + }; + + break; + + case 'bottom': + case 'end': + yfunc = function yfunc() { + return Math.round(textData.y + (prevTextHeight + textHeight + 2 * textData.textMargin) - textData.textMargin); + }; + + break; + } + } + + if (typeof textData.anchor !== 'undefined' && typeof textData.textMargin !== 'undefined' && typeof textData.width !== 'undefined') { + switch (textData.anchor) { + case 'left': + case 'start': + textData.x = Math.round(textData.x + textData.textMargin); + textData.anchor = 'start'; + textData.dominantBaseline = 'text-after-edge'; + textData.alignmentBaseline = 'middle'; + break; + + case 'middle': + case 'center': + textData.x = Math.round(textData.x + textData.width / 2); + textData.anchor = 'middle'; + textData.dominantBaseline = 'middle'; + textData.alignmentBaseline = 'middle'; + break; + + case 'right': + case 'end': + textData.x = Math.round(textData.x + textData.width - textData.textMargin); + textData.anchor = 'end'; + textData.dominantBaseline = 'text-before-edge'; + textData.alignmentBaseline = 'middle'; + break; + } + } + + for (var i = 0; i < lines.length; i++) { + var line = lines[i]; + + if (typeof textData.textMargin !== 'undefined' && textData.textMargin === 0 && typeof textData.fontSize !== 'undefined') { + dy = i * textData.fontSize; + } + + var textElem = elem.append('text'); + textElem.attr('x', textData.x); + textElem.attr('y', yfunc()); + + if (typeof textData.anchor !== 'undefined') { + textElem.attr('text-anchor', textData.anchor).attr('dominant-baseline', textData.dominantBaseline).attr('alignment-baseline', textData.alignmentBaseline); + } + + if (typeof textData.fontFamily !== 'undefined') { + textElem.style('font-family', textData.fontFamily); + } + + if (typeof textData.fontSize !== 'undefined') { + textElem.style('font-size', textData.fontSize); + } + + if (typeof textData.fontWeight !== 'undefined') { + textElem.style('font-weight', textData.fontWeight); + } + + if (typeof textData.fill !== 'undefined') { + textElem.attr('fill', textData.fill); + } + + if (typeof textData.class !== 'undefined') { + textElem.attr('class', textData.class); + } + + if (typeof textData.dy !== 'undefined') { + textElem.attr('dy', textData.dy); + } else if (dy !== 0) { + textElem.attr('dy', dy); + } + + if (textData.tspan) { + var span = textElem.append('tspan'); + span.attr('x', textData.x); + + if (typeof textData.fill !== 'undefined') { + span.attr('fill', textData.fill); + } + + span.text(line); + } else { + textElem.text(line); + } + + if (typeof textData.valign !== 'undefined' && typeof textData.textMargin !== 'undefined' && textData.textMargin > 0) { + textHeight += (textElem._groups || textElem)[0][0].getBBox().height; + prevTextHeight = textHeight; + } + + textElems.push(textElem); + } + + return textElems; +}; +var drawLabel = function drawLabel(elem, txtObject) { + /** + * @param {any} x + * @param {any} y + * @param {any} width + * @param {any} height + * @param {any} cut + * @returns {any} + */ + function genPoints(x, y, width, height, cut) { + return x + ',' + y + ' ' + (x + width) + ',' + y + ' ' + (x + width) + ',' + (y + height - cut) + ' ' + (x + width - cut * 1.2) + ',' + (y + height) + ' ' + x + ',' + (y + height); + } + + var polygon = elem.append('polygon'); + polygon.attr('points', genPoints(txtObject.x, txtObject.y, txtObject.width, txtObject.height, 7)); + polygon.attr('class', 'labelBox'); + txtObject.y = txtObject.y + txtObject.height / 2; + drawText(elem, txtObject); + return polygon; +}; +var drawRels = function drawRels(elem, rels, conf) { + var relsElem = elem.append('g'); + var i = 0; + + var _iterator = _createForOfIteratorHelper(rels), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var rel = _step.value; + var textColor = rel.textColor ? rel.textColor : '#444444'; + var strokeColor = rel.lineColor ? rel.lineColor : '#444444'; + var offsetX = rel.offsetX ? parseInt(rel.offsetX) : 0; + var offsetY = rel.offsetY ? parseInt(rel.offsetY) : 0; + var url = ''; + + if (i === 0) { + var line = relsElem.append('line'); + line.attr('x1', rel.startPoint.x); + line.attr('y1', rel.startPoint.y); + line.attr('x2', rel.endPoint.x); + line.attr('y2', rel.endPoint.y); + line.attr('stroke-width', '1'); + line.attr('stroke', strokeColor); + line.style('fill', 'none'); + if (rel.type !== 'rel_b') line.attr('marker-end', 'url(' + url + '#arrowhead)'); + if (rel.type === 'birel' || rel.type === 'rel_b') line.attr('marker-start', 'url(' + url + '#arrowend)'); + i = -1; + } else { + var _line = relsElem.append('path'); + + _line.attr('fill', 'none').attr('stroke-width', '1').attr('stroke', strokeColor).attr('d', 'Mstartx,starty Qcontrolx,controly stopx,stopy '.replaceAll('startx', rel.startPoint.x).replaceAll('starty', rel.startPoint.y).replaceAll('controlx', rel.startPoint.x + (rel.endPoint.x - rel.startPoint.x) / 2 - (rel.endPoint.x - rel.startPoint.x) / 4).replaceAll('controly', rel.startPoint.y + (rel.endPoint.y - rel.startPoint.y) / 2).replaceAll('stopx', rel.endPoint.x).replaceAll('stopy', rel.endPoint.y)); + + if (rel.type !== 'rel_b') _line.attr('marker-end', 'url(' + url + '#arrowhead)'); + if (rel.type === 'birel' || rel.type === 'rel_b') _line.attr('marker-start', 'url(' + url + '#arrowend)'); + } + + var messageConf = conf.messageFont(); + + _drawTextCandidateFunc(conf)(rel.label.text, relsElem, Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX, Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + offsetY, rel.label.width, rel.label.height, { + fill: textColor + }, messageConf); + + if (rel.techn && rel.techn.text !== '') { + messageConf = conf.messageFont(); + + _drawTextCandidateFunc(conf)('[' + rel.techn.text + ']', relsElem, Math.min(rel.startPoint.x, rel.endPoint.x) + Math.abs(rel.endPoint.x - rel.startPoint.x) / 2 + offsetX, Math.min(rel.startPoint.y, rel.endPoint.y) + Math.abs(rel.endPoint.y - rel.startPoint.y) / 2 + conf.messageFontSize + 5 + offsetY, Math.max(rel.label.width, rel.techn.width), rel.techn.height, { + fill: textColor, + 'font-style': 'italic' + }, messageConf); + } + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } +}; +/** + * Draws an boundary in the diagram + * + * @param {any} elem - The diagram we'll draw to. + * @param {any} boundary - The boundary to draw. + * @param {any} conf - DrawText implementation discriminator object + */ + +var drawBoundary = function drawBoundary(elem, boundary, conf) { + var boundaryElem = elem.append('g'); + var fillColor = boundary.bgColor ? boundary.bgColor : 'none'; + var strokeColor = boundary.borderColor ? boundary.borderColor : '#444444'; + var fontColor = boundary.fontColor ? boundary.fontColor : 'black'; + var attrsValue = { + 'stroke-width': 1.0, + 'stroke-dasharray': '7.0,7.0' + }; + if (boundary.nodeType) attrsValue = { + 'stroke-width': 1.0 + }; + var rectData = { + x: boundary.x, + y: boundary.y, + fill: fillColor, + stroke: strokeColor, + width: boundary.width, + height: boundary.height, + rx: 2.5, + ry: 2.5, + attrs: attrsValue + }; + drawRect(boundaryElem, rectData); // draw label + + var boundaryConf = conf.boundaryFont(); + boundaryConf.fontWeight = 'bold'; + boundaryConf.fontSize = boundaryConf.fontSize + 2; + boundaryConf.fontColor = fontColor; + + _drawTextCandidateFunc(conf)(boundary.label.text, boundaryElem, boundary.x, boundary.y + boundary.label.Y, boundary.width, boundary.height, { + fill: '#444444' + }, boundaryConf); // draw type + + + if (boundary.type && boundary.type.text !== '') { + boundaryConf = conf.boundaryFont(); + boundaryConf.fontColor = fontColor; + + _drawTextCandidateFunc(conf)(boundary.type.text, boundaryElem, boundary.x, boundary.y + boundary.type.Y, boundary.width, boundary.height, { + fill: '#444444' + }, boundaryConf); + } // draw descr + + + if (boundary.descr && boundary.descr.text !== '') { + boundaryConf = conf.boundaryFont(); + boundaryConf.fontSize = boundaryConf.fontSize - 2; + boundaryConf.fontColor = fontColor; + + _drawTextCandidateFunc(conf)(boundary.descr.text, boundaryElem, boundary.x, boundary.y + boundary.descr.Y, boundary.width, boundary.height, { + fill: '#444444' + }, boundaryConf); + } +}; + +var drawC4Shape = function drawC4Shape(elem, c4Shape, conf) { + var fillColor = c4Shape.bgColor ? c4Shape.bgColor : conf[c4Shape.typeC4Shape.text + '_bg_color']; + var strokeColor = c4Shape.borderColor ? c4Shape.borderColor : conf[c4Shape.typeC4Shape.text + '_border_color']; + var fontColor = c4Shape.fontColor ? c4Shape.fontColor : '#FFFFFF'; + var personImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXD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tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII='; + break; + + case 'external_person': + personImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII='; + break; + } + + var c4ShapeElem = elem.append('g'); + c4ShapeElem.attr('class', 'person-man'); // + // draw rect of c4Shape + + var rect = getNoteRect(); + + switch (c4Shape.typeC4Shape.text) { + case 'person': + case 'external_person': + case 'system': + case 'external_system': + case 'container': + case 'external_container': + case 'component': + case 'external_component': + rect.x = c4Shape.x; + rect.y = c4Shape.y; + rect.fill = fillColor; + rect.width = c4Shape.width; + rect.height = c4Shape.height; + rect.style = 'stroke:' + strokeColor + ';stroke-width:0.5;'; + rect.rx = 2.5; + rect.ry = 2.5; + drawRect(c4ShapeElem, rect); + break; + + case 'system_db': + case 'external_system_db': + case 'container_db': + case 'external_container_db': + case 'component_db': + case 'external_component_db': + c4ShapeElem.append('path').attr('fill', fillColor).attr('stroke-width', '0.5').attr('stroke', strokeColor).attr('d', 'Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height'.replaceAll('startx', c4Shape.x).replaceAll('starty', c4Shape.y).replaceAll('half', c4Shape.width / 2).replaceAll('height', c4Shape.height)); + c4ShapeElem.append('path').attr('fill', 'none').attr('stroke-width', '0.5').attr('stroke', strokeColor).attr('d', 'Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10'.replaceAll('startx', c4Shape.x).replaceAll('starty', c4Shape.y).replaceAll('half', c4Shape.width / 2)); + break; + + case 'system_queue': + case 'external_system_queue': + case 'container_queue': + case 'external_container_queue': + case 'component_queue': + case 'external_component_queue': + c4ShapeElem.append('path').attr('fill', fillColor).attr('stroke-width', '0.5').attr('stroke', strokeColor).attr('d', 'Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half'.replaceAll('startx', c4Shape.x).replaceAll('starty', c4Shape.y).replaceAll('width', c4Shape.width).replaceAll('half', c4Shape.height / 2)); + c4ShapeElem.append('path').attr('fill', 'none').attr('stroke-width', '0.5').attr('stroke', strokeColor).attr('d', 'Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half'.replaceAll('startx', c4Shape.x + c4Shape.width).replaceAll('starty', c4Shape.y).replaceAll('half', c4Shape.height / 2)); + break; + } // draw type of c4Shape + + + var c4ShapeFontConf = getC4ShapeFont(conf, c4Shape.typeC4Shape.text); + c4ShapeElem.append('text').attr('fill', fontColor).attr('font-family', c4ShapeFontConf.fontFamily).attr('font-size', c4ShapeFontConf.fontSize - 2).attr('font-style', 'italic').attr('lengthAdjust', 'spacing').attr('textLength', c4Shape.typeC4Shape.width).attr('x', c4Shape.x + c4Shape.width / 2 - c4Shape.typeC4Shape.width / 2).attr('y', c4Shape.y + c4Shape.typeC4Shape.Y).text('<<' + c4Shape.typeC4Shape.text + '>>'); // draw image/sprite + + switch (c4Shape.typeC4Shape.text) { + case 'person': + case 'external_person': + drawImage(c4ShapeElem, 48, 48, c4Shape.x + c4Shape.width / 2 - 24, c4Shape.y + c4Shape.image.Y, personImg); + break; + } // draw label + + + var textFontConf = conf[c4Shape.typeC4Shape.text + 'Font'](); + textFontConf.fontWeight = 'bold'; + textFontConf.fontSize = textFontConf.fontSize + 2; + textFontConf.fontColor = fontColor; + + _drawTextCandidateFunc(conf)(c4Shape.label.text, c4ShapeElem, c4Shape.x, c4Shape.y + c4Shape.label.Y, c4Shape.width, c4Shape.height, { + fill: fontColor + }, textFontConf); // draw techn/type + + + textFontConf = conf[c4Shape.typeC4Shape.text + 'Font'](); + textFontConf.fontColor = fontColor; + + if (c4Shape.thchn && c4Shape.thchn.text !== '') { + _drawTextCandidateFunc(conf)(c4Shape.thchn.text, c4ShapeElem, c4Shape.x, c4Shape.y + c4Shape.thchn.Y, c4Shape.width, c4Shape.height, { + fill: fontColor, + 'font-style': 'italic' + }, textFontConf); + } else if (c4Shape.type && c4Shape.type.text !== '') { + _drawTextCandidateFunc(conf)(c4Shape.type.text, c4ShapeElem, c4Shape.x, c4Shape.y + c4Shape.type.Y, c4Shape.width, c4Shape.height, { + fill: fontColor, + 'font-style': 'italic' + }, textFontConf); + } // draw descr + + + if (c4Shape.descr && c4Shape.descr.text !== '') { + textFontConf = conf.personFont(); + textFontConf.fontColor = fontColor; + + _drawTextCandidateFunc(conf)(c4Shape.descr.text, c4ShapeElem, c4Shape.x, c4Shape.y + c4Shape.descr.Y, c4Shape.width, c4Shape.height, { + fill: fontColor + }, textFontConf); + } + + return c4Shape.height; +}; +var insertDatabaseIcon = function insertDatabaseIcon(elem) { + elem.append('defs').append('symbol').attr('id', 'database').attr('fill-rule', 'evenodd').attr('clip-rule', 'evenodd').append('path').attr('transform', 'scale(.5)').attr('d', 'M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z'); +}; +var insertComputerIcon = function insertComputerIcon(elem) { + elem.append('defs').append('symbol').attr('id', 'computer').attr('width', '24').attr('height', '24').append('path').attr('transform', 'scale(.5)').attr('d', 'M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z'); +}; +var insertClockIcon = function insertClockIcon(elem) { + elem.append('defs').append('symbol').attr('id', 'clock').attr('width', '24').attr('height', '24').append('path').attr('transform', 'scale(.5)').attr('d', 'M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z'); +}; +/** + * Setup arrow head and define the marker. The result is appended to the svg. + * + * @param elem + */ + +var insertArrowHead = function insertArrowHead(elem) { + elem.append('defs').append('marker').attr('id', 'arrowhead').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 12).attr('markerHeight', 12).attr('orient', 'auto').append('path').attr('d', 'M 0 0 L 10 5 L 0 10 z'); // this is actual shape for arrowhead +}; +var insertArrowEnd = function insertArrowEnd(elem) { + elem.append('defs').append('marker').attr('id', 'arrowend').attr('refX', 1).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 12).attr('markerHeight', 12).attr('orient', 'auto').append('path').attr('d', 'M 10 0 L 0 5 L 10 10 z'); // this is actual shape for arrowhead +}; +/** + * Setup arrow head and define the marker. The result is appended to the svg. + * + * @param {any} elem + */ + +var insertArrowFilledHead = function insertArrowFilledHead(elem) { + elem.append('defs').append('marker').attr('id', 'filled-head').attr('refX', 18).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z'); +}; +/** + * Setup node number. The result is appended to the svg. + * + * @param {any} elem + */ + +var insertDynamicNumber = function insertDynamicNumber(elem) { + elem.append('defs').append('marker').attr('id', 'sequencenumber').attr('refX', 15).attr('refY', 15).attr('markerWidth', 60).attr('markerHeight', 40).attr('orient', 'auto').append('circle').attr('cx', 15).attr('cy', 15).attr('r', 6); // .style("fill", '#f00'); +}; +/** + * Setup arrow head and define the marker. The result is appended to the svg. + * + * @param {any} elem + */ + +var insertArrowCrossHead = function insertArrowCrossHead(elem) { + var defs = elem.append('defs'); + var marker = defs.append('marker').attr('id', 'crosshead').attr('markerWidth', 15).attr('markerHeight', 8).attr('orient', 'auto').attr('refX', 16).attr('refY', 4); // The arrow + + marker.append('path').attr('fill', 'black').attr('stroke', '#000000').style('stroke-dasharray', '0, 0').attr('stroke-width', '1px').attr('d', 'M 9,2 V 6 L16,4 Z'); // The cross + + marker.append('path').attr('fill', 'none').attr('stroke', '#000000').style('stroke-dasharray', '0, 0').attr('stroke-width', '1px').attr('d', 'M 0,1 L 6,7 M 6,1 L 0,7'); // this is actual shape for arrowhead +}; +var getTextObj = function getTextObj() { + return { + x: 0, + y: 0, + fill: undefined, + anchor: undefined, + style: '#666', + width: undefined, + height: undefined, + textMargin: 0, + rx: 0, + ry: 0, + tspan: true, + valign: undefined + }; +}; +var getNoteRect = function getNoteRect() { + return { + x: 0, + y: 0, + fill: '#EDF2AE', + stroke: '#666', + width: 100, + anchor: 'start', + height: 100, + rx: 0, + ry: 0 + }; +}; + +var getC4ShapeFont = function getC4ShapeFont(cnf, typeC4Shape) { + return { + fontFamily: cnf[typeC4Shape + 'FontFamily'], + fontSize: cnf[typeC4Shape + 'FontSize'], + fontWeight: cnf[typeC4Shape + 'FontWeight'] + }; +}; + +var _drawTextCandidateFunc = function () { + /** + * @param {any} content + * @param {any} g + * @param {any} x + * @param {any} y + * @param {any} width + * @param {any} height + * @param {any} textAttrs + */ + function byText(content, g, x, y, width, height, textAttrs) { + var text = g.append('text').attr('x', x + width / 2).attr('y', y + height / 2 + 5).style('text-anchor', 'middle').text(content); + + _setTextAttrs(text, textAttrs); + } + /** + * @param {any} content + * @param {any} g + * @param {any} x + * @param {any} y + * @param {any} width + * @param {any} height + * @param {any} textAttrs + * @param {any} conf + */ + + + function byTspan(content, g, x, y, width, height, textAttrs, conf) { + var fontSize = conf.fontSize, + fontFamily = conf.fontFamily, + fontWeight = conf.fontWeight; + var lines = content.split(_common_common__WEBPACK_IMPORTED_MODULE_1__["default"].lineBreakRegex); + + for (var i = 0; i < lines.length; i++) { + var dy = i * fontSize - fontSize * (lines.length - 1) / 2; + var text = g.append('text').attr('x', x + width / 2).attr('y', y).style('text-anchor', 'middle').attr('dominant-baseline', 'middle').style('font-size', fontSize).style('font-weight', fontWeight).style('font-family', fontFamily); + text.append('tspan') // .attr('x', x + width / 2) + .attr('dy', dy).text(lines[i]) // .attr('y', y + height / 2) + .attr('alignment-baseline', 'mathematical'); + + _setTextAttrs(text, textAttrs); + } + } + /** + * @param {any} content + * @param {any} g + * @param {any} x + * @param {any} y + * @param {any} width + * @param {any} height + * @param {any} textAttrs + * @param {any} conf + */ + + + function byFo(content, g, x, y, width, height, textAttrs, conf) { + var s = g.append('switch'); + var f = s.append('foreignObject').attr('x', x).attr('y', y).attr('width', width).attr('height', height); + var text = f.append('xhtml:div').style('display', 'table').style('height', '100%').style('width', '100%'); + text.append('div').style('display', 'table-cell').style('text-align', 'center').style('vertical-align', 'middle').text(content); + byTspan(content, s, x, y, width, height, textAttrs, conf); + + _setTextAttrs(text, textAttrs); + } + /** + * @param {any} toText + * @param {any} fromTextAttrsDict + */ + + + function _setTextAttrs(toText, fromTextAttrsDict) { + for (var key in fromTextAttrsDict) { + if (fromTextAttrsDict.hasOwnProperty(key)) { + // eslint-disable-line + toText.attr(key, fromTextAttrsDict[key]); + } + } + } + + return function (conf) { + return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan; + }; +}(); + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + drawRect: drawRect, + drawText: drawText, + drawLabel: drawLabel, + drawBoundary: drawBoundary, + drawC4Shape: drawC4Shape, + drawRels: drawRels, + drawImage: drawImage, + drawEmbeddedImage: drawEmbeddedImage, + insertArrowHead: insertArrowHead, + insertArrowEnd: insertArrowEnd, + insertArrowFilledHead: insertArrowFilledHead, + insertDynamicNumber: insertDynamicNumber, + insertArrowCrossHead: insertArrowCrossHead, + insertDatabaseIcon: insertDatabaseIcon, + insertComputerIcon: insertComputerIcon, + insertClockIcon: insertClockIcon, + getTextObj: getTextObj, + getNoteRect: getNoteRect, + sanitizeUrl: _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__.sanitizeUrl +}); + +/***/ }), + +/***/ "./src/diagrams/class/classDb.js": +/*!***************************************!*\ + !*** ./src/diagrams/class/classDb.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "addAnnotation": () => (/* binding */ addAnnotation), +/* harmony export */ "addClass": () => (/* binding */ addClass), +/* harmony export */ "addMember": () => (/* binding */ addMember), +/* harmony export */ "addMembers": () => (/* binding */ addMembers), +/* harmony export */ "addRelation": () => (/* binding */ addRelation), +/* harmony export */ "bindFunctions": () => (/* binding */ bindFunctions), +/* harmony export */ "cleanupLabel": () => (/* binding */ cleanupLabel), +/* harmony export */ "clear": () => (/* binding */ clear), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "getClass": () => (/* binding */ getClass), +/* harmony export */ "getClasses": () => (/* binding */ getClasses), +/* harmony export */ "getRelations": () => (/* binding */ getRelations), +/* harmony export */ "lineType": () => (/* binding */ lineType), +/* harmony export */ "lookUpDomId": () => (/* binding */ lookUpDomId), +/* harmony export */ "parseDirective": () => (/* binding */ parseDirective), +/* harmony export */ "relationType": () => (/* binding */ relationType), +/* harmony export */ "setClickEvent": () => (/* binding */ setClickEvent), +/* harmony export */ "setCssClass": () => (/* binding */ setCssClass), +/* harmony export */ "setLink": () => (/* binding */ setLink) +/* harmony export */ }); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "./node_modules/d3/src/index.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../config */ "./src/config.js"); +/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); +/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js"); +/* harmony import */ var _commonDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../commonDb */ "./src/commonDb.js"); +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + + + + + + + +var MERMAID_DOM_ID_PREFIX = 'classid-'; +var relations = []; +var classes = {}; +var classCounter = 0; +var funs = []; + +var sanitizeText = function sanitizeText(txt) { + return _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(txt, _config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); +}; + +var parseDirective = function parseDirective(statement, context, type) { + _mermaidAPI__WEBPACK_IMPORTED_MODULE_3__["default"].parseDirective(this, statement, context, type); +}; + +var splitClassNameAndType = function splitClassNameAndType(id) { + var genericType = ''; + var className = id; + + if (id.indexOf('~') > 0) { + var split = id.split('~'); + className = split[0]; + genericType = _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(split[1], _config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); + } + + return { + className: className, + type: genericType + }; +}; +/** + * Function called by parser when a node definition has been found. + * + * @param id + * @public + */ + + +var addClass = function addClass(id) { + var classId = splitClassNameAndType(id); // Only add class if not exists + + if (typeof classes[classId.className] !== 'undefined') return; + classes[classId.className] = { + id: classId.className, + type: classId.type, + cssClasses: [], + methods: [], + members: [], + annotations: [], + domId: MERMAID_DOM_ID_PREFIX + classId.className + '-' + classCounter + }; + classCounter++; +}; +/** + * Function to lookup domId from id in the graph definition. + * + * @param id + * @public + */ + +var lookUpDomId = function lookUpDomId(id) { + var classKeys = Object.keys(classes); + + for (var i = 0; i < classKeys.length; i++) { + if (classes[classKeys[i]].id === id) { + return classes[classKeys[i]].domId; + } + } +}; +var clear = function clear() { + relations = []; + classes = {}; + funs = []; + funs.push(setupToolTips); + (0,_commonDb__WEBPACK_IMPORTED_MODULE_4__.clear)(); +}; +var getClass = function getClass(id) { + return classes[id]; +}; +var getClasses = function getClasses() { + return classes; +}; +var getRelations = function getRelations() { + return relations; +}; +var addRelation = function addRelation(relation) { + _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug('Adding relation: ' + JSON.stringify(relation)); + addClass(relation.id1); + addClass(relation.id2); + relation.id1 = splitClassNameAndType(relation.id1).className; + relation.id2 = splitClassNameAndType(relation.id2).className; + relation.relationTitle1 = _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(relation.relationTitle1.trim(), _config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); + relation.relationTitle2 = _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(relation.relationTitle2.trim(), _config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); + relations.push(relation); +}; +/** + * Adds an annotation to the specified class Annotations mark special properties of the given type + * (like 'interface' or 'service') + * + * @param className The class name + * @param annotation The name of the annotation without any brackets + * @public + */ + +var addAnnotation = function addAnnotation(className, annotation) { + var validatedClassName = splitClassNameAndType(className).className; + classes[validatedClassName].annotations.push(annotation); +}; +/** + * Adds a member to the specified class + * + * @param className The class name + * @param member The full name of the member. If the member is enclosed in <> it is + * treated as an annotation If the member is ending with a closing bracket ) it is treated as a + * method Otherwise the member will be treated as a normal property + * @public + */ + +var addMember = function addMember(className, member) { + var validatedClassName = splitClassNameAndType(className).className; + var theClass = classes[validatedClassName]; + + if (typeof member === 'string') { + // Member can contain white spaces, we trim them out + var memberString = member.trim(); + + if (memberString.startsWith('<<') && memberString.endsWith('>>')) { + // Remove leading and trailing brackets + // theClass.annotations.push(memberString.substring(2, memberString.length - 2)); + theClass.annotations.push(sanitizeText(memberString.substring(2, memberString.length - 2))); + } else if (memberString.indexOf(')') > 0) { + theClass.methods.push(sanitizeText(memberString)); + } else if (memberString) { + theClass.members.push(sanitizeText(memberString)); + } + } +}; +var addMembers = function addMembers(className, members) { + if (Array.isArray(members)) { + members.reverse(); + members.forEach(function (member) { + return addMember(className, member); + }); + } +}; +var cleanupLabel = function cleanupLabel(label) { + if (label.substring(0, 1) === ':') { + return _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(label.substr(1).trim(), _config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); + } else { + return sanitizeText(label.trim()); + } +}; +/** + * Called by parser when a special node is found, e.g. a clickable element. + * + * @param ids Comma separated list of ids + * @param className Class to add + */ + +var setCssClass = function setCssClass(ids, className) { + ids.split(',').forEach(function (_id) { + var id = _id; + if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id; + + if (typeof classes[id] !== 'undefined') { + classes[id].cssClasses.push(className); + } + }); +}; +/** + * Called by parser when a tooltip is found, e.g. a clickable element. + * + * @param ids Comma separated list of ids + * @param tooltip Tooltip to add + */ + +var setTooltip = function setTooltip(ids, tooltip) { + var config = _config__WEBPACK_IMPORTED_MODULE_2__.getConfig(); + ids.split(',').forEach(function (id) { + if (typeof tooltip !== 'undefined') { + classes[id].tooltip = _common_common__WEBPACK_IMPORTED_MODULE_1__["default"].sanitizeText(tooltip, config); + } + }); +}; +/** + * Called by parser when a link is found. Adds the URL to the vertex data. + * + * @param ids Comma separated list of ids + * @param linkStr URL to create a link for + * @param target Target of the link, _blank by default as originally defined in the svgDraw.js file + */ + + +var setLink = function setLink(ids, linkStr, target) { + var config = _config__WEBPACK_IMPORTED_MODULE_2__.getConfig(); + ids.split(',').forEach(function (_id) { + var id = _id; + if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id; + + if (typeof classes[id] !== 'undefined') { + classes[id].link = _utils__WEBPACK_IMPORTED_MODULE_6__["default"].formatUrl(linkStr, config); + + if (config.securityLevel === 'sandbox') { + classes[id].linkTarget = '_top'; + } else if (typeof target === 'string') { + classes[id].linkTarget = sanitizeText(target); + } else { + classes[id].linkTarget = '_blank'; + } + } + }); + setCssClass(ids, 'clickable'); +}; +/** + * Called by parser when a click definition is found. Registers an event handler. + * + * @param ids Comma separated list of ids + * @param functionName Function to be called on click + * @param functionArgs Function args the function should be called with + */ + +var setClickEvent = function setClickEvent(ids, functionName, functionArgs) { + ids.split(',').forEach(function (id) { + setClickFunc(id, functionName, functionArgs); + classes[id].haveCallback = true; + }); + setCssClass(ids, 'clickable'); +}; + +var setClickFunc = function setClickFunc(domId, functionName, functionArgs) { + var config = _config__WEBPACK_IMPORTED_MODULE_2__.getConfig(); + var id = domId; + var elemId = lookUpDomId(id); + + if (config.securityLevel !== 'loose') { + return; + } + + if (typeof functionName === 'undefined') { + return; + } + + if (typeof classes[id] !== 'undefined') { + var argList = []; + + if (typeof functionArgs === 'string') { + /* Splits functionArgs by ',', ignoring all ',' in double quoted strings */ + argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); + + for (var i = 0; i < argList.length; i++) { + var item = argList[i].trim(); + /* Removes all double quotes at the start and end of an argument */ + + /* This preserves all starting and ending whitespace inside */ + + if (item.charAt(0) === '"' && item.charAt(item.length - 1) === '"') { + item = item.substr(1, item.length - 2); + } + + argList[i] = item; + } + } + /* if no arguments passed into callback, default to passing in id */ + + + if (argList.length === 0) { + argList.push(elemId); + } + + funs.push(function () { + var elem = document.querySelector("[id=\"".concat(elemId, "\"]")); + + if (elem !== null) { + elem.addEventListener('click', function () { + _utils__WEBPACK_IMPORTED_MODULE_6__["default"].runFunc.apply(_utils__WEBPACK_IMPORTED_MODULE_6__["default"], [functionName].concat(_toConsumableArray(argList))); + }, false); + } + }); + } +}; + +var bindFunctions = function bindFunctions(element) { + funs.forEach(function (fun) { + fun(element); + }); +}; +var lineType = { + LINE: 0, + DOTTED_LINE: 1 +}; +var relationType = { + AGGREGATION: 0, + EXTENSION: 1, + COMPOSITION: 2, + DEPENDENCY: 3 +}; + +var setupToolTips = function setupToolTips(element) { + var tooltipElem = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('.mermaidTooltip'); + + if ((tooltipElem._groups || tooltipElem)[0][0] === null) { + tooltipElem = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('body').append('div').attr('class', 'mermaidTooltip').style('opacity', 0); + } + + var svg = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(element).select('svg'); + var nodes = svg.selectAll('g.node'); + nodes.on('mouseover', function () { + var el = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(this); + var title = el.attr('title'); // Dont try to draw a tooltip if no data is provided + + if (title === null) { + return; + } + + var rect = this.getBoundingClientRect(); + tooltipElem.transition().duration(200).style('opacity', '.9'); + tooltipElem.text(el.attr('title')).style('left', window.scrollX + rect.left + (rect.right - rect.left) / 2 + 'px').style('top', window.scrollY + rect.top - 14 + document.body.scrollTop + 'px'); + el.classed('hover', true); + }).on('mouseout', function () { + tooltipElem.transition().duration(500).style('opacity', 0); + var el = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(this); + el.classed('hover', false); + }); +}; + +funs.push(setupToolTips); +var direction = 'TB'; + +var getDirection = function getDirection() { + return direction; +}; + +var setDirection = function setDirection(dir) { + direction = dir; +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + parseDirective: parseDirective, + setAccTitle: _commonDb__WEBPACK_IMPORTED_MODULE_4__.setAccTitle, + getAccTitle: _commonDb__WEBPACK_IMPORTED_MODULE_4__.getAccTitle, + getAccDescription: _commonDb__WEBPACK_IMPORTED_MODULE_4__.getAccDescription, + setAccDescription: _commonDb__WEBPACK_IMPORTED_MODULE_4__.setAccDescription, + getConfig: function getConfig() { + return _config__WEBPACK_IMPORTED_MODULE_2__.getConfig().class; + }, + addClass: addClass, + bindFunctions: bindFunctions, + clear: clear, + getClass: getClass, + getClasses: getClasses, + addAnnotation: addAnnotation, + getRelations: getRelations, + addRelation: addRelation, + getDirection: getDirection, + setDirection: setDirection, + addMember: addMember, + addMembers: addMembers, + cleanupLabel: cleanupLabel, + lineType: lineType, + relationType: relationType, + setClickEvent: setClickEvent, + setCssClass: setCssClass, + setLink: setLink, + setTooltip: setTooltip, + lookUpDomId: lookUpDomId +}); + +/***/ }), + +/***/ "./src/diagrams/class/classRenderer-v2.js": +/*!************************************************!*\ + !*** ./src/diagrams/class/classRenderer-v2.js ***! + \************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "addClasses": () => (/* binding */ addClasses), +/* harmony export */ "addRelations": () => (/* binding */ addRelations), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "draw": () => (/* binding */ draw), +/* harmony export */ "setConf": () => (/* binding */ setConf) +/* harmony export */ }); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "./node_modules/d3/src/index.js"); +/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dagre */ "./node_modules/dagre/index.js"); +/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! graphlib */ "./node_modules/graphlib/index.js"); +/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); +/* harmony import */ var _classDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./classDb */ "./src/diagrams/class/classDb.js"); +/* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/classDiagram */ "./src/diagrams/class/parser/classDiagram.jison"); +/* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../config */ "./src/config.js"); +/* harmony import */ var _dagre_wrapper_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../dagre-wrapper/index.js */ "./src/dagre-wrapper/index.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); +/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); +/* harmony import */ var _accessibility__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../accessibility */ "./src/accessibility.js"); + + + + + + + + + // import addHtmlLabel from 'dagre-d3/lib/label/add-html-label.js'; + + + + + +_parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.yy = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"]; +var idCache = {}; +var padding = 20; + +var sanitizeText = function sanitizeText(txt) { + return _common_common__WEBPACK_IMPORTED_MODULE_5__["default"].sanitizeText(txt, (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)()); +}; + +var conf = { + dividerMargin: 10, + padding: 5, + textHeight: 10 +}; +/** + * Function that adds the vertices found during parsing to the graph to be rendered. + * + * @param {Object< + * string, + * { cssClasses: string[]; text: string; id: string; type: string; domId: string } + * >} classes + * Object containing the vertices. + * @param {SVGGElement} g The graph that is to be drawn. + */ + +var addClasses = function addClasses(classes, g) { + // const svg = select(`[id="${svgId}"]`); + var keys = Object.keys(classes); + _logger__WEBPACK_IMPORTED_MODULE_7__.log.info('keys:', keys); + _logger__WEBPACK_IMPORTED_MODULE_7__.log.info(classes); // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition + + keys.forEach(function (id) { + var vertex = classes[id]; + /** + * Variable for storing the classes for the vertex + * + * @type {string} + */ + + var cssClassStr = ''; + + if (vertex.cssClasses.length > 0) { + cssClassStr = cssClassStr + ' ' + vertex.cssClasses.join(' '); + } // if (vertex.classes.length > 0) { + // classStr = vertex.classes.join(' '); + // } + + + var styles = { + labelStyle: '' + }; //getStylesFromArray(vertex.styles); + // Use vertex id as text in the box if no text is provided by the graph definition + + var vertexText = vertex.text !== undefined ? vertex.text : vertex.id; // We create a SVG label, either by delegating to addHtmlLabel or manually + // let vertexNode; + // if (evaluate(getConfig().flowchart.htmlLabels)) { + // const node = { + // label: vertexText.replace( + // /fa[lrsb]?:fa-[\w-]+/g, + // s => `` + // ) + // }; + // vertexNode = addHtmlLabel(svg, node).node(); + // vertexNode.parentNode.removeChild(vertexNode); + // } else { + // const svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text'); + // svgLabel.setAttribute('style', styles.labelStyle.replace('color:', 'fill:')); + // const rows = vertexText.split(common.lineBreakRegex); + // for (let j = 0; j < rows.length; j++) { + // const tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); + // tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve'); + // tspan.setAttribute('dy', '1em'); + // tspan.setAttribute('x', '1'); + // tspan.textContent = rows[j]; + // svgLabel.appendChild(tspan); + // } + // vertexNode = svgLabel; + // } + + var radious = 0; + var _shape = ''; // Set the shape based parameters + + switch (vertex.type) { + case 'class': + _shape = 'class_box'; + break; + + default: + _shape = 'class_box'; + } // Add the node + + + g.setNode(vertex.id, { + labelStyle: styles.labelStyle, + shape: _shape, + labelText: sanitizeText(vertexText), + classData: vertex, + rx: radious, + ry: radious, + class: cssClassStr, + style: styles.style, + id: vertex.id, + domId: vertex.domId, + haveCallback: vertex.haveCallback, + link: vertex.link, + width: vertex.type === 'group' ? 500 : undefined, + type: vertex.type, + padding: (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().flowchart.padding + }); + _logger__WEBPACK_IMPORTED_MODULE_7__.log.info('setNode', { + labelStyle: styles.labelStyle, + shape: _shape, + labelText: vertexText, + rx: radious, + ry: radious, + class: cssClassStr, + style: styles.style, + id: vertex.id, + width: vertex.type === 'group' ? 500 : undefined, + type: vertex.type, + padding: (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().flowchart.padding + }); + }); +}; +/** + * Add edges to graph based on parsed graph definition + * + * @param relations + * @param {object} g The graph object + */ + +var addRelations = function addRelations(relations, g) { + var cnt = 0; + var defaultStyle; + var defaultLabelStyle; // if (typeof relations.defaultStyle !== 'undefined') { + // const defaultStyles = getStylesFromArray(relations.defaultStyle); + // defaultStyle = defaultStyles.style; + // defaultLabelStyle = defaultStyles.labelStyle; + // } + + relations.forEach(function (edge) { + cnt++; + var edgeData = {}; //Set relationship style and line type + + edgeData.classes = 'relation'; + edgeData.pattern = edge.relation.lineType == 1 ? 'dashed' : 'solid'; + edgeData.id = 'id' + cnt; // Set link type for rendering + + if (edge.type === 'arrow_open') { + edgeData.arrowhead = 'none'; + } else { + edgeData.arrowhead = 'normal'; + } + + _logger__WEBPACK_IMPORTED_MODULE_7__.log.info(edgeData, edge); //Set edge extra labels + //edgeData.startLabelLeft = edge.relationTitle1; + + edgeData.startLabelRight = edge.relationTitle1 === 'none' ? '' : edge.relationTitle1; + edgeData.endLabelLeft = edge.relationTitle2 === 'none' ? '' : edge.relationTitle2; //edgeData.endLabelRight = edge.relationTitle2; + //Set relation arrow types + + edgeData.arrowTypeStart = getArrowMarker(edge.relation.type1); + edgeData.arrowTypeEnd = getArrowMarker(edge.relation.type2); + var style = ''; + var labelStyle = ''; + + if (typeof edge.style !== 'undefined') { + var styles = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.getStylesFromArray)(edge.style); + style = styles.style; + labelStyle = styles.labelStyle; + } else { + style = 'fill:none'; + + if (typeof defaultStyle !== 'undefined') { + style = defaultStyle; + } + + if (typeof defaultLabelStyle !== 'undefined') { + labelStyle = defaultLabelStyle; + } + } + + edgeData.style = style; + edgeData.labelStyle = labelStyle; + + if (typeof edge.interpolate !== 'undefined') { + edgeData.curve = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.interpolateToCurve)(edge.interpolate, d3__WEBPACK_IMPORTED_MODULE_0__.curveLinear); + } else if (typeof relations.defaultInterpolate !== 'undefined') { + edgeData.curve = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.interpolateToCurve)(relations.defaultInterpolate, d3__WEBPACK_IMPORTED_MODULE_0__.curveLinear); + } else { + edgeData.curve = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.interpolateToCurve)(conf.curve, d3__WEBPACK_IMPORTED_MODULE_0__.curveLinear); + } + + edge.text = edge.title; + + if (typeof edge.text === 'undefined') { + if (typeof edge.style !== 'undefined') { + edgeData.arrowheadStyle = 'fill: #333'; + } + } else { + edgeData.arrowheadStyle = 'fill: #333'; + edgeData.labelpos = 'c'; + + if ((0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().flowchart.htmlLabels) { + // eslint-disable-line + edgeData.labelType = 'html'; + edgeData.label = '' + edge.text + ''; + } else { + edgeData.labelType = 'text'; + edgeData.label = edge.text.replace(_common_common__WEBPACK_IMPORTED_MODULE_5__["default"].lineBreakRegex, '\n'); + + if (typeof edge.style === 'undefined') { + edgeData.style = edgeData.style || 'stroke: #333; stroke-width: 1.5px;fill:none'; + } + + edgeData.labelStyle = edgeData.labelStyle.replace('color:', 'fill:'); + } + } // Add the edge to the graph + + + g.setEdge(edge.id1, edge.id2, edgeData, cnt); + }); +}; +/** + * Gets the ID with the same label as in the cache + * + * @param {string} label The label to look for + * @returns {string} The resulting ID + */ + +var getGraphId = function getGraphId(label) { + var foundEntry = Object.entries(idCache).find(function (entry) { + return entry[1].label === label; + }); + + if (foundEntry) { + return foundEntry[0]; + } +}; +/** + * Merges the value of `conf` with the passed `cnf` + * + * @param {object} cnf Config to merge + */ + + +var setConf = function setConf(cnf) { + var keys = Object.keys(cnf); + keys.forEach(function (key) { + conf[key] = cnf[key]; + }); +}; +/** + * Draws a flowchart in the tag with id: id based on the graph definition in text. + * + * @param {string} text + * @param {string} id + */ + +var draw = function draw(text, id) { + _logger__WEBPACK_IMPORTED_MODULE_7__.log.info('Drawing class - ', id); + _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].clear(); // const parser = classDb.parser; + // parser.yy = classDb; + // Parse the graph definition + // try { + + _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.parse(text); // } catch (err) { + // log.debug('Parsing failed'); + // } + // Fetch the default direction, use TD if none was found + //let dir = 'TD'; + + var conf = (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().flowchart; + var securityLevel = (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().securityLevel; + _logger__WEBPACK_IMPORTED_MODULE_7__.log.info('config:', conf); + var nodeSpacing = conf.nodeSpacing || 50; + var rankSpacing = conf.rankSpacing || 50; // Create the input mermaid.graph + + var g = new (graphlib__WEBPACK_IMPORTED_MODULE_2___default().Graph)({ + multigraph: true, + compound: true + }).setGraph({ + rankdir: _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getDirection(), + nodesep: nodeSpacing, + ranksep: rankSpacing, + marginx: 8, + marginy: 8 + }).setDefaultEdgeLabel(function () { + return {}; + }); // let subG; + // const subGraphs = flowDb.getSubGraphs(); + // log.info('Subgraphs - ', subGraphs); + // for (let i = subGraphs.length - 1; i >= 0; i--) { + // subG = subGraphs[i]; + // log.info('Subgraph - ', subG); + // flowDb.addVertex(subG.id, subG.title, 'group', undefined, subG.classes); + // } + // Fetch the vertices/nodes and edges/links from the parsed graph definition + + var classes = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getClasses(); + var relations = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRelations(); + _logger__WEBPACK_IMPORTED_MODULE_7__.log.info(relations); + addClasses(classes, g, id); + addRelations(relations, g); // Add custom shapes + // flowChartShapes.addToRenderV2(addShape); + // Set up an SVG group so that we can translate the final graph. + + var sandboxElement; + + if (securityLevel === 'sandbox') { + sandboxElement = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('#i' + id); + } + + var root = securityLevel === 'sandbox' ? (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(sandboxElement.nodes()[0].contentDocument.body) : (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('body'); + var svg = root.select("[id=\"".concat(id, "\"]")); + svg.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink'); // Run the renderer. This is what draws the final graph. + + var element = root.select('#' + id + ' g'); + (0,_dagre_wrapper_index_js__WEBPACK_IMPORTED_MODULE_9__.render)(element, g, ['aggregation', 'extension', 'composition', 'dependency'], 'classDiagram', id); + (0,_utils__WEBPACK_IMPORTED_MODULE_8__.setupGraphViewbox)(g, svg, conf.diagramPadding, conf.useMaxWidth); // Add label rects for non html labels + + if (!conf.htmlLabels) { + var doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; + var labels = doc.querySelectorAll('[id="' + id + '"] .edgeLabel .label'); + + for (var k = 0; k < labels.length; k++) { + var label = labels[k]; // Get dimensions of label + + var dim = label.getBBox(); + var rect = doc.createElementNS('http://www.w3.org/2000/svg', 'rect'); + rect.setAttribute('rx', 0); + rect.setAttribute('ry', 0); + rect.setAttribute('width', dim.width); + rect.setAttribute('height', dim.height); // rect.setAttribute('style', 'fill:#e8e8e8;'); + + label.insertBefore(rect, label.firstChild); + } + } + + (0,_accessibility__WEBPACK_IMPORTED_MODULE_10__["default"])(_parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.yy, svg, id); // If node has a link, wrap it in an anchor SVG object. + // const keys = Object.keys(classes); + // keys.forEach(function(key) { + // const vertex = classes[key]; + // if (vertex.link) { + // const node = select('#' + id + ' [id="' + key + '"]'); + // if (node) { + // const link = document.createElementNS('http://www.w3.org/2000/svg', 'a'); + // link.setAttributeNS('http://www.w3.org/2000/svg', 'class', vertex.classes.join(' ')); + // link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link); + // link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener'); + // const linkNode = node.insert(function() { + // return link; + // }, ':first-child'); + // const shape = node.select('.label-container'); + // if (shape) { + // linkNode.append(function() { + // return shape.node(); + // }); + // } + // const label = node.select('.label'); + // if (label) { + // linkNode.append(function() { + // return label.node(); + // }); + // } + // } + // } + // }); +}; +/** + * Gets the arrow marker for a type index + * + * @param {number} type The type to look for + * @returns {'aggregation' | 'extension' | 'composition' | 'dependency'} The arrow marker + */ + +function getArrowMarker(type) { + var marker; + + switch (type) { + case 0: + marker = 'aggregation'; + break; + + case 1: + marker = 'extension'; + break; + + case 2: + marker = 'composition'; + break; + + case 3: + marker = 'dependency'; + break; + + default: + marker = 'none'; + } + + return marker; +} + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + setConf: setConf, + draw: draw +}); + +/***/ }), + +/***/ "./src/diagrams/class/classRenderer.js": +/*!*********************************************!*\ + !*** ./src/diagrams/class/classRenderer.js ***! + \*********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "draw": () => (/* binding */ draw), +/* harmony export */ "setConf": () => (/* binding */ setConf) +/* harmony export */ }); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "./node_modules/d3/src/index.js"); +/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dagre */ "./node_modules/dagre/index.js"); +/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! graphlib */ "./node_modules/graphlib/index.js"); +/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); +/* harmony import */ var _classDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./classDb */ "./src/diagrams/class/classDb.js"); +/* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/classDiagram */ "./src/diagrams/class/parser/classDiagram.jison"); +/* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var _svgDraw__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./svgDraw */ "./src/diagrams/class/svgDraw.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../config */ "./src/config.js"); +/* harmony import */ var _accessibility__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../accessibility */ "./src/accessibility.js"); + + + + + + + + + + +_parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.yy = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"]; +var idCache = {}; +var padding = 20; +var conf = { + dividerMargin: 10, + padding: 5, + textHeight: 10 +}; +/** + * Gets the ID with the same label as in the cache + * + * @param {string} label The label to look for + * @returns {string} The resulting ID + */ + +var getGraphId = function getGraphId(label) { + var foundEntry = Object.entries(idCache).find(function (entry) { + return entry[1].label === label; + }); + + if (foundEntry) { + return foundEntry[0]; + } +}; +/** + * Setup arrow head and define the marker. The result is appended to the svg. + * + * @param {SVGSVGElement} elem The SVG element to append to + */ + + +var insertMarkers = function insertMarkers(elem) { + elem.append('defs').append('marker').attr('id', 'extensionStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 1,7 L18,13 V 1 Z'); + elem.append('defs').append('marker').attr('id', 'extensionEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead + + elem.append('defs').append('marker').attr('id', 'compositionStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); + elem.append('defs').append('marker').attr('id', 'compositionEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); + elem.append('defs').append('marker').attr('id', 'aggregationStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); + elem.append('defs').append('marker').attr('id', 'aggregationEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z'); + elem.append('defs').append('marker').attr('id', 'dependencyStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z'); + elem.append('defs').append('marker').attr('id', 'dependencyEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z'); +}; +/** + * Merges the value of `conf` with the passed `cnf` + * + * @param {object} cnf Config to merge + */ + + +var setConf = function setConf(cnf) { + var keys = Object.keys(cnf); + keys.forEach(function (key) { + conf[key] = cnf[key]; + }); +}; +/** + * Draws a flowchart in the tag with id: id based on the graph definition in text. + * + * @param {string} text + * @param {string} id + */ + +var draw = function draw(text, id) { + idCache = {}; + _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.yy.clear(); + _parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.parse(text); + _logger__WEBPACK_IMPORTED_MODULE_5__.log.info('Rendering diagram ' + text); + var securityLevel = (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)().securityLevel; // Handle root and Document for when rendering in sanbox mode + + var sandboxElement; + + if (securityLevel === 'sandbox') { + sandboxElement = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('#i' + id); + } + + var root = securityLevel === 'sandbox' ? (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(sandboxElement.nodes()[0].contentDocument.body) : (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('body'); + var doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; // Fetch the default direction, use TD if none was found + + var diagram = root.select("[id='".concat(id, "']")); + diagram.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink'); + insertMarkers(diagram); // Layout graph, Create a new directed graph + + var g = new (graphlib__WEBPACK_IMPORTED_MODULE_2___default().Graph)({ + multigraph: true + }); // Set an object for the graph label + + g.setGraph({ + isMultiGraph: true + }); // Default to assigning a new object as a label for each new edge. + + g.setDefaultEdgeLabel(function () { + return {}; + }); + var classes = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getClasses(); + var keys = Object.keys(classes); + + for (var i = 0; i < keys.length; i++) { + var classDef = classes[keys[i]]; + var node = _svgDraw__WEBPACK_IMPORTED_MODULE_7__["default"].drawClass(diagram, classDef, conf); + idCache[node.id] = node; // Add nodes to the graph. The first argument is the node id. The second is + // metadata about the node. In this case we're going to add labels to each of + // our nodes. + + g.setNode(node.id, node); + _logger__WEBPACK_IMPORTED_MODULE_5__.log.info('Org height: ' + node.height); + } + + var relations = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRelations(); + relations.forEach(function (relation) { + _logger__WEBPACK_IMPORTED_MODULE_5__.log.info('tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation)); + g.setEdge(getGraphId(relation.id1), getGraphId(relation.id2), { + relation: relation + }, relation.title || 'DEFAULT'); + }); + dagre__WEBPACK_IMPORTED_MODULE_1___default().layout(g); + g.nodes().forEach(function (v) { + if (typeof v !== 'undefined' && typeof g.node(v) !== 'undefined') { + _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug('Node ' + v + ': ' + JSON.stringify(g.node(v))); + root.select('#' + (0,_classDb__WEBPACK_IMPORTED_MODULE_4__.lookUpDomId)(v)).attr('transform', 'translate(' + (g.node(v).x - g.node(v).width / 2) + ',' + (g.node(v).y - g.node(v).height / 2) + ' )'); + } + }); + g.edges().forEach(function (e) { + if (typeof e !== 'undefined' && typeof g.edge(e) !== 'undefined') { + _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(g.edge(e))); + _svgDraw__WEBPACK_IMPORTED_MODULE_7__["default"].drawEdge(diagram, g.edge(e), g.edge(e).relation, conf); + } + }); + var svgBounds = diagram.node().getBBox(); + var width = svgBounds.width + padding * 2; + var height = svgBounds.height + padding * 2; + (0,_utils__WEBPACK_IMPORTED_MODULE_8__.configureSvgSize)(diagram, height, width, conf.useMaxWidth); // Ensure the viewBox includes the whole svgBounds area with extra space for padding + + var vBox = "".concat(svgBounds.x - padding, " ").concat(svgBounds.y - padding, " ").concat(width, " ").concat(height); + _logger__WEBPACK_IMPORTED_MODULE_5__.log.debug("viewBox ".concat(vBox)); + diagram.attr('viewBox', vBox); + (0,_accessibility__WEBPACK_IMPORTED_MODULE_9__["default"])(_parser_classDiagram__WEBPACK_IMPORTED_MODULE_3__.parser.yy, diagram, id); +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + setConf: setConf, + draw: draw +}); + +/***/ }), + +/***/ "./src/diagrams/class/styles.js": +/*!**************************************!*\ + !*** ./src/diagrams/class/styles.js ***! + \**************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +var getStyles = function getStyles(options) { + return "g.classGroup text {\n fill: ".concat(options.nodeBorder, ";\n fill: ").concat(options.classText, ";\n stroke: none;\n font-family: ").concat(options.fontFamily, ";\n font-size: 10px;\n\n .title {\n font-weight: bolder;\n }\n\n}\n\n.nodeLabel, .edgeLabel {\n color: ").concat(options.classText, ";\n}\n.edgeLabel .label rect {\n fill: ").concat(options.mainBkg, ";\n}\n.label text {\n fill: ").concat(options.classText, ";\n}\n.edgeLabel .label span {\n background: ").concat(options.mainBkg, ";\n}\n\n.classTitle {\n font-weight: bolder;\n}\n.node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1px;\n }\n\n\n.divider {\n stroke: ").concat(options.nodeBorder, ";\n stroke: 1;\n}\n\ng.clickable {\n cursor: pointer;\n}\n\ng.classGroup rect {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n}\n\ng.classGroup line {\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1;\n}\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ").concat(options.mainBkg, ";\n opacity: 0.5;\n}\n\n.classLabel .label {\n fill: ").concat(options.nodeBorder, ";\n font-size: 10px;\n}\n\n.relation {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n fill: none;\n}\n\n.dashed-line{\n stroke-dasharray: 3;\n}\n\n#compositionStart, .composition {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#compositionEnd, .composition {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#dependencyStart, .dependency {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#extensionStart, .extension {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#extensionEnd, .extension {\n fill: ").concat(options.lineColor, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#aggregationStart, .aggregation {\n fill: ").concat(options.mainBkg, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n#aggregationEnd, .aggregation {\n fill: ").concat(options.mainBkg, " !important;\n stroke: ").concat(options.lineColor, " !important;\n stroke-width: 1;\n}\n\n.edgeTerminals {\n font-size: 11px;\n}\n\n"); +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getStyles); + +/***/ }), + +/***/ "./src/diagrams/class/svgDraw.js": +/*!***************************************!*\ + !*** ./src/diagrams/class/svgDraw.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "drawClass": () => (/* binding */ drawClass), +/* harmony export */ "drawEdge": () => (/* binding */ drawEdge), +/* harmony export */ "parseMember": () => (/* binding */ parseMember) +/* harmony export */ }); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "./node_modules/d3/src/index.js"); +/* harmony import */ var _classDb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./classDb */ "./src/diagrams/class/classDb.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); + + + + +var edgeCount = 0; +var drawEdge = function drawEdge(elem, path, relation, conf) { + var getRelationType = function getRelationType(type) { + switch (type) { + case _classDb__WEBPACK_IMPORTED_MODULE_1__.relationType.AGGREGATION: + return 'aggregation'; + + case _classDb__WEBPACK_IMPORTED_MODULE_1__.relationType.EXTENSION: + return 'extension'; + + case _classDb__WEBPACK_IMPORTED_MODULE_1__.relationType.COMPOSITION: + return 'composition'; + + case _classDb__WEBPACK_IMPORTED_MODULE_1__.relationType.DEPENDENCY: + return 'dependency'; + } + }; + + path.points = path.points.filter(function (p) { + return !Number.isNaN(p.y); + }); // The data for our line + + var lineData = path.points; // This is the accessor function we talked about above + + var lineFunction = (0,d3__WEBPACK_IMPORTED_MODULE_0__.line)().x(function (d) { + return d.x; + }).y(function (d) { + return d.y; + }).curve(d3__WEBPACK_IMPORTED_MODULE_0__.curveBasis); + var svgPath = elem.append('path').attr('d', lineFunction(lineData)).attr('id', 'edge' + edgeCount).attr('class', 'relation'); + var url = ''; + + if (conf.arrowMarkerAbsolute) { + url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search; + url = url.replace(/\(/g, '\\('); + url = url.replace(/\)/g, '\\)'); + } + + if (relation.relation.lineType == 1) { + svgPath.attr('class', 'relation dashed-line'); + } + + if (relation.relation.type1 !== 'none') { + svgPath.attr('marker-start', 'url(' + url + '#' + getRelationType(relation.relation.type1) + 'Start' + ')'); + } + + if (relation.relation.type2 !== 'none') { + svgPath.attr('marker-end', 'url(' + url + '#' + getRelationType(relation.relation.type2) + 'End' + ')'); + } + + var x, y; + var l = path.points.length; // Calculate Label position + + var labelPosition = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].calcLabelPosition(path.points); + x = labelPosition.x; + y = labelPosition.y; + var p1_card_x, p1_card_y; + var p2_card_x, p2_card_y; + + if (l % 2 !== 0 && l > 1) { + var cardinality_1_point = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].calcCardinalityPosition(relation.relation.type1 !== 'none', path.points, path.points[0]); + var cardinality_2_point = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].calcCardinalityPosition(relation.relation.type2 !== 'none', path.points, path.points[l - 1]); + _logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('cardinality_1_point ' + JSON.stringify(cardinality_1_point)); + _logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('cardinality_2_point ' + JSON.stringify(cardinality_2_point)); + p1_card_x = cardinality_1_point.x; + p1_card_y = cardinality_1_point.y; + p2_card_x = cardinality_2_point.x; + p2_card_y = cardinality_2_point.y; + } + + if (typeof relation.title !== 'undefined') { + var g = elem.append('g').attr('class', 'classLabel'); + var label = g.append('text').attr('class', 'label').attr('x', x).attr('y', y).attr('fill', 'red').attr('text-anchor', 'middle').text(relation.title); + window.label = label; + var bounds = label.node().getBBox(); + g.insert('rect', ':first-child').attr('class', 'box').attr('x', bounds.x - conf.padding / 2).attr('y', bounds.y - conf.padding / 2).attr('width', bounds.width + conf.padding).attr('height', bounds.height + conf.padding); + } + + _logger__WEBPACK_IMPORTED_MODULE_3__.log.info('Rendering relation ' + JSON.stringify(relation)); + + if (typeof relation.relationTitle1 !== 'undefined' && relation.relationTitle1 !== 'none') { + var _g = elem.append('g').attr('class', 'cardinality'); + + _g.append('text').attr('class', 'type1').attr('x', p1_card_x).attr('y', p1_card_y).attr('fill', 'black').attr('font-size', '6').text(relation.relationTitle1); + } + + if (typeof relation.relationTitle2 !== 'undefined' && relation.relationTitle2 !== 'none') { + var _g2 = elem.append('g').attr('class', 'cardinality'); + + _g2.append('text').attr('class', 'type2').attr('x', p2_card_x).attr('y', p2_card_y).attr('fill', 'black').attr('font-size', '6').text(relation.relationTitle2); + } + + edgeCount++; +}; +/** + * Renders a class diagram + * + * @param {SVGSVGElement} elem The element to draw it into + * @param classDef + * @param conf + * @todo Add more information in the JSDOC here + */ + +var drawClass = function drawClass(elem, classDef, conf) { + _logger__WEBPACK_IMPORTED_MODULE_3__.log.info('Rendering class ' + classDef); + var id = classDef.id; + var classInfo = { + id: id, + label: classDef.id, + width: 0, + height: 0 + }; // add class group + + var g = elem.append('g').attr('id', (0,_classDb__WEBPACK_IMPORTED_MODULE_1__.lookUpDomId)(id)).attr('class', 'classGroup'); // add title + + var title; + + if (classDef.link) { + title = g.append('svg:a').attr('xlink:href', classDef.link).attr('target', classDef.linkTarget).append('text').attr('y', conf.textHeight + conf.padding).attr('x', 0); + } else { + title = g.append('text').attr('y', conf.textHeight + conf.padding).attr('x', 0); + } // add annotations + + + var isFirst = true; + classDef.annotations.forEach(function (member) { + var titleText2 = title.append('tspan').text('«' + member + '»'); + if (!isFirst) titleText2.attr('dy', conf.textHeight); + isFirst = false; + }); + var classTitleString = classDef.id; + + if (classDef.type !== undefined && classDef.type !== '') { + classTitleString += '<' + classDef.type + '>'; + } + + var classTitle = title.append('tspan').text(classTitleString).attr('class', 'title'); // If class has annotations the title needs to have an offset of the text height + + if (!isFirst) classTitle.attr('dy', conf.textHeight); + var titleHeight = title.node().getBBox().height; + var membersLine = g.append('line') // text label for the x axis + .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin / 2).attr('y2', conf.padding + titleHeight + conf.dividerMargin / 2); + var members = g.append('text') // text label for the x axis + .attr('x', conf.padding).attr('y', titleHeight + conf.dividerMargin + conf.textHeight).attr('fill', 'white').attr('class', 'classText'); + isFirst = true; + classDef.members.forEach(function (member) { + addTspan(members, member, isFirst, conf); + isFirst = false; + }); + var membersBox = members.node().getBBox(); + var methodsLine = g.append('line') // text label for the x axis + .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin + membersBox.height).attr('y2', conf.padding + titleHeight + conf.dividerMargin + membersBox.height); + var methods = g.append('text') // text label for the x axis + .attr('x', conf.padding).attr('y', titleHeight + 2 * conf.dividerMargin + membersBox.height + conf.textHeight).attr('fill', 'white').attr('class', 'classText'); + isFirst = true; + classDef.methods.forEach(function (method) { + addTspan(methods, method, isFirst, conf); + isFirst = false; + }); + var classBox = g.node().getBBox(); + var cssClassStr = ' '; + + if (classDef.cssClasses.length > 0) { + cssClassStr = cssClassStr + classDef.cssClasses.join(' '); + } + + var rect = g.insert('rect', ':first-child').attr('x', 0).attr('y', 0).attr('width', classBox.width + 2 * conf.padding).attr('height', classBox.height + conf.padding + 0.5 * conf.dividerMargin).attr('class', cssClassStr); + var rectWidth = rect.node().getBBox().width; // Center title + // We subtract the width of each text element from the class box width and divide it by 2 + + title.node().childNodes.forEach(function (x) { + x.setAttribute('x', (rectWidth - x.getBBox().width) / 2); + }); + + if (classDef.tooltip) { + title.insert('title').text(classDef.tooltip); + } + + membersLine.attr('x2', rectWidth); + methodsLine.attr('x2', rectWidth); + classInfo.width = rectWidth; + classInfo.height = classBox.height + conf.padding + 0.5 * conf.dividerMargin; + return classInfo; +}; +var parseMember = function parseMember(text) { + var fieldRegEx = /^(\+|-|~|#)?(\w+)(~\w+~|\[\])?\s+(\w+) *(\*|\$)?$/; + var methodRegEx = /^([+|\-|~|#])?(\w+) *\( *(.*)\) *(\*|\$)? *(\w*[~|[\]]*\s*\w*~?)$/; + var fieldMatch = text.match(fieldRegEx); + var methodMatch = text.match(methodRegEx); + + if (fieldMatch && !methodMatch) { + return buildFieldDisplay(fieldMatch); + } else if (methodMatch) { + return buildMethodDisplay(methodMatch); + } else { + return buildLegacyDisplay(text); + } +}; + +var buildFieldDisplay = function buildFieldDisplay(parsedText) { + var cssStyle = ''; + var displayText = ''; + + try { + var visibility = parsedText[1] ? parsedText[1].trim() : ''; + var fieldType = parsedText[2] ? parsedText[2].trim() : ''; + var genericType = parsedText[3] ? parseGenericTypes(parsedText[3].trim()) : ''; + var fieldName = parsedText[4] ? parsedText[4].trim() : ''; + var classifier = parsedText[5] ? parsedText[5].trim() : ''; + displayText = visibility + fieldType + genericType + ' ' + fieldName; + cssStyle = parseClassifier(classifier); + } catch (err) { + displayText = parsedText; + } + + return { + displayText: displayText, + cssStyle: cssStyle + }; +}; + +var buildMethodDisplay = function buildMethodDisplay(parsedText) { + var cssStyle = ''; + var displayText = ''; + + try { + var visibility = parsedText[1] ? parsedText[1].trim() : ''; + var methodName = parsedText[2] ? parsedText[2].trim() : ''; + var parameters = parsedText[3] ? parseGenericTypes(parsedText[3].trim()) : ''; + var classifier = parsedText[4] ? parsedText[4].trim() : ''; + var returnType = parsedText[5] ? ' : ' + parseGenericTypes(parsedText[5]).trim() : ''; + displayText = visibility + methodName + '(' + parameters + ')' + returnType; + cssStyle = parseClassifier(classifier); + } catch (err) { + displayText = parsedText; + } + + return { + displayText: displayText, + cssStyle: cssStyle + }; +}; + +var buildLegacyDisplay = function buildLegacyDisplay(text) { + // if for some reason we dont have any match, use old format to parse text + var displayText = ''; + var cssStyle = ''; + var memberText = ''; + var returnType = ''; + var methodStart = text.indexOf('('); + var methodEnd = text.indexOf(')'); + + if (methodStart > 1 && methodEnd > methodStart && methodEnd <= text.length) { + var visibility = ''; + var methodName = ''; + var firstChar = text.substring(0, 1); + + if (firstChar.match(/\w/)) { + methodName = text.substring(0, methodStart).trim(); + } else { + if (firstChar.match(/\+|-|~|#/)) { + visibility = firstChar; + } + + methodName = text.substring(1, methodStart).trim(); + } + + var parameters = text.substring(methodStart + 1, methodEnd); + var classifier = text.substring(methodEnd + 1, 1); + cssStyle = parseClassifier(classifier); + displayText = visibility + methodName + '(' + parseGenericTypes(parameters.trim()) + ')'; + + if (methodEnd < memberText.length) { + returnType = text.substring(methodEnd + 2).trim(); + + if (returnType !== '') { + returnType = ' : ' + parseGenericTypes(returnType); + } + } + } else { + // finally - if all else fails, just send the text back as written (other than parsing for generic types) + displayText = parseGenericTypes(text); + } + + return { + displayText: displayText, + cssStyle: cssStyle + }; +}; +/** + * Adds a for a member in a diagram + * + * @param {SVGElement} textEl The element to append to + * @param {string} txt The member + * @param {boolean} isFirst + * @param {{ padding: string; textHeight: string }} conf The configuration for the member + */ + + +var addTspan = function addTspan(textEl, txt, isFirst, conf) { + var member = parseMember(txt); + var tSpan = textEl.append('tspan').attr('x', conf.padding).text(member.displayText); + + if (member.cssStyle !== '') { + tSpan.attr('style', member.cssStyle); + } + + if (!isFirst) { + tSpan.attr('dy', conf.textHeight); + } +}; +/** + * Makes generics in typescript syntax + * + * @example Array of array of strings in typescript syntax + * // returns "Array>" + * parseGenericTypes('Array~Array~string~~'); + * + * @param {string} text The text to convert + * @returns {string} The converted string + */ + + +var parseGenericTypes = function parseGenericTypes(text) { + var cleanedText = text; + + if (text.indexOf('~') != -1) { + cleanedText = cleanedText.replace('~', '<'); + cleanedText = cleanedText.replace('~', '>'); + return parseGenericTypes(cleanedText); + } else { + return cleanedText; + } +}; +/** + * Gives the styles for a classifier + * + * @param {'+' | '-' | '#' | '~' | '*' | '$'} classifier The classifier string + * @returns {string} Styling for the classifier + */ + + +var parseClassifier = function parseClassifier(classifier) { + switch (classifier) { + case '*': + return 'font-style:italic;'; + + case '$': + return 'text-decoration:underline;'; + + default: + return ''; + } +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + drawClass: drawClass, + drawEdge: drawEdge, + parseMember: parseMember +}); + +/***/ }), + +/***/ "./src/diagrams/common/common.js": +/*!***************************************!*\ + !*** ./src/diagrams/common/common.js ***! + \***************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "evaluate": () => (/* binding */ evaluate), +/* harmony export */ "getRows": () => (/* binding */ getRows), +/* harmony export */ "hasBreaks": () => (/* binding */ hasBreaks), +/* harmony export */ "lineBreakRegex": () => (/* binding */ lineBreakRegex), +/* harmony export */ "removeEscapes": () => (/* binding */ removeEscapes), +/* harmony export */ "removeScript": () => (/* binding */ removeScript), +/* harmony export */ "sanitizeText": () => (/* binding */ sanitizeText), +/* harmony export */ "sanitizeTextOrArray": () => (/* binding */ sanitizeTextOrArray), +/* harmony export */ "splitBreaks": () => (/* binding */ splitBreaks) +/* harmony export */ }); +/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dompurify */ "./node_modules/dompurify/dist/purify.js"); +/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dompurify__WEBPACK_IMPORTED_MODULE_0__); + +/** + * Gets the number of lines in a string + * + * @param {string | undefined} s The string to check the lines for + * @returns {number} The number of lines in that string + */ + +var getRows = function getRows(s) { + if (!s) return 1; + var str = breakToPlaceholder(s); + str = str.replace(/\\n/g, '#br#'); + return str.split('#br#'); +}; +var removeEscapes = function removeEscapes(text) { + var newStr = text.replace(/\\u[\dA-F]{4}/gi, function (match) { + return String.fromCharCode(parseInt(match.replace(/\\u/g, ''), 16)); + }); + newStr = newStr.replace(/\\x([0-9a-f]{2})/gi, function (_, c) { + return String.fromCharCode(parseInt(c, 16)); + }); + newStr = newStr.replace(/\\[\d\d\d]{3}/gi, function (match) { + return String.fromCharCode(parseInt(match.replace(/\\/g, ''), 8)); + }); + newStr = newStr.replace(/\\[\d\d\d]{2}/gi, function (match) { + return String.fromCharCode(parseInt(match.replace(/\\/g, ''), 8)); + }); + return newStr; +}; +/** + * Removes script tags from a text + * + * @param {string} txt The text to sanitize + * @returns {string} The safer text + */ + +var removeScript = function removeScript(txt) { + var rs = ''; + var idx = 0; + + while (idx >= 0) { + idx = txt.indexOf('= 0) { + rs += txt.substr(0, idx); + txt = txt.substr(idx + 1); + idx = txt.indexOf(''); + + if (idx >= 0) { + idx += 9; + txt = txt.substr(idx); + } + } else { + rs += txt; + idx = -1; + break; + } + } + + var decodedText = removeEscapes(rs); + decodedText = decodedText.replaceAll(/script>/gi, '#'); + decodedText = decodedText.replaceAll(/javascript:/gi, '#'); + decodedText = decodedText.replaceAll(/javascript&colon/gi, '#'); + decodedText = decodedText.replaceAll(/onerror=/gi, 'onerror:'); + decodedText = decodedText.replaceAll(/"); + } else { + if (cnf.securityLevel !== 'loose') { + svgCode = dompurify__WEBPACK_IMPORTED_MODULE_1___default().sanitize(svgCode, { + ADD_TAGS: ['foreignobject'], + ADD_ATTR: ['dominant-baseline'] + }); + } + } + + if (typeof cb !== 'undefined') { + switch (graphType) { + case 'flowchart': + case 'flowchart-v2': + cb(svgCode, _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_9__["default"].bindFunctions); + break; + + case 'gantt': + cb(svgCode, _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__["default"].bindFunctions); + break; + + case 'class': + case 'classDiagram': + cb(svgCode, _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_16__["default"].bindFunctions); + break; + + default: + cb(svgCode); + } + } else { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('CB = undefined!'); + } + + (0,_interactionDb__WEBPACK_IMPORTED_MODULE_50__.attachFunctions)(); + var tmpElementSelector = cnf.securityLevel === 'sandbox' ? '#i' + id : '#d' + id; + var node = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(tmpElementSelector).node(); + + if (node !== null && typeof node.remove === 'function') { + (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(tmpElementSelector).node().remove(); + } + + return svgCode; +}; + +var currentDirective = {}; + +var parseDirective = function parseDirective(p, statement, context, type) { + try { + if (statement !== undefined) { + statement = statement.trim(); + + switch (context) { + case 'open_directive': + currentDirective = {}; + break; + + case 'type_directive': + currentDirective.type = statement.toLowerCase(); + break; + + case 'arg_directive': + currentDirective.args = JSON.parse(statement); + break; + + case 'close_directive': + handleDirective(p, currentDirective, type); + currentDirective = null; + break; + } + } + } catch (error) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.error("Error while rendering sequenceDiagram directive: ".concat(statement, " jison context: ").concat(context)); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.error(error.message); + } +}; + +var handleDirective = function handleDirective(p, directive, type) { + _logger__WEBPACK_IMPORTED_MODULE_4__.log.debug("Directive type=".concat(directive.type, " with args:"), directive.args); + + switch (directive.type) { + case 'init': + case 'initialize': + { + ['config'].forEach(function (prop) { + if (typeof directive.args[prop] !== 'undefined') { + if (type === 'flowchart-v2') { + type = 'flowchart'; + } + + directive.args[type] = directive.args[prop]; + delete directive.args[prop]; + } + }); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('sanitize in handleDirective', directive.args); + (0,_utils__WEBPACK_IMPORTED_MODULE_3__.directiveSanitizer)(directive.args); + _logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('sanitize in handleDirective (done)', directive.args); + reinitialize(directive.args); + _config__WEBPACK_IMPORTED_MODULE_2__.addDirective(directive.args); + break; + } + + case 'wrap': + case 'nowrap': + if (p && p['setWrap']) { + p.setWrap(directive.type === 'wrap'); + } + + break; + + case 'themeCss': + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn('themeCss encountered'); + break; + + default: + _logger__WEBPACK_IMPORTED_MODULE_4__.log.warn("Unhandled directive: source: '%%{".concat(directive.type, ": ").concat(JSON.stringify(directive.args ? directive.args : {}), "}%%"), directive); + break; + } +}; +/** @param {any} conf */ + + +function updateRendererConfigs(conf) { + // Todo remove, all diagrams should get config on demand from the config object, no need for this + // gitGraphRenderer.setConf(conf.git); // Todo Remove all of these + _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_30__["default"].setConf(conf.flowchart); + _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_36__["default"].setConf(conf.flowchart); + + if (typeof conf['sequenceDiagram'] !== 'undefined') { + _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_37__["default"].setConf((0,_utils__WEBPACK_IMPORTED_MODULE_3__.assignWithDepth)(conf.sequence, conf['sequenceDiagram'])); + } + + _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_37__["default"].setConf(conf.sequence); + _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_38__["default"].setConf(conf.gantt); + _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_39__["default"].setConf(conf.class); + _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_41__["default"].setConf(conf.state); + _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_42__["default"].setConf(conf.state); + _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_43__["default"].setConf(conf.class); // pieRenderer.setConf(conf.class); + + _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_46__["default"].setConf(conf.er); + _diagrams_user_journey_journeyRenderer__WEBPACK_IMPORTED_MODULE_47__["default"].setConf(conf.journey); + _diagrams_requirement_requirementRenderer__WEBPACK_IMPORTED_MODULE_48__["default"].setConf(conf.requirement); + _errorRenderer__WEBPACK_IMPORTED_MODULE_49__["default"].setConf(conf.class); +} +/** To be removed */ + + +function reinitialize() {// `mermaidAPI.reinitialize: v${pkg.version}`, + // JSON.stringify(options), + // options.themeVariables.primaryColor; + // // if (options.theme && theme[options.theme]) { + // // options.themeVariables = theme[options.theme].getThemeVariables(options.themeVariables); + // // } + // // Set default options + // const config = + // typeof options === 'object' ? configApi.setConfig(options) : configApi.getSiteConfig(); + // updateRendererConfigs(config); + // setLogLevel(config.logLevel); + // log.debug('mermaidAPI.reinitialize: ', config); +} +/** @param {any} options */ + + +function initialize(options) { + // console.warn(`mermaidAPI.initialize: v${pkg.version} `, options); + // Handle legacy location of font-family configuration + if (options && options.fontFamily) { + if (!options.themeVariables) { + options.themeVariables = { + fontFamily: options.fontFamily + }; + } else { + if (!options.themeVariables.fontFamily) { + options.themeVariables = { + fontFamily: options.fontFamily + }; + } + } + } // Set default options + + + _config__WEBPACK_IMPORTED_MODULE_2__.saveConfigFromInitialize(options); + + if (options && options.theme && _themes__WEBPACK_IMPORTED_MODULE_51__["default"][options.theme]) { + // Todo merge with user options + options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_51__["default"][options.theme].getThemeVariables(options.themeVariables); + } else { + if (options) options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_51__["default"]["default"].getThemeVariables(options.themeVariables); + } + + var config = _typeof(options) === 'object' ? _config__WEBPACK_IMPORTED_MODULE_2__.setSiteConfig(options) : _config__WEBPACK_IMPORTED_MODULE_2__.getSiteConfig(); + updateRendererConfigs(config); + (0,_logger__WEBPACK_IMPORTED_MODULE_4__.setLogLevel)(config.logLevel); // log.debug('mermaidAPI.initialize: ', config); +} + +var mermaidAPI = Object.freeze({ + render: render, + parse: parse, + parseDirective: parseDirective, + initialize: initialize, + reinitialize: reinitialize, + getConfig: _config__WEBPACK_IMPORTED_MODULE_2__.getConfig, + setConfig: _config__WEBPACK_IMPORTED_MODULE_2__.setConfig, + getSiteConfig: _config__WEBPACK_IMPORTED_MODULE_2__.getSiteConfig, + updateSiteConfig: _config__WEBPACK_IMPORTED_MODULE_2__.updateSiteConfig, + reset: function reset() { + // console.warn('reset'); + _config__WEBPACK_IMPORTED_MODULE_2__.reset(); // const siteConfig = configApi.getSiteConfig(); + // updateRendererConfigs(siteConfig); + }, + globalReset: function globalReset() { + _config__WEBPACK_IMPORTED_MODULE_2__.reset(_config__WEBPACK_IMPORTED_MODULE_2__.defaultConfig); + updateRendererConfigs(_config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); + }, + defaultConfig: _config__WEBPACK_IMPORTED_MODULE_2__.defaultConfig +}); +(0,_logger__WEBPACK_IMPORTED_MODULE_4__.setLogLevel)(_config__WEBPACK_IMPORTED_MODULE_2__.getConfig().logLevel); +_config__WEBPACK_IMPORTED_MODULE_2__.reset(_config__WEBPACK_IMPORTED_MODULE_2__.getConfig()); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mermaidAPI); +/** + * ## mermaidAPI configuration defaults + * + * ```html + * + * ``` + */ + +/***/ }), + +/***/ "./src/styles.js": +/*!***********************!*\ + !*** ./src/styles.js ***! + \***********************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "calcThemeVariables": () => (/* binding */ calcThemeVariables), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./diagrams/class/styles */ "./src/diagrams/class/styles.js"); +/* harmony import */ var _diagrams_er_styles__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./diagrams/er/styles */ "./src/diagrams/er/styles.js"); +/* harmony import */ var _diagrams_flowchart_styles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diagrams/flowchart/styles */ "./src/diagrams/flowchart/styles.js"); +/* harmony import */ var _diagrams_gantt_styles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./diagrams/gantt/styles */ "./src/diagrams/gantt/styles.js"); +/* harmony import */ var _diagrams_git_styles__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./diagrams/git/styles */ "./src/diagrams/git/styles.js"); +/* harmony import */ var _diagrams_info_styles__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./diagrams/info/styles */ "./src/diagrams/info/styles.js"); +/* harmony import */ var _diagrams_pie_styles__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./diagrams/pie/styles */ "./src/diagrams/pie/styles.js"); +/* harmony import */ var _diagrams_requirement_styles__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./diagrams/requirement/styles */ "./src/diagrams/requirement/styles.js"); +/* harmony import */ var _diagrams_sequence_styles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./diagrams/sequence/styles */ "./src/diagrams/sequence/styles.js"); +/* harmony import */ var _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./diagrams/state/styles */ "./src/diagrams/state/styles.js"); +/* harmony import */ var _diagrams_user_journey_styles__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./diagrams/user-journey/styles */ "./src/diagrams/user-journey/styles.js"); +/* harmony import */ var _diagrams_c4_styles__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./diagrams/c4/styles */ "./src/diagrams/c4/styles.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./logger */ "./src/logger.js"); + + + + + + + + + + + + + +var themes = { + flowchart: _diagrams_flowchart_styles__WEBPACK_IMPORTED_MODULE_0__["default"], + 'flowchart-v2': _diagrams_flowchart_styles__WEBPACK_IMPORTED_MODULE_0__["default"], + sequence: _diagrams_sequence_styles__WEBPACK_IMPORTED_MODULE_1__["default"], + gantt: _diagrams_gantt_styles__WEBPACK_IMPORTED_MODULE_2__["default"], + classDiagram: _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_3__["default"], + 'classDiagram-v2': _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_3__["default"], + class: _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_3__["default"], + stateDiagram: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_4__["default"], + state: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_4__["default"], + gitGraph: _diagrams_git_styles__WEBPACK_IMPORTED_MODULE_5__["default"], + info: _diagrams_info_styles__WEBPACK_IMPORTED_MODULE_6__["default"], + pie: _diagrams_pie_styles__WEBPACK_IMPORTED_MODULE_7__["default"], + er: _diagrams_er_styles__WEBPACK_IMPORTED_MODULE_8__["default"], + journey: _diagrams_user_journey_styles__WEBPACK_IMPORTED_MODULE_9__["default"], + requirement: _diagrams_requirement_styles__WEBPACK_IMPORTED_MODULE_10__["default"], + c4: _diagrams_c4_styles__WEBPACK_IMPORTED_MODULE_11__["default"] +}; +var calcThemeVariables = function calcThemeVariables(theme, userOverRides) { + _logger__WEBPACK_IMPORTED_MODULE_12__.log.info('userOverides', userOverRides); + return theme.calcColors(userOverRides); +}; + +var getStyles = function getStyles(type, userStyles, options) { + return " {\n font-family: ".concat(options.fontFamily, ";\n font-size: ").concat(options.fontSize, ";\n fill: ").concat(options.textColor, "\n }\n\n /* Classes common for multiple diagrams */\n\n .error-icon {\n fill: ").concat(options.errorBkgColor, ";\n }\n .error-text {\n fill: ").concat(options.errorTextColor, ";\n stroke: ").concat(options.errorTextColor, ";\n }\n\n .edge-thickness-normal {\n stroke-width: 2px;\n }\n .edge-thickness-thick {\n stroke-width: 3.5px\n }\n .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n\n .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n .marker {\n fill: ").concat(options.lineColor, ";\n stroke: ").concat(options.lineColor, ";\n }\n .marker.cross {\n stroke: ").concat(options.lineColor, ";\n }\n\n svg {\n font-family: ").concat(options.fontFamily, ";\n font-size: ").concat(options.fontSize, ";\n }\n\n ").concat(themes[type](options), "\n\n ").concat(userStyles, "\n"); +}; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getStyles); + +/***/ }), + +/***/ "./src/themes/index.js": +/*!*****************************!*\ + !*** ./src/themes/index.js ***! + \*****************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _theme_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./theme-base */ "./src/themes/theme-base.js"); +/* harmony import */ var _theme_dark__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-dark */ "./src/themes/theme-dark.js"); +/* harmony import */ var _theme_default__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./theme-default */ "./src/themes/theme-default.js"); +/* harmony import */ var _theme_forest__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./theme-forest */ "./src/themes/theme-forest.js"); +/* harmony import */ var _theme_neutral__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./theme-neutral */ "./src/themes/theme-neutral.js"); + + + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + base: { + getThemeVariables: _theme_base__WEBPACK_IMPORTED_MODULE_0__.getThemeVariables + }, + dark: { + getThemeVariables: _theme_dark__WEBPACK_IMPORTED_MODULE_1__.getThemeVariables + }, + default: { + getThemeVariables: _theme_default__WEBPACK_IMPORTED_MODULE_2__.getThemeVariables + }, + forest: { + getThemeVariables: _theme_forest__WEBPACK_IMPORTED_MODULE_3__.getThemeVariables + }, + neutral: { + getThemeVariables: _theme_neutral__WEBPACK_IMPORTED_MODULE_4__.getThemeVariables + } +}); + +/***/ }), + +/***/ "./src/themes/theme-base.js": +/*!**********************************!*\ + !*** ./src/themes/theme-base.js ***! + \**********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "getThemeVariables": () => (/* binding */ getThemeVariables) +/* harmony export */ }); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/adjust.js"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/invert.js"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/darken.js"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/lighten.js"); +/* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + + + + +var Theme = /*#__PURE__*/function () { + function Theme() { + _classCallCheck(this, Theme); + + /** # Base variables */ + + /** + * - Background - used to know what the background color is of the diagram. This is used for + * deducing colors for instance line color. Default value is #f4f4f4. + */ + this.background = '#f4f4f4'; + this.darkMode = false; + this.primaryColor = '#fff4dd'; + this.noteBkgColor = '#fff5ad'; + this.noteTextColor = '#333'; // dark + + this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; + this.fontSize = '16px'; + } + + _createClass(Theme, [{ + key: "updateColors", + value: function updateColors() { + // The || is to make sure that if the variable has been defined by a user override that value is to be used + + /* Main */ + this.primaryTextColor = this.primaryTextColor || (this.darkMode ? '#eee' : '#333'); // invert(this.primaryColor); + + this.secondaryColor = this.secondaryColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: -120 + }); + this.tertiaryColor = this.tertiaryColor || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: 180, + l: 5 + }); + this.primaryBorderColor = this.primaryBorderColor || (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.primaryColor, this.darkMode); + this.secondaryBorderColor = this.secondaryBorderColor || (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.secondaryColor, this.darkMode); + this.tertiaryBorderColor = this.tertiaryBorderColor || (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.tertiaryColor, this.darkMode); + this.noteBorderColor = this.noteBorderColor || (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.noteBkgColor, this.darkMode); + this.noteBkgColor = this.noteBkgColor || '#fff5ad'; + this.noteTextColor = this.noteTextColor || '#333'; + this.secondaryTextColor = this.secondaryTextColor || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.secondaryColor); + this.tertiaryTextColor = this.tertiaryTextColor || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.tertiaryColor); + this.lineColor = this.lineColor || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.background); + this.textColor = this.textColor || this.primaryTextColor; + /* Flowchart variables */ + + this.nodeBkg = this.nodeBkg || this.primaryColor; + this.mainBkg = this.mainBkg || this.primaryColor; + this.nodeBorder = this.nodeBorder || this.primaryBorderColor; + this.clusterBkg = this.clusterBkg || this.tertiaryColor; + this.clusterBorder = this.clusterBorder || this.tertiaryBorderColor; + this.defaultLinkColor = this.defaultLinkColor || this.lineColor; + this.titleColor = this.titleColor || this.tertiaryTextColor; + this.edgeLabelBackground = this.edgeLabelBackground || (this.darkMode ? (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.secondaryColor, 30) : this.secondaryColor); + this.nodeTextColor = this.nodeTextColor || this.primaryTextColor; + /* Sequence Diagram variables */ + // this.actorBorder = lighten(this.border1, 0.5); + + this.actorBorder = this.actorBorder || this.primaryBorderColor; + this.actorBkg = this.actorBkg || this.mainBkg; + this.actorTextColor = this.actorTextColor || this.primaryTextColor; + this.actorLineColor = this.actorLineColor || 'grey'; + this.labelBoxBkgColor = this.labelBoxBkgColor || this.actorBkg; + this.signalColor = this.signalColor || this.textColor; + this.signalTextColor = this.signalTextColor || this.textColor; + this.labelBoxBorderColor = this.labelBoxBorderColor || this.actorBorder; + this.labelTextColor = this.labelTextColor || this.actorTextColor; + this.loopTextColor = this.loopTextColor || this.actorTextColor; + this.activationBorderColor = this.activationBorderColor || (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.secondaryColor, 10); + this.activationBkgColor = this.activationBkgColor || this.secondaryColor; + this.sequenceNumberColor = this.sequenceNumberColor || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.lineColor); + /* Gantt chart variables */ + + this.sectionBkgColor = this.sectionBkgColor || this.tertiaryColor; + this.altSectionBkgColor = this.altSectionBkgColor || 'white'; + this.sectionBkgColor = this.sectionBkgColor || this.secondaryColor; + this.sectionBkgColor2 = this.sectionBkgColor2 || this.primaryColor; + this.excludeBkgColor = this.excludeBkgColor || '#eeeeee'; + this.taskBorderColor = this.taskBorderColor || this.primaryBorderColor; + this.taskBkgColor = this.taskBkgColor || this.primaryColor; + this.activeTaskBorderColor = this.activeTaskBorderColor || this.primaryColor; + this.activeTaskBkgColor = this.activeTaskBkgColor || (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.primaryColor, 23); + this.gridColor = this.gridColor || 'lightgrey'; + this.doneTaskBkgColor = this.doneTaskBkgColor || 'lightgrey'; + this.doneTaskBorderColor = this.doneTaskBorderColor || 'grey'; + this.critBorderColor = this.critBorderColor || '#ff8888'; + this.critBkgColor = this.critBkgColor || 'red'; + this.todayLineColor = this.todayLineColor || 'red'; + this.taskTextColor = this.taskTextColor || this.textColor; + this.taskTextOutsideColor = this.taskTextOutsideColor || this.textColor; + this.taskTextLightColor = this.taskTextLightColor || this.textColor; + this.taskTextColor = this.taskTextColor || this.primaryTextColor; + this.taskTextDarkColor = this.taskTextDarkColor || this.textColor; + this.taskTextClickableColor = this.taskTextClickableColor || '#003163'; + /* Sequence Diagram variables */ + + this.personBorder = this.personBorder || this.primaryBorderColor; + this.personBkg = this.personBkg || this.mainBkg; + /* state colors */ + + this.transitionColor = this.transitionColor || this.lineColor; + this.transitionLabelColor = this.transitionLabelColor || this.textColor; + /* The color of the text tables of the states*/ + + this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; + this.stateBkg = this.stateBkg || this.mainBkg; + this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; + this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; + this.altBackground = this.altBackground || this.tertiaryColor; + this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; + this.compositeBorder = this.compositeBorder || this.nodeBorder; + this.innerEndBackground = this.nodeBorder; + this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; + this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; + this.transitionColor = this.transitionColor || this.lineColor; + this.specialStateColor = this.lineColor; + /* class */ + + this.classText = this.classText || this.textColor; + /* user-journey */ + + this.fillType0 = this.fillType0 || this.primaryColor; + this.fillType1 = this.fillType1 || this.secondaryColor; + this.fillType2 = this.fillType2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: 64 + }); + this.fillType3 = this.fillType3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.secondaryColor, { + h: 64 + }); + this.fillType4 = this.fillType4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: -64 + }); + this.fillType5 = this.fillType5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.secondaryColor, { + h: -64 + }); + this.fillType6 = this.fillType6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: 128 + }); + this.fillType7 = this.fillType7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.secondaryColor, { + h: 128 + }); + /* pie */ + + this.pie1 = this.pie1 || this.primaryColor; + this.pie2 = this.pie2 || this.secondaryColor; + this.pie3 = this.pie3 || this.tertiaryColor; + this.pie4 = this.pie4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + l: -10 + }); + this.pie5 = this.pie5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.secondaryColor, { + l: -10 + }); + this.pie6 = this.pie6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.tertiaryColor, { + l: -10 + }); + this.pie7 = this.pie7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: +60, + l: -10 + }); + this.pie8 = this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: -60, + l: -10 + }); + this.pie9 = this.pie9 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: 120, + l: 0 + }); + this.pie10 = this.pie10 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: +60, + l: -20 + }); + this.pie11 = this.pie11 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: -60, + l: -20 + }); + this.pie12 = this.pie12 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: 120, + l: -10 + }); + this.pieTitleTextSize = this.pieTitleTextSize || '25px'; + this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; + this.pieSectionTextSize = this.pieSectionTextSize || '17px'; + this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; + this.pieLegendTextSize = this.pieLegendTextSize || '17px'; + this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; + this.pieStrokeColor = this.pieStrokeColor || 'black'; + this.pieStrokeWidth = this.pieStrokeWidth || '2px'; + this.pieOpacity = this.pieOpacity || '0.7'; + /* requirement-diagram */ + + this.requirementBackground = this.requirementBackground || this.primaryColor; + this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; + this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; + this.relationColor = this.relationColor || this.lineColor; + this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.secondaryColor, 30) : this.secondaryColor); + this.relationLabelColor = this.relationLabelColor || this.actorTextColor; + /* git */ + + this.git0 = this.git0 || this.primaryColor; + this.git1 = this.git1 || this.secondaryColor; + this.git2 = this.git2 || this.tertiaryColor; + this.git3 = this.git3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: -30 + }); + this.git4 = this.git4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: -60 + }); + this.git5 = this.git5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: -90 + }); + this.git6 = this.git6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: +60 + }); + this.git7 = this.git7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: +120 + }); + + if (this.darkMode) { + this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.git0, 25); + this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.git1, 25); + this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.git2, 25); + this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.git3, 25); + this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.git4, 25); + this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.git5, 25); + this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.git6, 25); + this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.git7, 25); + } else { + this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git0, 25); + this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git1, 25); + this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git2, 25); + this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git3, 25); + this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git4, 25); + this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git5, 25); + this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git6, 25); + this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git7, 25); + } + + this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git0); + this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git1); + this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git2); + this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git3); + this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git4); + this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git5); + this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git6); + this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git7); + this.branchLabelColor = this.branchLabelColor || (this.darkMode ? 'black' : this.labelTextColor); + this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor; + this.gitBranchLabel1 = this.gitBranchLabel1 || this.branchLabelColor; + this.gitBranchLabel2 = this.gitBranchLabel2 || this.branchLabelColor; + this.gitBranchLabel3 = this.gitBranchLabel3 || this.branchLabelColor; + this.gitBranchLabel4 = this.gitBranchLabel4 || this.branchLabelColor; + this.gitBranchLabel5 = this.gitBranchLabel5 || this.branchLabelColor; + this.gitBranchLabel6 = this.gitBranchLabel6 || this.branchLabelColor; + this.gitBranchLabel7 = this.gitBranchLabel7 || this.branchLabelColor; + this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; + this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; + this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; + this.tagLabelFontSize = this.tagLabelFontSize || '10px'; + this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; + this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; + this.commitLabelFontSize = this.commitLabelFontSize || '10px'; + } + }, { + key: "calculate", + value: function calculate(overrides) { + var _this = this; + + if (_typeof(overrides) !== 'object') { + // Calculate colors form base colors + this.updateColors(); + return; + } + + var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); // Calculate colors form base colors + + this.updateColors(); // Copy values from overrides again in case of an override of derived value + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); + } + }]); + + return Theme; +}(); + +var getThemeVariables = function getThemeVariables(userOverrides) { + var theme = new Theme(); + theme.calculate(userOverrides); + return theme; +}; + +/***/ }), + +/***/ "./src/themes/theme-dark.js": +/*!**********************************!*\ + !*** ./src/themes/theme-dark.js ***! + \**********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "getThemeVariables": () => (/* binding */ getThemeVariables) +/* harmony export */ }); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/lighten.js"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/adjust.js"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/invert.js"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/rgba.js"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/darken.js"); +/* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + + + + +var Theme = /*#__PURE__*/function () { + function Theme() { + _classCallCheck(this, Theme); + + this.background = '#333'; + this.primaryColor = '#1f2020'; + this.secondaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, 16); + this.tertiaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: -160 + }); + this.primaryBorderColor = (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.background); + this.secondaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_3__.mkBorder)(this.secondaryColor, this.darkMode); + this.tertiaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_3__.mkBorder)(this.tertiaryColor, this.darkMode); + this.primaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.primaryColor); + this.secondaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.secondaryColor); + this.tertiaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.tertiaryColor); + this.lineColor = (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.background); + this.textColor = (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.background); + this.mainBkg = '#1f2020'; + this.secondBkg = 'calculated'; + this.mainContrastColor = 'lightgrey'; + this.darkTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])((0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])('#323D47'), 10); + this.lineColor = 'calculated'; + this.border1 = '#81B1DB'; + this.border2 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(255, 255, 255, 0.25); + this.arrowheadColor = 'calculated'; + this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; + this.fontSize = '16px'; + this.labelBackground = '#181818'; + this.textColor = '#ccc'; + /* Flowchart variables */ + + this.nodeBkg = 'calculated'; + this.nodeBorder = 'calculated'; + this.clusterBkg = 'calculated'; + this.clusterBorder = 'calculated'; + this.defaultLinkColor = 'calculated'; + this.titleColor = '#F9FFFE'; + this.edgeLabelBackground = 'calculated'; + /* Sequence Diagram variables */ + + this.actorBorder = 'calculated'; + this.actorBkg = 'calculated'; + this.actorTextColor = 'calculated'; + this.actorLineColor = 'calculated'; + this.signalColor = 'calculated'; + this.signalTextColor = 'calculated'; + this.labelBoxBkgColor = 'calculated'; + this.labelBoxBorderColor = 'calculated'; + this.labelTextColor = 'calculated'; + this.loopTextColor = 'calculated'; + this.noteBorderColor = 'calculated'; + this.noteBkgColor = '#fff5ad'; + this.noteTextColor = 'calculated'; + this.activationBorderColor = 'calculated'; + this.activationBkgColor = 'calculated'; + this.sequenceNumberColor = 'black'; + /* Gantt chart variables */ + + this.sectionBkgColor = (0,khroma__WEBPACK_IMPORTED_MODULE_5__["default"])('#EAE8D9', 30); + this.altSectionBkgColor = 'calculated'; + this.sectionBkgColor2 = '#EAE8D9'; + this.taskBorderColor = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(255, 255, 255, 70); + this.taskBkgColor = 'calculated'; + this.taskTextColor = 'calculated'; + this.taskTextLightColor = 'calculated'; + this.taskTextOutsideColor = 'calculated'; + this.taskTextClickableColor = '#003163'; + this.activeTaskBorderColor = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(255, 255, 255, 50); + this.activeTaskBkgColor = '#81B1DB'; + this.gridColor = 'calculated'; + this.doneTaskBkgColor = 'calculated'; + this.doneTaskBorderColor = 'grey'; + this.critBorderColor = '#E83737'; + this.critBkgColor = '#E83737'; + this.taskTextDarkColor = 'calculated'; + this.todayLineColor = '#DB5757'; + /* C4 Context Diagram variables */ + + this.personBorder = 'calculated'; + this.personBkg = 'calculated'; + /* state colors */ + + this.labelColor = 'calculated'; + this.errorBkgColor = '#a44141'; + this.errorTextColor = '#ddd'; + } + + _createClass(Theme, [{ + key: "updateColors", + value: function updateColors() { + this.secondBkg = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.mainBkg, 16); + this.lineColor = this.mainContrastColor; + this.arrowheadColor = this.mainContrastColor; + /* Flowchart variables */ + + this.nodeBkg = this.mainBkg; + this.nodeBorder = this.border1; + this.clusterBkg = this.secondBkg; + this.clusterBorder = this.border2; + this.defaultLinkColor = this.lineColor; + this.edgeLabelBackground = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.labelBackground, 25); + /* Sequence Diagram variables */ + + this.actorBorder = this.border1; + this.actorBkg = this.mainBkg; + this.actorTextColor = this.mainContrastColor; + this.actorLineColor = this.mainContrastColor; + this.signalColor = this.mainContrastColor; + this.signalTextColor = this.mainContrastColor; + this.labelBoxBkgColor = this.actorBkg; + this.labelBoxBorderColor = this.actorBorder; + this.labelTextColor = this.mainContrastColor; + this.loopTextColor = this.mainContrastColor; + this.noteBorderColor = this.secondaryBorderColor; + this.noteBkgColor = this.secondBkg; + this.noteTextColor = this.secondaryTextColor; + this.activationBorderColor = this.border1; + this.activationBkgColor = this.secondBkg; + /* Gantt chart variables */ + + this.altSectionBkgColor = this.background; + this.taskBkgColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.mainBkg, 23); + this.taskTextColor = this.darkTextColor; + this.taskTextLightColor = this.mainContrastColor; + this.taskTextOutsideColor = this.taskTextLightColor; + this.gridColor = this.mainContrastColor; + this.doneTaskBkgColor = this.mainContrastColor; + this.taskTextDarkColor = this.darkTextColor; + /* state colors */ + + this.transitionColor = this.transitionColor || this.lineColor; + this.transitionLabelColor = this.transitionLabelColor || this.textColor; + this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; + this.stateBkg = this.stateBkg || this.mainBkg; + this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; + this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; + this.altBackground = this.altBackground || '#555'; + this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; + this.compositeBorder = this.compositeBorder || this.nodeBorder; + this.innerEndBackground = this.primaryBorderColor; + this.specialStateColor = '#f4f4f4'; // this.lineColor; + + this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; + this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; + this.fillType0 = this.primaryColor; + this.fillType1 = this.secondaryColor; + this.fillType2 = (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: 64 + }); + this.fillType3 = (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.secondaryColor, { + h: 64 + }); + this.fillType4 = (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: -64 + }); + this.fillType5 = (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.secondaryColor, { + h: -64 + }); + this.fillType6 = (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: 128 + }); + this.fillType7 = (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.secondaryColor, { + h: 128 + }); + /* pie */ + + this.pie1 = this.pie1 || '#0b0000'; + this.pie2 = this.pie2 || '#4d1037'; + this.pie3 = this.pie3 || '#3f5258'; + this.pie4 = this.pie4 || '#4f2f1b'; + this.pie5 = this.pie5 || '#6e0a0a'; + this.pie6 = this.pie6 || '#3b0048'; + this.pie7 = this.pie7 || '#995a01'; + this.pie8 = this.pie8 || '#154706'; + this.pie9 = this.pie9 || '#161722'; + this.pie10 = this.pie10 || '#00296f'; + this.pie11 = this.pie11 || '#01629c'; + this.pie12 = this.pie12 || '#010029'; + this.pieTitleTextSize = this.pieTitleTextSize || '25px'; + this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; + this.pieSectionTextSize = this.pieSectionTextSize || '17px'; + this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; + this.pieLegendTextSize = this.pieLegendTextSize || '17px'; + this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; + this.pieStrokeColor = this.pieStrokeColor || 'black'; + this.pieStrokeWidth = this.pieStrokeWidth || '2px'; + this.pieOpacity = this.pieOpacity || '0.7'; + /* class */ + + this.classText = this.primaryTextColor; + /* requirement-diagram */ + + this.requirementBackground = this.requirementBackground || this.primaryColor; + this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; + this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; + this.relationColor = this.relationColor || this.lineColor; + this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? (0,khroma__WEBPACK_IMPORTED_MODULE_5__["default"])(this.secondaryColor, 30) : this.secondaryColor); + this.relationLabelColor = this.relationLabelColor || this.actorTextColor; + /* git */ + + this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.secondaryColor, 20); + this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.pie2 || this.secondaryColor, 20); + this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.pie3 || this.tertiaryColor, 20); + this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.pie4 || (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: -30 + }), 20); + this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.pie5 || (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: -60 + }), 20); + this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.pie6 || (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: -90 + }), 10); + this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.pie7 || (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: +60 + }), 10); + this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: +120 + }), 20); + this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git0); + this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git1); + this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git2); + this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git3); + this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git4); + this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git5); + this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git6); + this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git7); + this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; + this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; + this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; + this.tagLabelFontSize = this.tagLabelFontSize || '10px'; + this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; + this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; + this.commitLabelFontSize = this.commitLabelFontSize || '10px'; + } + }, { + key: "calculate", + value: function calculate(overrides) { + var _this = this; + + if (_typeof(overrides) !== 'object') { + // Calculate colors form base colors + this.updateColors(); + return; + } + + var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); // Calculate colors form base colors + + this.updateColors(); // Copy values from overrides again in case of an override of derived value + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); + } + }]); + + return Theme; +}(); + +var getThemeVariables = function getThemeVariables(userOverrides) { + var theme = new Theme(); + theme.calculate(userOverrides); + return theme; +}; + +/***/ }), + +/***/ "./src/themes/theme-default.js": +/*!*************************************!*\ + !*** ./src/themes/theme-default.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "getThemeVariables": () => (/* binding */ getThemeVariables) +/* harmony export */ }); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/adjust.js"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/invert.js"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/rgba.js"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/lighten.js"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/darken.js"); +/* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + + + + +var Theme = /*#__PURE__*/function () { + function Theme() { + _classCallCheck(this, Theme); + + /* Base variables */ + this.background = '#f4f4f4'; + this.primaryColor = '#ECECFF'; + this.secondaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: 120 + }); + this.secondaryColor = '#ffffde'; + this.tertiaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: -160 + }); + this.primaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.primaryColor, this.darkMode); + this.secondaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.secondaryColor, this.darkMode); + this.tertiaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.tertiaryColor, this.darkMode); // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode); + + this.primaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.primaryColor); + this.secondaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.secondaryColor); + this.tertiaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.tertiaryColor); + this.lineColor = (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.background); + this.textColor = (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.background); + this.background = 'white'; + this.mainBkg = '#ECECFF'; + this.secondBkg = '#ffffde'; + this.lineColor = '#333333'; + this.border1 = '#9370DB'; + this.border2 = '#aaaa33'; + this.arrowheadColor = '#333333'; + this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; + this.fontSize = '16px'; + this.labelBackground = '#e8e8e8'; + this.textColor = '#333'; + /* Flowchart variables */ + + this.nodeBkg = 'calculated'; + this.nodeBorder = 'calculated'; + this.clusterBkg = 'calculated'; + this.clusterBorder = 'calculated'; + this.defaultLinkColor = 'calculated'; + this.titleColor = 'calculated'; + this.edgeLabelBackground = 'calculated'; + /* Sequence Diagram variables */ + + this.actorBorder = 'calculated'; + this.actorBkg = 'calculated'; + this.actorTextColor = 'black'; + this.actorLineColor = 'grey'; + this.signalColor = 'calculated'; + this.signalTextColor = 'calculated'; + this.labelBoxBkgColor = 'calculated'; + this.labelBoxBorderColor = 'calculated'; + this.labelTextColor = 'calculated'; + this.loopTextColor = 'calculated'; + this.noteBorderColor = 'calculated'; + this.noteBkgColor = '#fff5ad'; + this.noteTextColor = 'calculated'; + this.activationBorderColor = '#666'; + this.activationBkgColor = '#f4f4f4'; + this.sequenceNumberColor = 'white'; + /* Gantt chart variables */ + + this.sectionBkgColor = 'calculated'; + this.altSectionBkgColor = 'calculated'; + this.sectionBkgColor2 = 'calculated'; + this.excludeBkgColor = '#eeeeee'; + this.taskBorderColor = 'calculated'; + this.taskBkgColor = 'calculated'; + this.taskTextLightColor = 'calculated'; + this.taskTextColor = this.taskTextLightColor; + this.taskTextDarkColor = 'calculated'; + this.taskTextOutsideColor = this.taskTextDarkColor; + this.taskTextClickableColor = 'calculated'; + this.activeTaskBorderColor = 'calculated'; + this.activeTaskBkgColor = 'calculated'; + this.gridColor = 'calculated'; + this.doneTaskBkgColor = 'calculated'; + this.doneTaskBorderColor = 'calculated'; + this.critBorderColor = 'calculated'; + this.critBkgColor = 'calculated'; + this.todayLineColor = 'calculated'; + this.sectionBkgColor = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(102, 102, 255, 0.49); + this.altSectionBkgColor = 'white'; + this.sectionBkgColor2 = '#fff400'; + this.taskBorderColor = '#534fbc'; + this.taskBkgColor = '#8a90dd'; + this.taskTextLightColor = 'white'; + this.taskTextColor = 'calculated'; + this.taskTextDarkColor = 'black'; + this.taskTextOutsideColor = 'calculated'; + this.taskTextClickableColor = '#003163'; + this.activeTaskBorderColor = '#534fbc'; + this.activeTaskBkgColor = '#bfc7ff'; + this.gridColor = 'lightgrey'; + this.doneTaskBkgColor = 'lightgrey'; + this.doneTaskBorderColor = 'grey'; + this.critBorderColor = '#ff8888'; + this.critBkgColor = 'red'; + this.todayLineColor = 'red'; + /* C4 Context Diagram variables */ + + this.personBorder = 'calculated'; + this.personBkg = 'calculated'; + /* state colors */ + + this.labelColor = 'black'; + this.errorBkgColor = '#552222'; + this.errorTextColor = '#552222'; + this.updateColors(); + } + + _createClass(Theme, [{ + key: "updateColors", + value: function updateColors() { + /* Flowchart variables */ + this.nodeBkg = this.mainBkg; + this.nodeBorder = this.border1; // border 1 + + this.clusterBkg = this.secondBkg; + this.clusterBorder = this.border2; + this.defaultLinkColor = this.lineColor; + this.titleColor = this.textColor; + this.edgeLabelBackground = this.labelBackground; + /* Sequence Diagram variables */ + // this.actorBorder = lighten(this.border1, 0.5); + + this.actorBorder = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.border1, 23); + this.actorBkg = this.mainBkg; + this.labelBoxBkgColor = this.actorBkg; + this.signalColor = this.textColor; + this.signalTextColor = this.textColor; + this.labelBoxBorderColor = this.actorBorder; + this.labelTextColor = this.actorTextColor; + this.loopTextColor = this.actorTextColor; + this.noteBorderColor = this.border2; + this.noteTextColor = this.actorTextColor; + /* Gantt chart variables */ + + this.taskTextColor = this.taskTextLightColor; + this.taskTextOutsideColor = this.taskTextDarkColor; + /* state colors */ + + this.transitionColor = this.transitionColor || this.lineColor; + this.transitionLabelColor = this.transitionLabelColor || this.textColor; + this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; + this.stateBkg = this.stateBkg || this.mainBkg; + this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; + this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; + this.altBackground = this.altBackground || '#f0f0f0'; + this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; + this.compositeBorder = this.compositeBorder || this.nodeBorder; + this.innerEndBackground = this.nodeBorder; + this.specialStateColor = this.lineColor; + this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; + this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; + this.transitionColor = this.transitionColor || this.lineColor; + /* class */ + + this.classText = this.primaryTextColor; + /* journey */ + + this.fillType0 = this.primaryColor; + this.fillType1 = this.secondaryColor; + this.fillType2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: 64 + }); + this.fillType3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.secondaryColor, { + h: 64 + }); + this.fillType4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: -64 + }); + this.fillType5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.secondaryColor, { + h: -64 + }); + this.fillType6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: 128 + }); + this.fillType7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.secondaryColor, { + h: 128 + }); + /* pie */ + + this.pie1 = this.pie1 || this.primaryColor; + this.pie2 = this.pie2 || this.secondaryColor; + this.pie3 = this.pie3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.tertiaryColor, { + l: -40 + }); + this.pie4 = this.pie4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + l: -10 + }); + this.pie5 = this.pie5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.secondaryColor, { + l: -30 + }); + this.pie6 = this.pie6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.tertiaryColor, { + l: -20 + }); + this.pie7 = this.pie7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: +60, + l: -20 + }); + this.pie8 = this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: -60, + l: -40 + }); + this.pie9 = this.pie9 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: 120, + l: -40 + }); + this.pie10 = this.pie10 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: +60, + l: -40 + }); + this.pie11 = this.pie11 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: -90, + l: -40 + }); + this.pie12 = this.pie12 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: 120, + l: -30 + }); + this.pieTitleTextSize = this.pieTitleTextSize || '25px'; + this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; + this.pieSectionTextSize = this.pieSectionTextSize || '17px'; + this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; + this.pieLegendTextSize = this.pieLegendTextSize || '17px'; + this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; + this.pieStrokeColor = this.pieStrokeColor || 'black'; + this.pieStrokeWidth = this.pieStrokeWidth || '2px'; + this.pieOpacity = this.pieOpacity || '0.7'; + /* requirement-diagram */ + + this.requirementBackground = this.requirementBackground || this.primaryColor; + this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; + this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; + this.relationColor = this.relationColor || this.lineColor; + this.relationLabelBackground = this.relationLabelBackground || this.labelBackground; + this.relationLabelColor = this.relationLabelColor || this.actorTextColor; + /* git */ + + this.git0 = this.git0 || this.primaryColor; + this.git1 = this.git1 || this.secondaryColor; + this.git2 = this.git2 || this.tertiaryColor; + this.git3 = this.git3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: -30 + }); + this.git4 = this.git4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: -60 + }); + this.git5 = this.git5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: -90 + }); + this.git6 = this.git6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: +60 + }); + this.git7 = this.git7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.primaryColor, { + h: +120 + }); + + if (this.darkMode) { + this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.git0, 25); + this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.git1, 25); + this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.git2, 25); + this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.git3, 25); + this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.git4, 25); + this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.git5, 25); + this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.git6, 25); + this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.git7, 25); + } else { + this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_5__["default"])(this.git0, 25); + this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_5__["default"])(this.git1, 25); + this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_5__["default"])(this.git2, 25); + this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_5__["default"])(this.git3, 25); + this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_5__["default"])(this.git4, 25); + this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_5__["default"])(this.git5, 25); + this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_5__["default"])(this.git6, 25); + this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_5__["default"])(this.git7, 25); + } + + this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_5__["default"])((0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git0), 25); + this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git1); + this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git2); + this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git3); + this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git4); + this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git5); + this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git6); + this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git7); + this.gitBranchLabel0 = this.gitBranchLabel0 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.labelTextColor); + this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor; + this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor; + this.gitBranchLabel3 = this.gitBranchLabel3 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.labelTextColor); + this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor; + this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor; + this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor; + this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor; + this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; + this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; + this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; + this.tagLabelFontSize = this.tagLabelFontSize || '10px'; + this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; + this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; + this.commitLabelFontSize = this.commitLabelFontSize || '10px'; + } + }, { + key: "calculate", + value: function calculate(overrides) { + var _this = this; + + if (_typeof(overrides) !== 'object') { + // Calculate colors form base colors + this.updateColors(); + return; + } + + var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); // Calculate colors form base colors + + this.updateColors(); // Copy values from overrides again in case of an override of derived value + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); + } + }]); + + return Theme; +}(); + +var getThemeVariables = function getThemeVariables(userOverrides) { + var theme = new Theme(); + theme.calculate(userOverrides); + return theme; +}; + +/***/ }), + +/***/ "./src/themes/theme-forest.js": +/*!************************************!*\ + !*** ./src/themes/theme-forest.js ***! + \************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "getThemeVariables": () => (/* binding */ getThemeVariables) +/* harmony export */ }); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/lighten.js"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/invert.js"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/darken.js"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/adjust.js"); +/* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + + + + +var Theme = /*#__PURE__*/function () { + function Theme() { + _classCallCheck(this, Theme); + + /* Base vales */ + this.background = '#f4f4f4'; + this.primaryColor = '#cde498'; + this.secondaryColor = '#cdffb2'; + this.background = 'white'; + this.mainBkg = '#cde498'; + this.secondBkg = '#cdffb2'; + this.lineColor = 'green'; + this.border1 = '#13540c'; + this.border2 = '#6eaa49'; + this.arrowheadColor = 'green'; + this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; + this.fontSize = '16px'; + this.tertiaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])('#cde498', 10); + this.primaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.primaryColor, this.darkMode); + this.secondaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.secondaryColor, this.darkMode); + this.tertiaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.tertiaryColor, this.darkMode); + this.primaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.primaryColor); + this.secondaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.secondaryColor); + this.tertiaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.primaryColor); + this.lineColor = (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.background); + this.textColor = (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.background); + /* Flowchart variables */ + + this.nodeBkg = 'calculated'; + this.nodeBorder = 'calculated'; + this.clusterBkg = 'calculated'; + this.clusterBorder = 'calculated'; + this.defaultLinkColor = 'calculated'; + this.titleColor = '#333'; + this.edgeLabelBackground = '#e8e8e8'; + /* Sequence Diagram variables */ + + this.actorBorder = 'calculated'; + this.actorBkg = 'calculated'; + this.actorTextColor = 'black'; + this.actorLineColor = 'grey'; + this.signalColor = '#333'; + this.signalTextColor = '#333'; + this.labelBoxBkgColor = 'calculated'; + this.labelBoxBorderColor = '#326932'; + this.labelTextColor = 'calculated'; + this.loopTextColor = 'calculated'; + this.noteBorderColor = 'calculated'; + this.noteBkgColor = '#fff5ad'; + this.noteTextColor = 'calculated'; + this.activationBorderColor = '#666'; + this.activationBkgColor = '#f4f4f4'; + this.sequenceNumberColor = 'white'; + /* Gantt chart variables */ + + this.sectionBkgColor = '#6eaa49'; + this.altSectionBkgColor = 'white'; + this.sectionBkgColor2 = '#6eaa49'; + this.excludeBkgColor = '#eeeeee'; + this.taskBorderColor = 'calculated'; + this.taskBkgColor = '#487e3a'; + this.taskTextLightColor = 'white'; + this.taskTextColor = 'calculated'; + this.taskTextDarkColor = 'black'; + this.taskTextOutsideColor = 'calculated'; + this.taskTextClickableColor = '#003163'; + this.activeTaskBorderColor = 'calculated'; + this.activeTaskBkgColor = 'calculated'; + this.gridColor = 'lightgrey'; + this.doneTaskBkgColor = 'lightgrey'; + this.doneTaskBorderColor = 'grey'; + this.critBorderColor = '#ff8888'; + this.critBkgColor = 'red'; + this.todayLineColor = 'red'; + /* C4 Context Diagram variables */ + + this.personBorder = 'calculated'; + this.personBkg = 'calculated'; + /* state colors */ + + this.labelColor = 'black'; + this.errorBkgColor = '#552222'; + this.errorTextColor = '#552222'; + } + + _createClass(Theme, [{ + key: "updateColors", + value: function updateColors() { + /* Flowchart variables */ + this.nodeBkg = this.mainBkg; + this.nodeBorder = this.border1; + this.clusterBkg = this.secondBkg; + this.clusterBorder = this.border2; + this.defaultLinkColor = this.lineColor; + /* Sequence Diagram variables */ + + this.actorBorder = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.mainBkg, 20); + this.actorBkg = this.mainBkg; + this.labelBoxBkgColor = this.actorBkg; + this.labelTextColor = this.actorTextColor; + this.loopTextColor = this.actorTextColor; + this.noteBorderColor = this.border2; + this.noteTextColor = this.actorTextColor; + /* Gantt chart variables */ + + this.taskBorderColor = this.border1; + this.taskTextColor = this.taskTextLightColor; + this.taskTextOutsideColor = this.taskTextDarkColor; + this.activeTaskBorderColor = this.taskBorderColor; + this.activeTaskBkgColor = this.mainBkg; + /* state colors */ + + this.transitionColor = this.transitionColor || this.lineColor; + this.transitionLabelColor = this.transitionLabelColor || this.textColor; + this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; + this.stateBkg = this.stateBkg || this.mainBkg; + this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; + this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; + this.altBackground = this.altBackground || '#f0f0f0'; + this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; + this.compositeBorder = this.compositeBorder || this.nodeBorder; + this.innerEndBackground = this.primaryBorderColor; + this.specialStateColor = this.lineColor; + this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; + this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; + this.transitionColor = this.transitionColor || this.lineColor; + /* class */ + + this.classText = this.primaryTextColor; + /* journey */ + + this.fillType0 = this.primaryColor; + this.fillType1 = this.secondaryColor; + this.fillType2 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.primaryColor, { + h: 64 + }); + this.fillType3 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.secondaryColor, { + h: 64 + }); + this.fillType4 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.primaryColor, { + h: -64 + }); + this.fillType5 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.secondaryColor, { + h: -64 + }); + this.fillType6 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.primaryColor, { + h: 128 + }); + this.fillType7 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.secondaryColor, { + h: 128 + }); + /* pie */ + + this.pie1 = this.pie1 || this.primaryColor; + this.pie2 = this.pie2 || this.secondaryColor; + this.pie3 = this.pie3 || this.tertiaryColor; + this.pie4 = this.pie4 || (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.primaryColor, { + l: -30 + }); + this.pie5 = this.pie5 || (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.secondaryColor, { + l: -30 + }); + this.pie6 = this.pie6 || (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.tertiaryColor, { + h: +40, + l: -40 + }); + this.pie7 = this.pie7 || (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.primaryColor, { + h: +60, + l: -10 + }); + this.pie8 = this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.primaryColor, { + h: -60, + l: -10 + }); + this.pie9 = this.pie9 || (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.primaryColor, { + h: 120, + l: 0 + }); + this.pie10 = this.pie10 || (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.primaryColor, { + h: +60, + l: -50 + }); + this.pie11 = this.pie11 || (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.primaryColor, { + h: -60, + l: -50 + }); + this.pie12 = this.pie12 || (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.primaryColor, { + h: 120, + l: -50 + }); + this.pieTitleTextSize = this.pieTitleTextSize || '25px'; + this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; + this.pieSectionTextSize = this.pieSectionTextSize || '17px'; + this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; + this.pieLegendTextSize = this.pieLegendTextSize || '17px'; + this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; + this.pieStrokeColor = this.pieStrokeColor || 'black'; + this.pieStrokeWidth = this.pieStrokeWidth || '2px'; + this.pieOpacity = this.pieOpacity || '0.7'; + /* requirement-diagram */ + + this.requirementBackground = this.requirementBackground || this.primaryColor; + this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; + this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; + this.relationColor = this.relationColor || this.lineColor; + this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground; + this.relationLabelColor = this.relationLabelColor || this.actorTextColor; + /* git */ + + this.git0 = this.git0 || this.primaryColor; + this.git1 = this.git1 || this.secondaryColor; + this.git2 = this.git2 || this.tertiaryColor; + this.git3 = this.git3 || (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.primaryColor, { + h: -30 + }); + this.git4 = this.git4 || (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.primaryColor, { + h: -60 + }); + this.git5 = this.git5 || (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.primaryColor, { + h: -90 + }); + this.git6 = this.git6 || (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.primaryColor, { + h: +60 + }); + this.git7 = this.git7 || (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.primaryColor, { + h: +120 + }); + + if (this.darkMode) { + this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.git0, 25); + this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.git1, 25); + this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.git2, 25); + this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.git3, 25); + this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.git4, 25); + this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.git5, 25); + this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.git6, 25); + this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.git7, 25); + } else { + this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git0, 25); + this.git1 = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git1, 25); + this.git2 = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git2, 25); + this.git3 = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git3, 25); + this.git4 = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git4, 25); + this.git5 = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git5, 25); + this.git6 = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git6, 25); + this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git7, 25); + } + + this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git0); + this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git1); + this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git2); + this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git3); + this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git4); + this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git5); + this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git6); + this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_2__["default"])(this.git7); + this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; + this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; + this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; + this.tagLabelFontSize = this.tagLabelFontSize || '10px'; + this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; + this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; + this.commitLabelFontSize = this.commitLabelFontSize || '10px'; + } + }, { + key: "calculate", + value: function calculate(overrides) { + var _this = this; + + if (_typeof(overrides) !== 'object') { + // Calculate colors form base colors + this.updateColors(); + return; + } + + var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); // Calculate colors form base colors + + this.updateColors(); // Copy values from overrides again in case of an override of derived value + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); + } + }]); + + return Theme; +}(); + +var getThemeVariables = function getThemeVariables(userOverrides) { + var theme = new Theme(); + theme.calculate(userOverrides); + return theme; +}; + +/***/ }), + +/***/ "./src/themes/theme-helpers.js": +/*!*************************************!*\ + !*** ./src/themes/theme-helpers.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "mkBorder": () => (/* binding */ mkBorder) +/* harmony export */ }); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/adjust.js"); + +var mkBorder = function mkBorder(col, darkMode) { + return darkMode ? (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(col, { + s: -40, + l: 10 + }) : (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(col, { + s: -40, + l: -10 + }); +}; + +/***/ }), + +/***/ "./src/themes/theme-neutral.js": +/*!*************************************!*\ + !*** ./src/themes/theme-neutral.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "getThemeVariables": () => (/* binding */ getThemeVariables) +/* harmony export */ }); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/lighten.js"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/adjust.js"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/invert.js"); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! khroma */ "./node_modules/khroma/dist/methods/darken.js"); +/* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + + + // const Color = require ( 'khroma/dist/color' ).default +// Color.format.hex.stringify(Color.parse('hsl(210, 66.6666666667%, 95%)')); // => "#EAF2FB" + +var Theme = /*#__PURE__*/function () { + function Theme() { + _classCallCheck(this, Theme); + + this.primaryColor = '#eee'; + this.contrast = '#707070'; + this.secondaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.contrast, 55); + this.background = '#ffffff'; // this.secondaryColor = adjust(this.primaryColor, { h: 120 }); + + this.tertiaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: -160 + }); + this.primaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_2__.mkBorder)(this.primaryColor, this.darkMode); + this.secondaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_2__.mkBorder)(this.secondaryColor, this.darkMode); + this.tertiaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_2__.mkBorder)(this.tertiaryColor, this.darkMode); // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode); + + this.primaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.primaryColor); + this.secondaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.secondaryColor); + this.tertiaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.tertiaryColor); + this.lineColor = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.background); + this.textColor = (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.background); // this.altBackground = lighten(this.contrast, 55); + + this.mainBkg = '#eee'; + this.secondBkg = 'calculated'; + this.lineColor = '#666'; + this.border1 = '#999'; + this.border2 = 'calculated'; + this.note = '#ffa'; + this.text = '#333'; + this.critical = '#d42'; + this.done = '#bbb'; + this.arrowheadColor = '#333333'; + this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; + this.fontSize = '16px'; + /* Flowchart variables */ + + this.nodeBkg = 'calculated'; + this.nodeBorder = 'calculated'; + this.clusterBkg = 'calculated'; + this.clusterBorder = 'calculated'; + this.defaultLinkColor = 'calculated'; + this.titleColor = 'calculated'; + this.edgeLabelBackground = 'white'; + /* Sequence Diagram variables */ + + this.actorBorder = 'calculated'; + this.actorBkg = 'calculated'; + this.actorTextColor = 'calculated'; + this.actorLineColor = 'calculated'; + this.signalColor = 'calculated'; + this.signalTextColor = 'calculated'; + this.labelBoxBkgColor = 'calculated'; + this.labelBoxBorderColor = 'calculated'; + this.labelTextColor = 'calculated'; + this.loopTextColor = 'calculated'; + this.noteBorderColor = 'calculated'; + this.noteBkgColor = 'calculated'; + this.noteTextColor = 'calculated'; + this.activationBorderColor = '#666'; + this.activationBkgColor = '#f4f4f4'; + this.sequenceNumberColor = 'white'; + /* Gantt chart variables */ + + this.sectionBkgColor = 'calculated'; + this.altSectionBkgColor = 'white'; + this.sectionBkgColor2 = 'calculated'; + this.excludeBkgColor = '#eeeeee'; + this.taskBorderColor = 'calculated'; + this.taskBkgColor = 'calculated'; + this.taskTextLightColor = 'white'; + this.taskTextColor = 'calculated'; + this.taskTextDarkColor = 'calculated'; + this.taskTextOutsideColor = 'calculated'; + this.taskTextClickableColor = '#003163'; + this.activeTaskBorderColor = 'calculated'; + this.activeTaskBkgColor = 'calculated'; + this.gridColor = 'calculated'; + this.doneTaskBkgColor = 'calculated'; + this.doneTaskBorderColor = 'calculated'; + this.critBkgColor = 'calculated'; + this.critBorderColor = 'calculated'; + this.todayLineColor = 'calculated'; + /* C4 Context Diagram variables */ + + this.personBorder = 'calculated'; + this.personBkg = 'calculated'; + /* state colors */ + + this.labelColor = 'black'; + this.errorBkgColor = '#552222'; + this.errorTextColor = '#552222'; + } + + _createClass(Theme, [{ + key: "updateColors", + value: function updateColors() { + this.secondBkg = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.contrast, 55); + this.border2 = this.contrast; + /* Flowchart variables */ + + this.nodeBkg = this.mainBkg; + this.nodeBorder = this.border1; + this.clusterBkg = this.secondBkg; + this.clusterBorder = this.border2; + this.defaultLinkColor = this.lineColor; + this.titleColor = this.text; + /* Sequence Diagram variables */ + + this.actorBorder = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.border1, 23); + this.actorBkg = this.mainBkg; + this.actorTextColor = this.text; + this.actorLineColor = this.lineColor; + this.signalColor = this.text; + this.signalTextColor = this.text; + this.labelBoxBkgColor = this.actorBkg; + this.labelBoxBorderColor = this.actorBorder; + this.labelTextColor = this.text; + this.loopTextColor = this.text; + this.noteBorderColor = '#999'; + this.noteBkgColor = '#666'; + this.noteTextColor = '#fff'; + /* Gantt chart variables */ + + this.sectionBkgColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.contrast, 30); + this.sectionBkgColor2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.contrast, 30); + this.taskBorderColor = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.contrast, 10); + this.taskBkgColor = this.contrast; + this.taskTextColor = this.taskTextLightColor; + this.taskTextDarkColor = this.text; + this.taskTextOutsideColor = this.taskTextDarkColor; + this.activeTaskBorderColor = this.taskBorderColor; + this.activeTaskBkgColor = this.mainBkg; + this.gridColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__["default"])(this.border1, 30); + this.doneTaskBkgColor = this.done; + this.doneTaskBorderColor = this.lineColor; + this.critBkgColor = this.critical; + this.critBorderColor = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.critBkgColor, 10); + this.todayLineColor = this.critBkgColor; + /* state colors */ + + this.transitionColor = this.transitionColor || '#000'; + this.transitionLabelColor = this.transitionLabelColor || this.textColor; + this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; + this.stateBkg = this.stateBkg || this.mainBkg; + this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; + this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; + this.altBackground = this.altBackground || '#f4f4f4'; + this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; + this.stateBorder = this.stateBorder || '#000'; + this.innerEndBackground = this.primaryBorderColor; + this.specialStateColor = '#222'; + this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; + this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; + /* class */ + + this.classText = this.primaryTextColor; + /* journey */ + + this.fillType0 = this.primaryColor; + this.fillType1 = this.secondaryColor; + this.fillType2 = (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: 64 + }); + this.fillType3 = (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.secondaryColor, { + h: 64 + }); + this.fillType4 = (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: -64 + }); + this.fillType5 = (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.secondaryColor, { + h: -64 + }); + this.fillType6 = (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: 128 + }); + this.fillType7 = (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.secondaryColor, { + h: 128 + }); // /* pie */ + + this.pie1 = this.pie1 || '#F4F4F4'; + this.pie2 = this.pie2 || '#555'; + this.pie3 = this.pie3 || '#BBB'; + this.pie4 = this.pie4 || '#777'; + this.pie5 = this.pie5 || '#999'; + this.pie6 = this.pie6 || '#DDD'; + this.pie7 = this.pie7 || '#FFF'; + this.pie8 = this.pie8 || '#DDD'; + this.pie9 = this.pie9 || '#BBB'; + this.pie10 = this.pie10 || '#999'; + this.pie11 = this.pie11 || '#777'; + this.pie12 = this.pie12 || '#555'; + this.pieTitleTextSize = this.pieTitleTextSize || '25px'; + this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; + this.pieSectionTextSize = this.pieSectionTextSize || '17px'; + this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; + this.pieLegendTextSize = this.pieLegendTextSize || '17px'; + this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; + this.pieStrokeColor = this.pieStrokeColor || 'black'; + this.pieStrokeWidth = this.pieStrokeWidth || '2px'; + this.pieOpacity = this.pieOpacity || '0.7'; // this.pie1 = this.pie1 || '#212529'; + // this.pie2 = this.pie2 || '#343A40'; + // this.pie3 = this.pie3 || '#495057'; + // this.pie4 = this.pie4 || '#6C757D'; + // this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -10 }); + // this.pie6 = this.pie6 || adjust(this.tertiaryColor, { l: -10 }); + // this.pie7 = this.pie7 || adjust(this.primaryColor, { h: +60, l: -10 }); + // this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -10 }); + // this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: 0 }); + // this.pie10 = this.pie10 || adjust(this.primaryColor, { h: +60, l: -20 }); + // this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -60, l: -20 }); + // this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -10 }); + + /* requirement-diagram */ + + this.requirementBackground = this.requirementBackground || this.primaryColor; + this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; + this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; + this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; + this.relationColor = this.relationColor || this.lineColor; + this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground; + this.relationLabelColor = this.relationLabelColor || this.actorTextColor; + /* git */ + + this.git0 = (0,khroma__WEBPACK_IMPORTED_MODULE_4__["default"])(this.pie1, 25) || this.primaryColor; + this.git1 = this.pie2 || this.secondaryColor; + this.git2 = this.pie3 || this.tertiaryColor; + this.git3 = this.pie4 || (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: -30 + }); + this.git4 = this.pie5 || (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: -60 + }); + this.git5 = this.pie6 || (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: -90 + }); + this.git6 = this.pie7 || (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: +60 + }); + this.git7 = this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_1__["default"])(this.primaryColor, { + h: +120 + }); + this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git0); + this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git1); + this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git2); + this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git3); + this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git4); + this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git5); + this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git6); + this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_3__["default"])(this.git7); + this.branchLabelColor = this.branchLabelColor || this.labelTextColor; + this.gitBranchLabel0 = this.branchLabelColor; + this.gitBranchLabel1 = 'white'; + this.gitBranchLabel2 = this.branchLabelColor; + this.gitBranchLabel3 = 'white'; + this.gitBranchLabel4 = this.branchLabelColor; + this.gitBranchLabel5 = this.branchLabelColor; + this.gitBranchLabel6 = this.branchLabelColor; + this.gitBranchLabel7 = this.branchLabelColor; + this.tagLabelColor = this.tagLabelColor || this.primaryTextColor; + this.tagLabelBackground = this.tagLabelBackground || this.primaryColor; + this.tagLabelBorder = this.tagBorder || this.primaryBorderColor; + this.tagLabelFontSize = this.tagLabelFontSize || '10px'; + this.commitLabelColor = this.commitLabelColor || this.secondaryTextColor; + this.commitLabelBackground = this.commitLabelBackground || this.secondaryColor; + this.commitLabelFontSize = this.commitLabelFontSize || '10px'; + } + }, { + key: "calculate", + value: function calculate(overrides) { + var _this = this; + + if (_typeof(overrides) !== 'object') { + // Calculate colors form base colors + this.updateColors(); + return; + } + + var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); // Calculate colors form base colors + + this.updateColors(); // Copy values from overrides again in case of an override of derived value + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); + } + }]); + + return Theme; +}(); + +var getThemeVariables = function getThemeVariables(userOverrides) { + var theme = new Theme(); + theme.calculate(userOverrides); + return theme; +}; + +/***/ }), + +/***/ "./src/utils.js": +/*!**********************!*\ + !*** ./src/utils.js ***! + \**********************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "assignWithDepth": () => (/* binding */ assignWithDepth), +/* harmony export */ "calculateSvgSizeAttrs": () => (/* binding */ calculateSvgSizeAttrs), +/* harmony export */ "calculateTextDimensions": () => (/* binding */ calculateTextDimensions), +/* harmony export */ "calculateTextHeight": () => (/* binding */ calculateTextHeight), +/* harmony export */ "calculateTextWidth": () => (/* binding */ calculateTextWidth), +/* harmony export */ "configureSvgSize": () => (/* binding */ configureSvgSize), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "detectDirective": () => (/* binding */ detectDirective), +/* harmony export */ "detectInit": () => (/* binding */ detectInit), +/* harmony export */ "detectType": () => (/* binding */ detectType), +/* harmony export */ "directiveSanitizer": () => (/* binding */ directiveSanitizer), +/* harmony export */ "drawSimpleText": () => (/* binding */ drawSimpleText), +/* harmony export */ "entityDecode": () => (/* binding */ entityDecode), +/* harmony export */ "formatUrl": () => (/* binding */ formatUrl), +/* harmony export */ "generateId": () => (/* binding */ generateId), +/* harmony export */ "getStylesFromArray": () => (/* binding */ getStylesFromArray), +/* harmony export */ "getTextObj": () => (/* binding */ getTextObj), +/* harmony export */ "initIdGenerator": () => (/* binding */ initIdGenerator), +/* harmony export */ "interpolateToCurve": () => (/* binding */ interpolateToCurve), +/* harmony export */ "isSubstringInArray": () => (/* binding */ isSubstringInArray), +/* harmony export */ "random": () => (/* binding */ random), +/* harmony export */ "runFunc": () => (/* binding */ runFunc), +/* harmony export */ "sanitizeCss": () => (/* binding */ sanitizeCss), +/* harmony export */ "setupGraphViewbox": () => (/* binding */ setupGraphViewbox), +/* harmony export */ "wrapLabel": () => (/* binding */ wrapLabel) +/* harmony export */ }); +/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @braintree/sanitize-url */ "./node_modules/@braintree/sanitize-url/dist/index.js"); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3 */ "./node_modules/d3/src/index.js"); +/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./diagrams/common/common */ "./src/diagrams/common/common.js"); +/* harmony import */ var _defaultConfig__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defaultConfig */ "./src/defaultConfig.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./logger */ "./src/logger.js"); +var _this = undefined; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } + +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + + + + + // Effectively an enum of the supported curve types, accessible by name + +var d3CurveTypes = { + curveBasis: d3__WEBPACK_IMPORTED_MODULE_1__.curveBasis, + curveBasisClosed: d3__WEBPACK_IMPORTED_MODULE_1__.curveBasisClosed, + curveBasisOpen: d3__WEBPACK_IMPORTED_MODULE_1__.curveBasisOpen, + curveLinear: d3__WEBPACK_IMPORTED_MODULE_1__.curveLinear, + curveLinearClosed: d3__WEBPACK_IMPORTED_MODULE_1__.curveLinearClosed, + curveMonotoneX: d3__WEBPACK_IMPORTED_MODULE_1__.curveMonotoneX, + curveMonotoneY: d3__WEBPACK_IMPORTED_MODULE_1__.curveMonotoneY, + curveNatural: d3__WEBPACK_IMPORTED_MODULE_1__.curveNatural, + curveStep: d3__WEBPACK_IMPORTED_MODULE_1__.curveStep, + curveStepAfter: d3__WEBPACK_IMPORTED_MODULE_1__.curveStepAfter, + curveStepBefore: d3__WEBPACK_IMPORTED_MODULE_1__.curveStepBefore +}; +var directive = /[%]{2}[{]\s*(?:(?:(\w+)\s*:|(\w+))\s*(?:(?:(\w+))|((?:(?![}][%]{2}).|\r?\n)*))?\s*)(?:[}][%]{2})?/gi; +var directiveWithoutOpen = /\s*(?:(?:(\w+)(?=:):|(\w+))\s*(?:(?:(\w+))|((?:(?![}][%]{2}).|\r?\n)*))?\s*)(?:[}][%]{2})?/gi; +var anyComment = /\s*%%.*\n/gm; +/** + * @function detectInit Detects the init config object from the text + * + * ```mermaid + * %%{init: {"theme": "debug", "logLevel": 1 }}%% + * graph LR + * a-->b + * b-->c + * c-->d + * d-->e + * e-->f + * f-->g + * g-->h + * ``` + * + * Or + * + * ```mermaid + * %%{initialize: {"theme": "dark", logLevel: "debug" }}%% + * graph LR + * a-->b + * b-->c + * c-->d + * d-->e + * e-->f + * f-->g + * g-->h + * ``` + * @param {string} text The text defining the graph + * @param {any} cnf + * @returns {object} The json object representing the init passed to mermaid.initialize() + */ + +var detectInit = function detectInit(text, cnf) { + var inits = detectDirective(text, /(?:init\b)|(?:initialize\b)/); + var results = {}; + + if (Array.isArray(inits)) { + var args = inits.map(function (init) { + return init.args; + }); + directiveSanitizer(args); + results = assignWithDepth(results, _toConsumableArray(args)); + } else { + results = inits.args; + } + + if (results) { + var type = detectType(text, cnf); + ['config'].forEach(function (prop) { + if (typeof results[prop] !== 'undefined') { + if (type === 'flowchart-v2') { + type = 'flowchart'; + } + + results[type] = results[prop]; + delete results[prop]; + } + }); + } // Todo: refactor this, these results are never used + + + return results; +}; +/** + * @function detectDirective Detects the directive from the text. Text can be single line or + * multiline. If type is null or omitted the first directive encountered in text will be returned + * + * ```mermaid + * graph LR + * %%{somedirective}%% + * a-->b + * b-->c + * c-->d + * d-->e + * e-->f + * f-->g + * g-->h + * ``` + * @param {string} text The text defining the graph + * @param {string | RegExp} type The directive to return (default: null) + * @returns {object | Array} An object or Array representing the directive(s): { type: string, args: + * object|null } matched by the input type if a single directive was found, that directive object + * will be returned. + */ + +var detectDirective = function detectDirective(text) { + var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + try { + var commentWithoutDirectives = new RegExp("[%]{2}(?![{]".concat(directiveWithoutOpen.source, ")(?=[}][%]{2}).*\n"), 'ig'); + text = text.trim().replace(commentWithoutDirectives, '').replace(/'/gm, '"'); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug("Detecting diagram directive".concat(type !== null ? ' type:' + type : '', " based on the text:").concat(text)); + var match, + result = []; + + while ((match = directive.exec(text)) !== null) { + // This is necessary to avoid infinite loops with zero-width matches + if (match.index === directive.lastIndex) { + directive.lastIndex++; + } + + if (match && !type || type && match[1] && match[1].match(type) || type && match[2] && match[2].match(type)) { + var _type = match[1] ? match[1] : match[2]; + + var args = match[3] ? match[3].trim() : match[4] ? JSON.parse(match[4].trim()) : null; + result.push({ + type: _type, + args: args + }); + } + } + + if (result.length === 0) { + result.push({ + type: text, + args: null + }); + } + + return result.length === 1 ? result[0] : result; + } catch (error) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.error("ERROR: ".concat(error.message, " - Unable to parse directive\n ").concat(type !== null ? ' type:' + type : '', " based on the text:").concat(text)); + return { + type: null, + args: null + }; + } +}; +/** + * @function detectType Detects the type of the graph text. Takes into consideration the possible + * existence of an %%init directive + * + * ```mermaid + * %%{initialize: {"startOnLoad": true, logLevel: "fatal" }}%% + * graph LR + * a-->b + * b-->c + * c-->d + * d-->e + * e-->f + * f-->g + * g-->h + * ``` + * @param {string} text The text defining the graph + * @param {{ + * class: { defaultRenderer: string } | undefined; + * state: { defaultRenderer: string } | undefined; + * flowchart: { defaultRenderer: string } | undefined; + * }} [cnf] + * @returns {string} A graph definition key + */ + +var detectType = function detectType(text, cnf) { + text = text.replace(directive, '').replace(anyComment, '\n'); + + if (text.match(/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/)) { + return 'c4'; + } + + if (text.match(/^\s*sequenceDiagram/)) { + return 'sequence'; + } + + if (text.match(/^\s*gantt/)) { + return 'gantt'; + } + + if (text.match(/^\s*classDiagram-v2/)) { + return 'classDiagram'; + } + + if (text.match(/^\s*classDiagram/)) { + if (cnf && cnf.class && cnf.class.defaultRenderer === 'dagre-wrapper') return 'classDiagram'; + return 'class'; + } + + if (text.match(/^\s*stateDiagram-v2/)) { + return 'stateDiagram'; + } + + if (text.match(/^\s*stateDiagram/)) { + if (cnf && cnf.class && cnf.state.defaultRenderer === 'dagre-wrapper') return 'stateDiagram'; + return 'state'; + } + + if (text.match(/^\s*gitGraph/)) { + return 'gitGraph'; + } + + if (text.match(/^\s*flowchart/)) { + return 'flowchart-v2'; + } + + if (text.match(/^\s*info/)) { + return 'info'; + } + + if (text.match(/^\s*pie/)) { + return 'pie'; + } + + if (text.match(/^\s*erDiagram/)) { + return 'er'; + } + + if (text.match(/^\s*journey/)) { + return 'journey'; + } + + if (text.match(/^\s*requirement/) || text.match(/^\s*requirementDiagram/)) { + return 'requirement'; + } + + if (cnf && cnf.flowchart && cnf.flowchart.defaultRenderer === 'dagre-wrapper') return 'flowchart-v2'; + return 'flowchart'; +}; +/** + * Caches results of functions based on input + * + * @param {Function} fn Function to run + * @param {Function} resolver Function that resolves to an ID given arguments the `fn` takes + * @returns {Function} An optimized caching function + */ + +var memoize = function memoize(fn, resolver) { + var cache = {}; + return function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var n = resolver ? resolver.apply(_this, args) : args[0]; + + if (n in cache) { + return cache[n]; + } else { + var result = fn.apply(void 0, args); + cache[n] = result; + return result; + } + }; +}; +/** + * @function isSubstringInArray Detects whether a substring in present in a given array + * @param {string} str The substring to detect + * @param {Array} arr The array to search + * @returns {number} The array index containing the substring or -1 if not present + */ + + +var isSubstringInArray = function isSubstringInArray(str, arr) { + for (var i = 0; i < arr.length; i++) { + if (arr[i].match(str)) return i; + } + + return -1; +}; +/** + * Returns a d3 curve given a curve name + * + * @param {string | undefined} interpolate The interpolation name + * @param {any} defaultCurve The default curve to return + * @returns {import('d3-shape').CurveFactory} The curve factory to use + */ + +var interpolateToCurve = function interpolateToCurve(interpolate, defaultCurve) { + if (!interpolate) { + return defaultCurve; + } + + var curveName = "curve".concat(interpolate.charAt(0).toUpperCase() + interpolate.slice(1)); + return d3CurveTypes[curveName] || defaultCurve; +}; +/** + * Formats a URL string + * + * @param {string} linkStr String of the URL + * @param {{ securityLevel: string }} config Configuration passed to MermaidJS + * @returns {string | undefined} The formatted URL + */ + +var formatUrl = function formatUrl(linkStr, config) { + var url = linkStr.trim(); + + if (url) { + if (config.securityLevel !== 'loose') { + return (0,_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_0__.sanitizeUrl)(url); + } + + return url; + } +}; +/** + * Runs a function + * + * @param {string} functionName A dot seperated path to the function relative to the `window` + * @param {...any} params Parameters to pass to the function + */ + +var runFunc = function runFunc(functionName) { + var _obj; + + var arrPaths = functionName.split('.'); + var len = arrPaths.length - 1; + var fnName = arrPaths[len]; + var obj = window; + + for (var i = 0; i < len; i++) { + obj = obj[arrPaths[i]]; + if (!obj) return; + } + + for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + params[_key2 - 1] = arguments[_key2]; + } + + (_obj = obj)[fnName].apply(_obj, params); +}; +/** + * @typedef {object} Point A (x, y) point + * @property {number} x The x value + * @property {number} y The y value + */ + +/** + * Finds the distance between two points using the Distance Formula + * + * @param {Point} p1 The first point + * @param {Point} p2 The second point + * @returns {number} The distance + */ + +var distance = function distance(p1, p2) { + return p1 && p2 ? Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)) : 0; +}; +/** + * @param {Point[]} points List of points + * @returns {Point} + * @todo Give this a description + */ + + +var traverseEdge = function traverseEdge(points) { + var prevPoint; + var totalDistance = 0; + points.forEach(function (point) { + totalDistance += distance(point, prevPoint); + prevPoint = point; + }); // Traverse half of total distance along points + + var remainingDistance = totalDistance / 2; + var center = undefined; + prevPoint = undefined; + points.forEach(function (point) { + if (prevPoint && !center) { + var vectorDistance = distance(point, prevPoint); + + if (vectorDistance < remainingDistance) { + remainingDistance -= vectorDistance; + } else { + // The point is remainingDistance from prevPoint in the vector between prevPoint and point + // Calculate the coordinates + var distanceRatio = remainingDistance / vectorDistance; + if (distanceRatio <= 0) center = prevPoint; + if (distanceRatio >= 1) center = { + x: point.x, + y: point.y + }; + + if (distanceRatio > 0 && distanceRatio < 1) { + center = { + x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, + y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y + }; + } + } + } + + prevPoint = point; + }); + return center; +}; +/** + * Alias for `traverseEdge` + * + * @param {Point[]} points List of points + * @returns {Point} Return result of `transverseEdge` + */ + + +var calcLabelPosition = function calcLabelPosition(points) { + if (points.length === 1) { + return points[0]; + } + + return traverseEdge(points); +}; + +var calcCardinalityPosition = function calcCardinalityPosition(isRelationTypePresent, points, initialPosition) { + var prevPoint; + var totalDistance = 0; // eslint-disable-line + + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('our points', points); + + if (points[0] !== initialPosition) { + points = points.reverse(); + } + + points.forEach(function (point) { + totalDistance += distance(point, prevPoint); + prevPoint = point; + }); // Traverse only 25 total distance along points to find cardinality point + + var distanceToCardinalityPoint = 25; + var remainingDistance = distanceToCardinalityPoint; + var center; + prevPoint = undefined; + points.forEach(function (point) { + if (prevPoint && !center) { + var vectorDistance = distance(point, prevPoint); + + if (vectorDistance < remainingDistance) { + remainingDistance -= vectorDistance; + } else { + // The point is remainingDistance from prevPoint in the vector between prevPoint and point + // Calculate the coordinates + var distanceRatio = remainingDistance / vectorDistance; + if (distanceRatio <= 0) center = prevPoint; + if (distanceRatio >= 1) center = { + x: point.x, + y: point.y + }; + + if (distanceRatio > 0 && distanceRatio < 1) { + center = { + x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, + y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y + }; + } + } + } + + prevPoint = point; + }); // if relation is present (Arrows will be added), change cardinality point off-set distance (d) + + var d = isRelationTypePresent ? 10 : 5; //Calculate Angle for x and y axis + + var angle = Math.atan2(points[0].y - center.y, points[0].x - center.x); + var cardinalityPosition = { + x: 0, + y: 0 + }; //Calculation cardinality position using angle, center point on the line/curve but pendicular and with offset-distance + + cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2; + cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2; + return cardinalityPosition; +}; +/** + * Position ['start_left', 'start_right', 'end_left', 'end_right'] + * + * @param {any} terminalMarkerSize + * @param {any} position + * @param {any} _points + * @returns {any} + */ + + +var calcTerminalLabelPosition = function calcTerminalLabelPosition(terminalMarkerSize, position, _points) { + // Todo looking to faster cloning method + var points = JSON.parse(JSON.stringify(_points)); + var prevPoint; + var totalDistance = 0; // eslint-disable-line + + _logger__WEBPACK_IMPORTED_MODULE_2__.log.info('our points', points); + + if (position !== 'start_left' && position !== 'start_right') { + points = points.reverse(); + } + + points.forEach(function (point) { + totalDistance += distance(point, prevPoint); + prevPoint = point; + }); // Traverse only 25 total distance along points to find cardinality point + + var distanceToCardinalityPoint = 25 + terminalMarkerSize; + var remainingDistance = distanceToCardinalityPoint; + var center; + prevPoint = undefined; + points.forEach(function (point) { + if (prevPoint && !center) { + var vectorDistance = distance(point, prevPoint); + + if (vectorDistance < remainingDistance) { + remainingDistance -= vectorDistance; + } else { + // The point is remainingDistance from prevPoint in the vector between prevPoint and point + // Calculate the coordinates + var distanceRatio = remainingDistance / vectorDistance; + if (distanceRatio <= 0) center = prevPoint; + if (distanceRatio >= 1) center = { + x: point.x, + y: point.y + }; + + if (distanceRatio > 0 && distanceRatio < 1) { + center = { + x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, + y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y + }; + } + } + } + + prevPoint = point; + }); // if relation is present (Arrows will be added), change cardinality point off-set distance (d) + + var d = 10 + terminalMarkerSize * 0.5; //Calculate Angle for x and y axis + + var angle = Math.atan2(points[0].y - center.y, points[0].x - center.x); + var cardinalityPosition = { + x: 0, + y: 0 + }; //Calculation cardinality position using angle, center point on the line/curve but pendicular and with offset-distance + + cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2; + cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2; + + if (position === 'start_left') { + cardinalityPosition.x = Math.sin(angle + Math.PI) * d + (points[0].x + center.x) / 2; + cardinalityPosition.y = -Math.cos(angle + Math.PI) * d + (points[0].y + center.y) / 2; + } + + if (position === 'end_right') { + cardinalityPosition.x = Math.sin(angle - Math.PI) * d + (points[0].x + center.x) / 2 - 5; + cardinalityPosition.y = -Math.cos(angle - Math.PI) * d + (points[0].y + center.y) / 2 - 5; + } + + if (position === 'end_left') { + cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2 - 5; + cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2 - 5; + } + + return cardinalityPosition; +}; +/** + * Gets styles from an array of declarations + * + * @param {string[]} arr Declarations + * @returns {{ style: string; labelStyle: string }} The styles grouped as strings + */ + + +var getStylesFromArray = function getStylesFromArray(arr) { + var style = ''; + var labelStyle = ''; + + for (var i = 0; i < arr.length; i++) { + if (typeof arr[i] !== 'undefined') { + // add text properties to label style definition + if (arr[i].startsWith('color:') || arr[i].startsWith('text-align:')) { + labelStyle = labelStyle + arr[i] + ';'; + } else { + style = style + arr[i] + ';'; + } + } + } + + return { + style: style, + labelStyle: labelStyle + }; +}; +var cnt = 0; +var generateId = function generateId() { + cnt++; + return 'id-' + Math.random().toString(36).substr(2, 12) + '-' + cnt; +}; +/** + * @param {any} length + * @returns {any} + */ + +function makeid(length) { + var result = ''; + var characters = '0123456789abcdef'; + var charactersLength = characters.length; + + for (var i = 0; i < length; i++) { + result += characters.charAt(Math.floor(Math.random() * charactersLength)); + } + + return result; +} + +var random = function random(options) { + return makeid(options.length); +}; +/** + * @function assignWithDepth Extends the functionality of {@link ObjectConstructor.assign} with the + * ability to merge arbitrary-depth objects For each key in src with path `k` (recursively) + * performs an Object.assign(dst[`k`], src[`k`]) with a slight change from the typical handling of + * undefined for dst[`k`]: instead of raising an error, dst[`k`] is auto-initialized to {} and + * effectively merged with src[`k`]

Additionally, dissimilar types will not clobber unless the + * config.clobber parameter === true. Example: + * + * ```js + * let config_0 = { foo: { bar: 'bar' }, bar: 'foo' }; + * let config_1 = { foo: 'foo', bar: 'bar' }; + * let result = assignWithDepth(config_0, config_1); + * console.log(result); + * //-> result: { foo: { bar: 'bar' }, bar: 'bar' } + * ``` + * + * Traditional Object.assign would have clobbered foo in config_0 with foo in config_1. If src is a + * destructured array of objects and dst is not an array, assignWithDepth will apply each element + * of src to dst in order. + * @param dst + * @param src + * @param config + * @param dst + * @param src + * @param config + * @param dst + * @param src + * @param config + * @param {any} dst - The destination of the merge + * @param {any} src - The source object(s) to merge into destination + * @param {{ depth: number; clobber: boolean }} [config={ depth: 2, clobber: false }] - Depth: depth + * to traverse within src and dst for merging - clobber: should dissimilar types clobber (default: + * { depth: 2, clobber: false }). Default is `{ depth: 2, clobber: false }` + * @returns {any} + */ + +var assignWithDepth = function assignWithDepth(dst, src, config) { + var _Object$assign = Object.assign({ + depth: 2, + clobber: false + }, config), + depth = _Object$assign.depth, + clobber = _Object$assign.clobber; + + if (Array.isArray(src) && !Array.isArray(dst)) { + src.forEach(function (s) { + return assignWithDepth(dst, s, config); + }); + return dst; + } else if (Array.isArray(src) && Array.isArray(dst)) { + src.forEach(function (s) { + if (dst.indexOf(s) === -1) { + dst.push(s); + } + }); + return dst; + } + + if (typeof dst === 'undefined' || depth <= 0) { + if (dst !== undefined && dst !== null && _typeof(dst) === 'object' && _typeof(src) === 'object') { + return Object.assign(dst, src); + } else { + return src; + } + } + + if (typeof src !== 'undefined' && _typeof(dst) === 'object' && _typeof(src) === 'object') { + Object.keys(src).forEach(function (key) { + if (_typeof(src[key]) === 'object' && (dst[key] === undefined || _typeof(dst[key]) === 'object')) { + if (dst[key] === undefined) { + dst[key] = Array.isArray(src[key]) ? [] : {}; + } + + dst[key] = assignWithDepth(dst[key], src[key], { + depth: depth - 1, + clobber: clobber + }); + } else if (clobber || _typeof(dst[key]) !== 'object' && _typeof(src[key]) !== 'object') { + dst[key] = src[key]; + } + }); + } + + return dst; +}; +var getTextObj = function getTextObj() { + return { + x: 0, + y: 0, + fill: undefined, + anchor: 'start', + style: '#666', + width: 100, + height: 100, + textMargin: 0, + rx: 0, + ry: 0, + valign: undefined + }; +}; +/** + * Adds text to an element + * + * @param {SVGElement} elem Element to add text to + * @param {{ + * text: string; + * x: number; + * y: number; + * anchor: 'start' | 'middle' | 'end'; + * fontFamily: string; + * fontSize: string | number; + * fontWeight: string | number; + * fill: string; + * class: string | undefined; + * textMargin: number; + * }} textData + * @returns {SVGTextElement} Text element with given styling and content + */ + +var drawSimpleText = function drawSimpleText(elem, textData) { + // Remove and ignore br:s + var nText = textData.text.replace(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__["default"].lineBreakRegex, ' '); + var textElem = elem.append('text'); + textElem.attr('x', textData.x); + textElem.attr('y', textData.y); + textElem.style('text-anchor', textData.anchor); + textElem.style('font-family', textData.fontFamily); + textElem.style('font-size', textData.fontSize); + textElem.style('font-weight', textData.fontWeight); + textElem.attr('fill', textData.fill); + + if (typeof textData.class !== 'undefined') { + textElem.attr('class', textData.class); + } + + var span = textElem.append('tspan'); + span.attr('x', textData.x + textData.textMargin * 2); + span.attr('fill', textData.fill); + span.text(nText); + return textElem; +}; +var wrapLabel = memoize(function (label, maxWidth, config) { + if (!label) { + return label; + } + + config = Object.assign({ + fontSize: 12, + fontWeight: 400, + fontFamily: 'Arial', + joinWith: '
' + }, config); + + if (_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__["default"].lineBreakRegex.test(label)) { + return label; + } + + var words = label.split(' '); + var completedLines = []; + var nextLine = ''; + words.forEach(function (word, index) { + var wordLength = calculateTextWidth("".concat(word, " "), config); + var nextLineLength = calculateTextWidth(nextLine, config); + + if (wordLength > maxWidth) { + var _breakString = breakString(word, maxWidth, '-', config), + hyphenatedStrings = _breakString.hyphenatedStrings, + remainingWord = _breakString.remainingWord; + + completedLines.push.apply(completedLines, [nextLine].concat(_toConsumableArray(hyphenatedStrings))); + nextLine = remainingWord; + } else if (nextLineLength + wordLength >= maxWidth) { + completedLines.push(nextLine); + nextLine = word; + } else { + nextLine = [nextLine, word].filter(Boolean).join(' '); + } + + var currentWord = index + 1; + var isLastWord = currentWord === words.length; + + if (isLastWord) { + completedLines.push(nextLine); + } + }); + return completedLines.filter(function (line) { + return line !== ''; + }).join(config.joinWith); +}, function (label, maxWidth, config) { + return "".concat(label, "-").concat(maxWidth, "-").concat(config.fontSize, "-").concat(config.fontWeight, "-").concat(config.fontFamily, "-").concat(config.joinWith); +}); +var breakString = memoize(function (word, maxWidth) { + var hyphenCharacter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '-'; + var config = arguments.length > 3 ? arguments[3] : undefined; + config = Object.assign({ + fontSize: 12, + fontWeight: 400, + fontFamily: 'Arial', + margin: 0 + }, config); + var characters = word.split(''); + var lines = []; + var currentLine = ''; + characters.forEach(function (character, index) { + var nextLine = "".concat(currentLine).concat(character); + var lineWidth = calculateTextWidth(nextLine, config); + + if (lineWidth >= maxWidth) { + var currentCharacter = index + 1; + var isLastLine = characters.length === currentCharacter; + var hyphenatedNextLine = "".concat(nextLine).concat(hyphenCharacter); + lines.push(isLastLine ? nextLine : hyphenatedNextLine); + currentLine = ''; + } else { + currentLine = nextLine; + } + }); + return { + hyphenatedStrings: lines, + remainingWord: currentLine + }; +}, function (word, maxWidth) { + var hyphenCharacter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '-'; + var config = arguments.length > 3 ? arguments[3] : undefined; + return "".concat(word, "-").concat(maxWidth, "-").concat(hyphenCharacter, "-").concat(config.fontSize, "-").concat(config.fontWeight, "-").concat(config.fontFamily); +}); +/** + * This calculates the text's height, taking into account the wrap breaks and both the statically + * configured height, width, and the length of the text (in pixels). + * + * If the wrapped text text has greater height, we extend the height, so it's value won't overflow. + * + * @param {any} text The text to measure + * @param {any} config - The config for fontSize, fontFamily, and fontWeight all impacting the resulting size + * @returns {any} - The height for the given text + */ + +var calculateTextHeight = function calculateTextHeight(text, config) { + config = Object.assign({ + fontSize: 12, + fontWeight: 400, + fontFamily: 'Arial', + margin: 15 + }, config); + return calculateTextDimensions(text, config).height; +}; +/** + * This calculates the width of the given text, font size and family. + * + * @param {any} text - The text to calculate the width of + * @param {any} config - The config for fontSize, fontFamily, and fontWeight all impacting the resulting size + * @returns {any} - The width for the given text + */ + +var calculateTextWidth = function calculateTextWidth(text, config) { + config = Object.assign({ + fontSize: 12, + fontWeight: 400, + fontFamily: 'Arial' + }, config); + return calculateTextDimensions(text, config).width; +}; +/** + * This calculates the dimensions of the given text, font size, font family, font weight, and margins. + * + * @param {any} text - The text to calculate the width of + * @param {any} config - The config for fontSize, fontFamily, fontWeight, and margin all impacting + * the resulting size + * @returns - The width for the given text + */ + +var calculateTextDimensions = memoize(function (text, config) { + config = Object.assign({ + fontSize: 12, + fontWeight: 400, + fontFamily: 'Arial' + }, config); + var _config = config, + fontSize = _config.fontSize, + fontFamily = _config.fontFamily, + fontWeight = _config.fontWeight; + + if (!text) { + return { + width: 0, + height: 0 + }; + } // We can't really know if the user supplied font family will render on the user agent; + // thus, we'll take the max width between the user supplied font family, and a default + // of sans-serif. + + + var fontFamilies = ['sans-serif', fontFamily]; + var lines = text.split(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__["default"].lineBreakRegex); + var dims = []; + var body = (0,d3__WEBPACK_IMPORTED_MODULE_1__.select)('body'); // We don't want to leak DOM elements - if a removal operation isn't available + // for any reason, do not continue. + + if (!body.remove) { + return { + width: 0, + height: 0, + lineHeight: 0 + }; + } + + var g = body.append('svg'); + + for (var _i = 0, _fontFamilies = fontFamilies; _i < _fontFamilies.length; _i++) { + var _fontFamily = _fontFamilies[_i]; + var cheight = 0; + var dim = { + width: 0, + height: 0, + lineHeight: 0 + }; + + var _iterator = _createForOfIteratorHelper(lines), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var line = _step.value; + var textObj = getTextObj(); + textObj.text = line; + var textElem = drawSimpleText(g, textObj).style('font-size', fontSize).style('font-weight', fontWeight).style('font-family', _fontFamily); + var bBox = (textElem._groups || textElem)[0][0].getBBox(); + dim.width = Math.round(Math.max(dim.width, bBox.width)); + cheight = Math.round(bBox.height); + dim.height += cheight; + dim.lineHeight = Math.round(Math.max(dim.lineHeight, cheight)); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + + dims.push(dim); + } + + g.remove(); + var index = isNaN(dims[1].height) || isNaN(dims[1].width) || isNaN(dims[1].lineHeight) || dims[0].height > dims[1].height && dims[0].width > dims[1].width && dims[0].lineHeight > dims[1].lineHeight ? 0 : 1; + return dims[index]; +}, function (text, config) { + return "".concat(text, "-").concat(config.fontSize, "-").concat(config.fontWeight, "-").concat(config.fontFamily); +}); +/** + * Applys d3 attributes + * + * @param {any} d3Elem D3 Element to apply the attributes onto + * @param {[string, string][]} attrs Object.keys equivalent format of key to value mapping of attributes + */ + +var d3Attrs = function d3Attrs(d3Elem, attrs) { + var _iterator2 = _createForOfIteratorHelper(attrs), + _step2; + + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + var attr = _step2.value; + d3Elem.attr(attr[0], attr[1]); + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); + } +}; +/** + * Gives attributes for an SVG's size given arguments + * + * @param {number} height The height of the SVG + * @param {number} width The width of the SVG + * @param {boolean} useMaxWidth Whether or not to use max-width and set width to 100% + * @returns {Map<'height' | 'width' | 'style', string>} Attributes for the SVG + */ + + +var calculateSvgSizeAttrs = function calculateSvgSizeAttrs(height, width, useMaxWidth) { + var attrs = new Map(); + attrs.set('height', height); + + if (useMaxWidth) { + attrs.set('width', '100%'); + attrs.set('style', "max-width: ".concat(width, "px;")); + } else { + attrs.set('width', width); + } + + return attrs; +}; +/** + * Applies attributes from `calculateSvgSizeAttrs` + * + * @param {SVGSVGElement} svgElem The SVG Element to configure + * @param {number} height The height of the SVG + * @param {number} width The width of the SVG + * @param {boolean} useMaxWidth Whether or not to use max-width and set width to 100% + */ + +var configureSvgSize = function configureSvgSize(svgElem, height, width, useMaxWidth) { + var attrs = calculateSvgSizeAttrs(height, width, useMaxWidth); + d3Attrs(svgElem, attrs); +}; +var setupGraphViewbox = function setupGraphViewbox(graph, svgElem, padding, useMaxWidth) { + var svgBounds = svgElem.node().getBBox(); + var sWidth = svgBounds.width; + var sHeight = svgBounds.height; + var width = graph._label.width; + var height = graph._label.height; + var tx = 0; + var ty = 0; + + if (sWidth > width) { + tx = (sWidth - width) / 2 + padding; + width = sWidth + padding * 2; + } else { + if (Math.abs(sWidth - width) >= 2 * padding + 1) { + width = width - padding; + } + } + + if (sHeight > height) { + ty = (sHeight - height) / 2 + padding; + height = sHeight + padding * 2; + } + + configureSvgSize(svgElem, height, width, useMaxWidth); // Ensure the viewBox includes the whole svgBounds area with extra space for padding + + var vBox = "0 0 ".concat(width, " ").concat(height); + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('Graph.label', graph._label, 'swidth', sWidth, 'sheight', sHeight, 'width', width, 'height', height, 'tx', tx, 'ty', ty, 'vBox', vBox); + svgElem.attr('viewBox', vBox); + svgElem.select('g').attr('transform', "translate(".concat(tx, ", ").concat(ty, ")")); +}; +var initIdGenerator = /*#__PURE__*/function () { + function iterator(deterministic, seed) { + _classCallCheck(this, iterator); + + this.deterministic = deterministic; + this.seed = seed; + this.count = seed ? seed.length : 0; + } + + _createClass(iterator, [{ + key: "next", + value: function next() { + if (!this.deterministic) return Date.now(); + return this.count++; + } + }]); + + return iterator; +}(); +var decoder; +/** + * Decodes HTML, source: {@link https://github.com/shrpne/entity-decode/blob/v2.0.1/browser.js} + * + * @param {string} html HTML as a string + * @returns Unescaped HTML + */ + +var entityDecode = function entityDecode(html) { + decoder = decoder || document.createElement('div'); // Escape HTML before decoding for HTML Entities + + html = escape(html).replace(/%26/g, '&').replace(/%23/g, '#').replace(/%3B/g, ';'); // decoding + + decoder.innerHTML = html; + return unescape(decoder.textContent); +}; +/** + * Sanitizes directive objects + * + * @param {object} args Directive's JSON + */ + +var directiveSanitizer = function directiveSanitizer(args) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('directiveSanitizer called with', args); + + if (_typeof(args) === 'object') { + // check for array + if (args.length) { + args.forEach(function (arg) { + return directiveSanitizer(arg); + }); + } else { + // This is an object + Object.keys(args).forEach(function (key) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('Checking key', key); + + if (key.indexOf('__') === 0) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitize deleting __ option', key); + delete args[key]; + } + + if (key.indexOf('proto') >= 0) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitize deleting proto option', key); + delete args[key]; + } + + if (key.indexOf('constr') >= 0) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitize deleting constr option', key); + delete args[key]; + } + + if (key.indexOf('themeCSS') >= 0) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitizing themeCss option'); + args[key] = sanitizeCss(args[key]); + } + + if (key.indexOf('fontFamily') >= 0) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitizing fontFamily option'); + args[key] = sanitizeCss(args[key]); + } + + if (key.indexOf('altFontFamily') >= 0) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitizing altFontFamily option'); + args[key] = sanitizeCss(args[key]); + } + + if (_defaultConfig__WEBPACK_IMPORTED_MODULE_4__.configKeys.indexOf(key) < 0) { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitize deleting option', key); + delete args[key]; + } else { + if (_typeof(args[key]) === 'object') { + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('sanitize deleting object', key); + directiveSanitizer(args[key]); + } + } + }); + } + } + + if (args.themeVariables) { + var kArr = Object.keys(args.themeVariables); + + for (var i = 0; i < kArr.length; i++) { + var k = kArr[i]; + var val = args.themeVariables[k]; + + if (val && val.match && !val.match(/^[a-zA-Z0-9#,";()%. ]+$/)) { + args.themeVariables[k] = ''; + } + } + } + + _logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('After sanitization', args); +}; +var sanitizeCss = function sanitizeCss(str) { + var startCnt = 0; + var endCnt = 0; + + for (var i = 0; i < str.length; i++) { + if (startCnt < endCnt) { + return '{ /* ERROR: Unbalanced CSS */ }'; + } + + if (str[i] === '{') { + startCnt++; + } else if (str[i] === '}') { + endCnt++; + } + } + + if (startCnt !== endCnt) { + return '{ /* ERROR: Unbalanced CSS */ }'; + } // Todo add more checks here + + + return str; +}; +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ + assignWithDepth: assignWithDepth, + wrapLabel: wrapLabel, + calculateTextHeight: calculateTextHeight, + calculateTextWidth: calculateTextWidth, + calculateTextDimensions: calculateTextDimensions, + calculateSvgSizeAttrs: calculateSvgSizeAttrs, + configureSvgSize: configureSvgSize, + setupGraphViewbox: setupGraphViewbox, + detectInit: detectInit, + detectDirective: detectDirective, + detectType: detectType, + isSubstringInArray: isSubstringInArray, + interpolateToCurve: interpolateToCurve, + calcLabelPosition: calcLabelPosition, + calcCardinalityPosition: calcCardinalityPosition, + calcTerminalLabelPosition: calcTerminalLabelPosition, + formatUrl: formatUrl, + getStylesFromArray: getStylesFromArray, + generateId: generateId, + random: random, + memoize: memoize, + runFunc: runFunc, + entityDecode: entityDecode, + initIdGenerator: initIdGenerator, + directiveSanitizer: directiveSanitizer, + sanitizeCss: sanitizeCss +}); + +/***/ }), + +/***/ "./node_modules/dagre-d3/index.js": +/*!****************************************!*\ + !*** ./node_modules/dagre-d3/index.js ***! + \****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * @license + * Copyright (c) 2012-2013 Chris Pettitt + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +module.exports = { + graphlib: __webpack_require__(/*! ./lib/graphlib */ "./node_modules/dagre-d3/lib/graphlib.js"), + dagre: __webpack_require__(/*! ./lib/dagre */ "./node_modules/dagre-d3/lib/dagre.js"), + intersect: __webpack_require__(/*! ./lib/intersect */ "./node_modules/dagre-d3/lib/intersect/index.js"), + render: __webpack_require__(/*! ./lib/render */ "./node_modules/dagre-d3/lib/render.js"), + util: __webpack_require__(/*! ./lib/util */ "./node_modules/dagre-d3/lib/util.js"), + version: __webpack_require__(/*! ./lib/version */ "./node_modules/dagre-d3/lib/version.js") +}; + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/arrows.js": +/*!*********************************************!*\ + !*** ./node_modules/dagre-d3/lib/arrows.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var util = __webpack_require__(/*! ./util */ "./node_modules/dagre-d3/lib/util.js"); + +module.exports = { + "default": normal, + "normal": normal, + "vee": vee, + "undirected": undirected +}; + +function normal(parent, id, edge, type) { + var marker = parent.append("marker") + .attr("id", id) + .attr("viewBox", "0 0 10 10") + .attr("refX", 9) + .attr("refY", 5) + .attr("markerUnits", "strokeWidth") + .attr("markerWidth", 8) + .attr("markerHeight", 6) + .attr("orient", "auto"); + + var path = marker.append("path") + .attr("d", "M 0 0 L 10 5 L 0 10 z") + .style("stroke-width", 1) + .style("stroke-dasharray", "1,0"); + util.applyStyle(path, edge[type + "Style"]); + if (edge[type + "Class"]) { + path.attr("class", edge[type + "Class"]); + } +} + +function vee(parent, id, edge, type) { + var marker = parent.append("marker") + .attr("id", id) + .attr("viewBox", "0 0 10 10") + .attr("refX", 9) + .attr("refY", 5) + .attr("markerUnits", "strokeWidth") + .attr("markerWidth", 8) + .attr("markerHeight", 6) + .attr("orient", "auto"); + + var path = marker.append("path") + .attr("d", "M 0 0 L 10 5 L 0 10 L 4 5 z") + .style("stroke-width", 1) + .style("stroke-dasharray", "1,0"); + util.applyStyle(path, edge[type + "Style"]); + if (edge[type + "Class"]) { + path.attr("class", edge[type + "Class"]); + } +} + +function undirected(parent, id, edge, type) { + var marker = parent.append("marker") + .attr("id", id) + .attr("viewBox", "0 0 10 10") + .attr("refX", 9) + .attr("refY", 5) + .attr("markerUnits", "strokeWidth") + .attr("markerWidth", 8) + .attr("markerHeight", 6) + .attr("orient", "auto"); + + var path = marker.append("path") + .attr("d", "M 0 5 L 10 5") + .style("stroke-width", 1) + .style("stroke-dasharray", "1,0"); + util.applyStyle(path, edge[type + "Style"]); + if (edge[type + "Class"]) { + path.attr("class", edge[type + "Class"]); + } +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/create-clusters.js": +/*!******************************************************!*\ + !*** ./node_modules/dagre-d3/lib/create-clusters.js ***! + \******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var util = __webpack_require__(/*! ./util */ "./node_modules/dagre-d3/lib/util.js"); +var d3 = __webpack_require__(/*! ./d3 */ "./node_modules/dagre-d3/lib/d3.js"); +var addLabel = __webpack_require__(/*! ./label/add-label */ "./node_modules/dagre-d3/lib/label/add-label.js"); + +module.exports = createClusters; + +function createClusters(selection, g) { + var clusters = g.nodes().filter(function(v) { return util.isSubgraph(g, v); }); + var svgClusters = selection.selectAll("g.cluster") + .data(clusters, function(v) { return v; }); + + svgClusters.selectAll("*").remove(); + svgClusters.enter().append("g") + .attr("class", "cluster") + .attr("id",function(v){ + var node = g.node(v); + return node.id; + }) + .style("opacity", 0); + + svgClusters = selection.selectAll("g.cluster"); + + util.applyTransition(svgClusters, g) + .style("opacity", 1); + + svgClusters.each(function(v) { + var node = g.node(v); + var thisGroup = d3.select(this); + d3.select(this).append("rect"); + var labelGroup = thisGroup.append("g").attr("class", "label"); + addLabel(labelGroup, node, node.clusterLabelPos); + }); + + svgClusters.selectAll("rect").each(function(c) { + var node = g.node(c); + var domCluster = d3.select(this); + util.applyStyle(domCluster, node.style); + }); + + var exitSelection; + + if (svgClusters.exit) { + exitSelection = svgClusters.exit(); + } else { + exitSelection = svgClusters.selectAll(null); // empty selection + } + + util.applyTransition(exitSelection, g) + .style("opacity", 0) + .remove(); + + return svgClusters; +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/create-edge-labels.js": +/*!*********************************************************!*\ + !*** ./node_modules/dagre-d3/lib/create-edge-labels.js ***! + \*********************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var _ = __webpack_require__(/*! ./lodash */ "./node_modules/dagre-d3/lib/lodash.js"); +var addLabel = __webpack_require__(/*! ./label/add-label */ "./node_modules/dagre-d3/lib/label/add-label.js"); +var util = __webpack_require__(/*! ./util */ "./node_modules/dagre-d3/lib/util.js"); +var d3 = __webpack_require__(/*! ./d3 */ "./node_modules/dagre-d3/lib/d3.js"); + +module.exports = createEdgeLabels; + +function createEdgeLabels(selection, g) { + var svgEdgeLabels = selection.selectAll("g.edgeLabel") + .data(g.edges(), function(e) { return util.edgeToId(e); }) + .classed("update", true); + + svgEdgeLabels.exit().remove(); + svgEdgeLabels.enter().append("g") + .classed("edgeLabel", true) + .style("opacity", 0); + + svgEdgeLabels = selection.selectAll("g.edgeLabel"); + + svgEdgeLabels.each(function(e) { + var root = d3.select(this); + root.select(".label").remove(); + var edge = g.edge(e); + var label = addLabel(root, g.edge(e), 0, 0).classed("label", true); + var bbox = label.node().getBBox(); + + if (edge.labelId) { label.attr("id", edge.labelId); } + if (!_.has(edge, "width")) { edge.width = bbox.width; } + if (!_.has(edge, "height")) { edge.height = bbox.height; } + }); + + var exitSelection; + + if (svgEdgeLabels.exit) { + exitSelection = svgEdgeLabels.exit(); + } else { + exitSelection = svgEdgeLabels.selectAll(null); // empty selection + } + + util.applyTransition(exitSelection, g) + .style("opacity", 0) + .remove(); + + return svgEdgeLabels; +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/create-edge-paths.js": +/*!********************************************************!*\ + !*** ./node_modules/dagre-d3/lib/create-edge-paths.js ***! + \********************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var _ = __webpack_require__(/*! ./lodash */ "./node_modules/dagre-d3/lib/lodash.js"); +var intersectNode = __webpack_require__(/*! ./intersect/intersect-node */ "./node_modules/dagre-d3/lib/intersect/intersect-node.js"); +var util = __webpack_require__(/*! ./util */ "./node_modules/dagre-d3/lib/util.js"); +var d3 = __webpack_require__(/*! ./d3 */ "./node_modules/dagre-d3/lib/d3.js"); +module.exports = createEdgePaths; + +function createEdgePaths(selection, g, arrows) { + var previousPaths = selection.selectAll("g.edgePath") + .data(g.edges(), function(e) { return util.edgeToId(e); }) + .classed("update", true); + + var newPaths = enter(previousPaths, g); + exit(previousPaths, g); + + var svgPaths = previousPaths.merge !== undefined ? previousPaths.merge(newPaths) : previousPaths; + util.applyTransition(svgPaths, g) + .style("opacity", 1); + + // Save DOM element in the path group, and set ID and class + svgPaths.each(function(e) { + var domEdge = d3.select(this); + var edge = g.edge(e); + edge.elem = this; + + if (edge.id) { + domEdge.attr("id", edge.id); + } + + util.applyClass(domEdge, edge["class"], + (domEdge.classed("update") ? "update " : "") + "edgePath"); + }); + + svgPaths.selectAll("path.path") + .each(function(e) { + var edge = g.edge(e); + edge.arrowheadId = _.uniqueId("arrowhead"); + + var domEdge = d3.select(this) + .attr("marker-end", function() { + return "url(" + makeFragmentRef(location.href, edge.arrowheadId) + ")"; + }) + .style("fill", "none"); + + util.applyTransition(domEdge, g) + .attr("d", function(e) { return calcPoints(g, e); }); + + util.applyStyle(domEdge, edge.style); + }); + + svgPaths.selectAll("defs *").remove(); + svgPaths.selectAll("defs") + .each(function(e) { + var edge = g.edge(e); + var arrowhead = arrows[edge.arrowhead]; + arrowhead(d3.select(this), edge.arrowheadId, edge, "arrowhead"); + }); + + return svgPaths; +} + +function makeFragmentRef(url, fragmentId) { + var baseUrl = url.split("#")[0]; + return baseUrl + "#" + fragmentId; +} + +function calcPoints(g, e) { + var edge = g.edge(e); + var tail = g.node(e.v); + var head = g.node(e.w); + var points = edge.points.slice(1, edge.points.length - 1); + points.unshift(intersectNode(tail, points[0])); + points.push(intersectNode(head, points[points.length - 1])); + + return createLine(edge, points); +} + +function createLine(edge, points) { + var line = (d3.line || d3.svg.line)() + .x(function(d) { return d.x; }) + .y(function(d) { return d.y; }); + + (line.curve || line.interpolate)(edge.curve); + + return line(points); +} + +function getCoords(elem) { + var bbox = elem.getBBox(); + var matrix = elem.ownerSVGElement.getScreenCTM() + .inverse() + .multiply(elem.getScreenCTM()) + .translate(bbox.width / 2, bbox.height / 2); + return { x: matrix.e, y: matrix.f }; +} + +function enter(svgPaths, g) { + var svgPathsEnter = svgPaths.enter().append("g") + .attr("class", "edgePath") + .style("opacity", 0); + svgPathsEnter.append("path") + .attr("class", "path") + .attr("d", function(e) { + var edge = g.edge(e); + var sourceElem = g.node(e.v).elem; + var points = _.range(edge.points.length).map(function() { return getCoords(sourceElem); }); + return createLine(edge, points); + }); + svgPathsEnter.append("defs"); + return svgPathsEnter; +} + +function exit(svgPaths, g) { + var svgPathExit = svgPaths.exit(); + util.applyTransition(svgPathExit, g) + .style("opacity", 0) + .remove(); +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/create-nodes.js": +/*!***************************************************!*\ + !*** ./node_modules/dagre-d3/lib/create-nodes.js ***! + \***************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var _ = __webpack_require__(/*! ./lodash */ "./node_modules/dagre-d3/lib/lodash.js"); +var addLabel = __webpack_require__(/*! ./label/add-label */ "./node_modules/dagre-d3/lib/label/add-label.js"); +var util = __webpack_require__(/*! ./util */ "./node_modules/dagre-d3/lib/util.js"); +var d3 = __webpack_require__(/*! ./d3 */ "./node_modules/dagre-d3/lib/d3.js"); + +module.exports = createNodes; + +function createNodes(selection, g, shapes) { + var simpleNodes = g.nodes().filter(function(v) { return !util.isSubgraph(g, v); }); + var svgNodes = selection.selectAll("g.node") + .data(simpleNodes, function(v) { return v; }) + .classed("update", true); + + svgNodes.exit().remove(); + + svgNodes.enter().append("g") + .attr("class", "node") + .style("opacity", 0); + + svgNodes = selection.selectAll("g.node"); + + svgNodes.each(function(v) { + var node = g.node(v); + var thisGroup = d3.select(this); + util.applyClass(thisGroup, node["class"], + (thisGroup.classed("update") ? "update " : "") + "node"); + + thisGroup.select("g.label").remove(); + var labelGroup = thisGroup.append("g").attr("class", "label"); + var labelDom = addLabel(labelGroup, node); + var shape = shapes[node.shape]; + var bbox = _.pick(labelDom.node().getBBox(), "width", "height"); + + node.elem = this; + + if (node.id) { thisGroup.attr("id", node.id); } + if (node.labelId) { labelGroup.attr("id", node.labelId); } + + if (_.has(node, "width")) { bbox.width = node.width; } + if (_.has(node, "height")) { bbox.height = node.height; } + + bbox.width += node.paddingLeft + node.paddingRight; + bbox.height += node.paddingTop + node.paddingBottom; + labelGroup.attr("transform", "translate(" + + ((node.paddingLeft - node.paddingRight) / 2) + "," + + ((node.paddingTop - node.paddingBottom) / 2) + ")"); + + var root = d3.select(this); + root.select(".label-container").remove(); + var shapeSvg = shape(root, bbox, node).classed("label-container", true); + util.applyStyle(shapeSvg, node.style); + + var shapeBBox = shapeSvg.node().getBBox(); + node.width = shapeBBox.width; + node.height = shapeBBox.height; + }); + + var exitSelection; + + if (svgNodes.exit) { + exitSelection = svgNodes.exit(); + } else { + exitSelection = svgNodes.selectAll(null); // empty selection + } + + util.applyTransition(exitSelection, g) + .style("opacity", 0) + .remove(); + + return svgNodes; +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/d3.js": +/*!*****************************************!*\ + !*** ./node_modules/dagre-d3/lib/d3.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +// Stub to get D3 either via NPM or from the global object +var d3; + +if (!d3) { + if (true) { + try { + d3 = __webpack_require__(/*! d3 */ "./node_modules/d3/src/index.js"); + } + catch (e) { + // continue regardless of error + } + } +} + +if (!d3) { + d3 = window.d3; +} + +module.exports = d3; + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/dagre.js": +/*!********************************************!*\ + !*** ./node_modules/dagre-d3/lib/dagre.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/* global window */ + +var dagre; + +if (true) { + try { + dagre = __webpack_require__(/*! dagre */ "./node_modules/dagre/index.js"); + } catch (e) { + // continue regardless of error + } +} + +if (!dagre) { + dagre = window.dagre; +} + +module.exports = dagre; + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/graphlib.js": +/*!***********************************************!*\ + !*** ./node_modules/dagre-d3/lib/graphlib.js ***! + \***********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/* global window */ + +var graphlib; + +if (true) { + try { + graphlib = __webpack_require__(/*! graphlib */ "./node_modules/graphlib/index.js"); + } + catch (e) { + // continue regardless of error + } +} + +if (!graphlib) { + graphlib = window.graphlib; +} + +module.exports = graphlib; + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/intersect/index.js": +/*!******************************************************!*\ + !*** ./node_modules/dagre-d3/lib/intersect/index.js ***! + \******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = { + node: __webpack_require__(/*! ./intersect-node */ "./node_modules/dagre-d3/lib/intersect/intersect-node.js"), + circle: __webpack_require__(/*! ./intersect-circle */ "./node_modules/dagre-d3/lib/intersect/intersect-circle.js"), + ellipse: __webpack_require__(/*! ./intersect-ellipse */ "./node_modules/dagre-d3/lib/intersect/intersect-ellipse.js"), + polygon: __webpack_require__(/*! ./intersect-polygon */ "./node_modules/dagre-d3/lib/intersect/intersect-polygon.js"), + rect: __webpack_require__(/*! ./intersect-rect */ "./node_modules/dagre-d3/lib/intersect/intersect-rect.js") +}; + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/intersect/intersect-circle.js": +/*!*****************************************************************!*\ + !*** ./node_modules/dagre-d3/lib/intersect/intersect-circle.js ***! + \*****************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var intersectEllipse = __webpack_require__(/*! ./intersect-ellipse */ "./node_modules/dagre-d3/lib/intersect/intersect-ellipse.js"); + +module.exports = intersectCircle; + +function intersectCircle(node, rx, point) { + return intersectEllipse(node, rx, rx, point); +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/intersect/intersect-ellipse.js": +/*!******************************************************************!*\ + !*** ./node_modules/dagre-d3/lib/intersect/intersect-ellipse.js ***! + \******************************************************************/ +/***/ ((module) => { + +module.exports = intersectEllipse; + +function intersectEllipse(node, rx, ry, point) { + // Formulae from: http://mathworld.wolfram.com/Ellipse-LineIntersection.html + + var cx = node.x; + var cy = node.y; + + var px = cx - point.x; + var py = cy - point.y; + + var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px); + + var dx = Math.abs(rx * ry * px / det); + if (point.x < cx) { + dx = -dx; + } + var dy = Math.abs(rx * ry * py / det); + if (point.y < cy) { + dy = -dy; + } + + return {x: cx + dx, y: cy + dy}; +} + + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/intersect/intersect-line.js": +/*!***************************************************************!*\ + !*** ./node_modules/dagre-d3/lib/intersect/intersect-line.js ***! + \***************************************************************/ +/***/ ((module) => { + +module.exports = intersectLine; + +/* + * Returns the point at which two lines, p and q, intersect or returns + * undefined if they do not intersect. + */ +function intersectLine(p1, p2, q1, q2) { + // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994, + // p7 and p473. + + var a1, a2, b1, b2, c1, c2; + var r1, r2 , r3, r4; + var denom, offset, num; + var x, y; + + // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x + + // b1 y + c1 = 0. + a1 = p2.y - p1.y; + b1 = p1.x - p2.x; + c1 = (p2.x * p1.y) - (p1.x * p2.y); + + // Compute r3 and r4. + r3 = ((a1 * q1.x) + (b1 * q1.y) + c1); + r4 = ((a1 * q2.x) + (b1 * q2.y) + c1); + + // Check signs of r3 and r4. If both point 3 and point 4 lie on + // same side of line 1, the line segments do not intersect. + if ((r3 !== 0) && (r4 !== 0) && sameSign(r3, r4)) { + return /*DONT_INTERSECT*/; + } + + // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0 + a2 = q2.y - q1.y; + b2 = q1.x - q2.x; + c2 = (q2.x * q1.y) - (q1.x * q2.y); + + // Compute r1 and r2 + r1 = (a2 * p1.x) + (b2 * p1.y) + c2; + r2 = (a2 * p2.x) + (b2 * p2.y) + c2; + + // Check signs of r1 and r2. If both point 1 and point 2 lie + // on same side of second line segment, the line segments do + // not intersect. + if ((r1 !== 0) && (r2 !== 0) && (sameSign(r1, r2))) { + return /*DONT_INTERSECT*/; + } + + // Line segments intersect: compute intersection point. + denom = (a1 * b2) - (a2 * b1); + if (denom === 0) { + return /*COLLINEAR*/; + } + + offset = Math.abs(denom / 2); + + // The denom/2 is to get rounding instead of truncating. It + // is added or subtracted to the numerator, depending upon the + // sign of the numerator. + num = (b1 * c2) - (b2 * c1); + x = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom); + + num = (a2 * c1) - (a1 * c2); + y = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom); + + return { x: x, y: y }; +} + +function sameSign(r1, r2) { + return r1 * r2 > 0; +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/intersect/intersect-node.js": +/*!***************************************************************!*\ + !*** ./node_modules/dagre-d3/lib/intersect/intersect-node.js ***! + \***************************************************************/ +/***/ ((module) => { + +module.exports = intersectNode; + +function intersectNode(node, point) { + return node.intersect(point); +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/intersect/intersect-polygon.js": +/*!******************************************************************!*\ + !*** ./node_modules/dagre-d3/lib/intersect/intersect-polygon.js ***! + \******************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/* eslint "no-console": off */ + +var intersectLine = __webpack_require__(/*! ./intersect-line */ "./node_modules/dagre-d3/lib/intersect/intersect-line.js"); + +module.exports = intersectPolygon; + +/* + * Returns the point ({x, y}) at which the point argument intersects with the + * node argument assuming that it has the shape specified by polygon. + */ +function intersectPolygon(node, polyPoints, point) { + var x1 = node.x; + var y1 = node.y; + + var intersections = []; + + var minX = Number.POSITIVE_INFINITY; + var minY = Number.POSITIVE_INFINITY; + polyPoints.forEach(function(entry) { + minX = Math.min(minX, entry.x); + minY = Math.min(minY, entry.y); + }); + + var left = x1 - node.width / 2 - minX; + var top = y1 - node.height / 2 - minY; + + for (var i = 0; i < polyPoints.length; i++) { + var p1 = polyPoints[i]; + var p2 = polyPoints[i < polyPoints.length - 1 ? i + 1 : 0]; + var intersect = intersectLine(node, point, + {x: left + p1.x, y: top + p1.y}, {x: left + p2.x, y: top + p2.y}); + if (intersect) { + intersections.push(intersect); + } + } + + if (!intersections.length) { + console.log("NO INTERSECTION FOUND, RETURN NODE CENTER", node); + return node; + } + + if (intersections.length > 1) { + // More intersections, find the one nearest to edge end point + intersections.sort(function(p, q) { + var pdx = p.x - point.x; + var pdy = p.y - point.y; + var distp = Math.sqrt(pdx * pdx + pdy * pdy); + + var qdx = q.x - point.x; + var qdy = q.y - point.y; + var distq = Math.sqrt(qdx * qdx + qdy * qdy); + + return (distp < distq) ? -1 : (distp === distq ? 0 : 1); + }); + } + return intersections[0]; +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/intersect/intersect-rect.js": +/*!***************************************************************!*\ + !*** ./node_modules/dagre-d3/lib/intersect/intersect-rect.js ***! + \***************************************************************/ +/***/ ((module) => { + +module.exports = intersectRect; + +function intersectRect(node, point) { + var x = node.x; + var y = node.y; + + // Rectangle intersection algorithm from: + // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes + var dx = point.x - x; + var dy = point.y - y; + var w = node.width / 2; + var h = node.height / 2; + + var sx, sy; + if (Math.abs(dy) * w > Math.abs(dx) * h) { + // Intersection is top or bottom of rect. + if (dy < 0) { + h = -h; + } + sx = dy === 0 ? 0 : h * dx / dy; + sy = h; + } else { + // Intersection is left or right of rect. + if (dx < 0) { + w = -w; + } + sx = w; + sy = dx === 0 ? 0 : w * dy / dx; + } + + return {x: x + sx, y: y + sy}; +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/label/add-html-label.js": +/*!***********************************************************!*\ + !*** ./node_modules/dagre-d3/lib/label/add-html-label.js ***! + \***********************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var util = __webpack_require__(/*! ../util */ "./node_modules/dagre-d3/lib/util.js"); + +module.exports = addHtmlLabel; + +function addHtmlLabel(root, node) { + var fo = root + .append("foreignObject") + .attr("width", "100000"); + + var div = fo + .append("xhtml:div"); + div.attr("xmlns", "http://www.w3.org/1999/xhtml"); + + var label = node.label; + switch(typeof label) { + case "function": + div.insert(label); + break; + case "object": + // Currently we assume this is a DOM object. + div.insert(function() { return label; }); + break; + default: div.html(label); + } + + util.applyStyle(div, node.labelStyle); + div.style("display", "inline-block"); + // Fix for firefox + div.style("white-space", "nowrap"); + + var client = div.node().getBoundingClientRect(); + fo + .attr("width", client.width) + .attr("height", client.height); + + return fo; +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/label/add-label.js": +/*!******************************************************!*\ + !*** ./node_modules/dagre-d3/lib/label/add-label.js ***! + \******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var addTextLabel = __webpack_require__(/*! ./add-text-label */ "./node_modules/dagre-d3/lib/label/add-text-label.js"); +var addHtmlLabel = __webpack_require__(/*! ./add-html-label */ "./node_modules/dagre-d3/lib/label/add-html-label.js"); +var addSVGLabel = __webpack_require__(/*! ./add-svg-label */ "./node_modules/dagre-d3/lib/label/add-svg-label.js"); + +module.exports = addLabel; + +function addLabel(root, node, location) { + var label = node.label; + var labelSvg = root.append("g"); + + // Allow the label to be a string, a function that returns a DOM element, or + // a DOM element itself. + if (node.labelType === "svg") { + addSVGLabel(labelSvg, node); + } else if (typeof label !== "string" || node.labelType === "html") { + addHtmlLabel(labelSvg, node); + } else { + addTextLabel(labelSvg, node); + } + + var labelBBox = labelSvg.node().getBBox(); + var y; + switch(location) { + case "top": + y = (-node.height / 2); + break; + case "bottom": + y = (node.height / 2) - labelBBox.height; + break; + default: + y = (-labelBBox.height / 2); + } + labelSvg.attr( + "transform", + "translate(" + (-labelBBox.width / 2) + "," + y + ")"); + + return labelSvg; +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/label/add-svg-label.js": +/*!**********************************************************!*\ + !*** ./node_modules/dagre-d3/lib/label/add-svg-label.js ***! + \**********************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var util = __webpack_require__(/*! ../util */ "./node_modules/dagre-d3/lib/util.js"); + +module.exports = addSVGLabel; + +function addSVGLabel(root, node) { + var domNode = root; + + domNode.node().appendChild(node.label); + + util.applyStyle(domNode, node.labelStyle); + + return domNode; +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/label/add-text-label.js": +/*!***********************************************************!*\ + !*** ./node_modules/dagre-d3/lib/label/add-text-label.js ***! + \***********************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var util = __webpack_require__(/*! ../util */ "./node_modules/dagre-d3/lib/util.js"); + +module.exports = addTextLabel; + +/* + * Attaches a text label to the specified root. Handles escape sequences. + */ +function addTextLabel(root, node) { + var domNode = root.append("text"); + + var lines = processEscapeSequences(node.label).split("\n"); + for (var i = 0; i < lines.length; i++) { + domNode.append("tspan") + .attr("xml:space", "preserve") + .attr("dy", "1em") + .attr("x", "1") + .text(lines[i]); + } + + util.applyStyle(domNode, node.labelStyle); + + return domNode; +} + +function processEscapeSequences(text) { + var newText = ""; + var escaped = false; + var ch; + for (var i = 0; i < text.length; ++i) { + ch = text[i]; + if (escaped) { + switch(ch) { + case "n": newText += "\n"; break; + default: newText += ch; + } + escaped = false; + } else if (ch === "\\") { + escaped = true; + } else { + newText += ch; + } + } + return newText; +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/lodash.js": +/*!*********************************************!*\ + !*** ./node_modules/dagre-d3/lib/lodash.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/* global window */ + +var lodash; + +if (true) { + try { + lodash = { + defaults: __webpack_require__(/*! lodash/defaults */ "./node_modules/lodash/defaults.js"), + each: __webpack_require__(/*! lodash/each */ "./node_modules/lodash/each.js"), + isFunction: __webpack_require__(/*! lodash/isFunction */ "./node_modules/lodash/isFunction.js"), + isPlainObject: __webpack_require__(/*! lodash/isPlainObject */ "./node_modules/lodash/isPlainObject.js"), + pick: __webpack_require__(/*! lodash/pick */ "./node_modules/lodash/pick.js"), + has: __webpack_require__(/*! lodash/has */ "./node_modules/lodash/has.js"), + range: __webpack_require__(/*! lodash/range */ "./node_modules/lodash/range.js"), + uniqueId: __webpack_require__(/*! lodash/uniqueId */ "./node_modules/lodash/uniqueId.js") + }; + } + catch (e) { + // continue regardless of error + } +} + +if (!lodash) { + lodash = window._; +} + +module.exports = lodash; + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/position-clusters.js": +/*!********************************************************!*\ + !*** ./node_modules/dagre-d3/lib/position-clusters.js ***! + \********************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var util = __webpack_require__(/*! ./util */ "./node_modules/dagre-d3/lib/util.js"); +var d3 = __webpack_require__(/*! ./d3 */ "./node_modules/dagre-d3/lib/d3.js"); + +module.exports = positionClusters; + +function positionClusters(selection, g) { + var created = selection.filter(function() { return !d3.select(this).classed("update"); }); + + function translate(v) { + var node = g.node(v); + return "translate(" + node.x + "," + node.y + ")"; + } + + created.attr("transform", translate); + + util.applyTransition(selection, g) + .style("opacity", 1) + .attr("transform", translate); + + util.applyTransition(created.selectAll("rect"), g) + .attr("width", function(v) { return g.node(v).width; }) + .attr("height", function(v) { return g.node(v).height; }) + .attr("x", function(v) { + var node = g.node(v); + return -node.width / 2; + }) + .attr("y", function(v) { + var node = g.node(v); + return -node.height / 2; + }); +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/position-edge-labels.js": +/*!***********************************************************!*\ + !*** ./node_modules/dagre-d3/lib/position-edge-labels.js ***! + \***********************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var util = __webpack_require__(/*! ./util */ "./node_modules/dagre-d3/lib/util.js"); +var d3 = __webpack_require__(/*! ./d3 */ "./node_modules/dagre-d3/lib/d3.js"); +var _ = __webpack_require__(/*! ./lodash */ "./node_modules/dagre-d3/lib/lodash.js"); + +module.exports = positionEdgeLabels; + +function positionEdgeLabels(selection, g) { + var created = selection.filter(function() { return !d3.select(this).classed("update"); }); + + function translate(e) { + var edge = g.edge(e); + return _.has(edge, "x") ? "translate(" + edge.x + "," + edge.y + ")" : ""; + } + + created.attr("transform", translate); + + util.applyTransition(selection, g) + .style("opacity", 1) + .attr("transform", translate); +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/position-nodes.js": +/*!*****************************************************!*\ + !*** ./node_modules/dagre-d3/lib/position-nodes.js ***! + \*****************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var util = __webpack_require__(/*! ./util */ "./node_modules/dagre-d3/lib/util.js"); +var d3 = __webpack_require__(/*! ./d3 */ "./node_modules/dagre-d3/lib/d3.js"); + +module.exports = positionNodes; + +function positionNodes(selection, g) { + var created = selection.filter(function() { return !d3.select(this).classed("update"); }); + + function translate(v) { + var node = g.node(v); + return "translate(" + node.x + "," + node.y + ")"; + } + + created.attr("transform", translate); + + util.applyTransition(selection, g) + .style("opacity", 1) + .attr("transform", translate); +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/render.js": +/*!*********************************************!*\ + !*** ./node_modules/dagre-d3/lib/render.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var _ = __webpack_require__(/*! ./lodash */ "./node_modules/dagre-d3/lib/lodash.js"); +var d3 = __webpack_require__(/*! ./d3 */ "./node_modules/dagre-d3/lib/d3.js"); +var layout = (__webpack_require__(/*! ./dagre */ "./node_modules/dagre-d3/lib/dagre.js").layout); + +module.exports = render; + +// This design is based on http://bost.ocks.org/mike/chart/. +function render() { + var createNodes = __webpack_require__(/*! ./create-nodes */ "./node_modules/dagre-d3/lib/create-nodes.js"); + var createClusters = __webpack_require__(/*! ./create-clusters */ "./node_modules/dagre-d3/lib/create-clusters.js"); + var createEdgeLabels = __webpack_require__(/*! ./create-edge-labels */ "./node_modules/dagre-d3/lib/create-edge-labels.js"); + var createEdgePaths = __webpack_require__(/*! ./create-edge-paths */ "./node_modules/dagre-d3/lib/create-edge-paths.js"); + var positionNodes = __webpack_require__(/*! ./position-nodes */ "./node_modules/dagre-d3/lib/position-nodes.js"); + var positionEdgeLabels = __webpack_require__(/*! ./position-edge-labels */ "./node_modules/dagre-d3/lib/position-edge-labels.js"); + var positionClusters = __webpack_require__(/*! ./position-clusters */ "./node_modules/dagre-d3/lib/position-clusters.js"); + var shapes = __webpack_require__(/*! ./shapes */ "./node_modules/dagre-d3/lib/shapes.js"); + var arrows = __webpack_require__(/*! ./arrows */ "./node_modules/dagre-d3/lib/arrows.js"); + + var fn = function(svg, g) { + preProcessGraph(g); + + var outputGroup = createOrSelectGroup(svg, "output"); + var clustersGroup = createOrSelectGroup(outputGroup, "clusters"); + var edgePathsGroup = createOrSelectGroup(outputGroup, "edgePaths"); + var edgeLabels = createEdgeLabels(createOrSelectGroup(outputGroup, "edgeLabels"), g); + var nodes = createNodes(createOrSelectGroup(outputGroup, "nodes"), g, shapes); + + layout(g); + + positionNodes(nodes, g); + positionEdgeLabels(edgeLabels, g); + createEdgePaths(edgePathsGroup, g, arrows); + + var clusters = createClusters(clustersGroup, g); + positionClusters(clusters, g); + + postProcessGraph(g); + }; + + fn.createNodes = function(value) { + if (!arguments.length) return createNodes; + createNodes = value; + return fn; + }; + + fn.createClusters = function(value) { + if (!arguments.length) return createClusters; + createClusters = value; + return fn; + }; + + fn.createEdgeLabels = function(value) { + if (!arguments.length) return createEdgeLabels; + createEdgeLabels = value; + return fn; + }; + + fn.createEdgePaths = function(value) { + if (!arguments.length) return createEdgePaths; + createEdgePaths = value; + return fn; + }; + + fn.shapes = function(value) { + if (!arguments.length) return shapes; + shapes = value; + return fn; + }; + + fn.arrows = function(value) { + if (!arguments.length) return arrows; + arrows = value; + return fn; + }; + + return fn; +} + +var NODE_DEFAULT_ATTRS = { + paddingLeft: 10, + paddingRight: 10, + paddingTop: 10, + paddingBottom: 10, + rx: 0, + ry: 0, + shape: "rect" +}; + +var EDGE_DEFAULT_ATTRS = { + arrowhead: "normal", + curve: d3.curveLinear +}; + +function preProcessGraph(g) { + g.nodes().forEach(function(v) { + var node = g.node(v); + if (!_.has(node, "label") && !g.children(v).length) { node.label = v; } + + if (_.has(node, "paddingX")) { + _.defaults(node, { + paddingLeft: node.paddingX, + paddingRight: node.paddingX + }); + } + + if (_.has(node, "paddingY")) { + _.defaults(node, { + paddingTop: node.paddingY, + paddingBottom: node.paddingY + }); + } + + if (_.has(node, "padding")) { + _.defaults(node, { + paddingLeft: node.padding, + paddingRight: node.padding, + paddingTop: node.padding, + paddingBottom: node.padding + }); + } + + _.defaults(node, NODE_DEFAULT_ATTRS); + + _.each(["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"], function(k) { + node[k] = Number(node[k]); + }); + + // Save dimensions for restore during post-processing + if (_.has(node, "width")) { node._prevWidth = node.width; } + if (_.has(node, "height")) { node._prevHeight = node.height; } + }); + + g.edges().forEach(function(e) { + var edge = g.edge(e); + if (!_.has(edge, "label")) { edge.label = ""; } + _.defaults(edge, EDGE_DEFAULT_ATTRS); + }); +} + +function postProcessGraph(g) { + _.each(g.nodes(), function(v) { + var node = g.node(v); + + // Restore original dimensions + if (_.has(node, "_prevWidth")) { + node.width = node._prevWidth; + } else { + delete node.width; + } + + if (_.has(node, "_prevHeight")) { + node.height = node._prevHeight; + } else { + delete node.height; + } + + delete node._prevWidth; + delete node._prevHeight; + }); +} + +function createOrSelectGroup(root, name) { + var selection = root.select("g." + name); + if (selection.empty()) { + selection = root.append("g").attr("class", name); + } + return selection; +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/shapes.js": +/*!*********************************************!*\ + !*** ./node_modules/dagre-d3/lib/shapes.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var intersectRect = __webpack_require__(/*! ./intersect/intersect-rect */ "./node_modules/dagre-d3/lib/intersect/intersect-rect.js"); +var intersectEllipse = __webpack_require__(/*! ./intersect/intersect-ellipse */ "./node_modules/dagre-d3/lib/intersect/intersect-ellipse.js"); +var intersectCircle = __webpack_require__(/*! ./intersect/intersect-circle */ "./node_modules/dagre-d3/lib/intersect/intersect-circle.js"); +var intersectPolygon = __webpack_require__(/*! ./intersect/intersect-polygon */ "./node_modules/dagre-d3/lib/intersect/intersect-polygon.js"); + +module.exports = { + rect: rect, + ellipse: ellipse, + circle: circle, + diamond: diamond +}; + +function rect(parent, bbox, node) { + var shapeSvg = parent.insert("rect", ":first-child") + .attr("rx", node.rx) + .attr("ry", node.ry) + .attr("x", -bbox.width / 2) + .attr("y", -bbox.height / 2) + .attr("width", bbox.width) + .attr("height", bbox.height); + + node.intersect = function(point) { + return intersectRect(node, point); + }; + + return shapeSvg; +} + +function ellipse(parent, bbox, node) { + var rx = bbox.width / 2; + var ry = bbox.height / 2; + var shapeSvg = parent.insert("ellipse", ":first-child") + .attr("x", -bbox.width / 2) + .attr("y", -bbox.height / 2) + .attr("rx", rx) + .attr("ry", ry); + + node.intersect = function(point) { + return intersectEllipse(node, rx, ry, point); + }; + + return shapeSvg; +} + +function circle(parent, bbox, node) { + var r = Math.max(bbox.width, bbox.height) / 2; + var shapeSvg = parent.insert("circle", ":first-child") + .attr("x", -bbox.width / 2) + .attr("y", -bbox.height / 2) + .attr("r", r); + + node.intersect = function(point) { + return intersectCircle(node, r, point); + }; + + return shapeSvg; +} + +// Circumscribe an ellipse for the bounding box with a diamond shape. I derived +// the function to calculate the diamond shape from: +// http://mathforum.org/kb/message.jspa?messageID=3750236 +function diamond(parent, bbox, node) { + var w = (bbox.width * Math.SQRT2) / 2; + var h = (bbox.height * Math.SQRT2) / 2; + var points = [ + { x: 0, y: -h }, + { x: -w, y: 0 }, + { x: 0, y: h }, + { x: w, y: 0 } + ]; + var shapeSvg = parent.insert("polygon", ":first-child") + .attr("points", points.map(function(p) { return p.x + "," + p.y; }).join(" ")); + + node.intersect = function(p) { + return intersectPolygon(node, points, p); + }; + + return shapeSvg; +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/util.js": +/*!*******************************************!*\ + !*** ./node_modules/dagre-d3/lib/util.js ***! + \*******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var _ = __webpack_require__(/*! ./lodash */ "./node_modules/dagre-d3/lib/lodash.js"); + +// Public utility functions +module.exports = { + isSubgraph: isSubgraph, + edgeToId: edgeToId, + applyStyle: applyStyle, + applyClass: applyClass, + applyTransition: applyTransition +}; + +/* + * Returns true if the specified node in the graph is a subgraph node. A + * subgraph node is one that contains other nodes. + */ +function isSubgraph(g, v) { + return !!g.children(v).length; +} + +function edgeToId(e) { + return escapeId(e.v) + ":" + escapeId(e.w) + ":" + escapeId(e.name); +} + +var ID_DELIM = /:/g; +function escapeId(str) { + return str ? String(str).replace(ID_DELIM, "\\:") : ""; +} + +function applyStyle(dom, styleFn) { + if (styleFn) { + dom.attr("style", styleFn); + } +} + +function applyClass(dom, classFn, otherClasses) { + if (classFn) { + dom + .attr("class", classFn) + .attr("class", otherClasses + " " + dom.attr("class")); + } +} + +function applyTransition(selection, g) { + var graph = g.graph(); + + if (_.isPlainObject(graph)) { + var transition = graph.transition; + if (_.isFunction(transition)) { + return transition(selection); + } + } + + return selection; +} + + +/***/ }), + +/***/ "./node_modules/dagre-d3/lib/version.js": +/*!**********************************************!*\ + !*** ./node_modules/dagre-d3/lib/version.js ***! + \**********************************************/ +/***/ ((module) => { + +module.exports = "0.6.4"; + + +/***/ }), + +/***/ "./node_modules/dagre/index.js": +/*!*************************************!*\ + !*** ./node_modules/dagre/index.js ***! + \*************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/* +Copyright (c) 2012-2014 Chris Pettitt + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +module.exports = { + graphlib: __webpack_require__(/*! ./lib/graphlib */ "./node_modules/dagre/lib/graphlib.js"), + + layout: __webpack_require__(/*! ./lib/layout */ "./node_modules/dagre/lib/layout.js"), + debug: __webpack_require__(/*! ./lib/debug */ "./node_modules/dagre/lib/debug.js"), + util: { + time: (__webpack_require__(/*! ./lib/util */ "./node_modules/dagre/lib/util.js").time), + notime: (__webpack_require__(/*! ./lib/util */ "./node_modules/dagre/lib/util.js").notime) + }, + version: __webpack_require__(/*! ./lib/version */ "./node_modules/dagre/lib/version.js") +}; + + +/***/ }), + +/***/ "./node_modules/dagre/lib/acyclic.js": +/*!*******************************************!*\ + !*** ./node_modules/dagre/lib/acyclic.js ***! + \*******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var _ = __webpack_require__(/*! ./lodash */ "./node_modules/dagre/lib/lodash.js"); +var greedyFAS = __webpack_require__(/*! ./greedy-fas */ "./node_modules/dagre/lib/greedy-fas.js"); + +module.exports = { + run: run, + undo: undo +}; + +function run(g) { + var fas = (g.graph().acyclicer === "greedy" + ? greedyFAS(g, weightFn(g)) + : dfsFAS(g)); + _.forEach(fas, function(e) { + var label = g.edge(e); + g.removeEdge(e); + label.forwardName = e.name; + label.reversed = true; + g.setEdge(e.w, e.v, label, _.uniqueId("rev")); + }); + + function weightFn(g) { + return function(e) { + return g.edge(e).weight; + }; + } +} + +function dfsFAS(g) { + var fas = []; + var stack = {}; + var visited = {}; + + function dfs(v) { + if (_.has(visited, v)) { + return; + } + visited[v] = true; + stack[v] = true; + _.forEach(g.outEdges(v), function(e) { + if (_.has(stack, e.w)) { + fas.push(e); + } else { + dfs(e.w); + } + }); + delete stack[v]; + } + + _.forEach(g.nodes(), dfs); + return fas; +} + +function undo(g) { + _.forEach(g.edges(), function(e) { + var label = g.edge(e); + if (label.reversed) { + g.removeEdge(e); + + var forwardName = label.forwardName; + delete label.reversed; + delete label.forwardName; + g.setEdge(e.w, e.v, label, forwardName); + } + }); +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/add-border-segments.js": +/*!*******************************************************!*\ + !*** ./node_modules/dagre/lib/add-border-segments.js ***! + \*******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var _ = __webpack_require__(/*! ./lodash */ "./node_modules/dagre/lib/lodash.js"); +var util = __webpack_require__(/*! ./util */ "./node_modules/dagre/lib/util.js"); + +module.exports = addBorderSegments; + +function addBorderSegments(g) { + function dfs(v) { + var children = g.children(v); + var node = g.node(v); + if (children.length) { + _.forEach(children, dfs); + } + + if (_.has(node, "minRank")) { + node.borderLeft = []; + node.borderRight = []; + for (var rank = node.minRank, maxRank = node.maxRank + 1; + rank < maxRank; + ++rank) { + addBorderNode(g, "borderLeft", "_bl", v, node, rank); + addBorderNode(g, "borderRight", "_br", v, node, rank); + } + } + } + + _.forEach(g.children(), dfs); +} + +function addBorderNode(g, prop, prefix, sg, sgNode, rank) { + var label = { width: 0, height: 0, rank: rank, borderType: prop }; + var prev = sgNode[prop][rank - 1]; + var curr = util.addDummyNode(g, "border", label, prefix); + sgNode[prop][rank] = curr; + g.setParent(curr, sg); + if (prev) { + g.setEdge(prev, curr, { weight: 1 }); + } +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/coordinate-system.js": +/*!*****************************************************!*\ + !*** ./node_modules/dagre/lib/coordinate-system.js ***! + \*****************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var _ = __webpack_require__(/*! ./lodash */ "./node_modules/dagre/lib/lodash.js"); + +module.exports = { + adjust: adjust, + undo: undo +}; + +function adjust(g) { + var rankDir = g.graph().rankdir.toLowerCase(); + if (rankDir === "lr" || rankDir === "rl") { + swapWidthHeight(g); + } +} + +function undo(g) { + var rankDir = g.graph().rankdir.toLowerCase(); + if (rankDir === "bt" || rankDir === "rl") { + reverseY(g); + } + + if (rankDir === "lr" || rankDir === "rl") { + swapXY(g); + swapWidthHeight(g); + } +} + +function swapWidthHeight(g) { + _.forEach(g.nodes(), function(v) { swapWidthHeightOne(g.node(v)); }); + _.forEach(g.edges(), function(e) { swapWidthHeightOne(g.edge(e)); }); +} + +function swapWidthHeightOne(attrs) { + var w = attrs.width; + attrs.width = attrs.height; + attrs.height = w; +} + +function reverseY(g) { + _.forEach(g.nodes(), function(v) { reverseYOne(g.node(v)); }); + + _.forEach(g.edges(), function(e) { + var edge = g.edge(e); + _.forEach(edge.points, reverseYOne); + if (_.has(edge, "y")) { + reverseYOne(edge); + } + }); +} + +function reverseYOne(attrs) { + attrs.y = -attrs.y; +} + +function swapXY(g) { + _.forEach(g.nodes(), function(v) { swapXYOne(g.node(v)); }); + + _.forEach(g.edges(), function(e) { + var edge = g.edge(e); + _.forEach(edge.points, swapXYOne); + if (_.has(edge, "x")) { + swapXYOne(edge); + } + }); +} + +function swapXYOne(attrs) { + var x = attrs.x; + attrs.x = attrs.y; + attrs.y = x; +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/data/list.js": +/*!*********************************************!*\ + !*** ./node_modules/dagre/lib/data/list.js ***! + \*********************************************/ +/***/ ((module) => { + +/* + * Simple doubly linked list implementation derived from Cormen, et al., + * "Introduction to Algorithms". + */ + +module.exports = List; + +function List() { + var sentinel = {}; + sentinel._next = sentinel._prev = sentinel; + this._sentinel = sentinel; +} + +List.prototype.dequeue = function() { + var sentinel = this._sentinel; + var entry = sentinel._prev; + if (entry !== sentinel) { + unlink(entry); + return entry; + } +}; + +List.prototype.enqueue = function(entry) { + var sentinel = this._sentinel; + if (entry._prev && entry._next) { + unlink(entry); + } + entry._next = sentinel._next; + sentinel._next._prev = entry; + sentinel._next = entry; + entry._prev = sentinel; +}; + +List.prototype.toString = function() { + var strs = []; + var sentinel = this._sentinel; + var curr = sentinel._prev; + while (curr !== sentinel) { + strs.push(JSON.stringify(curr, filterOutLinks)); + curr = curr._prev; + } + return "[" + strs.join(", ") + "]"; +}; + +function unlink(entry) { + entry._prev._next = entry._next; + entry._next._prev = entry._prev; + delete entry._next; + delete entry._prev; +} + +function filterOutLinks(k, v) { + if (k !== "_next" && k !== "_prev") { + return v; + } +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/debug.js": +/*!*****************************************!*\ + !*** ./node_modules/dagre/lib/debug.js ***! + \*****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var _ = __webpack_require__(/*! ./lodash */ "./node_modules/dagre/lib/lodash.js"); +var util = __webpack_require__(/*! ./util */ "./node_modules/dagre/lib/util.js"); +var Graph = (__webpack_require__(/*! ./graphlib */ "./node_modules/dagre/lib/graphlib.js").Graph); + +module.exports = { + debugOrdering: debugOrdering +}; + +/* istanbul ignore next */ +function debugOrdering(g) { + var layerMatrix = util.buildLayerMatrix(g); + + var h = new Graph({ compound: true, multigraph: true }).setGraph({}); + + _.forEach(g.nodes(), function(v) { + h.setNode(v, { label: v }); + h.setParent(v, "layer" + g.node(v).rank); + }); + + _.forEach(g.edges(), function(e) { + h.setEdge(e.v, e.w, {}, e.name); + }); + + _.forEach(layerMatrix, function(layer, i) { + var layerV = "layer" + i; + h.setNode(layerV, { rank: "same" }); + _.reduce(layer, function(u, v) { + h.setEdge(u, v, { style: "invis" }); + return v; + }); + }); + + return h; +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/graphlib.js": +/*!********************************************!*\ + !*** ./node_modules/dagre/lib/graphlib.js ***! + \********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/* global window */ + +var graphlib; + +if (true) { + try { + graphlib = __webpack_require__(/*! graphlib */ "./node_modules/graphlib/index.js"); + } catch (e) { + // continue regardless of error + } +} + +if (!graphlib) { + graphlib = window.graphlib; +} + +module.exports = graphlib; + + +/***/ }), + +/***/ "./node_modules/dagre/lib/greedy-fas.js": +/*!**********************************************!*\ + !*** ./node_modules/dagre/lib/greedy-fas.js ***! + \**********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var _ = __webpack_require__(/*! ./lodash */ "./node_modules/dagre/lib/lodash.js"); +var Graph = (__webpack_require__(/*! ./graphlib */ "./node_modules/dagre/lib/graphlib.js").Graph); +var List = __webpack_require__(/*! ./data/list */ "./node_modules/dagre/lib/data/list.js"); + +/* + * A greedy heuristic for finding a feedback arc set for a graph. A feedback + * arc set is a set of edges that can be removed to make a graph acyclic. + * The algorithm comes from: P. Eades, X. Lin, and W. F. Smyth, "A fast and + * effective heuristic for the feedback arc set problem." This implementation + * adjusts that from the paper to allow for weighted edges. + */ +module.exports = greedyFAS; + +var DEFAULT_WEIGHT_FN = _.constant(1); + +function greedyFAS(g, weightFn) { + if (g.nodeCount() <= 1) { + return []; + } + var state = buildState(g, weightFn || DEFAULT_WEIGHT_FN); + var results = doGreedyFAS(state.graph, state.buckets, state.zeroIdx); + + // Expand multi-edges + return _.flatten(_.map(results, function(e) { + return g.outEdges(e.v, e.w); + }), true); +} + +function doGreedyFAS(g, buckets, zeroIdx) { + var results = []; + var sources = buckets[buckets.length - 1]; + var sinks = buckets[0]; + + var entry; + while (g.nodeCount()) { + while ((entry = sinks.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } + while ((entry = sources.dequeue())) { removeNode(g, buckets, zeroIdx, entry); } + if (g.nodeCount()) { + for (var i = buckets.length - 2; i > 0; --i) { + entry = buckets[i].dequeue(); + if (entry) { + results = results.concat(removeNode(g, buckets, zeroIdx, entry, true)); + break; + } + } + } + } + + return results; +} + +function removeNode(g, buckets, zeroIdx, entry, collectPredecessors) { + var results = collectPredecessors ? [] : undefined; + + _.forEach(g.inEdges(entry.v), function(edge) { + var weight = g.edge(edge); + var uEntry = g.node(edge.v); + + if (collectPredecessors) { + results.push({ v: edge.v, w: edge.w }); + } + + uEntry.out -= weight; + assignBucket(buckets, zeroIdx, uEntry); + }); + + _.forEach(g.outEdges(entry.v), function(edge) { + var weight = g.edge(edge); + var w = edge.w; + var wEntry = g.node(w); + wEntry["in"] -= weight; + assignBucket(buckets, zeroIdx, wEntry); + }); + + g.removeNode(entry.v); + + return results; +} + +function buildState(g, weightFn) { + var fasGraph = new Graph(); + var maxIn = 0; + var maxOut = 0; + + _.forEach(g.nodes(), function(v) { + fasGraph.setNode(v, { v: v, "in": 0, out: 0 }); + }); + + // Aggregate weights on nodes, but also sum the weights across multi-edges + // into a single edge for the fasGraph. + _.forEach(g.edges(), function(e) { + var prevWeight = fasGraph.edge(e.v, e.w) || 0; + var weight = weightFn(e); + var edgeWeight = prevWeight + weight; + fasGraph.setEdge(e.v, e.w, edgeWeight); + maxOut = Math.max(maxOut, fasGraph.node(e.v).out += weight); + maxIn = Math.max(maxIn, fasGraph.node(e.w)["in"] += weight); + }); + + var buckets = _.range(maxOut + maxIn + 3).map(function() { return new List(); }); + var zeroIdx = maxIn + 1; + + _.forEach(fasGraph.nodes(), function(v) { + assignBucket(buckets, zeroIdx, fasGraph.node(v)); + }); + + return { graph: fasGraph, buckets: buckets, zeroIdx: zeroIdx }; +} + +function assignBucket(buckets, zeroIdx, entry) { + if (!entry.out) { + buckets[0].enqueue(entry); + } else if (!entry["in"]) { + buckets[buckets.length - 1].enqueue(entry); + } else { + buckets[entry.out - entry["in"] + zeroIdx].enqueue(entry); + } +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/layout.js": +/*!******************************************!*\ + !*** ./node_modules/dagre/lib/layout.js ***! + \******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var _ = __webpack_require__(/*! ./lodash */ "./node_modules/dagre/lib/lodash.js"); +var acyclic = __webpack_require__(/*! ./acyclic */ "./node_modules/dagre/lib/acyclic.js"); +var normalize = __webpack_require__(/*! ./normalize */ "./node_modules/dagre/lib/normalize.js"); +var rank = __webpack_require__(/*! ./rank */ "./node_modules/dagre/lib/rank/index.js"); +var normalizeRanks = (__webpack_require__(/*! ./util */ "./node_modules/dagre/lib/util.js").normalizeRanks); +var parentDummyChains = __webpack_require__(/*! ./parent-dummy-chains */ "./node_modules/dagre/lib/parent-dummy-chains.js"); +var removeEmptyRanks = (__webpack_require__(/*! ./util */ "./node_modules/dagre/lib/util.js").removeEmptyRanks); +var nestingGraph = __webpack_require__(/*! ./nesting-graph */ "./node_modules/dagre/lib/nesting-graph.js"); +var addBorderSegments = __webpack_require__(/*! ./add-border-segments */ "./node_modules/dagre/lib/add-border-segments.js"); +var coordinateSystem = __webpack_require__(/*! ./coordinate-system */ "./node_modules/dagre/lib/coordinate-system.js"); +var order = __webpack_require__(/*! ./order */ "./node_modules/dagre/lib/order/index.js"); +var position = __webpack_require__(/*! ./position */ "./node_modules/dagre/lib/position/index.js"); +var util = __webpack_require__(/*! ./util */ "./node_modules/dagre/lib/util.js"); +var Graph = (__webpack_require__(/*! ./graphlib */ "./node_modules/dagre/lib/graphlib.js").Graph); + +module.exports = layout; + +function layout(g, opts) { + var time = opts && opts.debugTiming ? util.time : util.notime; + time("layout", function() { + var layoutGraph = + time(" buildLayoutGraph", function() { return buildLayoutGraph(g); }); + time(" runLayout", function() { runLayout(layoutGraph, time); }); + time(" updateInputGraph", function() { updateInputGraph(g, layoutGraph); }); + }); +} + +function runLayout(g, time) { + time(" makeSpaceForEdgeLabels", function() { makeSpaceForEdgeLabels(g); }); + time(" removeSelfEdges", function() { removeSelfEdges(g); }); + time(" acyclic", function() { acyclic.run(g); }); + time(" nestingGraph.run", function() { nestingGraph.run(g); }); + time(" rank", function() { rank(util.asNonCompoundGraph(g)); }); + time(" injectEdgeLabelProxies", function() { injectEdgeLabelProxies(g); }); + time(" removeEmptyRanks", function() { removeEmptyRanks(g); }); + time(" nestingGraph.cleanup", function() { nestingGraph.cleanup(g); }); + time(" normalizeRanks", function() { normalizeRanks(g); }); + time(" assignRankMinMax", function() { assignRankMinMax(g); }); + time(" removeEdgeLabelProxies", function() { removeEdgeLabelProxies(g); }); + time(" normalize.run", function() { normalize.run(g); }); + time(" parentDummyChains", function() { parentDummyChains(g); }); + time(" addBorderSegments", function() { addBorderSegments(g); }); + time(" order", function() { order(g); }); + time(" insertSelfEdges", function() { insertSelfEdges(g); }); + time(" adjustCoordinateSystem", function() { coordinateSystem.adjust(g); }); + time(" position", function() { position(g); }); + time(" positionSelfEdges", function() { positionSelfEdges(g); }); + time(" removeBorderNodes", function() { removeBorderNodes(g); }); + time(" normalize.undo", function() { normalize.undo(g); }); + time(" fixupEdgeLabelCoords", function() { fixupEdgeLabelCoords(g); }); + time(" undoCoordinateSystem", function() { coordinateSystem.undo(g); }); + time(" translateGraph", function() { translateGraph(g); }); + time(" assignNodeIntersects", function() { assignNodeIntersects(g); }); + time(" reversePoints", function() { reversePointsForReversedEdges(g); }); + time(" acyclic.undo", function() { acyclic.undo(g); }); +} + +/* + * Copies final layout information from the layout graph back to the input + * graph. This process only copies whitelisted attributes from the layout graph + * to the input graph, so it serves as a good place to determine what + * attributes can influence layout. + */ +function updateInputGraph(inputGraph, layoutGraph) { + _.forEach(inputGraph.nodes(), function(v) { + var inputLabel = inputGraph.node(v); + var layoutLabel = layoutGraph.node(v); + + if (inputLabel) { + inputLabel.x = layoutLabel.x; + inputLabel.y = layoutLabel.y; + + if (layoutGraph.children(v).length) { + inputLabel.width = layoutLabel.width; + inputLabel.height = layoutLabel.height; + } + } + }); + + _.forEach(inputGraph.edges(), function(e) { + var inputLabel = inputGraph.edge(e); + var layoutLabel = layoutGraph.edge(e); + + inputLabel.points = layoutLabel.points; + if (_.has(layoutLabel, "x")) { + inputLabel.x = layoutLabel.x; + inputLabel.y = layoutLabel.y; + } + }); + + inputGraph.graph().width = layoutGraph.graph().width; + inputGraph.graph().height = layoutGraph.graph().height; +} + +var graphNumAttrs = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"]; +var graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }; +var graphAttrs = ["acyclicer", "ranker", "rankdir", "align"]; +var nodeNumAttrs = ["width", "height"]; +var nodeDefaults = { width: 0, height: 0 }; +var edgeNumAttrs = ["minlen", "weight", "width", "height", "labeloffset"]; +var edgeDefaults = { + minlen: 1, weight: 1, width: 0, height: 0, + labeloffset: 10, labelpos: "r" +}; +var edgeAttrs = ["labelpos"]; + +/* + * Constructs a new graph from the input graph, which can be used for layout. + * This process copies only whitelisted attributes from the input graph to the + * layout graph. Thus this function serves as a good place to determine what + * attributes can influence layout. + */ +function buildLayoutGraph(inputGraph) { + var g = new Graph({ multigraph: true, compound: true }); + var graph = canonicalize(inputGraph.graph()); + + g.setGraph(_.merge({}, + graphDefaults, + selectNumberAttrs(graph, graphNumAttrs), + _.pick(graph, graphAttrs))); + + _.forEach(inputGraph.nodes(), function(v) { + var node = canonicalize(inputGraph.node(v)); + g.setNode(v, _.defaults(selectNumberAttrs(node, nodeNumAttrs), nodeDefaults)); + g.setParent(v, inputGraph.parent(v)); + }); + + _.forEach(inputGraph.edges(), function(e) { + var edge = canonicalize(inputGraph.edge(e)); + g.setEdge(e, _.merge({}, + edgeDefaults, + selectNumberAttrs(edge, edgeNumAttrs), + _.pick(edge, edgeAttrs))); + }); + + return g; +} + +/* + * This idea comes from the Gansner paper: to account for edge labels in our + * layout we split each rank in half by doubling minlen and halving ranksep. + * Then we can place labels at these mid-points between nodes. + * + * We also add some minimal padding to the width to push the label for the edge + * away from the edge itself a bit. + */ +function makeSpaceForEdgeLabels(g) { + var graph = g.graph(); + graph.ranksep /= 2; + _.forEach(g.edges(), function(e) { + var edge = g.edge(e); + edge.minlen *= 2; + if (edge.labelpos.toLowerCase() !== "c") { + if (graph.rankdir === "TB" || graph.rankdir === "BT") { + edge.width += edge.labeloffset; + } else { + edge.height += edge.labeloffset; + } + } + }); +} + +/* + * Creates temporary dummy nodes that capture the rank in which each edge's + * label is going to, if it has one of non-zero width and height. We do this + * so that we can safely remove empty ranks while preserving balance for the + * label's position. + */ +function injectEdgeLabelProxies(g) { + _.forEach(g.edges(), function(e) { + var edge = g.edge(e); + if (edge.width && edge.height) { + var v = g.node(e.v); + var w = g.node(e.w); + var label = { rank: (w.rank - v.rank) / 2 + v.rank, e: e }; + util.addDummyNode(g, "edge-proxy", label, "_ep"); + } + }); +} + +function assignRankMinMax(g) { + var maxRank = 0; + _.forEach(g.nodes(), function(v) { + var node = g.node(v); + if (node.borderTop) { + node.minRank = g.node(node.borderTop).rank; + node.maxRank = g.node(node.borderBottom).rank; + maxRank = _.max(maxRank, node.maxRank); + } + }); + g.graph().maxRank = maxRank; +} + +function removeEdgeLabelProxies(g) { + _.forEach(g.nodes(), function(v) { + var node = g.node(v); + if (node.dummy === "edge-proxy") { + g.edge(node.e).labelRank = node.rank; + g.removeNode(v); + } + }); +} + +function translateGraph(g) { + var minX = Number.POSITIVE_INFINITY; + var maxX = 0; + var minY = Number.POSITIVE_INFINITY; + var maxY = 0; + var graphLabel = g.graph(); + var marginX = graphLabel.marginx || 0; + var marginY = graphLabel.marginy || 0; + + function getExtremes(attrs) { + var x = attrs.x; + var y = attrs.y; + var w = attrs.width; + var h = attrs.height; + minX = Math.min(minX, x - w / 2); + maxX = Math.max(maxX, x + w / 2); + minY = Math.min(minY, y - h / 2); + maxY = Math.max(maxY, y + h / 2); + } + + _.forEach(g.nodes(), function(v) { getExtremes(g.node(v)); }); + _.forEach(g.edges(), function(e) { + var edge = g.edge(e); + if (_.has(edge, "x")) { + getExtremes(edge); + } + }); + + minX -= marginX; + minY -= marginY; + + _.forEach(g.nodes(), function(v) { + var node = g.node(v); + node.x -= minX; + node.y -= minY; + }); + + _.forEach(g.edges(), function(e) { + var edge = g.edge(e); + _.forEach(edge.points, function(p) { + p.x -= minX; + p.y -= minY; + }); + if (_.has(edge, "x")) { edge.x -= minX; } + if (_.has(edge, "y")) { edge.y -= minY; } + }); + + graphLabel.width = maxX - minX + marginX; + graphLabel.height = maxY - minY + marginY; +} + +function assignNodeIntersects(g) { + _.forEach(g.edges(), function(e) { + var edge = g.edge(e); + var nodeV = g.node(e.v); + var nodeW = g.node(e.w); + var p1, p2; + if (!edge.points) { + edge.points = []; + p1 = nodeW; + p2 = nodeV; + } else { + p1 = edge.points[0]; + p2 = edge.points[edge.points.length - 1]; + } + edge.points.unshift(util.intersectRect(nodeV, p1)); + edge.points.push(util.intersectRect(nodeW, p2)); + }); +} + +function fixupEdgeLabelCoords(g) { + _.forEach(g.edges(), function(e) { + var edge = g.edge(e); + if (_.has(edge, "x")) { + if (edge.labelpos === "l" || edge.labelpos === "r") { + edge.width -= edge.labeloffset; + } + switch (edge.labelpos) { + case "l": edge.x -= edge.width / 2 + edge.labeloffset; break; + case "r": edge.x += edge.width / 2 + edge.labeloffset; break; + } + } + }); +} + +function reversePointsForReversedEdges(g) { + _.forEach(g.edges(), function(e) { + var edge = g.edge(e); + if (edge.reversed) { + edge.points.reverse(); + } + }); +} + +function removeBorderNodes(g) { + _.forEach(g.nodes(), function(v) { + if (g.children(v).length) { + var node = g.node(v); + var t = g.node(node.borderTop); + var b = g.node(node.borderBottom); + var l = g.node(_.last(node.borderLeft)); + var r = g.node(_.last(node.borderRight)); + + node.width = Math.abs(r.x - l.x); + node.height = Math.abs(b.y - t.y); + node.x = l.x + node.width / 2; + node.y = t.y + node.height / 2; + } + }); + + _.forEach(g.nodes(), function(v) { + if (g.node(v).dummy === "border") { + g.removeNode(v); + } + }); +} + +function removeSelfEdges(g) { + _.forEach(g.edges(), function(e) { + if (e.v === e.w) { + var node = g.node(e.v); + if (!node.selfEdges) { + node.selfEdges = []; + } + node.selfEdges.push({ e: e, label: g.edge(e) }); + g.removeEdge(e); + } + }); +} + +function insertSelfEdges(g) { + var layers = util.buildLayerMatrix(g); + _.forEach(layers, function(layer) { + var orderShift = 0; + _.forEach(layer, function(v, i) { + var node = g.node(v); + node.order = i + orderShift; + _.forEach(node.selfEdges, function(selfEdge) { + util.addDummyNode(g, "selfedge", { + width: selfEdge.label.width, + height: selfEdge.label.height, + rank: node.rank, + order: i + (++orderShift), + e: selfEdge.e, + label: selfEdge.label + }, "_se"); + }); + delete node.selfEdges; + }); + }); +} + +function positionSelfEdges(g) { + _.forEach(g.nodes(), function(v) { + var node = g.node(v); + if (node.dummy === "selfedge") { + var selfNode = g.node(node.e.v); + var x = selfNode.x + selfNode.width / 2; + var y = selfNode.y; + var dx = node.x - x; + var dy = selfNode.height / 2; + g.setEdge(node.e, node.label); + g.removeNode(v); + node.label.points = [ + { x: x + 2 * dx / 3, y: y - dy }, + { x: x + 5 * dx / 6, y: y - dy }, + { x: x + dx , y: y }, + { x: x + 5 * dx / 6, y: y + dy }, + { x: x + 2 * dx / 3, y: y + dy } + ]; + node.label.x = node.x; + node.label.y = node.y; + } + }); +} + +function selectNumberAttrs(obj, attrs) { + return _.mapValues(_.pick(obj, attrs), Number); +} + +function canonicalize(attrs) { + var newAttrs = {}; + _.forEach(attrs, function(v, k) { + newAttrs[k.toLowerCase()] = v; + }); + return newAttrs; +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/lodash.js": +/*!******************************************!*\ + !*** ./node_modules/dagre/lib/lodash.js ***! + \******************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/* global window */ + +var lodash; + +if (true) { + try { + lodash = { + cloneDeep: __webpack_require__(/*! lodash/cloneDeep */ "./node_modules/lodash/cloneDeep.js"), + constant: __webpack_require__(/*! lodash/constant */ "./node_modules/lodash/constant.js"), + defaults: __webpack_require__(/*! lodash/defaults */ "./node_modules/lodash/defaults.js"), + each: __webpack_require__(/*! lodash/each */ "./node_modules/lodash/each.js"), + filter: __webpack_require__(/*! lodash/filter */ "./node_modules/lodash/filter.js"), + find: __webpack_require__(/*! lodash/find */ "./node_modules/lodash/find.js"), + flatten: __webpack_require__(/*! lodash/flatten */ "./node_modules/lodash/flatten.js"), + forEach: __webpack_require__(/*! lodash/forEach */ "./node_modules/lodash/forEach.js"), + forIn: __webpack_require__(/*! lodash/forIn */ "./node_modules/lodash/forIn.js"), + has: __webpack_require__(/*! lodash/has */ "./node_modules/lodash/has.js"), + isUndefined: __webpack_require__(/*! lodash/isUndefined */ "./node_modules/lodash/isUndefined.js"), + last: __webpack_require__(/*! lodash/last */ "./node_modules/lodash/last.js"), + map: __webpack_require__(/*! lodash/map */ "./node_modules/lodash/map.js"), + mapValues: __webpack_require__(/*! lodash/mapValues */ "./node_modules/lodash/mapValues.js"), + max: __webpack_require__(/*! lodash/max */ "./node_modules/lodash/max.js"), + merge: __webpack_require__(/*! lodash/merge */ "./node_modules/lodash/merge.js"), + min: __webpack_require__(/*! lodash/min */ "./node_modules/lodash/min.js"), + minBy: __webpack_require__(/*! lodash/minBy */ "./node_modules/lodash/minBy.js"), + now: __webpack_require__(/*! lodash/now */ "./node_modules/lodash/now.js"), + pick: __webpack_require__(/*! lodash/pick */ "./node_modules/lodash/pick.js"), + range: __webpack_require__(/*! lodash/range */ "./node_modules/lodash/range.js"), + reduce: __webpack_require__(/*! lodash/reduce */ "./node_modules/lodash/reduce.js"), + sortBy: __webpack_require__(/*! lodash/sortBy */ "./node_modules/lodash/sortBy.js"), + uniqueId: __webpack_require__(/*! lodash/uniqueId */ "./node_modules/lodash/uniqueId.js"), + values: __webpack_require__(/*! lodash/values */ "./node_modules/lodash/values.js"), + zipObject: __webpack_require__(/*! lodash/zipObject */ "./node_modules/lodash/zipObject.js"), + }; + } catch (e) { + // continue regardless of error + } +} + +if (!lodash) { + lodash = window._; +} + +module.exports = lodash; + + +/***/ }), + +/***/ "./node_modules/dagre/lib/nesting-graph.js": +/*!*************************************************!*\ + !*** ./node_modules/dagre/lib/nesting-graph.js ***! + \*************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var _ = __webpack_require__(/*! ./lodash */ "./node_modules/dagre/lib/lodash.js"); +var util = __webpack_require__(/*! ./util */ "./node_modules/dagre/lib/util.js"); + +module.exports = { + run: run, + cleanup: cleanup +}; + +/* + * A nesting graph creates dummy nodes for the tops and bottoms of subgraphs, + * adds appropriate edges to ensure that all cluster nodes are placed between + * these boundries, and ensures that the graph is connected. + * + * In addition we ensure, through the use of the minlen property, that nodes + * and subgraph border nodes to not end up on the same rank. + * + * Preconditions: + * + * 1. Input graph is a DAG + * 2. Nodes in the input graph has a minlen attribute + * + * Postconditions: + * + * 1. Input graph is connected. + * 2. Dummy nodes are added for the tops and bottoms of subgraphs. + * 3. The minlen attribute for nodes is adjusted to ensure nodes do not + * get placed on the same rank as subgraph border nodes. + * + * The nesting graph idea comes from Sander, "Layout of Compound Directed + * Graphs." + */ +function run(g) { + var root = util.addDummyNode(g, "root", {}, "_root"); + var depths = treeDepths(g); + var height = _.max(_.values(depths)) - 1; // Note: depths is an Object not an array + var nodeSep = 2 * height + 1; + + g.graph().nestingRoot = root; + + // Multiply minlen by nodeSep to align nodes on non-border ranks. + _.forEach(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; }); + + // Calculate a weight that is sufficient to keep subgraphs vertically compact + var weight = sumWeights(g) + 1; + + // Create border nodes and link them up + _.forEach(g.children(), function(child) { + dfs(g, root, nodeSep, weight, height, depths, child); + }); + + // Save the multiplier for node layers for later removal of empty border + // layers. + g.graph().nodeRankFactor = nodeSep; +} + +function dfs(g, root, nodeSep, weight, height, depths, v) { + var children = g.children(v); + if (!children.length) { + if (v !== root) { + g.setEdge(root, v, { weight: 0, minlen: nodeSep }); + } + return; + } + + var top = util.addBorderNode(g, "_bt"); + var bottom = util.addBorderNode(g, "_bb"); + var label = g.node(v); + + g.setParent(top, v); + label.borderTop = top; + g.setParent(bottom, v); + label.borderBottom = bottom; + + _.forEach(children, function(child) { + dfs(g, root, nodeSep, weight, height, depths, child); + + var childNode = g.node(child); + var childTop = childNode.borderTop ? childNode.borderTop : child; + var childBottom = childNode.borderBottom ? childNode.borderBottom : child; + var thisWeight = childNode.borderTop ? weight : 2 * weight; + var minlen = childTop !== childBottom ? 1 : height - depths[v] + 1; + + g.setEdge(top, childTop, { + weight: thisWeight, + minlen: minlen, + nestingEdge: true + }); + + g.setEdge(childBottom, bottom, { + weight: thisWeight, + minlen: minlen, + nestingEdge: true + }); + }); + + if (!g.parent(v)) { + g.setEdge(root, top, { weight: 0, minlen: height + depths[v] }); + } +} + +function treeDepths(g) { + var depths = {}; + function dfs(v, depth) { + var children = g.children(v); + if (children && children.length) { + _.forEach(children, function(child) { + dfs(child, depth + 1); + }); + } + depths[v] = depth; + } + _.forEach(g.children(), function(v) { dfs(v, 1); }); + return depths; +} + +function sumWeights(g) { + return _.reduce(g.edges(), function(acc, e) { + return acc + g.edge(e).weight; + }, 0); +} + +function cleanup(g) { + var graphLabel = g.graph(); + g.removeNode(graphLabel.nestingRoot); + delete graphLabel.nestingRoot; + _.forEach(g.edges(), function(e) { + var edge = g.edge(e); + if (edge.nestingEdge) { + g.removeEdge(e); + } + }); +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/normalize.js": +/*!*********************************************!*\ + !*** ./node_modules/dagre/lib/normalize.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var _ = __webpack_require__(/*! ./lodash */ "./node_modules/dagre/lib/lodash.js"); +var util = __webpack_require__(/*! ./util */ "./node_modules/dagre/lib/util.js"); + +module.exports = { + run: run, + undo: undo +}; + +/* + * Breaks any long edges in the graph into short segments that span 1 layer + * each. This operation is undoable with the denormalize function. + * + * Pre-conditions: + * + * 1. The input graph is a DAG. + * 2. Each node in the graph has a "rank" property. + * + * Post-condition: + * + * 1. All edges in the graph have a length of 1. + * 2. Dummy nodes are added where edges have been split into segments. + * 3. The graph is augmented with a "dummyChains" attribute which contains + * the first dummy in each chain of dummy nodes produced. + */ +function run(g) { + g.graph().dummyChains = []; + _.forEach(g.edges(), function(edge) { normalizeEdge(g, edge); }); +} + +function normalizeEdge(g, e) { + var v = e.v; + var vRank = g.node(v).rank; + var w = e.w; + var wRank = g.node(w).rank; + var name = e.name; + var edgeLabel = g.edge(e); + var labelRank = edgeLabel.labelRank; + + if (wRank === vRank + 1) return; + + g.removeEdge(e); + + var dummy, attrs, i; + for (i = 0, ++vRank; vRank < wRank; ++i, ++vRank) { + edgeLabel.points = []; + attrs = { + width: 0, height: 0, + edgeLabel: edgeLabel, edgeObj: e, + rank: vRank + }; + dummy = util.addDummyNode(g, "edge", attrs, "_d"); + if (vRank === labelRank) { + attrs.width = edgeLabel.width; + attrs.height = edgeLabel.height; + attrs.dummy = "edge-label"; + attrs.labelpos = edgeLabel.labelpos; + } + g.setEdge(v, dummy, { weight: edgeLabel.weight }, name); + if (i === 0) { + g.graph().dummyChains.push(dummy); + } + v = dummy; + } + + g.setEdge(v, w, { weight: edgeLabel.weight }, name); +} + +function undo(g) { + _.forEach(g.graph().dummyChains, function(v) { + var node = g.node(v); + var origLabel = node.edgeLabel; + var w; + g.setEdge(node.edgeObj, origLabel); + while (node.dummy) { + w = g.successors(v)[0]; + g.removeNode(v); + origLabel.points.push({ x: node.x, y: node.y }); + if (node.dummy === "edge-label") { + origLabel.x = node.x; + origLabel.y = node.y; + origLabel.width = node.width; + origLabel.height = node.height; + } + v = w; + node = g.node(v); + } + }); +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/order/add-subgraph-constraints.js": +/*!******************************************************************!*\ + !*** ./node_modules/dagre/lib/order/add-subgraph-constraints.js ***! + \******************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var _ = __webpack_require__(/*! ../lodash */ "./node_modules/dagre/lib/lodash.js"); + +module.exports = addSubgraphConstraints; + +function addSubgraphConstraints(g, cg, vs) { + var prev = {}, + rootPrev; + + _.forEach(vs, function(v) { + var child = g.parent(v), + parent, + prevChild; + while (child) { + parent = g.parent(child); + if (parent) { + prevChild = prev[parent]; + prev[parent] = child; + } else { + prevChild = rootPrev; + rootPrev = child; + } + if (prevChild && prevChild !== child) { + cg.setEdge(prevChild, child); + return; + } + child = parent; + } + }); + + /* + function dfs(v) { + var children = v ? g.children(v) : g.children(); + if (children.length) { + var min = Number.POSITIVE_INFINITY, + subgraphs = []; + _.each(children, function(child) { + var childMin = dfs(child); + if (g.children(child).length) { + subgraphs.push({ v: child, order: childMin }); + } + min = Math.min(min, childMin); + }); + _.reduce(_.sortBy(subgraphs, "order"), function(prev, curr) { + cg.setEdge(prev.v, curr.v); + return curr; + }); + return min; + } + return g.node(v).order; + } + dfs(undefined); + */ +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/order/barycenter.js": +/*!****************************************************!*\ + !*** ./node_modules/dagre/lib/order/barycenter.js ***! + \****************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var _ = __webpack_require__(/*! ../lodash */ "./node_modules/dagre/lib/lodash.js"); + +module.exports = barycenter; + +function barycenter(g, movable) { + return _.map(movable, function(v) { + var inV = g.inEdges(v); + if (!inV.length) { + return { v: v }; + } else { + var result = _.reduce(inV, function(acc, e) { + var edge = g.edge(e), + nodeU = g.node(e.v); + return { + sum: acc.sum + (edge.weight * nodeU.order), + weight: acc.weight + edge.weight + }; + }, { sum: 0, weight: 0 }); + + return { + v: v, + barycenter: result.sum / result.weight, + weight: result.weight + }; + } + }); +} + + + +/***/ }), + +/***/ "./node_modules/dagre/lib/order/build-layer-graph.js": +/*!***********************************************************!*\ + !*** ./node_modules/dagre/lib/order/build-layer-graph.js ***! + \***********************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var _ = __webpack_require__(/*! ../lodash */ "./node_modules/dagre/lib/lodash.js"); +var Graph = (__webpack_require__(/*! ../graphlib */ "./node_modules/dagre/lib/graphlib.js").Graph); + +module.exports = buildLayerGraph; + +/* + * Constructs a graph that can be used to sort a layer of nodes. The graph will + * contain all base and subgraph nodes from the request layer in their original + * hierarchy and any edges that are incident on these nodes and are of the type + * requested by the "relationship" parameter. + * + * Nodes from the requested rank that do not have parents are assigned a root + * node in the output graph, which is set in the root graph attribute. This + * makes it easy to walk the hierarchy of movable nodes during ordering. + * + * Pre-conditions: + * + * 1. Input graph is a DAG + * 2. Base nodes in the input graph have a rank attribute + * 3. Subgraph nodes in the input graph has minRank and maxRank attributes + * 4. Edges have an assigned weight + * + * Post-conditions: + * + * 1. Output graph has all nodes in the movable rank with preserved + * hierarchy. + * 2. Root nodes in the movable layer are made children of the node + * indicated by the root attribute of the graph. + * 3. Non-movable nodes incident on movable nodes, selected by the + * relationship parameter, are included in the graph (without hierarchy). + * 4. Edges incident on movable nodes, selected by the relationship + * parameter, are added to the output graph. + * 5. The weights for copied edges are aggregated as need, since the output + * graph is not a multi-graph. + */ +function buildLayerGraph(g, rank, relationship) { + var root = createRootNode(g), + result = new Graph({ compound: true }).setGraph({ root: root }) + .setDefaultNodeLabel(function(v) { return g.node(v); }); + + _.forEach(g.nodes(), function(v) { + var node = g.node(v), + parent = g.parent(v); + + if (node.rank === rank || node.minRank <= rank && rank <= node.maxRank) { + result.setNode(v); + result.setParent(v, parent || root); + + // This assumes we have only short edges! + _.forEach(g[relationship](v), function(e) { + var u = e.v === v ? e.w : e.v, + edge = result.edge(u, v), + weight = !_.isUndefined(edge) ? edge.weight : 0; + result.setEdge(u, v, { weight: g.edge(e).weight + weight }); + }); + + if (_.has(node, "minRank")) { + result.setNode(v, { + borderLeft: node.borderLeft[rank], + borderRight: node.borderRight[rank] + }); + } + } + }); + + return result; +} + +function createRootNode(g) { + var v; + while (g.hasNode((v = _.uniqueId("_root")))); + return v; +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/order/cross-count.js": +/*!*****************************************************!*\ + !*** ./node_modules/dagre/lib/order/cross-count.js ***! + \*****************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var _ = __webpack_require__(/*! ../lodash */ "./node_modules/dagre/lib/lodash.js"); + +module.exports = crossCount; + +/* + * A function that takes a layering (an array of layers, each with an array of + * ordererd nodes) and a graph and returns a weighted crossing count. + * + * Pre-conditions: + * + * 1. Input graph must be simple (not a multigraph), directed, and include + * only simple edges. + * 2. Edges in the input graph must have assigned weights. + * + * Post-conditions: + * + * 1. The graph and layering matrix are left unchanged. + * + * This algorithm is derived from Barth, et al., "Bilayer Cross Counting." + */ +function crossCount(g, layering) { + var cc = 0; + for (var i = 1; i < layering.length; ++i) { + cc += twoLayerCrossCount(g, layering[i-1], layering[i]); + } + return cc; +} + +function twoLayerCrossCount(g, northLayer, southLayer) { + // Sort all of the edges between the north and south layers by their position + // in the north layer and then the south. Map these edges to the position of + // their head in the south layer. + var southPos = _.zipObject(southLayer, + _.map(southLayer, function (v, i) { return i; })); + var southEntries = _.flatten(_.map(northLayer, function(v) { + return _.sortBy(_.map(g.outEdges(v), function(e) { + return { pos: southPos[e.w], weight: g.edge(e).weight }; + }), "pos"); + }), true); + + // Build the accumulator tree + var firstIndex = 1; + while (firstIndex < southLayer.length) firstIndex <<= 1; + var treeSize = 2 * firstIndex - 1; + firstIndex -= 1; + var tree = _.map(new Array(treeSize), function() { return 0; }); + + // Calculate the weighted crossings + var cc = 0; + _.forEach(southEntries.forEach(function(entry) { + var index = entry.pos + firstIndex; + tree[index] += entry.weight; + var weightSum = 0; + while (index > 0) { + if (index % 2) { + weightSum += tree[index + 1]; + } + index = (index - 1) >> 1; + tree[index] += entry.weight; + } + cc += entry.weight * weightSum; + })); + + return cc; +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/order/index.js": +/*!***********************************************!*\ + !*** ./node_modules/dagre/lib/order/index.js ***! + \***********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var _ = __webpack_require__(/*! ../lodash */ "./node_modules/dagre/lib/lodash.js"); +var initOrder = __webpack_require__(/*! ./init-order */ "./node_modules/dagre/lib/order/init-order.js"); +var crossCount = __webpack_require__(/*! ./cross-count */ "./node_modules/dagre/lib/order/cross-count.js"); +var sortSubgraph = __webpack_require__(/*! ./sort-subgraph */ "./node_modules/dagre/lib/order/sort-subgraph.js"); +var buildLayerGraph = __webpack_require__(/*! ./build-layer-graph */ "./node_modules/dagre/lib/order/build-layer-graph.js"); +var addSubgraphConstraints = __webpack_require__(/*! ./add-subgraph-constraints */ "./node_modules/dagre/lib/order/add-subgraph-constraints.js"); +var Graph = (__webpack_require__(/*! ../graphlib */ "./node_modules/dagre/lib/graphlib.js").Graph); +var util = __webpack_require__(/*! ../util */ "./node_modules/dagre/lib/util.js"); + +module.exports = order; + +/* + * Applies heuristics to minimize edge crossings in the graph and sets the best + * order solution as an order attribute on each node. + * + * Pre-conditions: + * + * 1. Graph must be DAG + * 2. Graph nodes must be objects with a "rank" attribute + * 3. Graph edges must have the "weight" attribute + * + * Post-conditions: + * + * 1. Graph nodes will have an "order" attribute based on the results of the + * algorithm. + */ +function order(g) { + var maxRank = util.maxRank(g), + downLayerGraphs = buildLayerGraphs(g, _.range(1, maxRank + 1), "inEdges"), + upLayerGraphs = buildLayerGraphs(g, _.range(maxRank - 1, -1, -1), "outEdges"); + + var layering = initOrder(g); + assignOrder(g, layering); + + var bestCC = Number.POSITIVE_INFINITY, + best; + + for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) { + sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2); + + layering = util.buildLayerMatrix(g); + var cc = crossCount(g, layering); + if (cc < bestCC) { + lastBest = 0; + best = _.cloneDeep(layering); + bestCC = cc; + } + } + + assignOrder(g, best); +} + +function buildLayerGraphs(g, ranks, relationship) { + return _.map(ranks, function(rank) { + return buildLayerGraph(g, rank, relationship); + }); +} + +function sweepLayerGraphs(layerGraphs, biasRight) { + var cg = new Graph(); + _.forEach(layerGraphs, function(lg) { + var root = lg.graph().root; + var sorted = sortSubgraph(lg, root, cg, biasRight); + _.forEach(sorted.vs, function(v, i) { + lg.node(v).order = i; + }); + addSubgraphConstraints(lg, cg, sorted.vs); + }); +} + +function assignOrder(g, layering) { + _.forEach(layering, function(layer) { + _.forEach(layer, function(v, i) { + g.node(v).order = i; + }); + }); +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/order/init-order.js": +/*!****************************************************!*\ + !*** ./node_modules/dagre/lib/order/init-order.js ***! + \****************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var _ = __webpack_require__(/*! ../lodash */ "./node_modules/dagre/lib/lodash.js"); + +module.exports = initOrder; + +/* + * Assigns an initial order value for each node by performing a DFS search + * starting from nodes in the first rank. Nodes are assigned an order in their + * rank as they are first visited. + * + * This approach comes from Gansner, et al., "A Technique for Drawing Directed + * Graphs." + * + * Returns a layering matrix with an array per layer and each layer sorted by + * the order of its nodes. + */ +function initOrder(g) { + var visited = {}; + var simpleNodes = _.filter(g.nodes(), function(v) { + return !g.children(v).length; + }); + var maxRank = _.max(_.map(simpleNodes, function(v) { return g.node(v).rank; })); + var layers = _.map(_.range(maxRank + 1), function() { return []; }); + + function dfs(v) { + if (_.has(visited, v)) return; + visited[v] = true; + var node = g.node(v); + layers[node.rank].push(v); + _.forEach(g.successors(v), dfs); + } + + var orderedVs = _.sortBy(simpleNodes, function(v) { return g.node(v).rank; }); + _.forEach(orderedVs, dfs); + + return layers; +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/order/resolve-conflicts.js": +/*!***********************************************************!*\ + !*** ./node_modules/dagre/lib/order/resolve-conflicts.js ***! + \***********************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var _ = __webpack_require__(/*! ../lodash */ "./node_modules/dagre/lib/lodash.js"); + +module.exports = resolveConflicts; + +/* + * Given a list of entries of the form {v, barycenter, weight} and a + * constraint graph this function will resolve any conflicts between the + * constraint graph and the barycenters for the entries. If the barycenters for + * an entry would violate a constraint in the constraint graph then we coalesce + * the nodes in the conflict into a new node that respects the contraint and + * aggregates barycenter and weight information. + * + * This implementation is based on the description in Forster, "A Fast and + * Simple Hueristic for Constrained Two-Level Crossing Reduction," thought it + * differs in some specific details. + * + * Pre-conditions: + * + * 1. Each entry has the form {v, barycenter, weight}, or if the node has + * no barycenter, then {v}. + * + * Returns: + * + * A new list of entries of the form {vs, i, barycenter, weight}. The list + * `vs` may either be a singleton or it may be an aggregation of nodes + * ordered such that they do not violate constraints from the constraint + * graph. The property `i` is the lowest original index of any of the + * elements in `vs`. + */ +function resolveConflicts(entries, cg) { + var mappedEntries = {}; + _.forEach(entries, function(entry, i) { + var tmp = mappedEntries[entry.v] = { + indegree: 0, + "in": [], + out: [], + vs: [entry.v], + i: i + }; + if (!_.isUndefined(entry.barycenter)) { + tmp.barycenter = entry.barycenter; + tmp.weight = entry.weight; + } + }); + + _.forEach(cg.edges(), function(e) { + var entryV = mappedEntries[e.v]; + var entryW = mappedEntries[e.w]; + if (!_.isUndefined(entryV) && !_.isUndefined(entryW)) { + entryW.indegree++; + entryV.out.push(mappedEntries[e.w]); + } + }); + + var sourceSet = _.filter(mappedEntries, function(entry) { + return !entry.indegree; + }); + + return doResolveConflicts(sourceSet); +} + +function doResolveConflicts(sourceSet) { + var entries = []; + + function handleIn(vEntry) { + return function(uEntry) { + if (uEntry.merged) { + return; + } + if (_.isUndefined(uEntry.barycenter) || + _.isUndefined(vEntry.barycenter) || + uEntry.barycenter >= vEntry.barycenter) { + mergeEntries(vEntry, uEntry); + } + }; + } + + function handleOut(vEntry) { + return function(wEntry) { + wEntry["in"].push(vEntry); + if (--wEntry.indegree === 0) { + sourceSet.push(wEntry); + } + }; + } + + while (sourceSet.length) { + var entry = sourceSet.pop(); + entries.push(entry); + _.forEach(entry["in"].reverse(), handleIn(entry)); + _.forEach(entry.out, handleOut(entry)); + } + + return _.map(_.filter(entries, function(entry) { return !entry.merged; }), + function(entry) { + return _.pick(entry, ["vs", "i", "barycenter", "weight"]); + }); + +} + +function mergeEntries(target, source) { + var sum = 0; + var weight = 0; + + if (target.weight) { + sum += target.barycenter * target.weight; + weight += target.weight; + } + + if (source.weight) { + sum += source.barycenter * source.weight; + weight += source.weight; + } + + target.vs = source.vs.concat(target.vs); + target.barycenter = sum / weight; + target.weight = weight; + target.i = Math.min(source.i, target.i); + source.merged = true; +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/order/sort-subgraph.js": +/*!*******************************************************!*\ + !*** ./node_modules/dagre/lib/order/sort-subgraph.js ***! + \*******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var _ = __webpack_require__(/*! ../lodash */ "./node_modules/dagre/lib/lodash.js"); +var barycenter = __webpack_require__(/*! ./barycenter */ "./node_modules/dagre/lib/order/barycenter.js"); +var resolveConflicts = __webpack_require__(/*! ./resolve-conflicts */ "./node_modules/dagre/lib/order/resolve-conflicts.js"); +var sort = __webpack_require__(/*! ./sort */ "./node_modules/dagre/lib/order/sort.js"); + +module.exports = sortSubgraph; + +function sortSubgraph(g, v, cg, biasRight) { + var movable = g.children(v); + var node = g.node(v); + var bl = node ? node.borderLeft : undefined; + var br = node ? node.borderRight: undefined; + var subgraphs = {}; + + if (bl) { + movable = _.filter(movable, function(w) { + return w !== bl && w !== br; + }); + } + + var barycenters = barycenter(g, movable); + _.forEach(barycenters, function(entry) { + if (g.children(entry.v).length) { + var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight); + subgraphs[entry.v] = subgraphResult; + if (_.has(subgraphResult, "barycenter")) { + mergeBarycenters(entry, subgraphResult); + } + } + }); + + var entries = resolveConflicts(barycenters, cg); + expandSubgraphs(entries, subgraphs); + + var result = sort(entries, biasRight); + + if (bl) { + result.vs = _.flatten([bl, result.vs, br], true); + if (g.predecessors(bl).length) { + var blPred = g.node(g.predecessors(bl)[0]), + brPred = g.node(g.predecessors(br)[0]); + if (!_.has(result, "barycenter")) { + result.barycenter = 0; + result.weight = 0; + } + result.barycenter = (result.barycenter * result.weight + + blPred.order + brPred.order) / (result.weight + 2); + result.weight += 2; + } + } + + return result; +} + +function expandSubgraphs(entries, subgraphs) { + _.forEach(entries, function(entry) { + entry.vs = _.flatten(entry.vs.map(function(v) { + if (subgraphs[v]) { + return subgraphs[v].vs; + } + return v; + }), true); + }); +} + +function mergeBarycenters(target, other) { + if (!_.isUndefined(target.barycenter)) { + target.barycenter = (target.barycenter * target.weight + + other.barycenter * other.weight) / + (target.weight + other.weight); + target.weight += other.weight; + } else { + target.barycenter = other.barycenter; + target.weight = other.weight; + } +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/order/sort.js": +/*!**********************************************!*\ + !*** ./node_modules/dagre/lib/order/sort.js ***! + \**********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var _ = __webpack_require__(/*! ../lodash */ "./node_modules/dagre/lib/lodash.js"); +var util = __webpack_require__(/*! ../util */ "./node_modules/dagre/lib/util.js"); + +module.exports = sort; + +function sort(entries, biasRight) { + var parts = util.partition(entries, function(entry) { + return _.has(entry, "barycenter"); + }); + var sortable = parts.lhs, + unsortable = _.sortBy(parts.rhs, function(entry) { return -entry.i; }), + vs = [], + sum = 0, + weight = 0, + vsIndex = 0; + + sortable.sort(compareWithBias(!!biasRight)); + + vsIndex = consumeUnsortable(vs, unsortable, vsIndex); + + _.forEach(sortable, function (entry) { + vsIndex += entry.vs.length; + vs.push(entry.vs); + sum += entry.barycenter * entry.weight; + weight += entry.weight; + vsIndex = consumeUnsortable(vs, unsortable, vsIndex); + }); + + var result = { vs: _.flatten(vs, true) }; + if (weight) { + result.barycenter = sum / weight; + result.weight = weight; + } + return result; +} + +function consumeUnsortable(vs, unsortable, index) { + var last; + while (unsortable.length && (last = _.last(unsortable)).i <= index) { + unsortable.pop(); + vs.push(last.vs); + index++; + } + return index; +} + +function compareWithBias(bias) { + return function(entryV, entryW) { + if (entryV.barycenter < entryW.barycenter) { + return -1; + } else if (entryV.barycenter > entryW.barycenter) { + return 1; + } + + return !bias ? entryV.i - entryW.i : entryW.i - entryV.i; + }; +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/parent-dummy-chains.js": +/*!*******************************************************!*\ + !*** ./node_modules/dagre/lib/parent-dummy-chains.js ***! + \*******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var _ = __webpack_require__(/*! ./lodash */ "./node_modules/dagre/lib/lodash.js"); + +module.exports = parentDummyChains; + +function parentDummyChains(g) { + var postorderNums = postorder(g); + + _.forEach(g.graph().dummyChains, function(v) { + var node = g.node(v); + var edgeObj = node.edgeObj; + var pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w); + var path = pathData.path; + var lca = pathData.lca; + var pathIdx = 0; + var pathV = path[pathIdx]; + var ascending = true; + + while (v !== edgeObj.w) { + node = g.node(v); + + if (ascending) { + while ((pathV = path[pathIdx]) !== lca && + g.node(pathV).maxRank < node.rank) { + pathIdx++; + } + + if (pathV === lca) { + ascending = false; + } + } + + if (!ascending) { + while (pathIdx < path.length - 1 && + g.node(pathV = path[pathIdx + 1]).minRank <= node.rank) { + pathIdx++; + } + pathV = path[pathIdx]; + } + + g.setParent(v, pathV); + v = g.successors(v)[0]; + } + }); +} + +// Find a path from v to w through the lowest common ancestor (LCA). Return the +// full path and the LCA. +function findPath(g, postorderNums, v, w) { + var vPath = []; + var wPath = []; + var low = Math.min(postorderNums[v].low, postorderNums[w].low); + var lim = Math.max(postorderNums[v].lim, postorderNums[w].lim); + var parent; + var lca; + + // Traverse up from v to find the LCA + parent = v; + do { + parent = g.parent(parent); + vPath.push(parent); + } while (parent && + (postorderNums[parent].low > low || lim > postorderNums[parent].lim)); + lca = parent; + + // Traverse from w to LCA + parent = w; + while ((parent = g.parent(parent)) !== lca) { + wPath.push(parent); + } + + return { path: vPath.concat(wPath.reverse()), lca: lca }; +} + +function postorder(g) { + var result = {}; + var lim = 0; + + function dfs(v) { + var low = lim; + _.forEach(g.children(v), dfs); + result[v] = { low: low, lim: lim++ }; + } + _.forEach(g.children(), dfs); + + return result; +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/position/bk.js": +/*!***********************************************!*\ + !*** ./node_modules/dagre/lib/position/bk.js ***! + \***********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var _ = __webpack_require__(/*! ../lodash */ "./node_modules/dagre/lib/lodash.js"); +var Graph = (__webpack_require__(/*! ../graphlib */ "./node_modules/dagre/lib/graphlib.js").Graph); +var util = __webpack_require__(/*! ../util */ "./node_modules/dagre/lib/util.js"); + +/* + * This module provides coordinate assignment based on Brandes and Köpf, "Fast + * and Simple Horizontal Coordinate Assignment." + */ + +module.exports = { + positionX: positionX, + findType1Conflicts: findType1Conflicts, + findType2Conflicts: findType2Conflicts, + addConflict: addConflict, + hasConflict: hasConflict, + verticalAlignment: verticalAlignment, + horizontalCompaction: horizontalCompaction, + alignCoordinates: alignCoordinates, + findSmallestWidthAlignment: findSmallestWidthAlignment, + balance: balance +}; + +/* + * Marks all edges in the graph with a type-1 conflict with the "type1Conflict" + * property. A type-1 conflict is one where a non-inner segment crosses an + * inner segment. An inner segment is an edge with both incident nodes marked + * with the "dummy" property. + * + * This algorithm scans layer by layer, starting with the second, for type-1 + * conflicts between the current layer and the previous layer. For each layer + * it scans the nodes from left to right until it reaches one that is incident + * on an inner segment. It then scans predecessors to determine if they have + * edges that cross that inner segment. At the end a final scan is done for all + * nodes on the current rank to see if they cross the last visited inner + * segment. + * + * This algorithm (safely) assumes that a dummy node will only be incident on a + * single node in the layers being scanned. + */ +function findType1Conflicts(g, layering) { + var conflicts = {}; + + function visitLayer(prevLayer, layer) { + var + // last visited node in the previous layer that is incident on an inner + // segment. + k0 = 0, + // Tracks the last node in this layer scanned for crossings with a type-1 + // segment. + scanPos = 0, + prevLayerLength = prevLayer.length, + lastNode = _.last(layer); + + _.forEach(layer, function(v, i) { + var w = findOtherInnerSegmentNode(g, v), + k1 = w ? g.node(w).order : prevLayerLength; + + if (w || v === lastNode) { + _.forEach(layer.slice(scanPos, i +1), function(scanNode) { + _.forEach(g.predecessors(scanNode), function(u) { + var uLabel = g.node(u), + uPos = uLabel.order; + if ((uPos < k0 || k1 < uPos) && + !(uLabel.dummy && g.node(scanNode).dummy)) { + addConflict(conflicts, u, scanNode); + } + }); + }); + scanPos = i + 1; + k0 = k1; + } + }); + + return layer; + } + + _.reduce(layering, visitLayer); + return conflicts; +} + +function findType2Conflicts(g, layering) { + var conflicts = {}; + + function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) { + var v; + _.forEach(_.range(southPos, southEnd), function(i) { + v = south[i]; + if (g.node(v).dummy) { + _.forEach(g.predecessors(v), function(u) { + var uNode = g.node(u); + if (uNode.dummy && + (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) { + addConflict(conflicts, u, v); + } + }); + } + }); + } + + + function visitLayer(north, south) { + var prevNorthPos = -1, + nextNorthPos, + southPos = 0; + + _.forEach(south, function(v, southLookahead) { + if (g.node(v).dummy === "border") { + var predecessors = g.predecessors(v); + if (predecessors.length) { + nextNorthPos = g.node(predecessors[0]).order; + scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos); + southPos = southLookahead; + prevNorthPos = nextNorthPos; + } + } + scan(south, southPos, south.length, nextNorthPos, north.length); + }); + + return south; + } + + _.reduce(layering, visitLayer); + return conflicts; +} + +function findOtherInnerSegmentNode(g, v) { + if (g.node(v).dummy) { + return _.find(g.predecessors(v), function(u) { + return g.node(u).dummy; + }); + } +} + +function addConflict(conflicts, v, w) { + if (v > w) { + var tmp = v; + v = w; + w = tmp; + } + + var conflictsV = conflicts[v]; + if (!conflictsV) { + conflicts[v] = conflictsV = {}; + } + conflictsV[w] = true; +} + +function hasConflict(conflicts, v, w) { + if (v > w) { + var tmp = v; + v = w; + w = tmp; + } + return _.has(conflicts[v], w); +} + +/* + * Try to align nodes into vertical "blocks" where possible. This algorithm + * attempts to align a node with one of its median neighbors. If the edge + * connecting a neighbor is a type-1 conflict then we ignore that possibility. + * If a previous node has already formed a block with a node after the node + * we're trying to form a block with, we also ignore that possibility - our + * blocks would be split in that scenario. + */ +function verticalAlignment(g, layering, conflicts, neighborFn) { + var root = {}, + align = {}, + pos = {}; + + // We cache the position here based on the layering because the graph and + // layering may be out of sync. The layering matrix is manipulated to + // generate different extreme alignments. + _.forEach(layering, function(layer) { + _.forEach(layer, function(v, order) { + root[v] = v; + align[v] = v; + pos[v] = order; + }); + }); + + _.forEach(layering, function(layer) { + var prevIdx = -1; + _.forEach(layer, function(v) { + var ws = neighborFn(v); + if (ws.length) { + ws = _.sortBy(ws, function(w) { return pos[w]; }); + var mp = (ws.length - 1) / 2; + for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) { + var w = ws[i]; + if (align[v] === v && + prevIdx < pos[w] && + !hasConflict(conflicts, v, w)) { + align[w] = v; + align[v] = root[v] = root[w]; + prevIdx = pos[w]; + } + } + } + }); + }); + + return { root: root, align: align }; +} + +function horizontalCompaction(g, layering, root, align, reverseSep) { + // This portion of the algorithm differs from BK due to a number of problems. + // Instead of their algorithm we construct a new block graph and do two + // sweeps. The first sweep places blocks with the smallest possible + // coordinates. The second sweep removes unused space by moving blocks to the + // greatest coordinates without violating separation. + var xs = {}, + blockG = buildBlockGraph(g, layering, root, reverseSep), + borderType = reverseSep ? "borderLeft" : "borderRight"; + + function iterate(setXsFunc, nextNodesFunc) { + var stack = blockG.nodes(); + var elem = stack.pop(); + var visited = {}; + while (elem) { + if (visited[elem]) { + setXsFunc(elem); + } else { + visited[elem] = true; + stack.push(elem); + stack = stack.concat(nextNodesFunc(elem)); + } + + elem = stack.pop(); + } + } + + // First pass, assign smallest coordinates + function pass1(elem) { + xs[elem] = blockG.inEdges(elem).reduce(function(acc, e) { + return Math.max(acc, xs[e.v] + blockG.edge(e)); + }, 0); + } + + // Second pass, assign greatest coordinates + function pass2(elem) { + var min = blockG.outEdges(elem).reduce(function(acc, e) { + return Math.min(acc, xs[e.w] - blockG.edge(e)); + }, Number.POSITIVE_INFINITY); + + var node = g.node(elem); + if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) { + xs[elem] = Math.max(xs[elem], min); + } + } + + iterate(pass1, blockG.predecessors.bind(blockG)); + iterate(pass2, blockG.successors.bind(blockG)); + + // Assign x coordinates to all nodes + _.forEach(align, function(v) { + xs[v] = xs[root[v]]; + }); + + return xs; +} + + +function buildBlockGraph(g, layering, root, reverseSep) { + var blockGraph = new Graph(), + graphLabel = g.graph(), + sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep); + + _.forEach(layering, function(layer) { + var u; + _.forEach(layer, function(v) { + var vRoot = root[v]; + blockGraph.setNode(vRoot); + if (u) { + var uRoot = root[u], + prevMax = blockGraph.edge(uRoot, vRoot); + blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0)); + } + u = v; + }); + }); + + return blockGraph; +} + +/* + * Returns the alignment that has the smallest width of the given alignments. + */ +function findSmallestWidthAlignment(g, xss) { + return _.minBy(_.values(xss), function (xs) { + var max = Number.NEGATIVE_INFINITY; + var min = Number.POSITIVE_INFINITY; + + _.forIn(xs, function (x, v) { + var halfWidth = width(g, v) / 2; + + max = Math.max(x + halfWidth, max); + min = Math.min(x - halfWidth, min); + }); + + return max - min; + }); +} + +/* + * Align the coordinates of each of the layout alignments such that + * left-biased alignments have their minimum coordinate at the same point as + * the minimum coordinate of the smallest width alignment and right-biased + * alignments have their maximum coordinate at the same point as the maximum + * coordinate of the smallest width alignment. + */ +function alignCoordinates(xss, alignTo) { + var alignToVals = _.values(alignTo), + alignToMin = _.min(alignToVals), + alignToMax = _.max(alignToVals); + + _.forEach(["u", "d"], function(vert) { + _.forEach(["l", "r"], function(horiz) { + var alignment = vert + horiz, + xs = xss[alignment], + delta; + if (xs === alignTo) return; + + var xsVals = _.values(xs); + delta = horiz === "l" ? alignToMin - _.min(xsVals) : alignToMax - _.max(xsVals); + + if (delta) { + xss[alignment] = _.mapValues(xs, function(x) { return x + delta; }); + } + }); + }); +} + +function balance(xss, align) { + return _.mapValues(xss.ul, function(ignore, v) { + if (align) { + return xss[align.toLowerCase()][v]; + } else { + var xs = _.sortBy(_.map(xss, v)); + return (xs[1] + xs[2]) / 2; + } + }); +} + +function positionX(g) { + var layering = util.buildLayerMatrix(g); + var conflicts = _.merge( + findType1Conflicts(g, layering), + findType2Conflicts(g, layering)); + + var xss = {}; + var adjustedLayering; + _.forEach(["u", "d"], function(vert) { + adjustedLayering = vert === "u" ? layering : _.values(layering).reverse(); + _.forEach(["l", "r"], function(horiz) { + if (horiz === "r") { + adjustedLayering = _.map(adjustedLayering, function(inner) { + return _.values(inner).reverse(); + }); + } + + var neighborFn = (vert === "u" ? g.predecessors : g.successors).bind(g); + var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn); + var xs = horizontalCompaction(g, adjustedLayering, + align.root, align.align, horiz === "r"); + if (horiz === "r") { + xs = _.mapValues(xs, function(x) { return -x; }); + } + xss[vert + horiz] = xs; + }); + }); + + var smallestWidth = findSmallestWidthAlignment(g, xss); + alignCoordinates(xss, smallestWidth); + return balance(xss, g.graph().align); +} + +function sep(nodeSep, edgeSep, reverseSep) { + return function(g, v, w) { + var vLabel = g.node(v); + var wLabel = g.node(w); + var sum = 0; + var delta; + + sum += vLabel.width / 2; + if (_.has(vLabel, "labelpos")) { + switch (vLabel.labelpos.toLowerCase()) { + case "l": delta = -vLabel.width / 2; break; + case "r": delta = vLabel.width / 2; break; + } + } + if (delta) { + sum += reverseSep ? delta : -delta; + } + delta = 0; + + sum += (vLabel.dummy ? edgeSep : nodeSep) / 2; + sum += (wLabel.dummy ? edgeSep : nodeSep) / 2; + + sum += wLabel.width / 2; + if (_.has(wLabel, "labelpos")) { + switch (wLabel.labelpos.toLowerCase()) { + case "l": delta = wLabel.width / 2; break; + case "r": delta = -wLabel.width / 2; break; + } + } + if (delta) { + sum += reverseSep ? delta : -delta; + } + delta = 0; + + return sum; + }; +} + +function width(g, v) { + return g.node(v).width; +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/position/index.js": +/*!**************************************************!*\ + !*** ./node_modules/dagre/lib/position/index.js ***! + \**************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var _ = __webpack_require__(/*! ../lodash */ "./node_modules/dagre/lib/lodash.js"); +var util = __webpack_require__(/*! ../util */ "./node_modules/dagre/lib/util.js"); +var positionX = (__webpack_require__(/*! ./bk */ "./node_modules/dagre/lib/position/bk.js").positionX); + +module.exports = position; + +function position(g) { + g = util.asNonCompoundGraph(g); + + positionY(g); + _.forEach(positionX(g), function(x, v) { + g.node(v).x = x; + }); +} + +function positionY(g) { + var layering = util.buildLayerMatrix(g); + var rankSep = g.graph().ranksep; + var prevY = 0; + _.forEach(layering, function(layer) { + var maxHeight = _.max(_.map(layer, function(v) { return g.node(v).height; })); + _.forEach(layer, function(v) { + g.node(v).y = prevY + maxHeight / 2; + }); + prevY += maxHeight + rankSep; + }); +} + + + +/***/ }), + +/***/ "./node_modules/dagre/lib/rank/feasible-tree.js": +/*!******************************************************!*\ + !*** ./node_modules/dagre/lib/rank/feasible-tree.js ***! + \******************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var _ = __webpack_require__(/*! ../lodash */ "./node_modules/dagre/lib/lodash.js"); +var Graph = (__webpack_require__(/*! ../graphlib */ "./node_modules/dagre/lib/graphlib.js").Graph); +var slack = (__webpack_require__(/*! ./util */ "./node_modules/dagre/lib/rank/util.js").slack); + +module.exports = feasibleTree; + +/* + * Constructs a spanning tree with tight edges and adjusted the input node's + * ranks to achieve this. A tight edge is one that is has a length that matches + * its "minlen" attribute. + * + * The basic structure for this function is derived from Gansner, et al., "A + * Technique for Drawing Directed Graphs." + * + * Pre-conditions: + * + * 1. Graph must be a DAG. + * 2. Graph must be connected. + * 3. Graph must have at least one node. + * 5. Graph nodes must have been previously assigned a "rank" property that + * respects the "minlen" property of incident edges. + * 6. Graph edges must have a "minlen" property. + * + * Post-conditions: + * + * - Graph nodes will have their rank adjusted to ensure that all edges are + * tight. + * + * Returns a tree (undirected graph) that is constructed using only "tight" + * edges. + */ +function feasibleTree(g) { + var t = new Graph({ directed: false }); + + // Choose arbitrary node from which to start our tree + var start = g.nodes()[0]; + var size = g.nodeCount(); + t.setNode(start, {}); + + var edge, delta; + while (tightTree(t, g) < size) { + edge = findMinSlackEdge(t, g); + delta = t.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge); + shiftRanks(t, g, delta); + } + + return t; +} + +/* + * Finds a maximal tree of tight edges and returns the number of nodes in the + * tree. + */ +function tightTree(t, g) { + function dfs(v) { + _.forEach(g.nodeEdges(v), function(e) { + var edgeV = e.v, + w = (v === edgeV) ? e.w : edgeV; + if (!t.hasNode(w) && !slack(g, e)) { + t.setNode(w, {}); + t.setEdge(v, w, {}); + dfs(w); + } + }); + } + + _.forEach(t.nodes(), dfs); + return t.nodeCount(); +} + +/* + * Finds the edge with the smallest slack that is incident on tree and returns + * it. + */ +function findMinSlackEdge(t, g) { + return _.minBy(g.edges(), function(e) { + if (t.hasNode(e.v) !== t.hasNode(e.w)) { + return slack(g, e); + } + }); +} + +function shiftRanks(t, g, delta) { + _.forEach(t.nodes(), function(v) { + g.node(v).rank += delta; + }); +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/rank/index.js": +/*!**********************************************!*\ + !*** ./node_modules/dagre/lib/rank/index.js ***! + \**********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var rankUtil = __webpack_require__(/*! ./util */ "./node_modules/dagre/lib/rank/util.js"); +var longestPath = rankUtil.longestPath; +var feasibleTree = __webpack_require__(/*! ./feasible-tree */ "./node_modules/dagre/lib/rank/feasible-tree.js"); +var networkSimplex = __webpack_require__(/*! ./network-simplex */ "./node_modules/dagre/lib/rank/network-simplex.js"); + +module.exports = rank; + +/* + * Assigns a rank to each node in the input graph that respects the "minlen" + * constraint specified on edges between nodes. + * + * This basic structure is derived from Gansner, et al., "A Technique for + * Drawing Directed Graphs." + * + * Pre-conditions: + * + * 1. Graph must be a connected DAG + * 2. Graph nodes must be objects + * 3. Graph edges must have "weight" and "minlen" attributes + * + * Post-conditions: + * + * 1. Graph nodes will have a "rank" attribute based on the results of the + * algorithm. Ranks can start at any index (including negative), we'll + * fix them up later. + */ +function rank(g) { + switch(g.graph().ranker) { + case "network-simplex": networkSimplexRanker(g); break; + case "tight-tree": tightTreeRanker(g); break; + case "longest-path": longestPathRanker(g); break; + default: networkSimplexRanker(g); + } +} + +// A fast and simple ranker, but results are far from optimal. +var longestPathRanker = longestPath; + +function tightTreeRanker(g) { + longestPath(g); + feasibleTree(g); +} + +function networkSimplexRanker(g) { + networkSimplex(g); +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/rank/network-simplex.js": +/*!********************************************************!*\ + !*** ./node_modules/dagre/lib/rank/network-simplex.js ***! + \********************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var _ = __webpack_require__(/*! ../lodash */ "./node_modules/dagre/lib/lodash.js"); +var feasibleTree = __webpack_require__(/*! ./feasible-tree */ "./node_modules/dagre/lib/rank/feasible-tree.js"); +var slack = (__webpack_require__(/*! ./util */ "./node_modules/dagre/lib/rank/util.js").slack); +var initRank = (__webpack_require__(/*! ./util */ "./node_modules/dagre/lib/rank/util.js").longestPath); +var preorder = (__webpack_require__(/*! ../graphlib */ "./node_modules/dagre/lib/graphlib.js").alg.preorder); +var postorder = (__webpack_require__(/*! ../graphlib */ "./node_modules/dagre/lib/graphlib.js").alg.postorder); +var simplify = (__webpack_require__(/*! ../util */ "./node_modules/dagre/lib/util.js").simplify); + +module.exports = networkSimplex; + +// Expose some internals for testing purposes +networkSimplex.initLowLimValues = initLowLimValues; +networkSimplex.initCutValues = initCutValues; +networkSimplex.calcCutValue = calcCutValue; +networkSimplex.leaveEdge = leaveEdge; +networkSimplex.enterEdge = enterEdge; +networkSimplex.exchangeEdges = exchangeEdges; + +/* + * The network simplex algorithm assigns ranks to each node in the input graph + * and iteratively improves the ranking to reduce the length of edges. + * + * Preconditions: + * + * 1. The input graph must be a DAG. + * 2. All nodes in the graph must have an object value. + * 3. All edges in the graph must have "minlen" and "weight" attributes. + * + * Postconditions: + * + * 1. All nodes in the graph will have an assigned "rank" attribute that has + * been optimized by the network simplex algorithm. Ranks start at 0. + * + * + * A rough sketch of the algorithm is as follows: + * + * 1. Assign initial ranks to each node. We use the longest path algorithm, + * which assigns ranks to the lowest position possible. In general this + * leads to very wide bottom ranks and unnecessarily long edges. + * 2. Construct a feasible tight tree. A tight tree is one such that all + * edges in the tree have no slack (difference between length of edge + * and minlen for the edge). This by itself greatly improves the assigned + * rankings by shorting edges. + * 3. Iteratively find edges that have negative cut values. Generally a + * negative cut value indicates that the edge could be removed and a new + * tree edge could be added to produce a more compact graph. + * + * Much of the algorithms here are derived from Gansner, et al., "A Technique + * for Drawing Directed Graphs." The structure of the file roughly follows the + * structure of the overall algorithm. + */ +function networkSimplex(g) { + g = simplify(g); + initRank(g); + var t = feasibleTree(g); + initLowLimValues(t); + initCutValues(t, g); + + var e, f; + while ((e = leaveEdge(t))) { + f = enterEdge(t, g, e); + exchangeEdges(t, g, e, f); + } +} + +/* + * Initializes cut values for all edges in the tree. + */ +function initCutValues(t, g) { + var vs = postorder(t, t.nodes()); + vs = vs.slice(0, vs.length - 1); + _.forEach(vs, function(v) { + assignCutValue(t, g, v); + }); +} + +function assignCutValue(t, g, child) { + var childLab = t.node(child); + var parent = childLab.parent; + t.edge(child, parent).cutvalue = calcCutValue(t, g, child); +} + +/* + * Given the tight tree, its graph, and a child in the graph calculate and + * return the cut value for the edge between the child and its parent. + */ +function calcCutValue(t, g, child) { + var childLab = t.node(child); + var parent = childLab.parent; + // True if the child is on the tail end of the edge in the directed graph + var childIsTail = true; + // The graph's view of the tree edge we're inspecting + var graphEdge = g.edge(child, parent); + // The accumulated cut value for the edge between this node and its parent + var cutValue = 0; + + if (!graphEdge) { + childIsTail = false; + graphEdge = g.edge(parent, child); + } + + cutValue = graphEdge.weight; + + _.forEach(g.nodeEdges(child), function(e) { + var isOutEdge = e.v === child, + other = isOutEdge ? e.w : e.v; + + if (other !== parent) { + var pointsToHead = isOutEdge === childIsTail, + otherWeight = g.edge(e).weight; + + cutValue += pointsToHead ? otherWeight : -otherWeight; + if (isTreeEdge(t, child, other)) { + var otherCutValue = t.edge(child, other).cutvalue; + cutValue += pointsToHead ? -otherCutValue : otherCutValue; + } + } + }); + + return cutValue; +} + +function initLowLimValues(tree, root) { + if (arguments.length < 2) { + root = tree.nodes()[0]; + } + dfsAssignLowLim(tree, {}, 1, root); +} + +function dfsAssignLowLim(tree, visited, nextLim, v, parent) { + var low = nextLim; + var label = tree.node(v); + + visited[v] = true; + _.forEach(tree.neighbors(v), function(w) { + if (!_.has(visited, w)) { + nextLim = dfsAssignLowLim(tree, visited, nextLim, w, v); + } + }); + + label.low = low; + label.lim = nextLim++; + if (parent) { + label.parent = parent; + } else { + // TODO should be able to remove this when we incrementally update low lim + delete label.parent; + } + + return nextLim; +} + +function leaveEdge(tree) { + return _.find(tree.edges(), function(e) { + return tree.edge(e).cutvalue < 0; + }); +} + +function enterEdge(t, g, edge) { + var v = edge.v; + var w = edge.w; + + // For the rest of this function we assume that v is the tail and w is the + // head, so if we don't have this edge in the graph we should flip it to + // match the correct orientation. + if (!g.hasEdge(v, w)) { + v = edge.w; + w = edge.v; + } + + var vLabel = t.node(v); + var wLabel = t.node(w); + var tailLabel = vLabel; + var flip = false; + + // If the root is in the tail of the edge then we need to flip the logic that + // checks for the head and tail nodes in the candidates function below. + if (vLabel.lim > wLabel.lim) { + tailLabel = wLabel; + flip = true; + } + + var candidates = _.filter(g.edges(), function(edge) { + return flip === isDescendant(t, t.node(edge.v), tailLabel) && + flip !== isDescendant(t, t.node(edge.w), tailLabel); + }); + + return _.minBy(candidates, function(edge) { return slack(g, edge); }); +} + +function exchangeEdges(t, g, e, f) { + var v = e.v; + var w = e.w; + t.removeEdge(v, w); + t.setEdge(f.v, f.w, {}); + initLowLimValues(t); + initCutValues(t, g); + updateRanks(t, g); +} + +function updateRanks(t, g) { + var root = _.find(t.nodes(), function(v) { return !g.node(v).parent; }); + var vs = preorder(t, root); + vs = vs.slice(1); + _.forEach(vs, function(v) { + var parent = t.node(v).parent, + edge = g.edge(v, parent), + flipped = false; + + if (!edge) { + edge = g.edge(parent, v); + flipped = true; + } + + g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen); + }); +} + +/* + * Returns true if the edge is in the tree. + */ +function isTreeEdge(tree, u, v) { + return tree.hasEdge(u, v); +} + +/* + * Returns true if the specified node is descendant of the root node per the + * assigned low and lim attributes in the tree. + */ +function isDescendant(tree, vLabel, rootLabel) { + return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim; +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/rank/util.js": +/*!*********************************************!*\ + !*** ./node_modules/dagre/lib/rank/util.js ***! + \*********************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +var _ = __webpack_require__(/*! ../lodash */ "./node_modules/dagre/lib/lodash.js"); + +module.exports = { + longestPath: longestPath, + slack: slack +}; + +/* + * Initializes ranks for the input graph using the longest path algorithm. This + * algorithm scales well and is fast in practice, it yields rather poor + * solutions. Nodes are pushed to the lowest layer possible, leaving the bottom + * ranks wide and leaving edges longer than necessary. However, due to its + * speed, this algorithm is good for getting an initial ranking that can be fed + * into other algorithms. + * + * This algorithm does not normalize layers because it will be used by other + * algorithms in most cases. If using this algorithm directly, be sure to + * run normalize at the end. + * + * Pre-conditions: + * + * 1. Input graph is a DAG. + * 2. Input graph node labels can be assigned properties. + * + * Post-conditions: + * + * 1. Each node will be assign an (unnormalized) "rank" property. + */ +function longestPath(g) { + var visited = {}; + + function dfs(v) { + var label = g.node(v); + if (_.has(visited, v)) { + return label.rank; + } + visited[v] = true; + + var rank = _.min(_.map(g.outEdges(v), function(e) { + return dfs(e.w) - g.edge(e).minlen; + })); + + if (rank === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3 + rank === undefined || // return value of _.map([]) for Lodash 4 + rank === null) { // return value of _.map([null]) + rank = 0; + } + + return (label.rank = rank); + } + + _.forEach(g.sources(), dfs); +} + +/* + * Returns the amount of slack for the given edge. The slack is defined as the + * difference between the length of the edge and its minimum length. + */ +function slack(g, e) { + return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen; +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/util.js": +/*!****************************************!*\ + !*** ./node_modules/dagre/lib/util.js ***! + \****************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; +/* eslint "no-console": off */ + + + +var _ = __webpack_require__(/*! ./lodash */ "./node_modules/dagre/lib/lodash.js"); +var Graph = (__webpack_require__(/*! ./graphlib */ "./node_modules/dagre/lib/graphlib.js").Graph); + +module.exports = { + addDummyNode: addDummyNode, + simplify: simplify, + asNonCompoundGraph: asNonCompoundGraph, + successorWeights: successorWeights, + predecessorWeights: predecessorWeights, + intersectRect: intersectRect, + buildLayerMatrix: buildLayerMatrix, + normalizeRanks: normalizeRanks, + removeEmptyRanks: removeEmptyRanks, + addBorderNode: addBorderNode, + maxRank: maxRank, + partition: partition, + time: time, + notime: notime +}; + +/* + * Adds a dummy node to the graph and return v. + */ +function addDummyNode(g, type, attrs, name) { + var v; + do { + v = _.uniqueId(name); + } while (g.hasNode(v)); + + attrs.dummy = type; + g.setNode(v, attrs); + return v; +} + +/* + * Returns a new graph with only simple edges. Handles aggregation of data + * associated with multi-edges. + */ +function simplify(g) { + var simplified = new Graph().setGraph(g.graph()); + _.forEach(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); }); + _.forEach(g.edges(), function(e) { + var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 }; + var label = g.edge(e); + simplified.setEdge(e.v, e.w, { + weight: simpleLabel.weight + label.weight, + minlen: Math.max(simpleLabel.minlen, label.minlen) + }); + }); + return simplified; +} + +function asNonCompoundGraph(g) { + var simplified = new Graph({ multigraph: g.isMultigraph() }).setGraph(g.graph()); + _.forEach(g.nodes(), function(v) { + if (!g.children(v).length) { + simplified.setNode(v, g.node(v)); + } + }); + _.forEach(g.edges(), function(e) { + simplified.setEdge(e, g.edge(e)); + }); + return simplified; +} + +function successorWeights(g) { + var weightMap = _.map(g.nodes(), function(v) { + var sucs = {}; + _.forEach(g.outEdges(v), function(e) { + sucs[e.w] = (sucs[e.w] || 0) + g.edge(e).weight; + }); + return sucs; + }); + return _.zipObject(g.nodes(), weightMap); +} + +function predecessorWeights(g) { + var weightMap = _.map(g.nodes(), function(v) { + var preds = {}; + _.forEach(g.inEdges(v), function(e) { + preds[e.v] = (preds[e.v] || 0) + g.edge(e).weight; + }); + return preds; + }); + return _.zipObject(g.nodes(), weightMap); +} + +/* + * Finds where a line starting at point ({x, y}) would intersect a rectangle + * ({x, y, width, height}) if it were pointing at the rectangle's center. + */ +function intersectRect(rect, point) { + var x = rect.x; + var y = rect.y; + + // Rectangle intersection algorithm from: + // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes + var dx = point.x - x; + var dy = point.y - y; + var w = rect.width / 2; + var h = rect.height / 2; + + if (!dx && !dy) { + throw new Error("Not possible to find intersection inside of the rectangle"); + } + + var sx, sy; + if (Math.abs(dy) * w > Math.abs(dx) * h) { + // Intersection is top or bottom of rect. + if (dy < 0) { + h = -h; + } + sx = h * dx / dy; + sy = h; + } else { + // Intersection is left or right of rect. + if (dx < 0) { + w = -w; + } + sx = w; + sy = w * dy / dx; + } + + return { x: x + sx, y: y + sy }; +} + +/* + * Given a DAG with each node assigned "rank" and "order" properties, this + * function will produce a matrix with the ids of each node. + */ +function buildLayerMatrix(g) { + var layering = _.map(_.range(maxRank(g) + 1), function() { return []; }); + _.forEach(g.nodes(), function(v) { + var node = g.node(v); + var rank = node.rank; + if (!_.isUndefined(rank)) { + layering[rank][node.order] = v; + } + }); + return layering; +} + +/* + * Adjusts the ranks for all nodes in the graph such that all nodes v have + * rank(v) >= 0 and at least one node w has rank(w) = 0. + */ +function normalizeRanks(g) { + var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); + _.forEach(g.nodes(), function(v) { + var node = g.node(v); + if (_.has(node, "rank")) { + node.rank -= min; + } + }); +} + +function removeEmptyRanks(g) { + // Ranks may not start at 0, so we need to offset them + var offset = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; })); + + var layers = []; + _.forEach(g.nodes(), function(v) { + var rank = g.node(v).rank - offset; + if (!layers[rank]) { + layers[rank] = []; + } + layers[rank].push(v); + }); + + var delta = 0; + var nodeRankFactor = g.graph().nodeRankFactor; + _.forEach(layers, function(vs, i) { + if (_.isUndefined(vs) && i % nodeRankFactor !== 0) { + --delta; + } else if (delta) { + _.forEach(vs, function(v) { g.node(v).rank += delta; }); + } + }); +} + +function addBorderNode(g, prefix, rank, order) { + var node = { + width: 0, + height: 0 + }; + if (arguments.length >= 4) { + node.rank = rank; + node.order = order; + } + return addDummyNode(g, "border", node, prefix); +} + +function maxRank(g) { + return _.max(_.map(g.nodes(), function(v) { + var rank = g.node(v).rank; + if (!_.isUndefined(rank)) { + return rank; + } + })); +} + +/* + * Partition a collection into two groups: `lhs` and `rhs`. If the supplied + * function returns true for an entry it goes into `lhs`. Otherwise it goes + * into `rhs. + */ +function partition(collection, fn) { + var result = { lhs: [], rhs: [] }; + _.forEach(collection, function(value) { + if (fn(value)) { + result.lhs.push(value); + } else { + result.rhs.push(value); + } + }); + return result; +} + +/* + * Returns a new function that wraps `fn` with a timer. The wrapper logs the + * time it takes to execute the function. + */ +function time(name, fn) { + var start = _.now(); + try { + return fn(); + } finally { + console.log(name + " time: " + (_.now() - start) + "ms"); + } +} + +function notime(name, fn) { + return fn(); +} + + +/***/ }), + +/***/ "./node_modules/dagre/lib/version.js": +/*!*******************************************!*\ + !*** ./node_modules/dagre/lib/version.js ***! + \*******************************************/ +/***/ ((module) => { + +module.exports = "0.8.5"; + + +/***/ }), + +/***/ "./node_modules/dompurify/dist/purify.js": +/*!***********************************************!*\ + !*** ./node_modules/dompurify/dist/purify.js ***! + \***********************************************/ +/***/ (function(module) { + +/*! @license DOMPurify 2.3.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.8/LICENSE */ + +(function (global, factory) { + true ? module.exports = factory() : + 0; +})(this, (function () { 'use strict'; + + function _typeof(obj) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }, _typeof(obj); + } + + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); + } + + function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + return true; + } catch (e) { + return false; + } + } + + function _construct(Parent, args, Class) { + if (_isNativeReflectConstruct()) { + _construct = Reflect.construct; + } else { + _construct = function _construct(Parent, args, Class) { + var a = [null]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) _setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + + return _construct.apply(null, arguments); + } + + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); + } + + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); + } + + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; + } + + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + var hasOwnProperty = Object.hasOwnProperty, + setPrototypeOf = Object.setPrototypeOf, + isFrozen = Object.isFrozen, + getPrototypeOf = Object.getPrototypeOf, + getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + var freeze = Object.freeze, + seal = Object.seal, + create = Object.create; // eslint-disable-line import/no-mutable-exports + + var _ref = typeof Reflect !== 'undefined' && Reflect, + apply = _ref.apply, + construct = _ref.construct; + + if (!apply) { + apply = function apply(fun, thisValue, args) { + return fun.apply(thisValue, args); + }; + } + + if (!freeze) { + freeze = function freeze(x) { + return x; + }; + } + + if (!seal) { + seal = function seal(x) { + return x; + }; + } + + if (!construct) { + construct = function construct(Func, args) { + return _construct(Func, _toConsumableArray(args)); + }; + } + + var arrayForEach = unapply(Array.prototype.forEach); + var arrayPop = unapply(Array.prototype.pop); + var arrayPush = unapply(Array.prototype.push); + var stringToLowerCase = unapply(String.prototype.toLowerCase); + var stringMatch = unapply(String.prototype.match); + var stringReplace = unapply(String.prototype.replace); + var stringIndexOf = unapply(String.prototype.indexOf); + var stringTrim = unapply(String.prototype.trim); + var regExpTest = unapply(RegExp.prototype.test); + var typeErrorCreate = unconstruct(TypeError); + function unapply(func) { + return function (thisArg) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + return apply(func, thisArg, args); + }; + } + function unconstruct(func) { + return function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return construct(func, args); + }; + } + /* Add properties to a lookup table */ + + function addToSet(set, array) { + if (setPrototypeOf) { + // Make 'in' and truthy checks like Boolean(set.constructor) + // independent of any properties defined on Object.prototype. + // Prevent prototype setters from intercepting set as a this value. + setPrototypeOf(set, null); + } + + var l = array.length; + + while (l--) { + var element = array[l]; + + if (typeof element === 'string') { + var lcElement = stringToLowerCase(element); + + if (lcElement !== element) { + // Config presets (e.g. tags.js, attrs.js) are immutable. + if (!isFrozen(array)) { + array[l] = lcElement; + } + + element = lcElement; + } + } + + set[element] = true; + } + + return set; + } + /* Shallow clone an object */ + + function clone(object) { + var newObject = create(null); + var property; + + for (property in object) { + if (apply(hasOwnProperty, object, [property])) { + newObject[property] = object[property]; + } + } + + return newObject; + } + /* IE10 doesn't support __lookupGetter__ so lets' + * simulate it. It also automatically checks + * if the prop is function or getter and behaves + * accordingly. */ + + function lookupGetter(object, prop) { + while (object !== null) { + var desc = getOwnPropertyDescriptor(object, prop); + + if (desc) { + if (desc.get) { + return unapply(desc.get); + } + + if (typeof desc.value === 'function') { + return unapply(desc.value); + } + } + + object = getPrototypeOf(object); + } + + function fallbackValue(element) { + console.warn('fallback value for', element); + return null; + } + + return fallbackValue; + } + + var html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']); // SVG + + var svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']); + var svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']); // List of SVG elements that are disallowed by default. + // We still need to know them so that we can do namespace + // checks properly in case one wants to add them to + // allow-list. + + var svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'fedropshadow', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']); + var mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover']); // Similarly to SVG, we want to know all MathML elements, + // even those that we disallow by default. + + var mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']); + var text = freeze(['#text']); + + var html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']); + var svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']); + var mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']); + var xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']); + + var MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode + + var ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm); + var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); // eslint-disable-line no-useless-escape + + var ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape + + var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape + ); + var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i); + var ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex + ); + var DOCTYPE_NAME = seal(/^html$/i); + + var getGlobal = function getGlobal() { + return typeof window === 'undefined' ? null : window; + }; + /** + * Creates a no-op policy for internal use only. + * Don't export this function outside this module! + * @param {?TrustedTypePolicyFactory} trustedTypes The policy factory. + * @param {Document} document The document object (to determine policy name suffix) + * @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types + * are not supported). + */ + + + var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, document) { + if (_typeof(trustedTypes) !== 'object' || typeof trustedTypes.createPolicy !== 'function') { + return null; + } // Allow the callers to control the unique policy name + // by adding a data-tt-policy-suffix to the script element with the DOMPurify. + // Policy creation with duplicate names throws in Trusted Types. + + + var suffix = null; + var ATTR_NAME = 'data-tt-policy-suffix'; + + if (document.currentScript && document.currentScript.hasAttribute(ATTR_NAME)) { + suffix = document.currentScript.getAttribute(ATTR_NAME); + } + + var policyName = 'dompurify' + (suffix ? '#' + suffix : ''); + + try { + return trustedTypes.createPolicy(policyName, { + createHTML: function createHTML(html) { + return html; + } + }); + } catch (_) { + // Policy creation failed (most likely another DOMPurify script has + // already run). Skip creating the policy, as this will only cause errors + // if TT are enforced. + console.warn('TrustedTypes policy ' + policyName + ' could not be created.'); + return null; + } + }; + + function createDOMPurify() { + var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal(); + + var DOMPurify = function DOMPurify(root) { + return createDOMPurify(root); + }; + /** + * Version label, exposed for easier checks + * if DOMPurify is up to date or not + */ + + + DOMPurify.version = '2.3.8'; + /** + * Array of elements that DOMPurify removed during sanitation. + * Empty if nothing was removed. + */ + + DOMPurify.removed = []; + + if (!window || !window.document || window.document.nodeType !== 9) { + // Not running in a browser, provide a factory function + // so that you can pass your own Window + DOMPurify.isSupported = false; + return DOMPurify; + } + + var originalDocument = window.document; + var document = window.document; + var DocumentFragment = window.DocumentFragment, + HTMLTemplateElement = window.HTMLTemplateElement, + Node = window.Node, + Element = window.Element, + NodeFilter = window.NodeFilter, + _window$NamedNodeMap = window.NamedNodeMap, + NamedNodeMap = _window$NamedNodeMap === void 0 ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap, + HTMLFormElement = window.HTMLFormElement, + DOMParser = window.DOMParser, + trustedTypes = window.trustedTypes; + var ElementPrototype = Element.prototype; + var cloneNode = lookupGetter(ElementPrototype, 'cloneNode'); + var getNextSibling = lookupGetter(ElementPrototype, 'nextSibling'); + var getChildNodes = lookupGetter(ElementPrototype, 'childNodes'); + var getParentNode = lookupGetter(ElementPrototype, 'parentNode'); // As per issue #47, the web-components registry is inherited by a + // new document created via createHTMLDocument. As per the spec + // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries) + // a new empty registry is used when creating a template contents owner + // document, so we use that as our parent document to ensure nothing + // is inherited. + + if (typeof HTMLTemplateElement === 'function') { + var template = document.createElement('template'); + + if (template.content && template.content.ownerDocument) { + document = template.content.ownerDocument; + } + } + + var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument); + + var emptyHTML = trustedTypesPolicy ? trustedTypesPolicy.createHTML('') : ''; + var _document = document, + implementation = _document.implementation, + createNodeIterator = _document.createNodeIterator, + createDocumentFragment = _document.createDocumentFragment, + getElementsByTagName = _document.getElementsByTagName; + var importNode = originalDocument.importNode; + var documentMode = {}; + + try { + documentMode = clone(document).documentMode ? document.documentMode : {}; + } catch (_) {} + + var hooks = {}; + /** + * Expose whether this browser supports running the full DOMPurify. + */ + + DOMPurify.isSupported = typeof getParentNode === 'function' && implementation && typeof implementation.createHTMLDocument !== 'undefined' && documentMode !== 9; + var MUSTACHE_EXPR$1 = MUSTACHE_EXPR, + ERB_EXPR$1 = ERB_EXPR, + DATA_ATTR$1 = DATA_ATTR, + ARIA_ATTR$1 = ARIA_ATTR, + IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, + ATTR_WHITESPACE$1 = ATTR_WHITESPACE; + var IS_ALLOWED_URI$1 = IS_ALLOWED_URI; + /** + * We consider the elements and attributes below to be safe. Ideally + * don't add any new ones but feel free to remove unwanted ones. + */ + + /* allowed element names */ + + var ALLOWED_TAGS = null; + var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray(html$1), _toConsumableArray(svg$1), _toConsumableArray(svgFilters), _toConsumableArray(mathMl$1), _toConsumableArray(text))); + /* Allowed attribute names */ + + var ALLOWED_ATTR = null; + var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray(html), _toConsumableArray(svg), _toConsumableArray(mathMl), _toConsumableArray(xml))); + /* + * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements. + * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements) + * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list) + * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`. + */ + + var CUSTOM_ELEMENT_HANDLING = Object.seal(Object.create(null, { + tagNameCheck: { + writable: true, + configurable: false, + enumerable: true, + value: null + }, + attributeNameCheck: { + writable: true, + configurable: false, + enumerable: true, + value: null + }, + allowCustomizedBuiltInElements: { + writable: true, + configurable: false, + enumerable: true, + value: false + } + })); + /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */ + + var FORBID_TAGS = null; + /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */ + + var FORBID_ATTR = null; + /* Decide if ARIA attributes are okay */ + + var ALLOW_ARIA_ATTR = true; + /* Decide if custom data attributes are okay */ + + var ALLOW_DATA_ATTR = true; + /* Decide if unknown protocols are okay */ + + var ALLOW_UNKNOWN_PROTOCOLS = false; + /* Output should be safe for common template engines. + * This means, DOMPurify removes data attributes, mustaches and ERB + */ + + var SAFE_FOR_TEMPLATES = false; + /* Decide if document with ... should be returned */ + + var WHOLE_DOCUMENT = false; + /* Track whether config is already set on this instance of DOMPurify. */ + + var SET_CONFIG = false; + /* Decide if all elements (e.g. style, script) must be children of + * document.body. By default, browsers might move them to document.head */ + + var FORCE_BODY = false; + /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html + * string (or a TrustedHTML object if Trusted Types are supported). + * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead + */ + + var RETURN_DOM = false; + /* Decide if a DOM `DocumentFragment` should be returned, instead of a html + * string (or a TrustedHTML object if Trusted Types are supported) */ + + var RETURN_DOM_FRAGMENT = false; + /* Try to return a Trusted Type object instead of a string, return a string in + * case Trusted Types are not supported */ + + var RETURN_TRUSTED_TYPE = false; + /* Output should be free from DOM clobbering attacks? */ + + var SANITIZE_DOM = true; + /* Keep element content when removing element? */ + + var KEEP_CONTENT = true; + /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead + * of importing it into a new Document and returning a sanitized copy */ + + var IN_PLACE = false; + /* Allow usage of profiles like html, svg and mathMl */ + + var USE_PROFILES = {}; + /* Tags to ignore content of when KEEP_CONTENT is true */ + + var FORBID_CONTENTS = null; + var DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']); + /* Tags that are safe for data: URIs */ + + var DATA_URI_TAGS = null; + var DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']); + /* Attributes safe for values like "javascript:" */ + + var URI_SAFE_ATTRIBUTES = null; + var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']); + var MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML'; + var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; + var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'; + /* Document namespace */ + + var NAMESPACE = HTML_NAMESPACE; + var IS_EMPTY_INPUT = false; + /* Parsing of strict XHTML documents */ + + var PARSER_MEDIA_TYPE; + var SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html']; + var DEFAULT_PARSER_MEDIA_TYPE = 'text/html'; + var transformCaseFunc; + /* Keep a reference to config to pass to hooks */ + + var CONFIG = null; + /* Ideally, do not touch anything below this line */ + + /* ______________________________________________ */ + + var formElement = document.createElement('form'); + + var isRegexOrFunction = function isRegexOrFunction(testValue) { + return testValue instanceof RegExp || testValue instanceof Function; + }; + /** + * _parseConfig + * + * @param {Object} cfg optional config literal + */ + // eslint-disable-next-line complexity + + + var _parseConfig = function _parseConfig(cfg) { + if (CONFIG && CONFIG === cfg) { + return; + } + /* Shield configuration object from tampering */ + + + if (!cfg || _typeof(cfg) !== 'object') { + cfg = {}; + } + /* Shield configuration object from prototype pollution */ + + + cfg = clone(cfg); + /* Set configuration parameters */ + + ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS) : DEFAULT_ALLOWED_TAGS; + ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR) : DEFAULT_ALLOWED_ATTR; + URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR) : DEFAULT_URI_SAFE_ATTRIBUTES; + DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS) : DEFAULT_DATA_URI_TAGS; + FORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS) : DEFAULT_FORBID_CONTENTS; + FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS) : {}; + FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR) : {}; + USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false; + ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true + + ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true + + ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false + + SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false + + WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false + + RETURN_DOM = cfg.RETURN_DOM || false; // Default false + + RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false + + RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false + + FORCE_BODY = cfg.FORCE_BODY || false; // Default false + + SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true + + KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true + + IN_PLACE = cfg.IN_PLACE || false; // Default false + + IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$1; + NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE; + + if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) { + CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck; + } + + if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) { + CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck; + } + + if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') { + CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements; + } + + PARSER_MEDIA_TYPE = // eslint-disable-next-line unicorn/prefer-includes + SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? PARSER_MEDIA_TYPE = DEFAULT_PARSER_MEDIA_TYPE : PARSER_MEDIA_TYPE = cfg.PARSER_MEDIA_TYPE; // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is. + + transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? function (x) { + return x; + } : stringToLowerCase; + + if (SAFE_FOR_TEMPLATES) { + ALLOW_DATA_ATTR = false; + } + + if (RETURN_DOM_FRAGMENT) { + RETURN_DOM = true; + } + /* Parse profile info */ + + + if (USE_PROFILES) { + ALLOWED_TAGS = addToSet({}, _toConsumableArray(text)); + ALLOWED_ATTR = []; + + if (USE_PROFILES.html === true) { + addToSet(ALLOWED_TAGS, html$1); + addToSet(ALLOWED_ATTR, html); + } + + if (USE_PROFILES.svg === true) { + addToSet(ALLOWED_TAGS, svg$1); + addToSet(ALLOWED_ATTR, svg); + addToSet(ALLOWED_ATTR, xml); + } + + if (USE_PROFILES.svgFilters === true) { + addToSet(ALLOWED_TAGS, svgFilters); + addToSet(ALLOWED_ATTR, svg); + addToSet(ALLOWED_ATTR, xml); + } + + if (USE_PROFILES.mathMl === true) { + addToSet(ALLOWED_TAGS, mathMl$1); + addToSet(ALLOWED_ATTR, mathMl); + addToSet(ALLOWED_ATTR, xml); + } + } + /* Merge configuration parameters */ + + + if (cfg.ADD_TAGS) { + if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) { + ALLOWED_TAGS = clone(ALLOWED_TAGS); + } + + addToSet(ALLOWED_TAGS, cfg.ADD_TAGS); + } + + if (cfg.ADD_ATTR) { + if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) { + ALLOWED_ATTR = clone(ALLOWED_ATTR); + } + + addToSet(ALLOWED_ATTR, cfg.ADD_ATTR); + } + + if (cfg.ADD_URI_SAFE_ATTR) { + addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR); + } + + if (cfg.FORBID_CONTENTS) { + if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) { + FORBID_CONTENTS = clone(FORBID_CONTENTS); + } + + addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS); + } + /* Add #text in case KEEP_CONTENT is set to true */ + + + if (KEEP_CONTENT) { + ALLOWED_TAGS['#text'] = true; + } + /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */ + + + if (WHOLE_DOCUMENT) { + addToSet(ALLOWED_TAGS, ['html', 'head', 'body']); + } + /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */ + + + if (ALLOWED_TAGS.table) { + addToSet(ALLOWED_TAGS, ['tbody']); + delete FORBID_TAGS.tbody; + } // Prevent further manipulation of configuration. + // Not available in IE8, Safari 5, etc. + + + if (freeze) { + freeze(cfg); + } + + CONFIG = cfg; + }; + + var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']); + var HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']); // Certain elements are allowed in both SVG and HTML + // namespace. We need to specify them explicitly + // so that they don't get erroneously deleted from + // HTML namespace. + + var COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']); + /* Keep track of all possible SVG and MathML tags + * so that we can perform the namespace checks + * correctly. */ + + var ALL_SVG_TAGS = addToSet({}, svg$1); + addToSet(ALL_SVG_TAGS, svgFilters); + addToSet(ALL_SVG_TAGS, svgDisallowed); + var ALL_MATHML_TAGS = addToSet({}, mathMl$1); + addToSet(ALL_MATHML_TAGS, mathMlDisallowed); + /** + * + * + * @param {Element} element a DOM element whose namespace is being checked + * @returns {boolean} Return false if the element has a + * namespace that a spec-compliant parser would never + * return. Return true otherwise. + */ + + var _checkValidNamespace = function _checkValidNamespace(element) { + var parent = getParentNode(element); // In JSDOM, if we're inside shadow DOM, then parentNode + // can be null. We just simulate parent in this case. + + if (!parent || !parent.tagName) { + parent = { + namespaceURI: HTML_NAMESPACE, + tagName: 'template' + }; + } + + var tagName = stringToLowerCase(element.tagName); + var parentTagName = stringToLowerCase(parent.tagName); + + if (element.namespaceURI === SVG_NAMESPACE) { + // The only way to switch from HTML namespace to SVG + // is via . If it happens via any other tag, then + // it should be killed. + if (parent.namespaceURI === HTML_NAMESPACE) { + return tagName === 'svg'; + } // The only way to switch from MathML to SVG is via + // svg if parent is either or MathML + // text integration points. + + + if (parent.namespaceURI === MATHML_NAMESPACE) { + return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]); + } // We only allow elements that are defined in SVG + // spec. All others are disallowed in SVG namespace. + + + return Boolean(ALL_SVG_TAGS[tagName]); + } + + if (element.namespaceURI === MATHML_NAMESPACE) { + // The only way to switch from HTML namespace to MathML + // is via . If it happens via any other tag, then + // it should be killed. + if (parent.namespaceURI === HTML_NAMESPACE) { + return tagName === 'math'; + } // The only way to switch from SVG to MathML is via + // and HTML integration points + + + if (parent.namespaceURI === SVG_NAMESPACE) { + return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName]; + } // We only allow elements that are defined in MathML + // spec. All others are disallowed in MathML namespace. + + + return Boolean(ALL_MATHML_TAGS[tagName]); + } + + if (element.namespaceURI === HTML_NAMESPACE) { + // The only way to switch from SVG to HTML is via + // HTML integration points, and from MathML to HTML + // is via MathML text integration points + if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) { + return false; + } + + if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) { + return false; + } // We disallow tags that are specific for MathML + // or SVG and should never appear in HTML namespace + + + return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]); + } // The code should never reach this place (this means + // that the element somehow got namespace that is not + // HTML, SVG or MathML). Return false just in case. + + + return false; + }; + /** + * _forceRemove + * + * @param {Node} node a DOM node + */ + + + var _forceRemove = function _forceRemove(node) { + arrayPush(DOMPurify.removed, { + element: node + }); + + try { + // eslint-disable-next-line unicorn/prefer-dom-node-remove + node.parentNode.removeChild(node); + } catch (_) { + try { + node.outerHTML = emptyHTML; + } catch (_) { + node.remove(); + } + } + }; + /** + * _removeAttribute + * + * @param {String} name an Attribute name + * @param {Node} node a DOM node + */ + + + var _removeAttribute = function _removeAttribute(name, node) { + try { + arrayPush(DOMPurify.removed, { + attribute: node.getAttributeNode(name), + from: node + }); + } catch (_) { + arrayPush(DOMPurify.removed, { + attribute: null, + from: node + }); + } + + node.removeAttribute(name); // We void attribute values for unremovable "is"" attributes + + if (name === 'is' && !ALLOWED_ATTR[name]) { + if (RETURN_DOM || RETURN_DOM_FRAGMENT) { + try { + _forceRemove(node); + } catch (_) {} + } else { + try { + node.setAttribute(name, ''); + } catch (_) {} + } + } + }; + /** + * _initDocument + * + * @param {String} dirty a string of dirty markup + * @return {Document} a DOM, filled with the dirty markup + */ + + + var _initDocument = function _initDocument(dirty) { + /* Create a HTML document */ + var doc; + var leadingWhitespace; + + if (FORCE_BODY) { + dirty = '' + dirty; + } else { + /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */ + var matches = stringMatch(dirty, /^[\r\n\t ]+/); + leadingWhitespace = matches && matches[0]; + } + + if (PARSER_MEDIA_TYPE === 'application/xhtml+xml') { + // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict) + dirty = '' + dirty + ''; + } + + var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty; + /* + * Use the DOMParser API by default, fallback later if needs be + * DOMParser not work for svg when has multiple root element. + */ + + if (NAMESPACE === HTML_NAMESPACE) { + try { + doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE); + } catch (_) {} + } + /* Use createHTMLDocument in case DOMParser is not available */ + + + if (!doc || !doc.documentElement) { + doc = implementation.createDocument(NAMESPACE, 'template', null); + + try { + doc.documentElement.innerHTML = IS_EMPTY_INPUT ? '' : dirtyPayload; + } catch (_) {// Syntax error if dirtyPayload is invalid xml + } + } + + var body = doc.body || doc.documentElement; + + if (dirty && leadingWhitespace) { + body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null); + } + /* Work on whole document or just its body */ + + + if (NAMESPACE === HTML_NAMESPACE) { + return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0]; + } + + return WHOLE_DOCUMENT ? doc.documentElement : body; + }; + /** + * _createIterator + * + * @param {Document} root document/fragment to create iterator for + * @return {Iterator} iterator instance + */ + + + var _createIterator = function _createIterator(root) { + return createNodeIterator.call(root.ownerDocument || root, root, // eslint-disable-next-line no-bitwise + NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null, false); + }; + /** + * _isClobbered + * + * @param {Node} elm element to check for clobbering attacks + * @return {Boolean} true if clobbered, false if safe + */ + + + var _isClobbered = function _isClobbered(elm) { + return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function'); + }; + /** + * _isNode + * + * @param {Node} obj object to check whether it's a DOM node + * @return {Boolean} true is object is a DOM node + */ + + + var _isNode = function _isNode(object) { + return _typeof(Node) === 'object' ? object instanceof Node : object && _typeof(object) === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'; + }; + /** + * _executeHook + * Execute user configurable hooks + * + * @param {String} entryPoint Name of the hook's entry point + * @param {Node} currentNode node to work on with the hook + * @param {Object} data additional hook parameters + */ + + + var _executeHook = function _executeHook(entryPoint, currentNode, data) { + if (!hooks[entryPoint]) { + return; + } + + arrayForEach(hooks[entryPoint], function (hook) { + hook.call(DOMPurify, currentNode, data, CONFIG); + }); + }; + /** + * _sanitizeElements + * + * @protect nodeName + * @protect textContent + * @protect removeChild + * + * @param {Node} currentNode to check for permission to exist + * @return {Boolean} true if node was killed, false if left alive + */ + + + var _sanitizeElements = function _sanitizeElements(currentNode) { + var content; + /* Execute a hook if present */ + + _executeHook('beforeSanitizeElements', currentNode, null); + /* Check if element is clobbered or can clobber */ + + + if (_isClobbered(currentNode)) { + _forceRemove(currentNode); + + return true; + } + /* Check if tagname contains Unicode */ + + + if (regExpTest(/[\u0080-\uFFFF]/, currentNode.nodeName)) { + _forceRemove(currentNode); + + return true; + } + /* Now let's check the element's type and name */ + + + var tagName = transformCaseFunc(currentNode.nodeName); + /* Execute a hook if present */ + + _executeHook('uponSanitizeElement', currentNode, { + tagName: tagName, + allowedTags: ALLOWED_TAGS + }); + /* Detect mXSS attempts abusing namespace confusion */ + + + if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) { + _forceRemove(currentNode); + + return true; + } + /* Mitigate a problem with templates inside select */ + + + if (tagName === 'select' && regExpTest(/