diff --git a/bower.json b/bower.json index 6e24975db..129dc532c 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "mermaid", - "version": "0.2.3", + "version": "0.2.4", "authors": [ "knsv " ], diff --git a/dist/mermaid.full.js b/dist/mermaid.full.js index 56245c33f..5638c5f3e 100644 --- a/dist/mermaid.full.js +++ b/dist/mermaid.full.js @@ -386,7 +386,7 @@ var addVertices = function (vert, g) { // Create the node in the graph based on defined form if (vertice.type === 'round') { - g.setNode(vertice.id, {label: verticeText, rx: 5, ry: 5, style: style, id:vertice.id}); + g.setNode(vertice.id, {labelType: "html",label: verticeText, rx: 5, ry: 5, style: style, id:vertice.id}); } else { if (vertice.type === 'diamond') { g.setNode(vertice.id, {shape: "question", label: verticeText, rx: 0, ry: 0, style: style, id:vertice.id}); @@ -578,7 +578,7 @@ var init = function () { * @returns {string} */ exports.version = function(){ - return '0.2.3'; + return '0.2.4'; } var equals = function (val, variable){ @@ -892,12 +892,12 @@ exports.defaultStyle = function () { } */ 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,7],$V1=[2,13],$V2=[1,21],$V3=[1,22],$V4=[1,23],$V5=[1,24],$V6=[1,25],$V7=[1,26],$V8=[1,27],$V9=[1,28],$Va=[1,29],$Vb=[1,30],$Vc=[1,15],$Vd=[1,16],$Ve=[1,17],$Vf=[1,14],$Vg=[6,9],$Vh=[11,30,31,32,33,34,35,36,37,38,39,40,48,50,51,52],$Vi=[2,7],$Vj=[11,43,44,45,46],$Vk=[9,11,21,23,24,25,26,27,43,44,45,46,47],$Vl=[9,11,21,23,24,25,26,27,31,32,33,34,35,36,37,38,39,40,43,44,45,46,47],$Vm=[9,11,21,23,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,43,44,45,46,47],$Vn=[31,32,33,34,35,36,37,38,39,40],$Vo=[31,32,33,34,35,36,37,38,39,40,47],$Vp=[23,25,27,47],$Vq=[1,93],$Vr=[1,90],$Vs=[1,88],$Vt=[1,91],$Vu=[1,89],$Vv=[1,94],$Vw=[1,92],$Vx=[1,101],$Vy=[11,34],$Vz=[9,11,30,31,32,33,34,53,56]; +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,7],$V1=[1,21],$V2=[1,22],$V3=[1,23],$V4=[1,24],$V5=[1,25],$V6=[1,26],$V7=[1,27],$V8=[1,28],$V9=[1,29],$Va=[1,30],$Vb=[1,31],$Vc=[1,15],$Vd=[1,16],$Ve=[1,17],$Vf=[1,14],$Vg=[31,32,33,34,35,36,37,38,39,40,41,51,53,54,55],$Vh=[11,44,45,46,47],$Vi=[9,11,21,24,26,44,45,46,47],$Vj=[9,11,21,24,26,31,32,33,34,35,36,37,38,39,40,41,44,45,46,47],$Vk=[9,11,21,24,26,30,31,32,33,34,35,36,37,38,39,40,41,44,45,46,47],$Vl=[6,9],$Vm=[31,32,33,34,35,36,37,38,39,40,41],$Vn=[31,32,33,34,35,36,37,38,39,40,41,48],$Vo=[1,81],$Vp=[1,82],$Vq=[1,70],$Vr=[1,71],$Vs=[1,72],$Vt=[1,73],$Vu=[1,74],$Vv=[1,75],$Vw=[1,76],$Vx=[1,77],$Vy=[1,78],$Vz=[1,79],$VA=[1,80],$VB=[9,23,25,27,30,31,32,33,34,35,36,37,38,39,40,41,48],$VC=[1,106],$VD=[1,103],$VE=[1,101],$VF=[1,104],$VG=[1,102],$VH=[1,109],$VI=[1,108],$VJ=[1,107],$VK=[1,105],$VL=[1,114],$VM=[11,34],$VN=[9,11,30,31,32,33,34,38,41,56,59]; var parser = {trace: function trace() { }, yy: {}, -symbols_: {"error":2,"expressions":3,"graphConfig":4,"statements":5,"EOF":6,"spaceList":7,"GRAPH":8,"SPACE":9,"DIR":10,"SEMI":11,"statement":12,"verticeStatement":13,"styleStatement":14,"classDefStatement":15,"classStatement":16,"clickStatement":17,"vertex":18,"link":19,"alphaNum":20,"SQS":21,"text":22,"SQE":23,"PS":24,"PE":25,"DIAMOND_START":26,"DIAMOND_STOP":27,"alphaNumStatement":28,"alphaNumToken":29,"MINUS":30,"ALPHA":31,"NUM":32,"COLON":33,"COMMA":34,"PLUS":35,"EQUALS":36,"MULT":37,"DOT":38,"TAGSTART":39,"TAGEND":40,"linkStatement":41,"arrowText":42,"ARROW_POINT":43,"ARROW_CIRCLE":44,"ARROW_CROSS":45,"ARROW_OPEN":46,"PIPE":47,"CLASSDEF":48,"stylesOpt":49,"CLASS":50,"CLICK":51,"STYLE":52,"HEX":53,"style":54,"styleComponent":55,"UNIT":56,"$accept":0,"$end":1}, -terminals_: {2:"error",6:"EOF",8:"GRAPH",9:"SPACE",10:"DIR",11:"SEMI",21:"SQS",23:"SQE",24:"PS",25:"PE",26:"DIAMOND_START",27:"DIAMOND_STOP",30:"MINUS",31:"ALPHA",32:"NUM",33:"COLON",34:"COMMA",35:"PLUS",36:"EQUALS",37:"MULT",38:"DOT",39:"TAGSTART",40:"TAGEND",43:"ARROW_POINT",44:"ARROW_CIRCLE",45:"ARROW_CROSS",46:"ARROW_OPEN",47:"PIPE",48:"CLASSDEF",50:"CLASS",51:"CLICK",52:"STYLE",53:"HEX",56:"UNIT"}, -productions_: [0,[3,3],[3,4],[4,4],[5,3],[5,1],[7,2],[7,1],[12,2],[12,2],[12,2],[12,2],[12,2],[13,0],[13,3],[13,1],[18,4],[18,4],[18,4],[18,1],[20,1],[20,2],[28,1],[28,3],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[19,2],[19,1],[41,1],[41,1],[41,1],[41,1],[42,3],[22,3],[22,5],[22,1],[15,5],[16,5],[17,5],[14,5],[14,5],[49,1],[49,3],[54,1],[54,2],[55,1],[55,1],[55,1],[55,1],[55,1],[55,1],[55,1]], +symbols_: {"error":2,"expressions":3,"graphConfig":4,"statements":5,"EOF":6,"spaceList":7,"GRAPH":8,"SPACE":9,"DIR":10,"SEMI":11,"statement":12,"verticeStatement":13,"styleStatement":14,"classDefStatement":15,"classStatement":16,"clickStatement":17,"vertex":18,"link":19,"alphaNum":20,"SQS":21,"text":22,"SQE":23,"PS":24,"PE":25,"DIAMOND_START":26,"DIAMOND_STOP":27,"alphaNumStatement":28,"alphaNumToken":29,"MINUS":30,"ALPHA":31,"NUM":32,"COLON":33,"COMMA":34,"PLUS":35,"EQUALS":36,"MULT":37,"DOT":38,"TAGSTART":39,"TAGEND":40,"BRKT":41,"linkStatement":42,"arrowText":43,"ARROW_POINT":44,"ARROW_CIRCLE":45,"ARROW_CROSS":46,"ARROW_OPEN":47,"PIPE":48,"textToken":49,"textStatement":50,"CLASSDEF":51,"stylesOpt":52,"CLASS":53,"CLICK":54,"STYLE":55,"HEX":56,"style":57,"styleComponent":58,"UNIT":59,"$accept":0,"$end":1}, +terminals_: {2:"error",6:"EOF",8:"GRAPH",9:"SPACE",10:"DIR",11:"SEMI",21:"SQS",23:"SQE",24:"PS",25:"PE",26:"DIAMOND_START",27:"DIAMOND_STOP",30:"MINUS",31:"ALPHA",32:"NUM",33:"COLON",34:"COMMA",35:"PLUS",36:"EQUALS",37:"MULT",38:"DOT",39:"TAGSTART",40:"TAGEND",41:"BRKT",44:"ARROW_POINT",45:"ARROW_CIRCLE",46:"ARROW_CROSS",47:"ARROW_OPEN",48:"PIPE",51:"CLASSDEF",53:"CLASS",54:"CLICK",55:"STYLE",56:"HEX",59:"UNIT"}, +productions_: [0,[3,3],[3,4],[4,4],[5,3],[5,1],[7,2],[7,1],[12,2],[12,2],[12,2],[12,2],[12,2],[13,3],[13,1],[18,4],[18,4],[18,4],[18,1],[20,1],[20,2],[28,1],[28,3],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[19,2],[19,1],[42,1],[42,1],[42,1],[42,1],[43,3],[22,1],[22,2],[50,1],[50,2],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[15,5],[16,5],[17,5],[14,5],[14,5],[52,1],[52,3],[57,1],[57,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ @@ -909,36 +909,39 @@ break; case 3: yy.setDirection($$[$0-1]);this.$ = $$[$0-1]; break; -case 14: +case 13: yy.addLink($$[$0-2],$$[$0],$$[$0-1]);this.$ = 'oy' break; -case 15: +case 14: this.$ = 'yo'; break; -case 16: +case 15: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'square'); break; -case 17: +case 16: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'round'); break; -case 18: +case 17: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'diamond'); break; -case 19: +case 18: this.$ = $$[$0];yy.addVertex($$[$0]); break; -case 20: case 22: case 24: case 25: case 51: +case 19: case 21: case 23: case 24: case 41: case 45: case 46: case 65: this.$=$$[$0]; break; -case 21: +case 20: case 42: this.$=$$[$0-1]+''+$$[$0]; break; -case 23: +case 22: this.$=$$[$0-2]+'-'+$$[$0]; break; -case 26: case 27: case 28: case 29: case 30: case 31: case 32: case 33: case 35: case 43: +case 25: case 26: case 27: case 28: case 29: case 30: case 31: case 32: case 35: case 47: case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 56: case 57: this.$ = $$[$0]; break; +case 33: case 55: +this.$ = '
'; +break; case 34: $$[$0-1].text = $$[$0];this.$ = $$[$0-1]; break; @@ -957,43 +960,37 @@ break; case 40: this.$ = $$[$0-1]; break; -case 41: -this.$ = $$[$0-2] + ' ' +$$[$0]; -break; -case 42: -this.$ = $$[$0-4] + ' - ' +$$[$0]; -break; -case 44: +case 58: this.$ = $$[$0-4];yy.addClass($$[$0-2],$$[$0]); break; -case 45: +case 59: this.$ = $$[$0-4];yy.setClass($$[$0-2], $$[$0]); break; -case 46: +case 60: this.$ = $$[$0-4];yy.setClickEvent($$[$0-2], $$[$0]); break; -case 47: +case 61: this.$ = $$[$0-4];yy.addVertex($$[$0-2],undefined,undefined,$$[$0]); break; -case 48: +case 62: this.$ = $$[$0-4];yy.updateLink($$[$0-2],$$[$0]); break; -case 49: +case 63: this.$ = [$$[$0]] break; -case 50: +case 64: $$[$0-2].push($$[$0]);this.$ = $$[$0-2]; break; -case 52: +case 66: this.$ = $$[$0-1] + $$[$0]; break; -case 53: case 54: case 55: case 56: case 57: case 58: case 59: +case 67: case 68: case 69: case 70: case 71: case 72: case 73: case 74: case 75: this.$=$$[$0] break; } }, -table: [{3:1,4:2,8:[1,3]},{1:[3]},{5:4,7:5,9:$V0,11:$V1,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb,48:$Vc,50:$Vd,51:$Ve,52:$Vf},{9:[1,31]},{6:[1,32],7:33,9:$V0},{5:34,11:$V1,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb,48:$Vc,50:$Vd,51:$Ve,52:$Vf},o($Vg,[2,5]),o($Vh,$Vi,{7:35,9:$V0}),{11:[1,36]},{11:[1,37]},{11:[1,38]},{11:[1,39]},{11:[1,40]},{11:[2,15],19:41,41:42,43:[1,43],44:[1,44],45:[1,45],46:[1,46]},{9:[1,47]},{9:[1,48]},{9:[1,49]},{9:[1,50]},o($Vj,[2,19],{21:[1,51],24:[1,52],26:[1,53]}),o($Vk,[2,20],{28:19,29:20,20:54,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb}),o($Vl,[2,22],{30:[1,55]}),o($Vm,[2,24]),o($Vm,[2,25]),o($Vm,[2,26]),o($Vm,[2,27]),o($Vm,[2,28]),o($Vm,[2,29]),o($Vm,[2,30]),o($Vm,[2,31]),o($Vm,[2,32]),o($Vm,[2,33]),{10:[1,56]},{1:[2,1]},{11:$V1,12:57,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb,48:$Vc,50:$Vd,51:$Ve,52:$Vf},{6:[1,58],7:33,9:$V0},o($Vh,[2,6]),o($Vg,[2,8]),o($Vg,[2,9]),o($Vg,[2,10]),o($Vg,[2,11]),o($Vg,[2,12]),{18:59,20:18,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},o($Vn,[2,35],{42:60,47:[1,61]}),o($Vo,[2,36]),o($Vo,[2,37]),o($Vo,[2,38]),o($Vo,[2,39]),{20:62,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb,53:[1,63]},{20:64,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{20:65,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{20:66,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{20:68,22:67,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{20:68,22:69,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{20:68,22:70,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},o($Vk,[2,21]),{29:71,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{11:[1,72]},o($Vg,[2,4]),{1:[2,2]},{11:[2,14]},o($Vn,[2,34]),{20:68,22:73,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{9:[1,74]},{9:[1,75]},{9:[1,76]},{9:[1,77]},{9:[1,78]},{23:[1,79]},o($Vp,[2,43],{7:81,9:[1,80]}),{25:[1,82]},{27:[1,83]},o($Vl,[2,23]),o([9,11,31,32,33,34,35,36,37,38,39,40,48,50,51,52],[2,3]),{47:[1,84]},{9:$Vq,30:$Vr,31:$Vs,32:$Vt,33:$Vu,49:85,53:$Vv,54:86,55:87,56:$Vw},{9:$Vq,30:$Vr,31:$Vs,32:$Vt,33:$Vu,49:95,53:$Vv,54:86,55:87,56:$Vw},{9:$Vq,30:$Vr,31:$Vs,32:$Vt,33:$Vu,49:96,53:$Vv,54:86,55:87,56:$Vw},{20:97,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{20:98,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},o($Vj,[2,16]),{7:35,9:$V0,20:68,22:99,28:19,29:20,30:$Vi,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{30:[1,100]},o($Vj,[2,17]),o($Vj,[2,18]),o($Vn,[2,40]),{11:[2,47],34:$Vx},o($Vy,[2,49],{55:102,9:$Vq,30:$Vr,31:$Vs,32:$Vt,33:$Vu,53:$Vv,56:$Vw}),o($Vz,[2,51]),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]),{11:[2,48],34:$Vx},{11:[2,44],34:$Vx},{11:[2,45]},{11:[2,46]},o($Vp,[2,41]),{7:103,9:$V0},{9:$Vq,30:$Vr,31:$Vs,32:$Vt,33:$Vu,53:$Vv,54:104,55:87,56:$Vw},o($Vz,[2,52]),{20:68,22:105,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},o($Vy,[2,50],{55:102,9:$Vq,30:$Vr,31:$Vs,32:$Vt,33:$Vu,53:$Vv,56:$Vw}),o($Vp,[2,42])], -defaultActions: {32:[2,1],58:[2,2],59:[2,14],97:[2,45],98:[2,46]}, +table: [{3:1,4:2,8:[1,3]},{1:[3]},{5:4,7:5,9:$V0,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb,51:$Vc,53:$Vd,54:$Ve,55:$Vf},{9:[1,32]},{6:[1,33]},{5:34,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb,51:$Vc,53:$Vd,54:$Ve,55:$Vf},{6:[2,5],7:35,9:$V0},o($Vg,[2,7],{7:36,9:$V0}),{11:[1,37]},{11:[1,38]},{11:[1,39]},{11:[1,40]},{11:[1,41]},{11:[2,14],19:42,42:43,44:[1,44],45:[1,45],46:[1,46],47:[1,47]},{9:[1,48]},{9:[1,49]},{9:[1,50]},{9:[1,51]},o($Vh,[2,18],{21:[1,52],24:[1,53],26:[1,54]}),o($Vi,[2,19],{28:19,29:20,20:55,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb}),o($Vj,[2,21],{30:[1,56]}),o($Vk,[2,23]),o($Vk,[2,24]),o($Vk,[2,25]),o($Vk,[2,26]),o($Vk,[2,27]),o($Vk,[2,28]),o($Vk,[2,29]),o($Vk,[2,30]),o($Vk,[2,31]),o($Vk,[2,32]),o($Vk,[2,33]),{10:[1,57]},{1:[2,1]},{6:[1,58]},{5:59,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb,51:$Vc,53:$Vd,54:$Ve,55:$Vf},o($Vg,[2,6]),o($Vl,[2,8]),o($Vl,[2,9]),o($Vl,[2,10]),o($Vl,[2,11]),o($Vl,[2,12]),{18:60,20:18,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb},o($Vm,[2,35],{43:61,48:[1,62]}),o($Vn,[2,36]),o($Vn,[2,37]),o($Vn,[2,38]),o($Vn,[2,39]),{20:63,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb,56:[1,64]},{20:65,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb},{20:66,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb},{20:67,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb},{9:$Vo,22:68,30:$Vp,31:$Vq,32:$Vr,33:$Vs,34:$Vt,35:$Vu,36:$Vv,37:$Vw,38:$Vx,39:$Vy,40:$Vz,41:$VA,49:69},{9:$Vo,22:83,30:$Vp,31:$Vq,32:$Vr,33:$Vs,34:$Vt,35:$Vu,36:$Vv,37:$Vw,38:$Vx,39:$Vy,40:$Vz,41:$VA,49:69},{9:$Vo,22:84,30:$Vp,31:$Vq,32:$Vr,33:$Vs,34:$Vt,35:$Vu,36:$Vv,37:$Vw,38:$Vx,39:$Vy,40:$Vz,41:$VA,49:69},o($Vi,[2,20]),{29:85,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb},{11:[1,86]},{1:[2,2]},{6:[2,4]},{11:[2,13]},o($Vm,[2,34]),{9:$Vo,22:87,30:$Vp,31:$Vq,32:$Vr,33:$Vs,34:$Vt,35:$Vu,36:$Vv,37:$Vw,38:$Vx,39:$Vy,40:$Vz,41:$VA,49:69},{9:[1,88]},{9:[1,89]},{9:[1,90]},{9:[1,91]},{9:[1,92]},{9:$Vo,23:[1,93],30:$Vp,31:$Vq,32:$Vr,33:$Vs,34:$Vt,35:$Vu,36:$Vv,37:$Vw,38:$Vx,39:$Vy,40:$Vz,41:$VA,49:94},o($VB,[2,41]),o($VB,[2,45]),o($VB,[2,46]),o($VB,[2,47]),o($VB,[2,48]),o($VB,[2,49]),o($VB,[2,50]),o($VB,[2,51]),o($VB,[2,52]),o($VB,[2,53]),o($VB,[2,54]),o($VB,[2,55]),o($VB,[2,56]),o($VB,[2,57]),{9:$Vo,25:[1,95],30:$Vp,31:$Vq,32:$Vr,33:$Vs,34:$Vt,35:$Vu,36:$Vv,37:$Vw,38:$Vx,39:$Vy,40:$Vz,41:$VA,49:94},{9:$Vo,27:[1,96],30:$Vp,31:$Vq,32:$Vr,33:$Vs,34:$Vt,35:$Vu,36:$Vv,37:$Vw,38:$Vx,39:$Vy,40:$Vz,41:$VA,49:94},o($Vj,[2,22]),o([9,31,32,33,34,35,36,37,38,39,40,41,51,53,54,55],[2,3]),{9:$Vo,30:$Vp,31:$Vq,32:$Vr,33:$Vs,34:$Vt,35:$Vu,36:$Vv,37:$Vw,38:$Vx,39:$Vy,40:$Vz,41:$VA,48:[1,97],49:94},{9:$VC,30:$VD,31:$VE,32:$VF,33:$VG,38:$VH,41:$VI,52:98,56:$VJ,57:99,58:100,59:$VK},{9:$VC,30:$VD,31:$VE,32:$VF,33:$VG,38:$VH,41:$VI,52:110,56:$VJ,57:99,58:100,59:$VK},{9:$VC,30:$VD,31:$VE,32:$VF,33:$VG,38:$VH,41:$VI,52:111,56:$VJ,57:99,58:100,59:$VK},{20:112,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb},{20:113,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb},o($Vh,[2,15]),o($VB,[2,42]),o($Vh,[2,16]),o($Vh,[2,17]),o($Vm,[2,40]),{11:[2,61],34:$VL},o($VM,[2,63],{58:115,9:$VC,30:$VD,31:$VE,32:$VF,33:$VG,38:$VH,41:$VI,56:$VJ,59:$VK}),o($VN,[2,65]),o($VN,[2,67]),o($VN,[2,68]),o($VN,[2,69]),o($VN,[2,70]),o($VN,[2,71]),o($VN,[2,72]),o($VN,[2,73]),o($VN,[2,74]),o($VN,[2,75]),{11:[2,62],34:$VL},{11:[2,58],34:$VL},{11:[2,59]},{11:[2,60]},{9:$VC,30:$VD,31:$VE,32:$VF,33:$VG,38:$VH,41:$VI,56:$VJ,57:116,58:100,59:$VK},o($VN,[2,66]),o($VM,[2,64],{58:115,9:$VC,30:$VD,31:$VE,32:$VF,33:$VG,38:$VH,41:$VI,56:$VJ,59:$VK})], +defaultActions: {33:[2,1],58:[2,2],59:[2,4],60:[2,13],112:[2,59],113:[2,60]}, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); @@ -1466,13 +1463,13 @@ options: {}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { var YYSTATE=YY_START; switch($avoiding_name_collisions) { -case 0:return 52; +case 0:return 55; break; -case 1:return 48; +case 1:return 51; break; -case 2:return 50; +case 2:return 53; break; -case 3:return 51; +case 3:return 54; break; case 4:return 8; break; @@ -1488,74 +1485,66 @@ case 9:return 10; break; case 10:return 10; break; -case 11:return 53; +case 11:return 32; break; -case 12:return 32; +case 12:return 41; break; -case 13:return 'BRKT'; +case 13:return 33; break; -case 14:return 56; +case 14:return 11; break; -case 15:return 56; +case 15:return 34; break; -case 16:return 56; +case 16:return 36; break; -case 17:return 33; +case 17:return 37; break; -case 18:return 11; +case 18:return 38; break; -case 19:return 34; +case 19:return 39; break; -case 20:return 36; +case 20:return 40; break; -case 21:return 37; +case 21:return 46; break; -case 22:return 38; +case 22:return 44; break; -case 23:return 39; +case 23:return 45; break; -case 24:return 40; +case 24:return 47; break; -case 25:return 45; +case 25:return 30; break; -case 26:return 43; +case 26:return 35; break; -case 27:return 44; +case 27:return 36; break; -case 28:return 46; +case 28:return 31; break; -case 29:return 30; +case 29:return 48; break; -case 30:return 35; +case 30:return 24; break; -case 31:return 36; +case 31:return 25; break; -case 32:return 31; +case 32:return 21; break; -case 33:return 47; +case 33:return 23; break; -case 34:return 24; +case 34:return 26 break; -case 35:return 25; +case 35:return 27 break; -case 36:return 21; +case 36:return 9; break; -case 37:return 23; +case 37:return 'NEWLINE'; break; -case 38:return 26 -break; -case 39:return 27 -break; -case 40:return 9; -break; -case 41:return 'NEWLINE'; -break; -case 42:return 6; +case 38:return 6; break; } }, -rules: [/^(?:style\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:#[a-f0-9]+)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?:px\b)/,/^(?:pt\b)/,/^(?:dot\b)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:<)/,/^(?:>)/,/^(?:--[x])/,/^(?:-->)/,/^(?:--[o])/,/^(?:---)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[a-zåäöæøA-ZÅÄÖÆØ_]+)/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:\s)/,/^(?:\n)/,/^(?:$)/], -conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,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],"inclusive":true}} +rules: [/^(?:style\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9])/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:<)/,/^(?:>)/,/^(?:--[x])/,/^(?:-->)/,/^(?:--[o])/,/^(?:---)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[a-zåäöæøA-ZÅÄÖÆØ_])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:\s)/,/^(?:\n)/,/^(?:$)/], +conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,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],"inclusive":true}} }); return lexer; })(); diff --git a/dist/mermaid.full.min.js b/dist/mermaid.full.min.js index 49bdfb44d..0ffca3a42 100644 --- a/dist/mermaid.full.min.js +++ b/dist/mermaid.full.min.js @@ -30,5 +30,5 @@ module.exports={graphlib:require("./lib/graphlib"),dagre:require("./lib/dagre"), }));_.each(g.nodes(),function(v){var node=g.node(v);if(_.has(node,"rank")){node.rank-=min}})}function removeEmptyRanks(g){var offset=_.min(_.map(g.nodes(),function(v){return g.node(v).rank}));var layers=[];_.each(g.nodes(),function(v){var rank=g.node(v).rank-offset;if(!_.has(layers,rank)){layers[rank]=[]}layers[rank].push(v)});var delta=0,nodeRankFactor=g.graph().nodeRankFactor;_.each(layers,function(vs,i){if(_.isUndefined(vs)&&i%nodeRankFactor!==0){--delta}else if(delta){_.each(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}}))}function partition(collection,fn){var result={lhs:[],rhs:[]};_.each(collection,function(value){if(fn(value)){result.lhs.push(value)}else{result.rhs.push(value)}});return result}function time(name,fn){var start=_.now();try{return fn()}finally{console.log(name+" time: "+(_.now()-start)+"ms")}}function notime(name,fn){return fn()}},{"./graphlib":33,"./lodash":36}],56:[function(require,module,exports){module.exports="0.6.1"},{}],57:[function(require,module,exports){var lib=require("./lib");module.exports={Graph:lib.Graph,json:require("./lib/json"),alg:require("./lib/alg"),version:lib.version}},{"./lib":73,"./lib/alg":64,"./lib/json":74}],58:[function(require,module,exports){var _=require("../lodash");module.exports=components;function components(g){var visited={},cmpts=[],cmpt;function dfs(v){if(_.has(visited,v))return;visited[v]=true;cmpt.push(v);_.each(g.successors(v),dfs);_.each(g.predecessors(v),dfs)}_.each(g.nodes(),function(v){cmpt=[];dfs(v);if(cmpt.length){cmpts.push(cmpt)}});return cmpts}},{"../lodash":75}],59:[function(require,module,exports){var _=require("../lodash");module.exports=dfs;function dfs(g,vs,order){if(!_.isArray(vs)){vs=[vs]}var acc=[],visited={};_.each(vs,function(v){if(!g.hasNode(v)){throw new Error("Graph does not have node: "+v)}doDfs(g,v,order==="post",visited,acc)});return acc}function doDfs(g,v,postorder,visited,acc){if(!_.has(visited,v)){visited[v]=true;if(!postorder){acc.push(v)}_.each(g.neighbors(v),function(w){doDfs(g,w,postorder,visited,acc)});if(postorder){acc.push(v)}}}},{"../lodash":75}],60:[function(require,module,exports){var dijkstra=require("./dijkstra"),_=require("../lodash");module.exports=dijkstraAll;function dijkstraAll(g,weightFunc,edgeFunc){return _.transform(g.nodes(),function(acc,v){acc[v]=dijkstra(g,v,weightFunc,edgeFunc)},{})}},{"../lodash":75,"./dijkstra":61}],61:[function(require,module,exports){var _=require("../lodash"),PriorityQueue=require("../data/priority-queue");module.exports=dijkstra;var DEFAULT_WEIGHT_FUNC=_.constant(1);function dijkstra(g,source,weightFn,edgeFn){return runDijkstra(g,String(source),weightFn||DEFAULT_WEIGHT_FUNC,edgeFn||function(v){return g.outEdges(v)})}function runDijkstra(g,source,weightFn,edgeFn){var results={},pq=new PriorityQueue,v,vEntry;var updateNeighbors=function(edge){var w=edge.v!==v?edge.v:edge.w,wEntry=results[w],weight=weightFn(edge),distance=vEntry.distance+weight;if(weight<0){throw new Error("dijkstra does not allow negative edge weights. "+"Bad edge: "+edge+" Weight: "+weight)}if(distance0){v=pq.removeMin();vEntry=results[v];if(vEntry.distance===Number.POSITIVE_INFINITY){break}edgeFn(v).forEach(updateNeighbors)}return results}},{"../data/priority-queue":71,"../lodash":75}],62:[function(require,module,exports){var _=require("../lodash"),tarjan=require("./tarjan");module.exports=findCycles;function findCycles(g){return _.filter(tarjan(g),function(cmpt){return cmpt.length>1})}},{"../lodash":75,"./tarjan":69}],63:[function(require,module,exports){var _=require("../lodash");module.exports=floydWarshall;var DEFAULT_WEIGHT_FUNC=_.constant(1);function floydWarshall(g,weightFn,edgeFn){return runFloydWarshall(g,weightFn||DEFAULT_WEIGHT_FUNC,edgeFn||function(v){return g.outEdges(v)})}function runFloydWarshall(g,weightFn,edgeFn){var results={},nodes=g.nodes();nodes.forEach(function(v){results[v]={};results[v][v]={distance:0};nodes.forEach(function(w){if(v!==w){results[v][w]={distance:Number.POSITIVE_INFINITY}}});edgeFn(v).forEach(function(edge){var w=edge.v===v?edge.w:edge.v,d=weightFn(edge);results[v][w]={distance:d,predecessor:v}})});nodes.forEach(function(k){var rowK=results[k];nodes.forEach(function(i){var rowI=results[i];nodes.forEach(function(j){var ik=rowI[k];var kj=rowK[j];var ij=rowI[j];var altDistance=ik.distance+kj.distance;if(altDistance0){v=pq.removeMin();if(_.has(parents,v)){result.setEdge(v,parents[v])}else if(init){throw new Error("Input graph is not connected: "+g)}else{init=true}g.nodeEdges(v).forEach(updateNeighbors)}return result}},{"../data/priority-queue":71,"../graph":72,"../lodash":75}],69:[function(require,module,exports){var _=require("../lodash");module.exports=tarjan;function tarjan(g){var index=0,stack=[],visited={},results=[];function dfs(v){var entry=visited[v]={onStack:true,lowlink:index,index:index++};stack.push(v);g.successors(v).forEach(function(w){if(!_.has(visited,w)){dfs(w);entry.lowlink=Math.min(entry.lowlink,visited[w].lowlink)}else if(visited[w].onStack){entry.lowlink=Math.min(entry.lowlink,visited[w].index)}});if(entry.lowlink===entry.index){var cmpt=[],w;do{w=stack.pop();visited[w].onStack=false;cmpt.push(w)}while(v!==w);results.push(cmpt)}}g.nodes().forEach(function(v){if(!_.has(visited,v)){dfs(v)}});return results}},{"../lodash":75}],70:[function(require,module,exports){var _=require("../lodash");module.exports=topsort;topsort.CycleException=CycleException;function topsort(g){var visited={},stack={},results=[];function visit(node){if(_.has(stack,node)){throw new CycleException}if(!_.has(visited,node)){stack[node]=true;visited[node]=true;_.each(g.predecessors(node),visit);delete stack[node];results.push(node)}}_.each(g.sinks(),visit);if(_.size(visited)!==g.nodeCount()){throw new CycleException}return results}function CycleException(){}},{"../lodash":75}],71:[function(require,module,exports){var _=require("../lodash");module.exports=PriorityQueue;function PriorityQueue(){this._arr=[];this._keyIndices={}}PriorityQueue.prototype.size=function(){return this._arr.length};PriorityQueue.prototype.keys=function(){return this._arr.map(function(x){return x.key})};PriorityQueue.prototype.has=function(key){return _.has(this._keyIndices,key)};PriorityQueue.prototype.priority=function(key){var index=this._keyIndices[key];if(index!==undefined){return this._arr[index].priority}};PriorityQueue.prototype.min=function(){if(this.size()===0){throw new Error("Queue underflow")}return this._arr[0].key};PriorityQueue.prototype.add=function(key,priority){var keyIndices=this._keyIndices;key=String(key);if(!_.has(keyIndices,key)){var arr=this._arr;var index=arr.length;keyIndices[key]=index;arr.push({key:key,priority:priority});this._decrease(index);return true}return false};PriorityQueue.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var min=this._arr.pop();delete this._keyIndices[min.key];this._heapify(0);return min.key};PriorityQueue.prototype.decrease=function(key,priority){var index=this._keyIndices[key];if(priority>this._arr[index].priority){throw new Error("New priority is greater than current priority. "+"Key: "+key+" Old: "+this._arr[index].priority+" New: "+priority)}this._arr[index].priority=priority;this._decrease(index)};PriorityQueue.prototype._heapify=function(i){var arr=this._arr;var l=2*i,r=l+1,largest=i;if(l>1;if(arr[parent].priority1){this.setNode(v,value)}else{this.setNode(v)}},this);return this};Graph.prototype.setNode=function(v,value){if(_.has(this._nodes,v)){if(arguments.length>1){this._nodes[v]=value}return this}this._nodes[v]=arguments.length>1?value:this._defaultNodeLabelFn(v);if(this._isCompound){this._parent[v]=GRAPH_NODE;this._children[v]={};this._children[GRAPH_NODE][v]=true}this._in[v]={};this._preds[v]={};this._out[v]={};this._sucs[v]={};++this._nodeCount;return this};Graph.prototype.node=function(v){return this._nodes[v]};Graph.prototype.hasNode=function(v){return _.has(this._nodes,v)};Graph.prototype.removeNode=function(v){var self=this;if(_.has(this._nodes,v)){var removeEdge=function(e){self.removeEdge(self._edgeObjs[e])};delete this._nodes[v];if(this._isCompound){this._removeFromParentsChildList(v);delete this._parent[v];_.each(this.children(v),function(child){this.setParent(child)},this);delete this._children[v]}_.each(_.keys(this._in[v]),removeEdge);delete this._in[v];delete this._preds[v];_.each(_.keys(this._out[v]),removeEdge);delete this._out[v];delete this._sucs[v];--this._nodeCount}return this};Graph.prototype.setParent=function(v,parent){if(!this._isCompound){throw new Error("Cannot set parent in a non-compound graph")}if(_.isUndefined(parent)){parent=GRAPH_NODE}else{for(var ancestor=parent;!_.isUndefined(ancestor);ancestor=this.parent(ancestor)){if(ancestor===v){throw new Error("Setting "+parent+" as parent of "+v+" would create create a cycle")}}this.setNode(parent)}this.setNode(v);this._removeFromParentsChildList(v);this._parent[v]=parent;this._children[parent][v]=true;return this};Graph.prototype._removeFromParentsChildList=function(v){delete this._children[this._parent[v]][v]};Graph.prototype.parent=function(v){if(this._isCompound){var parent=this._parent[v];if(parent!==GRAPH_NODE){return parent}}};Graph.prototype.children=function(v){if(_.isUndefined(v)){v=GRAPH_NODE}if(this._isCompound){var children=this._children[v];if(children){return _.keys(children)}}else if(v===GRAPH_NODE){return this.nodes()}else if(this.hasNode(v)){return[]}};Graph.prototype.predecessors=function(v){var predsV=this._preds[v];if(predsV){return _.keys(predsV)}};Graph.prototype.successors=function(v){var sucsV=this._sucs[v];if(sucsV){return _.keys(sucsV)}};Graph.prototype.neighbors=function(v){var preds=this.predecessors(v);if(preds){return _.union(preds,this.successors(v))}};Graph.prototype.setDefaultEdgeLabel=function(newDefault){if(!_.isFunction(newDefault)){newDefault=_.constant(newDefault)}this._defaultEdgeLabelFn=newDefault;return this};Graph.prototype.edgeCount=function(){return this._edgeCount};Graph.prototype.edges=function(){return _.values(this._edgeObjs)};Graph.prototype.setPath=function(vs,value){var self=this,args=arguments;_.reduce(vs,function(v,w){if(args.length>1){self.setEdge(v,w,value)}else{self.setEdge(v,w)}return w});return this};Graph.prototype.setEdge=function(v,w,value,name){var valueSpecified=arguments.length>2;v=String(v);w=String(w);if(!_.isUndefined(name)){name=String(name)}if(_.isPlainObject(arguments[0])){v=arguments[0].v;w=arguments[0].w;name=arguments[0].name;if(arguments.length===2){value=arguments[1];valueSpecified=true}}var e=edgeArgsToId(this._isDirected,v,w,name);if(_.has(this._edgeLabels,e)){if(valueSpecified){this._edgeLabels[e]=value}return this}if(!_.isUndefined(name)&&!this._isMultigraph){throw new Error("Cannot set a named edge when isMultigraph = false")}this.setNode(v);this.setNode(w);this._edgeLabels[e]=valueSpecified?value:this._defaultEdgeLabelFn(v,w,name);var edgeObj=edgeArgsToObj(this._isDirected,v,w,name);v=edgeObj.v;w=edgeObj.w;Object.freeze(edgeObj);this._edgeObjs[e]=edgeObj;incrementOrInitEntry(this._preds[w],v);incrementOrInitEntry(this._sucs[v],w);this._in[w][e]=edgeObj;this._out[v][e]=edgeObj;this._edgeCount++;return this};Graph.prototype.edge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name);return this._edgeLabels[e]};Graph.prototype.hasEdge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name);return _.has(this._edgeLabels,e)};Graph.prototype.removeEdge=function(v,w,name){var e=arguments.length===1?edgeObjToId(this._isDirected,arguments[0]):edgeArgsToId(this._isDirected,v,w,name),edge=this._edgeObjs[e];if(edge){v=edge.v;w=edge.w;delete this._edgeLabels[e];delete this._edgeObjs[e];decrementOrRemoveEntry(this._preds[w],v);decrementOrRemoveEntry(this._sucs[v],w);delete this._in[w][e];delete this._out[v][e];this._edgeCount--}return this};Graph.prototype.inEdges=function(v,u){var inV=this._in[v];if(inV){var edges=_.values(inV);if(!u){return edges}return _.filter(edges,function(edge){return edge.v===u})}};Graph.prototype.outEdges=function(v,w){var outV=this._out[v];if(outV){var edges=_.values(outV);if(!w){return edges}return _.filter(edges,function(edge){return edge.w===w})}};Graph.prototype.nodeEdges=function(v,w){var inEdges=this.inEdges(v,w);if(inEdges){return inEdges.concat(this.outEdges(v,w))}};function incrementOrInitEntry(map,k){if(_.has(map,k)){map[k]++}else{map[k]=1}}function decrementOrRemoveEntry(map,k){if(!--map[k]){delete map[k]}}function edgeArgsToId(isDirected,v,w,name){if(!isDirected&&v>w){var tmp=v;v=w;w=tmp}return v+EDGE_KEY_DELIM+w+EDGE_KEY_DELIM+(_.isUndefined(name)?DEFAULT_EDGE_NAME:name)}function edgeArgsToObj(isDirected,v,w,name){if(!isDirected&&v>w){var tmp=v;v=w;w=tmp}var edgeObj={v:v,w:w};if(name){edgeObj.name=name}return edgeObj}function edgeObjToId(isDirected,edgeObj){return edgeArgsToId(isDirected,edgeObj.v,edgeObj.w,edgeObj.name)}},{"./lodash":75}],73:[function(require,module,exports){module.exports={Graph:require("./graph"),version:require("./version")}},{"./graph":72,"./version":76}],74:[function(require,module,exports){var _=require("./lodash"),Graph=require("./graph");module.exports={write:write,read:read};function write(g){var json={options:{directed:g.isDirected(),multigraph:g.isMultigraph(),compound:g.isCompound()},nodes:writeNodes(g),edges:writeEdges(g)};if(!_.isUndefined(g.graph())){json.value=_.clone(g.graph())}return json}function writeNodes(g){return _.map(g.nodes(),function(v){var nodeValue=g.node(v),parent=g.parent(v),node={v:v};if(!_.isUndefined(nodeValue)){node.value=nodeValue}if(!_.isUndefined(parent)){node.parent=parent}return node})}function writeEdges(g){return _.map(g.edges(),function(e){var edgeValue=g.edge(e),edge={v:e.v,w:e.w};if(!_.isUndefined(e.name)){edge.name=e.name}if(!_.isUndefined(edgeValue)){edge.value=edgeValue}return edge})}function read(json){var g=new Graph(json.options).setGraph(json.value);_.each(json.nodes,function(entry){g.setNode(entry.v,entry.value);if(entry.parent){g.setParent(entry.v,entry.parent)}});_.each(json.edges,function(entry){g.setEdge({v:entry.v,w:entry.w,name:entry.name},entry.value)});return g}},{"./graph":72,"./lodash":75}],75:[function(require,module,exports){module.exports=require(20)},{"/Users/cpettitt/projects/dagre-d3/lib/lodash.js":20,lodash:77}],76:[function(require,module,exports){module.exports="0.9.1"},{}],77:[function(require,module,exports){(function(global){(function(){var undefined;var arrayPool=[],objectPool=[];var idCounter=0;var keyPrefix=+new Date+"";var largeArraySize=75;var maxPoolSize=40;var whitespace=" \f "+"\n\r\u2028\u2029"+" ᠎              ";var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var reFlags=/\w*$/;var reFuncName=/^\s*function[ \n\r\t]+\w/;var reInterpolate=/<%=([\s\S]+?)%>/g;var reLeadingSpacesAndZeros=RegExp("^["+whitespace+"]*0+(?=.$)");var reNoMatch=/($^)/;var reThis=/\bthis\b/;var reUnescapedString=/['\n\r\t\u2028\u2029\\]/g;var contextProps=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"];var templateCounter=0;var argsClass="[object Arguments]",arrayClass="[object Array]",boolClass="[object Boolean]",dateClass="[object Date]",funcClass="[object Function]",numberClass="[object Number]",objectClass="[object Object]",regexpClass="[object RegExp]",stringClass="[object String]";var cloneableClasses={};cloneableClasses[funcClass]=false;cloneableClasses[argsClass]=cloneableClasses[arrayClass]=cloneableClasses[boolClass]=cloneableClasses[dateClass]=cloneableClasses[numberClass]=cloneableClasses[objectClass]=cloneableClasses[regexpClass]=cloneableClasses[stringClass]=true;var debounceOptions={leading:false,maxWait:0,trailing:false};var descriptor={configurable:false,enumerable:false,value:null,writable:false};var objectTypes={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false};var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};var root=objectTypes[typeof window]&&window||this;var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports;var freeGlobal=objectTypes[typeof global]&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal)){root=freeGlobal}function baseIndexOf(array,value,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0;while(++index-1?0:-1:cache?0:-1}function cachePush(value){var cache=this.cache,type=typeof value;if(type=="boolean"||value==null){cache[value]=true}else{if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value,typeCache=cache[type]||(cache[type]={});if(type=="object"){(typeCache[key]||(typeCache[key]=[])).push(value)}else{typeCache[key]=true}}}function charAtCallback(value){return value.charCodeAt(0)}function compareAscending(a,b){var ac=a.criteria,bc=b.criteria,index=-1,length=ac.length;while(++indexother||typeof value=="undefined"){return 1}if(value/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:reInterpolate,variable:"",imports:{_:lodash}};function baseBind(bindData){var func=bindData[0],partialArgs=bindData[2],thisArg=bindData[4];function bound(){if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(this instanceof bound){var thisBinding=baseCreate(func.prototype),result=func.apply(thisBinding,args||arguments);return isObject(result)?result:thisBinding}return func.apply(thisArg,args||arguments)}setBindData(bound,bindData);return bound}function baseClone(value,isDeep,callback,stackA,stackB){if(callback){var result=callback(value);if(typeof result!="undefined"){return result}}var isObj=isObject(value);if(isObj){var className=toString.call(value);if(!cloneableClasses[className]){return value}var ctor=ctorByClass[className];switch(className){case boolClass:case dateClass:return new ctor(+value);case numberClass:case stringClass:return new ctor(value);case regexpClass:result=ctor(value.source,reFlags.exec(value));result.lastIndex=value.lastIndex;return result}}else{return value}var isArr=isArray(value);if(isDeep){var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==value){return stackB[length]}}result=isArr?ctor(value.length):{}}else{result=isArr?slice(value):assign({},value)}if(isArr){if(hasOwnProperty.call(value,"index")){result.index=value.index}if(hasOwnProperty.call(value,"input")){result.input=value.input}}if(!isDeep){return result}stackA.push(value);stackB.push(result);(isArr?forEach:forOwn)(value,function(objValue,key){result[key]=baseClone(objValue,isDeep,callback,stackA,stackB)});if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseCreate(prototype,properties){return isObject(prototype)?nativeCreate(prototype):{}}if(!nativeCreate){baseCreate=function(){function Object(){}return function(prototype){if(isObject(prototype)){Object.prototype=prototype;var result=new Object;Object.prototype=null}return result||context.Object()}}()}function baseCreateCallback(func,thisArg,argCount){if(typeof func!="function"){return identity}if(typeof thisArg=="undefined"||!("prototype"in func)){return func}var bindData=func.__bindData__;if(typeof bindData=="undefined"){if(support.funcNames){bindData=!func.name}bindData=bindData||!support.funcDecomp;if(!bindData){var source=fnToString.call(func);if(!support.funcNames){bindData=!reFuncName.test(source)}if(!bindData){bindData=reThis.test(source);setBindData(func,bindData)}}}if(bindData===false||bindData!==true&&bindData[1]&1){return func}switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 2:return function(a,b){return func.call(thisArg,a,b)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)}}return bind(func,thisArg)}function baseCreateWrapper(bindData){var func=bindData[0],bitmask=bindData[1],partialArgs=bindData[2],partialRightArgs=bindData[3],thisArg=bindData[4],arity=bindData[5];var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,key=func;function bound(){var thisBinding=isBind?thisArg:this;if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(partialRightArgs||isCurry){args||(args=slice(arguments));if(partialRightArgs){push.apply(args,partialRightArgs)}if(isCurry&&args.length=largeArraySize&&indexOf===baseIndexOf,result=[];if(isLarge){var cache=createCache(values);if(cache){indexOf=cacheIndexOf;values=cache}else{isLarge=false}}while(++index-1}})}}stackA.pop();stackB.pop();if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseMerge(object,source,callback,stackA,stackB){(isArray(source)?forEach:forOwn)(source,function(source,key){var found,isArr,result=source,value=object[key];if(source&&((isArr=isArray(source))||isPlainObject(source))){var stackLength=stackA.length;while(stackLength--){if(found=stackA[stackLength]==source){value=stackB[stackLength];break}}if(!found){var isShallow;if(callback){result=callback(value,source);if(isShallow=typeof result!="undefined"){value=result}}if(!isShallow){value=isArr?isArray(value)?value:[]:isPlainObject(value)?value:{}}stackA.push(source);stackB.push(value);if(!isShallow){baseMerge(value,source,callback,stackA,stackB)}}}else{if(callback){result=callback(value,source);if(typeof result=="undefined"){result=source}}if(typeof result!="undefined"){value=result}}object[key]=value})}function baseRandom(min,max){return min+floor(nativeRandom()*(max-min+1))}function baseUniq(array,isSorted,callback){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,result=[];var isLarge=!isSorted&&length>=largeArraySize&&indexOf===baseIndexOf,seen=callback||isLarge?getArray():result;if(isLarge){var cache=createCache(seen);indexOf=cacheIndexOf;seen=cache}while(++index":">",'"':""","'":"'"};var htmlUnescapes=invert(htmlEscapes);var reEscapedHtml=RegExp("("+keys(htmlUnescapes).join("|")+")","g"),reUnescapedHtml=RegExp("["+keys(htmlEscapes).join("")+"]","g");var assign=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;if(argsLength>3&&typeof args[argsLength-2]=="function"){var callback=baseCreateCallback(args[--argsLength-1],args[argsLength--],2)}else if(argsLength>2&&typeof args[argsLength-1]=="function"){callback=args[--argsLength]}while(++argsIndex3&&typeof args[length-2]=="function"){var callback=baseCreateCallback(args[--length-1],args[length--],2)}else if(length>2&&typeof args[length-1]=="function"){callback=args[--length]}var sources=slice(arguments,1,length),index=-1,stackA=getArray(),stackB=getArray();while(++index-1}else if(typeof length=="number"){result=(isString(collection)?collection.indexOf(target,fromIndex):indexOf(collection,target,fromIndex))>-1}else{forOwn(collection,function(value){if(++index>=fromIndex){return!(result=value===target)}})}return result}var countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key]++:result[key]=1});function every(collection,callback,thisArg){var result=true;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++indexresult){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current>computed){computed=current;result=value}})}return result}function min(collection,callback,thisArg){var computed=Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index=largeArraySize&&createCache(argsIndex?args[argsIndex]:seen))}}var array=args[0],index=-1,length=array?array.length:0,result=[];outer:while(++index>>1;callback(array[mid])1?arguments:arguments[0],index=-1,length=array?max(pluck(array,"length")):0,result=Array(length<0?0:length);while(++index2?createWrapper(func,17,slice(arguments,2),null,thisArg):createWrapper(func,1,null,null,thisArg)}function bindAll(object){var funcs=arguments.length>1?baseFlatten(arguments,true,false,1):functions(object),index=-1,length=funcs.length;while(++index2?createWrapper(key,19,slice(arguments,2),null,object):createWrapper(key,3,null,null,object)}function compose(){var funcs=arguments,length=funcs.length;while(length--){if(!isFunction(funcs[length])){throw new TypeError}}return function(){var args=arguments,length=funcs.length;while(length--){args=[funcs[length].apply(this,args)]}return args[0]}}function curry(func,arity){arity=typeof arity=="number"?arity:+arity||func.length;return createWrapper(func,4,null,null,null,arity)}function debounce(func,wait,options){var args,maxTimeoutId,result,stamp,thisArg,timeoutId,trailingCall,lastCalled=0,maxWait=false,trailing=true;if(!isFunction(func)){throw new TypeError}wait=nativeMax(0,wait)||0;if(options===true){var leading=true;trailing=false}else if(isObject(options)){leading=options.leading;maxWait="maxWait"in options&&(nativeMax(wait,options.maxWait)||0);trailing="trailing"in options?options.trailing:trailing}var delayed=function(){var remaining=wait-(now()-stamp);if(remaining<=0){if(maxTimeoutId){clearTimeout(maxTimeoutId)}var isCalled=trailingCall;maxTimeoutId=timeoutId=trailingCall=undefined;if(isCalled){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}}else{timeoutId=setTimeout(delayed,remaining)}};var maxDelayed=function(){if(timeoutId){clearTimeout(timeoutId)}maxTimeoutId=timeoutId=trailingCall=undefined;if(trailing||maxWait!==wait){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}};return function(){args=arguments;stamp=now();thisArg=this;trailingCall=trailing&&(timeoutId||!leading);if(maxWait===false){var leadingCall=leading&&!timeoutId}else{if(!maxTimeoutId&&!leading){lastCalled=stamp}var remaining=maxWait-(stamp-lastCalled),isCalled=remaining<=0;if(isCalled){if(maxTimeoutId){maxTimeoutId=clearTimeout(maxTimeoutId)}lastCalled=stamp;result=func.apply(thisArg,args)}else if(!maxTimeoutId){maxTimeoutId=setTimeout(maxDelayed,remaining)}}if(isCalled&&timeoutId){timeoutId=clearTimeout(timeoutId)}else if(!timeoutId&&wait!==maxWait){timeoutId=setTimeout(delayed,wait)}if(leadingCall){isCalled=true;result=func.apply(thisArg,args)}if(isCalled&&!timeoutId&&!maxTimeoutId){args=thisArg=null}return result}}function defer(func){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,1);return setTimeout(function(){func.apply(undefined,args)},1)}function delay(func,wait){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,2);return setTimeout(function(){func.apply(undefined,args)},wait)}function memoize(func,resolver){if(!isFunction(func)){throw new TypeError}var memoized=function(){var cache=memoized.cache,key=resolver?resolver.apply(this,arguments):keyPrefix+arguments[0];return hasOwnProperty.call(cache,key)?cache[key]:cache[key]=func.apply(this,arguments)};memoized.cache={};return memoized}function once(func){var ran,result;if(!isFunction(func)){throw new TypeError}return function(){if(ran){return result}ran=true;result=func.apply(this,arguments); func=null;return result}}function partial(func){return createWrapper(func,16,slice(arguments,1))}function partialRight(func){return createWrapper(func,32,null,slice(arguments,1))}function throttle(func,wait,options){var leading=true,trailing=true;if(!isFunction(func)){throw new TypeError}if(options===false){leading=false}else if(isObject(options)){leading="leading"in options?options.leading:leading;trailing="trailing"in options?options.trailing:trailing}debounceOptions.leading=leading;debounceOptions.maxWait=wait;debounceOptions.trailing=trailing;return debounce(func,wait,debounceOptions)}function wrap(value,wrapper){return createWrapper(wrapper,16,[value])}function constant(value){return function(){return value}}function createCallback(func,thisArg,argCount){var type=typeof func;if(func==null||type=="function"){return baseCreateCallback(func,thisArg,argCount)}if(type!="object"){return property(func)}var props=keys(func),key=props[0],a=func[key];if(props.length==1&&a===a&&!isObject(a)){return function(object){var b=object[key];return a===b&&(a!==0||1/a==1/b)}}return function(object){var length=props.length,result=false;while(length--){if(!(result=baseIsEqual(object[props[length]],func[props[length]],null,true))){break}}return result}}function escape(string){return string==null?"":String(string).replace(reUnescapedHtml,escapeHtmlChar)}function identity(value){return value}function mixin(object,source,options){var chain=true,methodNames=source&&functions(source);if(!source||!options&&!methodNames.length){if(options==null){options=source}ctor=lodashWrapper;source=object;object=lodash;methodNames=functions(source)}if(options===false){chain=false}else if(isObject(options)&&"chain"in options){chain=options.chain}var ctor=object,isFunc=isFunction(ctor);forEach(methodNames,function(methodName){var func=object[methodName]=source[methodName];if(isFunc){ctor.prototype[methodName]=function(){var chainAll=this.__chain__,value=this.__wrapped__,args=[value];push.apply(args,arguments);var result=func.apply(object,args);if(chain||chainAll){if(value===result&&isObject(result)){return this}result=new ctor(result);result.__chain__=chainAll}return result}}})}function noConflict(){context._=oldDash;return this}function noop(){}var now=isNative(now=Date.now)&&now||function(){return(new Date).getTime()};var parseInt=nativeParseInt(whitespace+"08")==8?nativeParseInt:function(value,radix){return nativeParseInt(isString(value)?value.replace(reLeadingSpacesAndZeros,""):value,radix||0)};function property(key){return function(object){return object[key]}}function random(min,max,floating){var noMin=min==null,noMax=max==null;if(floating==null){if(typeof min=="boolean"&&noMax){floating=min;min=1}else if(!noMax&&typeof max=="boolean"){floating=max;noMax=true}}if(noMin&&noMax){max=1}min=+min||0;if(noMax){max=min;min=0}else{max=+max||0}if(floating||min%1||max%1){var rand=nativeRandom();return nativeMin(min+rand*(max-min+parseFloat("1e-"+((rand+"").length-1))),max)}return baseRandom(min,max)}function result(object,key){if(object){var value=object[key];return isFunction(value)?object[key]():value}}function template(text,data,options){var settings=lodash.templateSettings;text=String(text||"");options=defaults({},options,settings);var imports=defaults({},options.imports,settings.imports),importsKeys=keys(imports),importsValues=values(imports);var isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";var reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g");text.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);source+=text.slice(index,offset).replace(reUnescapedString,escapeStringChar);if(escapeValue){source+="' +\n__e("+escapeValue+") +\n'"}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '"}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"}index=offset+match.length;return match});source+="';\n";var variable=options.variable,hasVariable=variable;if(!hasVariable){variable="obj";source="with ("+variable+") {\n"+source+"\n}\n"}source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;");source="function("+variable+") {\n"+(hasVariable?"":variable+" || ("+variable+" = {});\n")+"var __t, __p = '', __e = _.escape"+(isEvaluating?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var sourceURL="\n/*\n//# sourceURL="+(options.sourceURL||"/lodash/template/source["+templateCounter++ +"]")+"\n*/";try{var result=Function(importsKeys,"return "+source+sourceURL).apply(undefined,importsValues)}catch(e){e.source=source;throw e}if(data){return result(data)}result.source=source;return result}function times(n,callback,thisArg){n=(n=+n)>-1?n:0;var index=-1,result=Array(n);callback=baseCreateCallback(callback,thisArg,1);while(++index=0;s--){var i=t[s];"."===i?t.splice(s,1):".."===i?(t.splice(s,1),n++):n&&(t.splice(s,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function s(t,e){if(t.filter)return t.filter(e);for(var n=[],s=0;s=-1&&!i;r--){var a=r>=0?arguments[r]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(n=a+"/"+n,i="/"===a.charAt(0))}return n=e(s(n.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(t){var i=n.isAbsolute(t),r="/"===a(t,-1);return t=e(s(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&r&&(t+="/"),(i?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(s(t,function(t){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function s(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=s(t.split("/")),r=s(e.split("/")),a=Math.min(i.length,r.length),o=a,c=0;a>c;c++)if(i[c]!==r[c]){o=c;break}for(var l=[],c=o;ce&&(e=t.length+e),t.substr(e,n)}}).call(this,t("1YiZ5S"))},{"1YiZ5S":3}],3:[function(t,e){function n(){}var s=e.exports={};s.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var s=n.shift();s()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),s.title="browser",s.browser=!0,s.env={},s.argv=[],s.on=n,s.addListener=n,s.once=n,s.off=n,s.removeListener=n,s.removeAllListeners=n,s.emit=n,s.binding=function(){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(){throw new Error("process.chdir is not supported")}},{}],4:[function(t,e,n){(function(e){var s=t("./graphDb"),r=t("./parser/flow"),a=t("./utils"),o=t("./sequenceRenderer"),c=function(t,e){var n=Object.keys(t),i=function(t,e){var n;for(n=0;n0)for(a=0;a',"graph"===a.detectType(c)?(h(c,n),s.bindFunctions()):o.draw(c,n)}};n.version=function(){return"0.2.3"};var y=function(t,e){return"undefined"!=typeof e?!1:t===e};document.addEventListener("DOMContentLoaded",function(){"undefined"!=typeof mermaid_config?y(!0,mermaid_config.startOnLoad)&&u():u()},!1),e.mermaid={init:function(){u()},version:function(){return n.version()}}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./graphDb":5,"./parser/flow":6,"./sequenceRenderer":9,"./utils":10}],5:[function(require,module,exports){var vertices={},edges=[],classes=[],direction,funs=[];exports.addVertex=function(t,e,n,s){"undefined"==typeof vertices[t]&&(vertices[t]={id:t,styles:[],classes:[]}),"undefined"!=typeof e&&(vertices[t].text=e),"undefined"!=typeof n&&(vertices[t].type=n),"undefined"!=typeof n&&(vertices[t].type=n),"undefined"!=typeof s&&null!==s&&s.forEach(function(e){vertices[t].styles.push(e)})},exports.addLink=function(t,e,n,s){var i={start:t,end:e,type:void 0,text:""},s=n.text;"undefined"!=typeof s&&(i.text=s),"undefined"!=typeof n&&(i.type=n.type),edges.push(i)},exports.updateLink=function(t,e){var n=t.substr(1);edges[n].style=e},exports.addClass=function(t,e){"undefined"==typeof classes[t]&&(classes[t]={id:t,styles:[]}),"undefined"!=typeof e&&null!==e&&e.forEach(function(e){classes[t].styles.push(e)})},exports.setDirection=function(t){direction=t},exports.setClass=function(t,e){t.indexOf(",")>0?t.split(",").forEach(function(t){"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)}):"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)},exports.setClickEvent=function(id,functionName){id.indexOf(",")>0?id.split(",").forEach(function(id2){"undefined"!=typeof vertices[id2]&&funs.push(function(){var elem=document.getElementById(id2);null!==elem&&(elem.onclick=function(){eval(functionName+"('"+id2+"')")})})}):"undefined"!=typeof vertices[id]&&funs.push(function(){var elem=document.getElementById(id);null!==elem&&(elem.onclick=function(){eval(functionName+"('"+id+"')")})})},exports.bindFunctions=function(){funs.forEach(function(t){t()})},exports.getDirection=function(){return direction},exports.getVertices=function(){return vertices},exports.getEdges=function(){return edges},exports.getClasses=function(){return classes},exports.clear=function(){vertices={},classes={},edges=[],funs=[]},exports.defaultStyle=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}},{}],6:[function(t,e,n){(function(s){var i=function(){function t(){this.yy={}}var e=function(t,e,n,s){for(n=n||{},s=t.length;s--;n[t[s]]=e);return n},n=[1,7],s=[2,13],i=[1,21],r=[1,22],a=[1,23],o=[1,24],c=[1,25],l=[1,26],h=[1,27],u=[1,28],y=[1,29],f=[1,30],p=[1,15],d=[1,16],g=[1,17],m=[1,14],_=[6,9],k=[11,30,31,32,33,34,35,36,37,38,39,40,48,50,51,52],b=[2,7],v=[11,43,44,45,46],x=[9,11,21,23,24,25,26,27,43,44,45,46,47],S=[9,11,21,23,24,25,26,27,31,32,33,34,35,36,37,38,39,40,43,44,45,46,47],w=[9,11,21,23,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,43,44,45,46,47],E=[31,32,33,34,35,36,37,38,39,40],A=[31,32,33,34,35,36,37,38,39,40,47],I=[23,25,27,47],L=[1,93],O=[1,90],$=[1,88],P=[1,91],T=[1,89],N=[1,94],C=[1,92],D=[1,101],R=[11,34],M=[9,11,30,31,32,33,34,53,56],U={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graphConfig:4,statements:5,EOF:6,spaceList:7,GRAPH:8,SPACE:9,DIR:10,SEMI:11,statement:12,verticeStatement:13,styleStatement:14,classDefStatement:15,classStatement:16,clickStatement:17,vertex:18,link:19,alphaNum:20,SQS:21,text:22,SQE:23,PS:24,PE:25,DIAMOND_START:26,DIAMOND_STOP:27,alphaNumStatement:28,alphaNumToken:29,MINUS:30,ALPHA:31,NUM:32,COLON:33,COMMA:34,PLUS:35,EQUALS:36,MULT:37,DOT:38,TAGSTART:39,TAGEND:40,linkStatement:41,arrowText:42,ARROW_POINT:43,ARROW_CIRCLE:44,ARROW_CROSS:45,ARROW_OPEN:46,PIPE:47,CLASSDEF:48,stylesOpt:49,CLASS:50,CLICK:51,STYLE:52,HEX:53,style:54,styleComponent:55,UNIT:56,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",8:"GRAPH",9:"SPACE",10:"DIR",11:"SEMI",21:"SQS",23:"SQE",24:"PS",25:"PE",26:"DIAMOND_START",27:"DIAMOND_STOP",30:"MINUS",31:"ALPHA",32:"NUM",33:"COLON",34:"COMMA",35:"PLUS",36:"EQUALS",37:"MULT",38:"DOT",39:"TAGSTART",40:"TAGEND",43:"ARROW_POINT",44:"ARROW_CIRCLE",45:"ARROW_CROSS",46:"ARROW_OPEN",47:"PIPE",48:"CLASSDEF",50:"CLASS",51:"CLICK",52:"STYLE",53:"HEX",56:"UNIT"},productions_:[0,[3,3],[3,4],[4,4],[5,3],[5,1],[7,2],[7,1],[12,2],[12,2],[12,2],[12,2],[12,2],[13,0],[13,3],[13,1],[18,4],[18,4],[18,4],[18,1],[20,1],[20,2],[28,1],[28,3],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[19,2],[19,1],[41,1],[41,1],[41,1],[41,1],[42,3],[22,3],[22,5],[22,1],[15,5],[16,5],[17,5],[14,5],[14,5],[49,1],[49,3],[54,1],[54,2],[55,1],[55,1],[55,1],[55,1],[55,1],[55,1],[55,1]],performAction:function(t,e,n,s,i,r){var a=r.length-1;switch(i){case 2:this.$=r[a-3];break;case 3:s.setDirection(r[a-1]),this.$=r[a-1];break;case 14:s.addLink(r[a-2],r[a],r[a-1]),this.$="oy";break;case 15:this.$="yo";break;case 16:this.$=r[a-3],s.addVertex(r[a-3],r[a-1],"square");break;case 17:this.$=r[a-3],s.addVertex(r[a-3],r[a-1],"round");break;case 18:this.$=r[a-3],s.addVertex(r[a-3],r[a-1],"diamond");break;case 19:this.$=r[a],s.addVertex(r[a]);break;case 20:case 22:case 24:case 25:case 51:this.$=r[a];break;case 21:this.$=r[a-1]+""+r[a];break;case 23:this.$=r[a-2]+"-"+r[a];break;case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 33:case 35:case 43:this.$=r[a];break;case 34:r[a-1].text=r[a],this.$=r[a-1];break;case 36:this.$={type:"arrow"};break;case 37:this.$={type:"arrow_circle"};break;case 38:this.$={type:"arrow_cross"};break;case 39:this.$={type:"arrow_open"};break;case 40:this.$=r[a-1];break;case 41:this.$=r[a-2]+" "+r[a];break;case 42:this.$=r[a-4]+" - "+r[a];break;case 44:this.$=r[a-4],s.addClass(r[a-2],r[a]);break;case 45:this.$=r[a-4],s.setClass(r[a-2],r[a]);break;case 46:this.$=r[a-4],s.setClickEvent(r[a-2],r[a]);break;case 47:this.$=r[a-4],s.addVertex(r[a-2],void 0,void 0,r[a]);break;case 48:this.$=r[a-4],s.updateLink(r[a-2],r[a]);break;case 49:this.$=[r[a]];break;case 50:r[a-2].push(r[a]),this.$=r[a-2];break;case 52:this.$=r[a-1]+r[a];break;case 53:case 54:case 55:case 56:case 57:case 58:case 59:this.$=r[a]}},table:[{3:1,4:2,8:[1,3]},{1:[3]},{5:4,7:5,9:n,11:s,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f,48:p,50:d,51:g,52:m},{9:[1,31]},{6:[1,32],7:33,9:n},{5:34,11:s,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f,48:p,50:d,51:g,52:m},e(_,[2,5]),e(k,b,{7:35,9:n}),{11:[1,36]},{11:[1,37]},{11:[1,38]},{11:[1,39]},{11:[1,40]},{11:[2,15],19:41,41:42,43:[1,43],44:[1,44],45:[1,45],46:[1,46]},{9:[1,47]},{9:[1,48]},{9:[1,49]},{9:[1,50]},e(v,[2,19],{21:[1,51],24:[1,52],26:[1,53]}),e(x,[2,20],{28:19,29:20,20:54,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f}),e(S,[2,22],{30:[1,55]}),e(w,[2,24]),e(w,[2,25]),e(w,[2,26]),e(w,[2,27]),e(w,[2,28]),e(w,[2,29]),e(w,[2,30]),e(w,[2,31]),e(w,[2,32]),e(w,[2,33]),{10:[1,56]},{1:[2,1]},{11:s,12:57,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f,48:p,50:d,51:g,52:m},{6:[1,58],7:33,9:n},e(k,[2,6]),e(_,[2,8]),e(_,[2,9]),e(_,[2,10]),e(_,[2,11]),e(_,[2,12]),{18:59,20:18,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},e(E,[2,35],{42:60,47:[1,61]}),e(A,[2,36]),e(A,[2,37]),e(A,[2,38]),e(A,[2,39]),{20:62,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f,53:[1,63]},{20:64,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{20:65,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{20:66,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{20:68,22:67,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{20:68,22:69,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{20:68,22:70,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},e(x,[2,21]),{29:71,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{11:[1,72]},e(_,[2,4]),{1:[2,2]},{11:[2,14]},e(E,[2,34]),{20:68,22:73,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{9:[1,74]},{9:[1,75]},{9:[1,76]},{9:[1,77]},{9:[1,78]},{23:[1,79]},e(I,[2,43],{7:81,9:[1,80]}),{25:[1,82]},{27:[1,83]},e(S,[2,23]),e([9,11,31,32,33,34,35,36,37,38,39,40,48,50,51,52],[2,3]),{47:[1,84]},{9:L,30:O,31:$,32:P,33:T,49:85,53:N,54:86,55:87,56:C},{9:L,30:O,31:$,32:P,33:T,49:95,53:N,54:86,55:87,56:C},{9:L,30:O,31:$,32:P,33:T,49:96,53:N,54:86,55:87,56:C},{20:97,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{20:98,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},e(v,[2,16]),{7:35,9:n,20:68,22:99,28:19,29:20,30:b,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{30:[1,100]},e(v,[2,17]),e(v,[2,18]),e(E,[2,40]),{11:[2,47],34:D},e(R,[2,49],{55:102,9:L,30:O,31:$,32:P,33:T,53:N,56:C}),e(M,[2,51]),e(M,[2,53]),e(M,[2,54]),e(M,[2,55]),e(M,[2,56]),e(M,[2,57]),e(M,[2,58]),e(M,[2,59]),{11:[2,48],34:D},{11:[2,44],34:D},{11:[2,45]},{11:[2,46]},e(I,[2,41]),{7:103,9:n},{9:L,30:O,31:$,32:P,33:T,53:N,54:104,55:87,56:C},e(M,[2,52]),{20:68,22:105,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},e(R,[2,50],{55:102,9:L,30:O,31:$,32:P,33:T,53:N,56:C}),e(I,[2,42])],defaultActions:{32:[2,1],58:[2,2],59:[2,14],97:[2,45],98:[2,46]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=p.lex()||y,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,s=[0],i=[null],r=[],a=this.table,o="",c=0,l=0,h=0,u=2,y=1,f=r.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(d.yy[g]=this.yy[g]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,"undefined"==typeof p.yylloc&&(p.yylloc={});var m=p.yylloc;r.push(m);var _=p.options&&p.options.ranges;this.parseError="function"==typeof d.yy.parseError?d.yy.parseError:Object.getPrototypeOf(this).parseError;for(var k,b,v,x,S,w,E,A,I,L={};;){if(v=s[s.length-1],this.defaultActions[v]?x=this.defaultActions[v]:((null===k||"undefined"==typeof k)&&(k=e()),x=a[v]&&a[v][k]),"undefined"==typeof x||!x.length||!x[0]){var O="";I=[];for(w in a[v])this.terminals_[w]&&w>u&&I.push("'"+this.terminals_[w]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+I.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(c+1)+": Unexpected "+(k==y?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[k]||k,line:p.yylineno,loc:m,expected:I})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+k);switch(x[0]){case 1:s.push(k),i.push(p.yytext),r.push(p.yylloc),s.push(x[1]),k=null,b?(k=b,b=null):(l=p.yyleng,o=p.yytext,c=p.yylineno,m=p.yylloc,h>0&&h--);break;case 2:if(E=this.productions_[x[1]][1],L.$=i[i.length-E],L._$={first_line:r[r.length-(E||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(E||1)].first_column,last_column:r[r.length-1].last_column},_&&(L._$.range=[r[r.length-(E||1)].range[0],r[r.length-1].range[1]]),S=this.performAction.apply(L,[o,l,c,d.yy,x[1],i,r].concat(f)),"undefined"!=typeof S)return S;E&&(s=s.slice(0,-1*E*2),i=i.slice(0,-1*E),r=r.slice(0,-1*E)),s.push(this.productions_[x[1]][0]),i.push(L.$),r.push(L._$),A=a[s[s.length-2]][s[s.length-1]],s.push(A);break;case 3:return!0}}return!0}},j=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=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),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),s=t[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,s;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;re[0].length)){if(e=n,s=r,this.options.backtrack_lexer){if(t=this.test_match(n,i[r]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[s]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,s){switch(n){case 0:return 52;case 1:return 48;case 2:return 50;case 3:return 51;case 4:return 8;case 5:return 10;case 6:return 10;case 7:return 10;case 8:return 10;case 9:return 10;case 10:return 10;case 11:return 53;case 12:return 32;case 13:return"BRKT";case 14:return 56;case 15:return 56;case 16:return 56;case 17:return 33;case 18:return 11;case 19:return 34;case 20:return 36;case 21:return 37;case 22:return 38;case 23:return 39;case 24:return 40;case 25:return 45;case 26:return 43;case 27:return 44;case 28:return 46;case 29:return 30;case 30:return 35;case 31:return 36;case 32:return 31;case 33:return 47;case 34:return 24;case 35:return 25;case 36:return 21;case 37:return 23;case 38:return 26;case 39:return 27;case 40:return 9;case 41:return"NEWLINE";case 42:return 6}},rules:[/^(?:style\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:#[a-f0-9]+)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?:px\b)/,/^(?:pt\b)/,/^(?:dot\b)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:<)/,/^(?:>)/,/^(?:--[x])/,/^(?:-->)/,/^(?:--[o])/,/^(?:---)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[a-zåäöæøA-ZÅÄÖÆØ_]+)/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:\s)/,/^(?:\n)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,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],inclusive:!0}}};return t}();return U.lexer=j,t.prototype=U,U.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),s.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(s.argv.slice(1)))}).call(this,t("1YiZ5S"))},{"1YiZ5S":3,fs:1,path:2}],7:[function(t,e,n){(function(s){var i=function(){function t(){this.yy={}}var e=function(t,e,n,s){for(n=n||{},s=t.length;s--;n[t[s]]=e);return n},n=[1,11],s=[1,12],i=[1,17],r=[1,16],a=[6,8,28],o=[6,8,14,16,28,31,32],c=[6,8,14,16,18,28,31,32],l=[6,31,32],h=[1,35],u=[6,8,16,18,28,31,32],y={trace:function(){},yy:{},symbols_:{error:2,expressions:3,sequenceConfig:4,statements:5,EOF:6,SEQ:7,SPACE:8,DIR:9,newlines:10,statement:11,preStatement:12,alphaNum:13,COLON:14,text:15,DOT:16,message:17,EQUALS:18,callee:19,action:20,SQS:21,SQE:22,actorDefinition:23,messageDefinition:24,caller:25,answer:26,spaceList:27,NEWLINE:28,alphaNumStatement:29,alphaNumToken:30,ALPHA:31,NUM:32,textStatement:33,textToken:34,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"SEQ",8:"SPACE",9:"DIR",14:"COLON",16:"DOT",18:"EQUALS",21:"SQS",22:"SQE",28:"NEWLINE",31:"ALPHA",32:"NUM"},productions_:[0,[3,2],[3,1],[4,4],[5,3],[5,2],[5,3],[12,3],[11,1],[11,3],[11,5],[20,2],[23,3],[24,7],[25,1],[26,1],[19,1],[17,1],[27,2],[27,1],[10,2],[10,2],[10,1],[10,1],[13,1],[29,2],[29,1],[30,1],[30,1],[15,1],[33,2],[33,1],[34,1],[34,1]],performAction:function(t,e,n,s,i,r){var a=r.length-1;switch(i){case 1:case 5:this.$=r[a-1];break;case 3:this.$=r[a-1];break;case 4:case 6:this.$=r[a-2];break;case 7:this.$={a:r[a-2],b:r[a]};break;case 8:s.addActor(r[a].a,"actor",r[a].b),this.$="actor";break;case 9:s.addMessage(r[a-2].a,r[a-2].b,r[a]),this.$="message";break;case 10:s.addMessage(r[a-4].a,r[a-2],r[a],r[a-4].b),this.$="actor";break;case 11:this.$="action";break;case 12:this.$="actor";break;case 13:console.log("Got new message from="+r[a-6]+" to="+r[a-2]+" message="+r[a]+" answer="+r[a-4]),this.$="actor";break;case 24:case 27:case 28:case 29:case 33:this.$=r[a];break;case 25:case 30:this.$=r[a-1]+""+r[a]}},table:[{3:1,4:2,6:[1,3],7:[1,4]},{1:[3]},{5:5,11:6,12:7,13:8,29:9,30:10,31:n,32:s},{1:[2,2]},{8:[1,13]},{1:[2,1]},{6:[1,15],8:i,10:14,28:r},e(a,[2,8],{16:[1,18],18:[1,19]}),{14:[1,20],30:21,31:n,32:s},e(o,[2,24]),e(o,[2,26]),e(c,[2,27]),e(c,[2,28]),{9:[1,22]},{5:23,6:[1,24],11:6,12:7,13:8,29:9,30:10,31:n,32:s},{1:[2,5]},e(l,[2,22],{10:25,8:i,28:r}),e(l,[2,23],{10:26,8:i,28:r}),{13:28,17:27,29:9,30:10,31:n,32:s},{13:30,19:29,29:9,30:10,31:n,32:s},{8:h,15:31,30:34,31:n,32:s,33:32,34:33},e(o,[2,25]),{8:i,10:36,28:r},{1:[2,4]},{1:[2,6]},e(l,[2,20]),e(l,[2,21]),e(a,[2,9]),e(a,[2,17],{30:21,31:n,32:s}),{16:[1,37]},{16:[2,16],30:21,31:n,32:s},e([6,16,18,28],[2,7],{30:34,34:38,8:h,31:n,32:s}),e(u,[2,29]),e(u,[2,31]),e(u,[2,32]),e(u,[2,33]),e([31,32],[2,3]),{13:28,17:39,29:9,30:10,31:n,32:s},e(u,[2,30]),e(a,[2,10])],defaultActions:{3:[2,2],5:[2,1],15:[2,5],23:[2,4],24:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=p.lex()||y,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,s=[0],i=[null],r=[],a=this.table,o="",c=0,l=0,h=0,u=2,y=1,f=r.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(d.yy[g]=this.yy[g]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,"undefined"==typeof p.yylloc&&(p.yylloc={});var m=p.yylloc;r.push(m);var _=p.options&&p.options.ranges;this.parseError="function"==typeof d.yy.parseError?d.yy.parseError:Object.getPrototypeOf(this).parseError;for(var k,b,v,x,S,w,E,A,I,L={};;){if(v=s[s.length-1],this.defaultActions[v]?x=this.defaultActions[v]:((null===k||"undefined"==typeof k)&&(k=e()),x=a[v]&&a[v][k]),"undefined"==typeof x||!x.length||!x[0]){var O="";I=[];for(w in a[v])this.terminals_[w]&&w>u&&I.push("'"+this.terminals_[w]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+I.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(c+1)+": Unexpected "+(k==y?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[k]||k,line:p.yylineno,loc:m,expected:I})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+k);switch(x[0]){case 1:s.push(k),i.push(p.yytext),r.push(p.yylloc),s.push(x[1]),k=null,b?(k=b,b=null):(l=p.yyleng,o=p.yytext,c=p.yylineno,m=p.yylloc,h>0&&h--);break;case 2:if(E=this.productions_[x[1]][1],L.$=i[i.length-E],L._$={first_line:r[r.length-(E||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(E||1)].first_column,last_column:r[r.length-1].last_column},_&&(L._$.range=[r[r.length-(E||1)].range[0],r[r.length-1].range[1]]),S=this.performAction.apply(L,[o,l,c,d.yy,x[1],i,r].concat(f)),"undefined"!=typeof S)return S;E&&(s=s.slice(0,-1*E*2),i=i.slice(0,-1*E),r=r.slice(0,-1*E)),s.push(this.productions_[x[1]][0]),i.push(L.$),r.push(L._$),A=a[s[s.length-2]][s[s.length-1]],s.push(A);break;case 3:return!0}}return!0}},f=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=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),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),s=t[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n; -if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,s;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;re[0].length)){if(e=n,s=r,this.options.backtrack_lexer){if(t=this.test_match(n,i[r]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[s]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,s){switch(n){case 0:return 28;case 1:return 7;case 2:return 9;case 3:return 32;case 4:return 14;case 5:return"MINUS";case 6:return"PLUS";case 7:return 18;case 8:return 31;case 9:return"SLASH";case 10:return"PS";case 11:return"PE";case 12:return 21;case 13:return 22;case 14:return 16;case 15:return 8;case 16:return 6}},rules:[/^(?:\n)/,/^(?:sequence\b)/,/^(?:TB\b)/,/^(?:[0-9]+)/,/^(?::)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[a-zåäöæøA-ZÅÄÖÆØ()]+)/,/^(?:\/)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\.)/,/^(?:\s)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],inclusive:!0}}};return t}();return y.lexer=f,t.prototype=y,y.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),s.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(s.argv.slice(1)))}).call(this,t("1YiZ5S"))},{"1YiZ5S":3,fs:1,path:2}],8:[function(t,e,n){var s={},i=[],r=[];n.addActor=function(t,e,n){console.log("Adding actor: "+t),s[t]={name:e,description:n},i.push(t)},n.addMessage=function(t,e,n,s){r.push({from:t,to:e,message:n,answer:s})},n.getMessages=function(){return r},n.getActors=function(){return s},n.getActorKeys=function(){return i},n.clear=function(){s={},r=[]}},{}],9:[function(t,e){var n=t("./parser/sequence").parser;n.yy=t("./sequenceDb"),e.exports.draw=function(t){n.yy.clear(),n.parse(t);var e,s=n.yy.getActors(),i=n.yy.getActorKeys();for(e=0;e=0;s--){var i=t[s];"."===i?t.splice(s,1):".."===i?(t.splice(s,1),n++):n&&(t.splice(s,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function s(t,e){if(t.filter)return t.filter(e);for(var n=[],s=0;s=-1&&!i;r--){var a=r>=0?arguments[r]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(n=a+"/"+n,i="/"===a.charAt(0))}return n=e(s(n.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(t){var i=n.isAbsolute(t),r="/"===a(t,-1);return t=e(s(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&r&&(t+="/"),(i?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(s(t,function(t){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function s(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=s(t.split("/")),r=s(e.split("/")),a=Math.min(i.length,r.length),o=a,c=0;a>c;c++)if(i[c]!==r[c]){o=c;break}for(var l=[],c=o;ce&&(e=t.length+e),t.substr(e,n)}}).call(this,t("1YiZ5S"))},{"1YiZ5S":3}],3:[function(t,e){function n(){}var s=e.exports={};s.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var s=n.shift();s()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),s.title="browser",s.browser=!0,s.env={},s.argv=[],s.on=n,s.addListener=n,s.once=n,s.off=n,s.removeListener=n,s.removeAllListeners=n,s.emit=n,s.binding=function(){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(){throw new Error("process.chdir is not supported")}},{}],4:[function(t,e,n){(function(e){var s=t("./graphDb"),r=t("./parser/flow"),a=t("./utils"),o=t("./sequenceRenderer"),c=function(t,e){var n=Object.keys(t),i=function(t,e){var n;for(n=0;n0)for(a=0;a',"graph"===a.detectType(c)?(h(c,n),s.bindFunctions()):o.draw(c,n)}};n.version=function(){return"0.2.4"};var y=function(t,e){return"undefined"!=typeof e?!1:t===e};document.addEventListener("DOMContentLoaded",function(){"undefined"!=typeof mermaid_config?y(!0,mermaid_config.startOnLoad)&&u():u()},!1),e.mermaid={init:function(){u()},version:function(){return n.version()}}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./graphDb":5,"./parser/flow":6,"./sequenceRenderer":9,"./utils":10}],5:[function(require,module,exports){var vertices={},edges=[],classes=[],direction,funs=[];exports.addVertex=function(t,e,n,s){"undefined"==typeof vertices[t]&&(vertices[t]={id:t,styles:[],classes:[]}),"undefined"!=typeof e&&(vertices[t].text=e),"undefined"!=typeof n&&(vertices[t].type=n),"undefined"!=typeof n&&(vertices[t].type=n),"undefined"!=typeof s&&null!==s&&s.forEach(function(e){vertices[t].styles.push(e)})},exports.addLink=function(t,e,n,s){var i={start:t,end:e,type:void 0,text:""},s=n.text;"undefined"!=typeof s&&(i.text=s),"undefined"!=typeof n&&(i.type=n.type),edges.push(i)},exports.updateLink=function(t,e){var n=t.substr(1);edges[n].style=e},exports.addClass=function(t,e){"undefined"==typeof classes[t]&&(classes[t]={id:t,styles:[]}),"undefined"!=typeof e&&null!==e&&e.forEach(function(e){classes[t].styles.push(e)})},exports.setDirection=function(t){direction=t},exports.setClass=function(t,e){t.indexOf(",")>0?t.split(",").forEach(function(t){"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)}):"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)},exports.setClickEvent=function(id,functionName){id.indexOf(",")>0?id.split(",").forEach(function(id2){"undefined"!=typeof vertices[id2]&&funs.push(function(){var elem=document.getElementById(id2);null!==elem&&(elem.onclick=function(){eval(functionName+"('"+id2+"')")})})}):"undefined"!=typeof vertices[id]&&funs.push(function(){var elem=document.getElementById(id);null!==elem&&(elem.onclick=function(){eval(functionName+"('"+id+"')")})})},exports.bindFunctions=function(){funs.forEach(function(t){t()})},exports.getDirection=function(){return direction},exports.getVertices=function(){return vertices},exports.getEdges=function(){return edges},exports.getClasses=function(){return classes},exports.clear=function(){vertices={},classes={},edges=[],funs=[]},exports.defaultStyle=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}},{}],6:[function(t,e,n){(function(s){var i=function(){function t(){this.yy={}}var e=function(t,e,n,s){for(n=n||{},s=t.length;s--;n[t[s]]=e);return n},n=[1,7],s=[1,21],i=[1,22],r=[1,23],a=[1,24],o=[1,25],c=[1,26],l=[1,27],h=[1,28],u=[1,29],y=[1,30],f=[1,31],p=[1,15],d=[1,16],g=[1,17],m=[1,14],_=[31,32,33,34,35,36,37,38,39,40,41,51,53,54,55],k=[11,44,45,46,47],b=[9,11,21,24,26,44,45,46,47],v=[9,11,21,24,26,31,32,33,34,35,36,37,38,39,40,41,44,45,46,47],x=[9,11,21,24,26,30,31,32,33,34,35,36,37,38,39,40,41,44,45,46,47],S=[6,9],w=[31,32,33,34,35,36,37,38,39,40,41],E=[31,32,33,34,35,36,37,38,39,40,41,48],A=[1,81],I=[1,82],L=[1,70],O=[1,71],$=[1,72],P=[1,73],T=[1,74],N=[1,75],C=[1,76],D=[1,77],R=[1,78],M=[1,79],U=[1,80],j=[9,23,25,27,30,31,32,33,34,35,36,37,38,39,40,41,48],q=[1,106],F=[1,103],H=[1,101],Q=[1,104],W=[1,102],z=[1,109],Y=[1,108],G=[1,107],B=[1,105],V=[1,114],Z=[11,34],K=[9,11,30,31,32,33,34,38,41,56,59],X={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graphConfig:4,statements:5,EOF:6,spaceList:7,GRAPH:8,SPACE:9,DIR:10,SEMI:11,statement:12,verticeStatement:13,styleStatement:14,classDefStatement:15,classStatement:16,clickStatement:17,vertex:18,link:19,alphaNum:20,SQS:21,text:22,SQE:23,PS:24,PE:25,DIAMOND_START:26,DIAMOND_STOP:27,alphaNumStatement:28,alphaNumToken:29,MINUS:30,ALPHA:31,NUM:32,COLON:33,COMMA:34,PLUS:35,EQUALS:36,MULT:37,DOT:38,TAGSTART:39,TAGEND:40,BRKT:41,linkStatement:42,arrowText:43,ARROW_POINT:44,ARROW_CIRCLE:45,ARROW_CROSS:46,ARROW_OPEN:47,PIPE:48,textToken:49,textStatement:50,CLASSDEF:51,stylesOpt:52,CLASS:53,CLICK:54,STYLE:55,HEX:56,style:57,styleComponent:58,UNIT:59,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",8:"GRAPH",9:"SPACE",10:"DIR",11:"SEMI",21:"SQS",23:"SQE",24:"PS",25:"PE",26:"DIAMOND_START",27:"DIAMOND_STOP",30:"MINUS",31:"ALPHA",32:"NUM",33:"COLON",34:"COMMA",35:"PLUS",36:"EQUALS",37:"MULT",38:"DOT",39:"TAGSTART",40:"TAGEND",41:"BRKT",44:"ARROW_POINT",45:"ARROW_CIRCLE",46:"ARROW_CROSS",47:"ARROW_OPEN",48:"PIPE",51:"CLASSDEF",53:"CLASS",54:"CLICK",55:"STYLE",56:"HEX",59:"UNIT"},productions_:[0,[3,3],[3,4],[4,4],[5,3],[5,1],[7,2],[7,1],[12,2],[12,2],[12,2],[12,2],[12,2],[13,3],[13,1],[18,4],[18,4],[18,4],[18,1],[20,1],[20,2],[28,1],[28,3],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[19,2],[19,1],[42,1],[42,1],[42,1],[42,1],[43,3],[22,1],[22,2],[50,1],[50,2],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[15,5],[16,5],[17,5],[14,5],[14,5],[52,1],[52,3],[57,1],[57,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1]],performAction:function(t,e,n,s,i,r){var a=r.length-1;switch(i){case 2:this.$=r[a-3];break;case 3:s.setDirection(r[a-1]),this.$=r[a-1];break;case 13:s.addLink(r[a-2],r[a],r[a-1]),this.$="oy";break;case 14:this.$="yo";break;case 15:this.$=r[a-3],s.addVertex(r[a-3],r[a-1],"square");break;case 16:this.$=r[a-3],s.addVertex(r[a-3],r[a-1],"round");break;case 17:this.$=r[a-3],s.addVertex(r[a-3],r[a-1],"diamond");break;case 18:this.$=r[a],s.addVertex(r[a]);break;case 19:case 21:case 23:case 24:case 41:case 45:case 46:case 65:this.$=r[a];break;case 20:case 42:this.$=r[a-1]+""+r[a];break;case 22:this.$=r[a-2]+"-"+r[a];break;case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 35:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 56:case 57:this.$=r[a];break;case 33:case 55:this.$="
";break;case 34:r[a-1].text=r[a],this.$=r[a-1];break;case 36:this.$={type:"arrow"};break;case 37:this.$={type:"arrow_circle"};break;case 38:this.$={type:"arrow_cross"};break;case 39:this.$={type:"arrow_open"};break;case 40:this.$=r[a-1];break;case 58:this.$=r[a-4],s.addClass(r[a-2],r[a]);break;case 59:this.$=r[a-4],s.setClass(r[a-2],r[a]);break;case 60:this.$=r[a-4],s.setClickEvent(r[a-2],r[a]);break;case 61:this.$=r[a-4],s.addVertex(r[a-2],void 0,void 0,r[a]);break;case 62:this.$=r[a-4],s.updateLink(r[a-2],r[a]);break;case 63:this.$=[r[a]];break;case 64:r[a-2].push(r[a]),this.$=r[a-2];break;case 66:this.$=r[a-1]+r[a];break;case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:this.$=r[a]}},table:[{3:1,4:2,8:[1,3]},{1:[3]},{5:4,7:5,9:n,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f,51:p,53:d,54:g,55:m},{9:[1,32]},{6:[1,33]},{5:34,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f,51:p,53:d,54:g,55:m},{6:[2,5],7:35,9:n},e(_,[2,7],{7:36,9:n}),{11:[1,37]},{11:[1,38]},{11:[1,39]},{11:[1,40]},{11:[1,41]},{11:[2,14],19:42,42:43,44:[1,44],45:[1,45],46:[1,46],47:[1,47]},{9:[1,48]},{9:[1,49]},{9:[1,50]},{9:[1,51]},e(k,[2,18],{21:[1,52],24:[1,53],26:[1,54]}),e(b,[2,19],{28:19,29:20,20:55,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f}),e(v,[2,21],{30:[1,56]}),e(x,[2,23]),e(x,[2,24]),e(x,[2,25]),e(x,[2,26]),e(x,[2,27]),e(x,[2,28]),e(x,[2,29]),e(x,[2,30]),e(x,[2,31]),e(x,[2,32]),e(x,[2,33]),{10:[1,57]},{1:[2,1]},{6:[1,58]},{5:59,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f,51:p,53:d,54:g,55:m},e(_,[2,6]),e(S,[2,8]),e(S,[2,9]),e(S,[2,10]),e(S,[2,11]),e(S,[2,12]),{18:60,20:18,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f},e(w,[2,35],{43:61,48:[1,62]}),e(E,[2,36]),e(E,[2,37]),e(E,[2,38]),e(E,[2,39]),{20:63,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f,56:[1,64]},{20:65,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f},{20:66,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f},{20:67,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f},{9:A,22:68,30:I,31:L,32:O,33:$,34:P,35:T,36:N,37:C,38:D,39:R,40:M,41:U,49:69},{9:A,22:83,30:I,31:L,32:O,33:$,34:P,35:T,36:N,37:C,38:D,39:R,40:M,41:U,49:69},{9:A,22:84,30:I,31:L,32:O,33:$,34:P,35:T,36:N,37:C,38:D,39:R,40:M,41:U,49:69},e(b,[2,20]),{29:85,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f},{11:[1,86]},{1:[2,2]},{6:[2,4]},{11:[2,13]},e(w,[2,34]),{9:A,22:87,30:I,31:L,32:O,33:$,34:P,35:T,36:N,37:C,38:D,39:R,40:M,41:U,49:69},{9:[1,88]},{9:[1,89]},{9:[1,90]},{9:[1,91]},{9:[1,92]},{9:A,23:[1,93],30:I,31:L,32:O,33:$,34:P,35:T,36:N,37:C,38:D,39:R,40:M,41:U,49:94},e(j,[2,41]),e(j,[2,45]),e(j,[2,46]),e(j,[2,47]),e(j,[2,48]),e(j,[2,49]),e(j,[2,50]),e(j,[2,51]),e(j,[2,52]),e(j,[2,53]),e(j,[2,54]),e(j,[2,55]),e(j,[2,56]),e(j,[2,57]),{9:A,25:[1,95],30:I,31:L,32:O,33:$,34:P,35:T,36:N,37:C,38:D,39:R,40:M,41:U,49:94},{9:A,27:[1,96],30:I,31:L,32:O,33:$,34:P,35:T,36:N,37:C,38:D,39:R,40:M,41:U,49:94},e(v,[2,22]),e([9,31,32,33,34,35,36,37,38,39,40,41,51,53,54,55],[2,3]),{9:A,30:I,31:L,32:O,33:$,34:P,35:T,36:N,37:C,38:D,39:R,40:M,41:U,48:[1,97],49:94},{9:q,30:F,31:H,32:Q,33:W,38:z,41:Y,52:98,56:G,57:99,58:100,59:B},{9:q,30:F,31:H,32:Q,33:W,38:z,41:Y,52:110,56:G,57:99,58:100,59:B},{9:q,30:F,31:H,32:Q,33:W,38:z,41:Y,52:111,56:G,57:99,58:100,59:B},{20:112,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f},{20:113,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f},e(k,[2,15]),e(j,[2,42]),e(k,[2,16]),e(k,[2,17]),e(w,[2,40]),{11:[2,61],34:V},e(Z,[2,63],{58:115,9:q,30:F,31:H,32:Q,33:W,38:z,41:Y,56:G,59:B}),e(K,[2,65]),e(K,[2,67]),e(K,[2,68]),e(K,[2,69]),e(K,[2,70]),e(K,[2,71]),e(K,[2,72]),e(K,[2,73]),e(K,[2,74]),e(K,[2,75]),{11:[2,62],34:V},{11:[2,58],34:V},{11:[2,59]},{11:[2,60]},{9:q,30:F,31:H,32:Q,33:W,38:z,41:Y,56:G,57:116,58:100,59:B},e(K,[2,66]),e(Z,[2,64],{58:115,9:q,30:F,31:H,32:Q,33:W,38:z,41:Y,56:G,59:B})],defaultActions:{33:[2,1],58:[2,2],59:[2,4],60:[2,13],112:[2,59],113:[2,60]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=p.lex()||y,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,s=[0],i=[null],r=[],a=this.table,o="",c=0,l=0,h=0,u=2,y=1,f=r.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(d.yy[g]=this.yy[g]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,"undefined"==typeof p.yylloc&&(p.yylloc={});var m=p.yylloc;r.push(m);var _=p.options&&p.options.ranges;this.parseError="function"==typeof d.yy.parseError?d.yy.parseError:Object.getPrototypeOf(this).parseError;for(var k,b,v,x,S,w,E,A,I,L={};;){if(v=s[s.length-1],this.defaultActions[v]?x=this.defaultActions[v]:((null===k||"undefined"==typeof k)&&(k=e()),x=a[v]&&a[v][k]),"undefined"==typeof x||!x.length||!x[0]){var O="";I=[];for(w in a[v])this.terminals_[w]&&w>u&&I.push("'"+this.terminals_[w]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+I.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(c+1)+": Unexpected "+(k==y?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[k]||k,line:p.yylineno,loc:m,expected:I})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+k);switch(x[0]){case 1:s.push(k),i.push(p.yytext),r.push(p.yylloc),s.push(x[1]),k=null,b?(k=b,b=null):(l=p.yyleng,o=p.yytext,c=p.yylineno,m=p.yylloc,h>0&&h--);break;case 2:if(E=this.productions_[x[1]][1],L.$=i[i.length-E],L._$={first_line:r[r.length-(E||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(E||1)].first_column,last_column:r[r.length-1].last_column},_&&(L._$.range=[r[r.length-(E||1)].range[0],r[r.length-1].range[1]]),S=this.performAction.apply(L,[o,l,c,d.yy,x[1],i,r].concat(f)),"undefined"!=typeof S)return S;E&&(s=s.slice(0,-1*E*2),i=i.slice(0,-1*E),r=r.slice(0,-1*E)),s.push(this.productions_[x[1]][0]),i.push(L.$),r.push(L._$),A=a[s[s.length-2]][s[s.length-1]],s.push(A);break;case 3:return!0}}return!0}},J=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=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),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),s=t[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,s;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;re[0].length)){if(e=n,s=r,this.options.backtrack_lexer){if(t=this.test_match(n,i[r]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[s]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,s){switch(n){case 0:return 55;case 1:return 51;case 2:return 53;case 3:return 54;case 4:return 8;case 5:return 10;case 6:return 10;case 7:return 10;case 8:return 10;case 9:return 10;case 10:return 10;case 11:return 32;case 12:return 41;case 13:return 33;case 14:return 11;case 15:return 34;case 16:return 36;case 17:return 37;case 18:return 38;case 19:return 39;case 20:return 40;case 21:return 46;case 22:return 44;case 23:return 45;case 24:return 47;case 25:return 30;case 26:return 35;case 27:return 36;case 28:return 31;case 29:return 48;case 30:return 24;case 31:return 25;case 32:return 21;case 33:return 23;case 34:return 26;case 35:return 27;case 36:return 9;case 37:return"NEWLINE";case 38:return 6}},rules:[/^(?:style\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9])/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:<)/,/^(?:>)/,/^(?:--[x])/,/^(?:-->)/,/^(?:--[o])/,/^(?:---)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[a-zåäöæøA-ZÅÄÖÆØ_])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:\s)/,/^(?:\n)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,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],inclusive:!0}}};return t}();return X.lexer=J,t.prototype=X,X.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),s.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(s.argv.slice(1)))}).call(this,t("1YiZ5S"))},{"1YiZ5S":3,fs:1,path:2}],7:[function(t,e,n){(function(s){var i=function(){function t(){this.yy={}}var e=function(t,e,n,s){for(n=n||{},s=t.length;s--;n[t[s]]=e);return n},n=[1,11],s=[1,12],i=[1,17],r=[1,16],a=[6,8,28],o=[6,8,14,16,28,31,32],c=[6,8,14,16,18,28,31,32],l=[6,31,32],h=[1,35],u=[6,8,16,18,28,31,32],y={trace:function(){},yy:{},symbols_:{error:2,expressions:3,sequenceConfig:4,statements:5,EOF:6,SEQ:7,SPACE:8,DIR:9,newlines:10,statement:11,preStatement:12,alphaNum:13,COLON:14,text:15,DOT:16,message:17,EQUALS:18,callee:19,action:20,SQS:21,SQE:22,actorDefinition:23,messageDefinition:24,caller:25,answer:26,spaceList:27,NEWLINE:28,alphaNumStatement:29,alphaNumToken:30,ALPHA:31,NUM:32,textStatement:33,textToken:34,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"SEQ",8:"SPACE",9:"DIR",14:"COLON",16:"DOT",18:"EQUALS",21:"SQS",22:"SQE",28:"NEWLINE",31:"ALPHA",32:"NUM"},productions_:[0,[3,2],[3,1],[4,4],[5,3],[5,2],[5,3],[12,3],[11,1],[11,3],[11,5],[20,2],[23,3],[24,7],[25,1],[26,1],[19,1],[17,1],[27,2],[27,1],[10,2],[10,2],[10,1],[10,1],[13,1],[29,2],[29,1],[30,1],[30,1],[15,1],[33,2],[33,1],[34,1],[34,1]],performAction:function(t,e,n,s,i,r){var a=r.length-1;switch(i){case 1:case 5:this.$=r[a-1];break;case 3:this.$=r[a-1];break;case 4:case 6:this.$=r[a-2];break;case 7:this.$={a:r[a-2],b:r[a]};break;case 8:s.addActor(r[a].a,"actor",r[a].b),this.$="actor";break;case 9:s.addMessage(r[a-2].a,r[a-2].b,r[a]),this.$="message";break;case 10:s.addMessage(r[a-4].a,r[a-2],r[a],r[a-4].b),this.$="actor";break;case 11:this.$="action";break;case 12:this.$="actor";break;case 13:console.log("Got new message from="+r[a-6]+" to="+r[a-2]+" message="+r[a]+" answer="+r[a-4]),this.$="actor";break;case 24:case 27:case 28:case 29:case 33:this.$=r[a];break;case 25:case 30:this.$=r[a-1]+""+r[a]}},table:[{3:1,4:2,6:[1,3],7:[1,4]},{1:[3]},{5:5,11:6,12:7,13:8,29:9,30:10,31:n,32:s},{1:[2,2]},{8:[1,13]},{1:[2,1]},{6:[1,15],8:i,10:14,28:r},e(a,[2,8],{16:[1,18],18:[1,19]}),{14:[1,20],30:21,31:n,32:s},e(o,[2,24]),e(o,[2,26]),e(c,[2,27]),e(c,[2,28]),{9:[1,22]},{5:23,6:[1,24],11:6,12:7,13:8,29:9,30:10,31:n,32:s},{1:[2,5]},e(l,[2,22],{10:25,8:i,28:r}),e(l,[2,23],{10:26,8:i,28:r}),{13:28,17:27,29:9,30:10,31:n,32:s},{13:30,19:29,29:9,30:10,31:n,32:s},{8:h,15:31,30:34,31:n,32:s,33:32,34:33},e(o,[2,25]),{8:i,10:36,28:r},{1:[2,4]},{1:[2,6]},e(l,[2,20]),e(l,[2,21]),e(a,[2,9]),e(a,[2,17],{30:21,31:n,32:s}),{16:[1,37]},{16:[2,16],30:21,31:n,32:s},e([6,16,18,28],[2,7],{30:34,34:38,8:h,31:n,32:s}),e(u,[2,29]),e(u,[2,31]),e(u,[2,32]),e(u,[2,33]),e([31,32],[2,3]),{13:28,17:39,29:9,30:10,31:n,32:s},e(u,[2,30]),e(a,[2,10])],defaultActions:{3:[2,2],5:[2,1],15:[2,5],23:[2,4],24:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=p.lex()||y,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,s=[0],i=[null],r=[],a=this.table,o="",c=0,l=0,h=0,u=2,y=1,f=r.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(d.yy[g]=this.yy[g]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,"undefined"==typeof p.yylloc&&(p.yylloc={});var m=p.yylloc;r.push(m);var _=p.options&&p.options.ranges;this.parseError="function"==typeof d.yy.parseError?d.yy.parseError:Object.getPrototypeOf(this).parseError;for(var k,b,v,x,S,w,E,A,I,L={};;){if(v=s[s.length-1],this.defaultActions[v]?x=this.defaultActions[v]:((null===k||"undefined"==typeof k)&&(k=e()),x=a[v]&&a[v][k]),"undefined"==typeof x||!x.length||!x[0]){var O="";I=[];for(w in a[v])this.terminals_[w]&&w>u&&I.push("'"+this.terminals_[w]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+I.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(c+1)+": Unexpected "+(k==y?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[k]||k,line:p.yylineno,loc:m,expected:I})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+k);switch(x[0]){case 1:s.push(k),i.push(p.yytext),r.push(p.yylloc),s.push(x[1]),k=null,b?(k=b,b=null):(l=p.yyleng,o=p.yytext,c=p.yylineno,m=p.yylloc,h>0&&h--);break;case 2:if(E=this.productions_[x[1]][1],L.$=i[i.length-E],L._$={first_line:r[r.length-(E||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(E||1)].first_column,last_column:r[r.length-1].last_column},_&&(L._$.range=[r[r.length-(E||1)].range[0],r[r.length-1].range[1]]),S=this.performAction.apply(L,[o,l,c,d.yy,x[1],i,r].concat(f)),"undefined"!=typeof S)return S;E&&(s=s.slice(0,-1*E*2),i=i.slice(0,-1*E),r=r.slice(0,-1*E)),s.push(this.productions_[x[1]][0]),i.push(L.$),r.push(L._$),A=a[s[s.length-2]][s[s.length-1]],s.push(A);break;case 3:return!0}}return!0}},f=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=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),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length); +return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),s=t[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,s;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;re[0].length)){if(e=n,s=r,this.options.backtrack_lexer){if(t=this.test_match(n,i[r]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[s]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,s){switch(n){case 0:return 28;case 1:return 7;case 2:return 9;case 3:return 32;case 4:return 14;case 5:return"MINUS";case 6:return"PLUS";case 7:return 18;case 8:return 31;case 9:return"SLASH";case 10:return"PS";case 11:return"PE";case 12:return 21;case 13:return 22;case 14:return 16;case 15:return 8;case 16:return 6}},rules:[/^(?:\n)/,/^(?:sequence\b)/,/^(?:TB\b)/,/^(?:[0-9]+)/,/^(?::)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[a-zåäöæøA-ZÅÄÖÆØ()]+)/,/^(?:\/)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\.)/,/^(?:\s)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],inclusive:!0}}};return t}();return y.lexer=f,t.prototype=y,y.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),s.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(s.argv.slice(1)))}).call(this,t("1YiZ5S"))},{"1YiZ5S":3,fs:1,path:2}],8:[function(t,e,n){var s={},i=[],r=[];n.addActor=function(t,e,n){console.log("Adding actor: "+t),s[t]={name:e,description:n},i.push(t)},n.addMessage=function(t,e,n,s){r.push({from:t,to:e,message:n,answer:s})},n.getMessages=function(){return r},n.getActors=function(){return s},n.getActorKeys=function(){return i},n.clear=function(){s={},r=[]}},{}],9:[function(t,e){var n=t("./parser/sequence").parser;n.yy=t("./sequenceDb"),e.exports.draw=function(t){n.yy.clear(),n.parse(t);var e,s=n.yy.getActors(),i=n.yy.getActorKeys();for(e=0;e)/,/^(?:--[x])/,/^(?:-->)/,/^(?:--[o])/,/^(?:---)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[a-zåäöæøA-ZÅÄÖÆØ_]+)/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:\s)/,/^(?:\n)/,/^(?:$)/], -conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,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],"inclusive":true}} +rules: [/^(?:style\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9])/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:<)/,/^(?:>)/,/^(?:--[x])/,/^(?:-->)/,/^(?:--[o])/,/^(?:---)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[a-zåäöæøA-ZÅÄÖÆØ_])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:\s)/,/^(?:\n)/,/^(?:$)/], +conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,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],"inclusive":true}} }); return lexer; })(); diff --git a/dist/mermaid.slim.min.js b/dist/mermaid.slim.min.js index e2e88d338..980eeebe1 100644 --- a/dist/mermaid.slim.min.js +++ b/dist/mermaid.slim.min.js @@ -1,2 +1,2 @@ -!function t(e,n,s){function i(a,o){if(!n[a]){if(!e[a]){var c="function"==typeof require&&require;if(!o&&c)return c(a,!0);if(r)return r(a,!0);throw new Error("Cannot find module '"+a+"'")}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return i(n?n:t)},l,l.exports,t,e,n,s)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a=0;s--){var i=t[s];"."===i?t.splice(s,1):".."===i?(t.splice(s,1),n++):n&&(t.splice(s,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function s(t,e){if(t.filter)return t.filter(e);for(var n=[],s=0;s=-1&&!i;r--){var a=r>=0?arguments[r]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(n=a+"/"+n,i="/"===a.charAt(0))}return n=e(s(n.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(t){var i=n.isAbsolute(t),r="/"===a(t,-1);return t=e(s(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&r&&(t+="/"),(i?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(s(t,function(t){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function s(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=s(t.split("/")),r=s(e.split("/")),a=Math.min(i.length,r.length),o=a,c=0;a>c;c++)if(i[c]!==r[c]){o=c;break}for(var l=[],c=o;ce&&(e=t.length+e),t.substr(e,n)}}).call(this,t("1YiZ5S"))},{"1YiZ5S":3}],3:[function(t,e){function n(){}var s=e.exports={};s.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var s=n.shift();s()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),s.title="browser",s.browser=!0,s.env={},s.argv=[],s.on=n,s.addListener=n,s.once=n,s.off=n,s.removeListener=n,s.removeAllListeners=n,s.emit=n,s.binding=function(){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(){throw new Error("process.chdir is not supported")}},{}],4:[function(t,e,n){(function(e){var s=t("./graphDb"),r=t("./parser/flow"),a=t("./utils"),o=t("./sequenceRenderer"),c=function(t,e){var n=Object.keys(t),i=function(t,e){var n;for(n=0;n0)for(a=0;a',"graph"===a.detectType(c)?(h(c,n),s.bindFunctions()):o.draw(c,n)}};n.version=function(){return"0.2.3"};var y=function(t,e){return"undefined"!=typeof e?!1:t===e};document.addEventListener("DOMContentLoaded",function(){"undefined"!=typeof mermaid_config?y(!0,mermaid_config.startOnLoad)&&u():u()},!1),e.mermaid={init:function(){u()},version:function(){return n.version()}}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./graphDb":5,"./parser/flow":6,"./sequenceRenderer":9,"./utils":10}],5:[function(require,module,exports){var vertices={},edges=[],classes=[],direction,funs=[];exports.addVertex=function(t,e,n,s){"undefined"==typeof vertices[t]&&(vertices[t]={id:t,styles:[],classes:[]}),"undefined"!=typeof e&&(vertices[t].text=e),"undefined"!=typeof n&&(vertices[t].type=n),"undefined"!=typeof n&&(vertices[t].type=n),"undefined"!=typeof s&&null!==s&&s.forEach(function(e){vertices[t].styles.push(e)})},exports.addLink=function(t,e,n,s){var i={start:t,end:e,type:void 0,text:""},s=n.text;"undefined"!=typeof s&&(i.text=s),"undefined"!=typeof n&&(i.type=n.type),edges.push(i)},exports.updateLink=function(t,e){var n=t.substr(1);edges[n].style=e},exports.addClass=function(t,e){"undefined"==typeof classes[t]&&(classes[t]={id:t,styles:[]}),"undefined"!=typeof e&&null!==e&&e.forEach(function(e){classes[t].styles.push(e)})},exports.setDirection=function(t){direction=t},exports.setClass=function(t,e){t.indexOf(",")>0?t.split(",").forEach(function(t){"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)}):"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)},exports.setClickEvent=function(id,functionName){id.indexOf(",")>0?id.split(",").forEach(function(id2){"undefined"!=typeof vertices[id2]&&funs.push(function(){var elem=document.getElementById(id2);null!==elem&&(elem.onclick=function(){eval(functionName+"('"+id2+"')")})})}):"undefined"!=typeof vertices[id]&&funs.push(function(){var elem=document.getElementById(id);null!==elem&&(elem.onclick=function(){eval(functionName+"('"+id+"')")})})},exports.bindFunctions=function(){funs.forEach(function(t){t()})},exports.getDirection=function(){return direction},exports.getVertices=function(){return vertices},exports.getEdges=function(){return edges},exports.getClasses=function(){return classes},exports.clear=function(){vertices={},classes={},edges=[],funs=[]},exports.defaultStyle=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}},{}],6:[function(t,e,n){(function(s){var i=function(){function t(){this.yy={}}var e=function(t,e,n,s){for(n=n||{},s=t.length;s--;n[t[s]]=e);return n},n=[1,7],s=[2,13],i=[1,21],r=[1,22],a=[1,23],o=[1,24],c=[1,25],l=[1,26],h=[1,27],u=[1,28],y=[1,29],f=[1,30],p=[1,15],d=[1,16],g=[1,17],m=[1,14],_=[6,9],k=[11,30,31,32,33,34,35,36,37,38,39,40,48,50,51,52],b=[2,7],v=[11,43,44,45,46],x=[9,11,21,23,24,25,26,27,43,44,45,46,47],S=[9,11,21,23,24,25,26,27,31,32,33,34,35,36,37,38,39,40,43,44,45,46,47],w=[9,11,21,23,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,43,44,45,46,47],E=[31,32,33,34,35,36,37,38,39,40],A=[31,32,33,34,35,36,37,38,39,40,47],I=[23,25,27,47],L=[1,93],O=[1,90],$=[1,88],P=[1,91],T=[1,89],N=[1,94],C=[1,92],D=[1,101],R=[11,34],M=[9,11,30,31,32,33,34,53,56],U={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graphConfig:4,statements:5,EOF:6,spaceList:7,GRAPH:8,SPACE:9,DIR:10,SEMI:11,statement:12,verticeStatement:13,styleStatement:14,classDefStatement:15,classStatement:16,clickStatement:17,vertex:18,link:19,alphaNum:20,SQS:21,text:22,SQE:23,PS:24,PE:25,DIAMOND_START:26,DIAMOND_STOP:27,alphaNumStatement:28,alphaNumToken:29,MINUS:30,ALPHA:31,NUM:32,COLON:33,COMMA:34,PLUS:35,EQUALS:36,MULT:37,DOT:38,TAGSTART:39,TAGEND:40,linkStatement:41,arrowText:42,ARROW_POINT:43,ARROW_CIRCLE:44,ARROW_CROSS:45,ARROW_OPEN:46,PIPE:47,CLASSDEF:48,stylesOpt:49,CLASS:50,CLICK:51,STYLE:52,HEX:53,style:54,styleComponent:55,UNIT:56,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",8:"GRAPH",9:"SPACE",10:"DIR",11:"SEMI",21:"SQS",23:"SQE",24:"PS",25:"PE",26:"DIAMOND_START",27:"DIAMOND_STOP",30:"MINUS",31:"ALPHA",32:"NUM",33:"COLON",34:"COMMA",35:"PLUS",36:"EQUALS",37:"MULT",38:"DOT",39:"TAGSTART",40:"TAGEND",43:"ARROW_POINT",44:"ARROW_CIRCLE",45:"ARROW_CROSS",46:"ARROW_OPEN",47:"PIPE",48:"CLASSDEF",50:"CLASS",51:"CLICK",52:"STYLE",53:"HEX",56:"UNIT"},productions_:[0,[3,3],[3,4],[4,4],[5,3],[5,1],[7,2],[7,1],[12,2],[12,2],[12,2],[12,2],[12,2],[13,0],[13,3],[13,1],[18,4],[18,4],[18,4],[18,1],[20,1],[20,2],[28,1],[28,3],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[19,2],[19,1],[41,1],[41,1],[41,1],[41,1],[42,3],[22,3],[22,5],[22,1],[15,5],[16,5],[17,5],[14,5],[14,5],[49,1],[49,3],[54,1],[54,2],[55,1],[55,1],[55,1],[55,1],[55,1],[55,1],[55,1]],performAction:function(t,e,n,s,i,r){var a=r.length-1;switch(i){case 2:this.$=r[a-3];break;case 3:s.setDirection(r[a-1]),this.$=r[a-1];break;case 14:s.addLink(r[a-2],r[a],r[a-1]),this.$="oy";break;case 15:this.$="yo";break;case 16:this.$=r[a-3],s.addVertex(r[a-3],r[a-1],"square");break;case 17:this.$=r[a-3],s.addVertex(r[a-3],r[a-1],"round");break;case 18:this.$=r[a-3],s.addVertex(r[a-3],r[a-1],"diamond");break;case 19:this.$=r[a],s.addVertex(r[a]);break;case 20:case 22:case 24:case 25:case 51:this.$=r[a];break;case 21:this.$=r[a-1]+""+r[a];break;case 23:this.$=r[a-2]+"-"+r[a];break;case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 33:case 35:case 43:this.$=r[a];break;case 34:r[a-1].text=r[a],this.$=r[a-1];break;case 36:this.$={type:"arrow"};break;case 37:this.$={type:"arrow_circle"};break;case 38:this.$={type:"arrow_cross"};break;case 39:this.$={type:"arrow_open"};break;case 40:this.$=r[a-1];break;case 41:this.$=r[a-2]+" "+r[a];break;case 42:this.$=r[a-4]+" - "+r[a];break;case 44:this.$=r[a-4],s.addClass(r[a-2],r[a]);break;case 45:this.$=r[a-4],s.setClass(r[a-2],r[a]);break;case 46:this.$=r[a-4],s.setClickEvent(r[a-2],r[a]);break;case 47:this.$=r[a-4],s.addVertex(r[a-2],void 0,void 0,r[a]);break;case 48:this.$=r[a-4],s.updateLink(r[a-2],r[a]);break;case 49:this.$=[r[a]];break;case 50:r[a-2].push(r[a]),this.$=r[a-2];break;case 52:this.$=r[a-1]+r[a];break;case 53:case 54:case 55:case 56:case 57:case 58:case 59:this.$=r[a]}},table:[{3:1,4:2,8:[1,3]},{1:[3]},{5:4,7:5,9:n,11:s,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f,48:p,50:d,51:g,52:m},{9:[1,31]},{6:[1,32],7:33,9:n},{5:34,11:s,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f,48:p,50:d,51:g,52:m},e(_,[2,5]),e(k,b,{7:35,9:n}),{11:[1,36]},{11:[1,37]},{11:[1,38]},{11:[1,39]},{11:[1,40]},{11:[2,15],19:41,41:42,43:[1,43],44:[1,44],45:[1,45],46:[1,46]},{9:[1,47]},{9:[1,48]},{9:[1,49]},{9:[1,50]},e(v,[2,19],{21:[1,51],24:[1,52],26:[1,53]}),e(x,[2,20],{28:19,29:20,20:54,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f}),e(S,[2,22],{30:[1,55]}),e(w,[2,24]),e(w,[2,25]),e(w,[2,26]),e(w,[2,27]),e(w,[2,28]),e(w,[2,29]),e(w,[2,30]),e(w,[2,31]),e(w,[2,32]),e(w,[2,33]),{10:[1,56]},{1:[2,1]},{11:s,12:57,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f,48:p,50:d,51:g,52:m},{6:[1,58],7:33,9:n},e(k,[2,6]),e(_,[2,8]),e(_,[2,9]),e(_,[2,10]),e(_,[2,11]),e(_,[2,12]),{18:59,20:18,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},e(E,[2,35],{42:60,47:[1,61]}),e(A,[2,36]),e(A,[2,37]),e(A,[2,38]),e(A,[2,39]),{20:62,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f,53:[1,63]},{20:64,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{20:65,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{20:66,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{20:68,22:67,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{20:68,22:69,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{20:68,22:70,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},e(x,[2,21]),{29:71,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{11:[1,72]},e(_,[2,4]),{1:[2,2]},{11:[2,14]},e(E,[2,34]),{20:68,22:73,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{9:[1,74]},{9:[1,75]},{9:[1,76]},{9:[1,77]},{9:[1,78]},{23:[1,79]},e(I,[2,43],{7:81,9:[1,80]}),{25:[1,82]},{27:[1,83]},e(S,[2,23]),e([9,11,31,32,33,34,35,36,37,38,39,40,48,50,51,52],[2,3]),{47:[1,84]},{9:L,30:O,31:$,32:P,33:T,49:85,53:N,54:86,55:87,56:C},{9:L,30:O,31:$,32:P,33:T,49:95,53:N,54:86,55:87,56:C},{9:L,30:O,31:$,32:P,33:T,49:96,53:N,54:86,55:87,56:C},{20:97,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{20:98,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},e(v,[2,16]),{7:35,9:n,20:68,22:99,28:19,29:20,30:b,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},{30:[1,100]},e(v,[2,17]),e(v,[2,18]),e(E,[2,40]),{11:[2,47],34:D},e(R,[2,49],{55:102,9:L,30:O,31:$,32:P,33:T,53:N,56:C}),e(M,[2,51]),e(M,[2,53]),e(M,[2,54]),e(M,[2,55]),e(M,[2,56]),e(M,[2,57]),e(M,[2,58]),e(M,[2,59]),{11:[2,48],34:D},{11:[2,44],34:D},{11:[2,45]},{11:[2,46]},e(I,[2,41]),{7:103,9:n},{9:L,30:O,31:$,32:P,33:T,53:N,54:104,55:87,56:C},e(M,[2,52]),{20:68,22:105,28:19,29:20,31:i,32:r,33:a,34:o,35:c,36:l,37:h,38:u,39:y,40:f},e(R,[2,50],{55:102,9:L,30:O,31:$,32:P,33:T,53:N,56:C}),e(I,[2,42])],defaultActions:{32:[2,1],58:[2,2],59:[2,14],97:[2,45],98:[2,46]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=p.lex()||y,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,s=[0],i=[null],r=[],a=this.table,o="",c=0,l=0,h=0,u=2,y=1,f=r.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(d.yy[g]=this.yy[g]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,"undefined"==typeof p.yylloc&&(p.yylloc={});var m=p.yylloc;r.push(m);var _=p.options&&p.options.ranges;this.parseError="function"==typeof d.yy.parseError?d.yy.parseError:Object.getPrototypeOf(this).parseError;for(var k,b,v,x,S,w,E,A,I,L={};;){if(v=s[s.length-1],this.defaultActions[v]?x=this.defaultActions[v]:((null===k||"undefined"==typeof k)&&(k=e()),x=a[v]&&a[v][k]),"undefined"==typeof x||!x.length||!x[0]){var O="";I=[];for(w in a[v])this.terminals_[w]&&w>u&&I.push("'"+this.terminals_[w]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+I.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(c+1)+": Unexpected "+(k==y?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[k]||k,line:p.yylineno,loc:m,expected:I})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+k);switch(x[0]){case 1:s.push(k),i.push(p.yytext),r.push(p.yylloc),s.push(x[1]),k=null,b?(k=b,b=null):(l=p.yyleng,o=p.yytext,c=p.yylineno,m=p.yylloc,h>0&&h--);break;case 2:if(E=this.productions_[x[1]][1],L.$=i[i.length-E],L._$={first_line:r[r.length-(E||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(E||1)].first_column,last_column:r[r.length-1].last_column},_&&(L._$.range=[r[r.length-(E||1)].range[0],r[r.length-1].range[1]]),S=this.performAction.apply(L,[o,l,c,d.yy,x[1],i,r].concat(f)),"undefined"!=typeof S)return S;E&&(s=s.slice(0,-1*E*2),i=i.slice(0,-1*E),r=r.slice(0,-1*E)),s.push(this.productions_[x[1]][0]),i.push(L.$),r.push(L._$),A=a[s[s.length-2]][s[s.length-1]],s.push(A);break;case 3:return!0}}return!0}},j=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=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),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),s=t[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,s;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;re[0].length)){if(e=n,s=r,this.options.backtrack_lexer){if(t=this.test_match(n,i[r]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[s]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,s){switch(n){case 0:return 52;case 1:return 48;case 2:return 50;case 3:return 51;case 4:return 8;case 5:return 10;case 6:return 10;case 7:return 10;case 8:return 10;case 9:return 10;case 10:return 10;case 11:return 53;case 12:return 32;case 13:return"BRKT";case 14:return 56;case 15:return 56;case 16:return 56;case 17:return 33;case 18:return 11;case 19:return 34;case 20:return 36;case 21:return 37;case 22:return 38;case 23:return 39;case 24:return 40;case 25:return 45;case 26:return 43;case 27:return 44;case 28:return 46;case 29:return 30;case 30:return 35;case 31:return 36;case 32:return 31;case 33:return 47;case 34:return 24;case 35:return 25;case 36:return 21;case 37:return 23;case 38:return 26;case 39:return 27;case 40:return 9;case 41:return"NEWLINE";case 42:return 6}},rules:[/^(?:style\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:#[a-f0-9]+)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?:px\b)/,/^(?:pt\b)/,/^(?:dot\b)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:<)/,/^(?:>)/,/^(?:--[x])/,/^(?:-->)/,/^(?:--[o])/,/^(?:---)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[a-zåäöæøA-ZÅÄÖÆØ_]+)/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:\s)/,/^(?:\n)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,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],inclusive:!0}}};return t}();return U.lexer=j,t.prototype=U,U.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),s.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(s.argv.slice(1)))}).call(this,t("1YiZ5S"))},{"1YiZ5S":3,fs:1,path:2}],7:[function(t,e,n){(function(s){var i=function(){function t(){this.yy={}}var e=function(t,e,n,s){for(n=n||{},s=t.length;s--;n[t[s]]=e);return n},n=[1,11],s=[1,12],i=[1,17],r=[1,16],a=[6,8,28],o=[6,8,14,16,28,31,32],c=[6,8,14,16,18,28,31,32],l=[6,31,32],h=[1,35],u=[6,8,16,18,28,31,32],y={trace:function(){},yy:{},symbols_:{error:2,expressions:3,sequenceConfig:4,statements:5,EOF:6,SEQ:7,SPACE:8,DIR:9,newlines:10,statement:11,preStatement:12,alphaNum:13,COLON:14,text:15,DOT:16,message:17,EQUALS:18,callee:19,action:20,SQS:21,SQE:22,actorDefinition:23,messageDefinition:24,caller:25,answer:26,spaceList:27,NEWLINE:28,alphaNumStatement:29,alphaNumToken:30,ALPHA:31,NUM:32,textStatement:33,textToken:34,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"SEQ",8:"SPACE",9:"DIR",14:"COLON",16:"DOT",18:"EQUALS",21:"SQS",22:"SQE",28:"NEWLINE",31:"ALPHA",32:"NUM"},productions_:[0,[3,2],[3,1],[4,4],[5,3],[5,2],[5,3],[12,3],[11,1],[11,3],[11,5],[20,2],[23,3],[24,7],[25,1],[26,1],[19,1],[17,1],[27,2],[27,1],[10,2],[10,2],[10,1],[10,1],[13,1],[29,2],[29,1],[30,1],[30,1],[15,1],[33,2],[33,1],[34,1],[34,1]],performAction:function(t,e,n,s,i,r){var a=r.length-1;switch(i){case 1:case 5:this.$=r[a-1];break;case 3:this.$=r[a-1];break;case 4:case 6:this.$=r[a-2];break;case 7:this.$={a:r[a-2],b:r[a]};break;case 8:s.addActor(r[a].a,"actor",r[a].b),this.$="actor";break;case 9:s.addMessage(r[a-2].a,r[a-2].b,r[a]),this.$="message";break;case 10:s.addMessage(r[a-4].a,r[a-2],r[a],r[a-4].b),this.$="actor";break;case 11:this.$="action";break;case 12:this.$="actor";break;case 13:console.log("Got new message from="+r[a-6]+" to="+r[a-2]+" message="+r[a]+" answer="+r[a-4]),this.$="actor";break;case 24:case 27:case 28:case 29:case 33:this.$=r[a];break;case 25:case 30:this.$=r[a-1]+""+r[a]}},table:[{3:1,4:2,6:[1,3],7:[1,4]},{1:[3]},{5:5,11:6,12:7,13:8,29:9,30:10,31:n,32:s},{1:[2,2]},{8:[1,13]},{1:[2,1]},{6:[1,15],8:i,10:14,28:r},e(a,[2,8],{16:[1,18],18:[1,19]}),{14:[1,20],30:21,31:n,32:s},e(o,[2,24]),e(o,[2,26]),e(c,[2,27]),e(c,[2,28]),{9:[1,22]},{5:23,6:[1,24],11:6,12:7,13:8,29:9,30:10,31:n,32:s},{1:[2,5]},e(l,[2,22],{10:25,8:i,28:r}),e(l,[2,23],{10:26,8:i,28:r}),{13:28,17:27,29:9,30:10,31:n,32:s},{13:30,19:29,29:9,30:10,31:n,32:s},{8:h,15:31,30:34,31:n,32:s,33:32,34:33},e(o,[2,25]),{8:i,10:36,28:r},{1:[2,4]},{1:[2,6]},e(l,[2,20]),e(l,[2,21]),e(a,[2,9]),e(a,[2,17],{30:21,31:n,32:s}),{16:[1,37]},{16:[2,16],30:21,31:n,32:s},e([6,16,18,28],[2,7],{30:34,34:38,8:h,31:n,32:s}),e(u,[2,29]),e(u,[2,31]),e(u,[2,32]),e(u,[2,33]),e([31,32],[2,3]),{13:28,17:39,29:9,30:10,31:n,32:s},e(u,[2,30]),e(a,[2,10])],defaultActions:{3:[2,2],5:[2,1],15:[2,5],23:[2,4],24:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=p.lex()||y,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,s=[0],i=[null],r=[],a=this.table,o="",c=0,l=0,h=0,u=2,y=1,f=r.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(d.yy[g]=this.yy[g]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,"undefined"==typeof p.yylloc&&(p.yylloc={});var m=p.yylloc;r.push(m);var _=p.options&&p.options.ranges;this.parseError="function"==typeof d.yy.parseError?d.yy.parseError:Object.getPrototypeOf(this).parseError;for(var k,b,v,x,S,w,E,A,I,L={};;){if(v=s[s.length-1],this.defaultActions[v]?x=this.defaultActions[v]:((null===k||"undefined"==typeof k)&&(k=e()),x=a[v]&&a[v][k]),"undefined"==typeof x||!x.length||!x[0]){var O="";I=[];for(w in a[v])this.terminals_[w]&&w>u&&I.push("'"+this.terminals_[w]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+I.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(c+1)+": Unexpected "+(k==y?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[k]||k,line:p.yylineno,loc:m,expected:I})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+k);switch(x[0]){case 1:s.push(k),i.push(p.yytext),r.push(p.yylloc),s.push(x[1]),k=null,b?(k=b,b=null):(l=p.yyleng,o=p.yytext,c=p.yylineno,m=p.yylloc,h>0&&h--);break;case 2:if(E=this.productions_[x[1]][1],L.$=i[i.length-E],L._$={first_line:r[r.length-(E||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(E||1)].first_column,last_column:r[r.length-1].last_column},_&&(L._$.range=[r[r.length-(E||1)].range[0],r[r.length-1].range[1]]),S=this.performAction.apply(L,[o,l,c,d.yy,x[1],i,r].concat(f)),"undefined"!=typeof S)return S;E&&(s=s.slice(0,-1*E*2),i=i.slice(0,-1*E),r=r.slice(0,-1*E)),s.push(this.productions_[x[1]][0]),i.push(L.$),r.push(L._$),A=a[s[s.length-2]][s[s.length-1]],s.push(A);break;case 3:return!0}}return!0}},f=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=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),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),s=t[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n; -if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,s;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;re[0].length)){if(e=n,s=r,this.options.backtrack_lexer){if(t=this.test_match(n,i[r]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[s]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,s){switch(n){case 0:return 28;case 1:return 7;case 2:return 9;case 3:return 32;case 4:return 14;case 5:return"MINUS";case 6:return"PLUS";case 7:return 18;case 8:return 31;case 9:return"SLASH";case 10:return"PS";case 11:return"PE";case 12:return 21;case 13:return 22;case 14:return 16;case 15:return 8;case 16:return 6}},rules:[/^(?:\n)/,/^(?:sequence\b)/,/^(?:TB\b)/,/^(?:[0-9]+)/,/^(?::)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[a-zåäöæøA-ZÅÄÖÆØ()]+)/,/^(?:\/)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\.)/,/^(?:\s)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],inclusive:!0}}};return t}();return y.lexer=f,t.prototype=y,y.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),s.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(s.argv.slice(1)))}).call(this,t("1YiZ5S"))},{"1YiZ5S":3,fs:1,path:2}],8:[function(t,e,n){var s={},i=[],r=[];n.addActor=function(t,e,n){console.log("Adding actor: "+t),s[t]={name:e,description:n},i.push(t)},n.addMessage=function(t,e,n,s){r.push({from:t,to:e,message:n,answer:s})},n.getMessages=function(){return r},n.getActors=function(){return s},n.getActorKeys=function(){return i},n.clear=function(){s={},r=[]}},{}],9:[function(t,e){var n=t("./parser/sequence").parser;n.yy=t("./sequenceDb"),e.exports.draw=function(t){n.yy.clear(),n.parse(t);var e,s=n.yy.getActors(),i=n.yy.getActorKeys();for(e=0;e=0;s--){var i=t[s];"."===i?t.splice(s,1):".."===i?(t.splice(s,1),n++):n&&(t.splice(s,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function s(t,e){if(t.filter)return t.filter(e);for(var n=[],s=0;s=-1&&!i;r--){var a=r>=0?arguments[r]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(n=a+"/"+n,i="/"===a.charAt(0))}return n=e(s(n.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(t){var i=n.isAbsolute(t),r="/"===a(t,-1);return t=e(s(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&r&&(t+="/"),(i?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(s(t,function(t){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function s(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=s(t.split("/")),r=s(e.split("/")),a=Math.min(i.length,r.length),o=a,c=0;a>c;c++)if(i[c]!==r[c]){o=c;break}for(var l=[],c=o;ce&&(e=t.length+e),t.substr(e,n)}}).call(this,t("1YiZ5S"))},{"1YiZ5S":3}],3:[function(t,e){function n(){}var s=e.exports={};s.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var s=n.shift();s()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),s.title="browser",s.browser=!0,s.env={},s.argv=[],s.on=n,s.addListener=n,s.once=n,s.off=n,s.removeListener=n,s.removeAllListeners=n,s.emit=n,s.binding=function(){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(){throw new Error("process.chdir is not supported")}},{}],4:[function(t,e,n){(function(e){var s=t("./graphDb"),r=t("./parser/flow"),a=t("./utils"),o=t("./sequenceRenderer"),c=function(t,e){var n=Object.keys(t),i=function(t,e){var n;for(n=0;n0)for(a=0;a',"graph"===a.detectType(c)?(h(c,n),s.bindFunctions()):o.draw(c,n)}};n.version=function(){return"0.2.4"};var y=function(t,e){return"undefined"!=typeof e?!1:t===e};document.addEventListener("DOMContentLoaded",function(){"undefined"!=typeof mermaid_config?y(!0,mermaid_config.startOnLoad)&&u():u()},!1),e.mermaid={init:function(){u()},version:function(){return n.version()}}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./graphDb":5,"./parser/flow":6,"./sequenceRenderer":9,"./utils":10}],5:[function(require,module,exports){var vertices={},edges=[],classes=[],direction,funs=[];exports.addVertex=function(t,e,n,s){"undefined"==typeof vertices[t]&&(vertices[t]={id:t,styles:[],classes:[]}),"undefined"!=typeof e&&(vertices[t].text=e),"undefined"!=typeof n&&(vertices[t].type=n),"undefined"!=typeof n&&(vertices[t].type=n),"undefined"!=typeof s&&null!==s&&s.forEach(function(e){vertices[t].styles.push(e)})},exports.addLink=function(t,e,n,s){var i={start:t,end:e,type:void 0,text:""},s=n.text;"undefined"!=typeof s&&(i.text=s),"undefined"!=typeof n&&(i.type=n.type),edges.push(i)},exports.updateLink=function(t,e){var n=t.substr(1);edges[n].style=e},exports.addClass=function(t,e){"undefined"==typeof classes[t]&&(classes[t]={id:t,styles:[]}),"undefined"!=typeof e&&null!==e&&e.forEach(function(e){classes[t].styles.push(e)})},exports.setDirection=function(t){direction=t},exports.setClass=function(t,e){t.indexOf(",")>0?t.split(",").forEach(function(t){"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)}):"undefined"!=typeof vertices[t]&&vertices[t].classes.push(e)},exports.setClickEvent=function(id,functionName){id.indexOf(",")>0?id.split(",").forEach(function(id2){"undefined"!=typeof vertices[id2]&&funs.push(function(){var elem=document.getElementById(id2);null!==elem&&(elem.onclick=function(){eval(functionName+"('"+id2+"')")})})}):"undefined"!=typeof vertices[id]&&funs.push(function(){var elem=document.getElementById(id);null!==elem&&(elem.onclick=function(){eval(functionName+"('"+id+"')")})})},exports.bindFunctions=function(){funs.forEach(function(t){t()})},exports.getDirection=function(){return direction},exports.getVertices=function(){return vertices},exports.getEdges=function(){return edges},exports.getClasses=function(){return classes},exports.clear=function(){vertices={},classes={},edges=[],funs=[]},exports.defaultStyle=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}},{}],6:[function(t,e,n){(function(s){var i=function(){function t(){this.yy={}}var e=function(t,e,n,s){for(n=n||{},s=t.length;s--;n[t[s]]=e);return n},n=[1,7],s=[1,21],i=[1,22],r=[1,23],a=[1,24],o=[1,25],c=[1,26],l=[1,27],h=[1,28],u=[1,29],y=[1,30],f=[1,31],p=[1,15],d=[1,16],g=[1,17],m=[1,14],_=[31,32,33,34,35,36,37,38,39,40,41,51,53,54,55],k=[11,44,45,46,47],b=[9,11,21,24,26,44,45,46,47],v=[9,11,21,24,26,31,32,33,34,35,36,37,38,39,40,41,44,45,46,47],x=[9,11,21,24,26,30,31,32,33,34,35,36,37,38,39,40,41,44,45,46,47],S=[6,9],w=[31,32,33,34,35,36,37,38,39,40,41],E=[31,32,33,34,35,36,37,38,39,40,41,48],A=[1,81],I=[1,82],L=[1,70],O=[1,71],$=[1,72],P=[1,73],T=[1,74],N=[1,75],C=[1,76],D=[1,77],R=[1,78],M=[1,79],U=[1,80],j=[9,23,25,27,30,31,32,33,34,35,36,37,38,39,40,41,48],q=[1,106],F=[1,103],H=[1,101],Q=[1,104],W=[1,102],z=[1,109],Y=[1,108],G=[1,107],B=[1,105],V=[1,114],Z=[11,34],K=[9,11,30,31,32,33,34,38,41,56,59],X={trace:function(){},yy:{},symbols_:{error:2,expressions:3,graphConfig:4,statements:5,EOF:6,spaceList:7,GRAPH:8,SPACE:9,DIR:10,SEMI:11,statement:12,verticeStatement:13,styleStatement:14,classDefStatement:15,classStatement:16,clickStatement:17,vertex:18,link:19,alphaNum:20,SQS:21,text:22,SQE:23,PS:24,PE:25,DIAMOND_START:26,DIAMOND_STOP:27,alphaNumStatement:28,alphaNumToken:29,MINUS:30,ALPHA:31,NUM:32,COLON:33,COMMA:34,PLUS:35,EQUALS:36,MULT:37,DOT:38,TAGSTART:39,TAGEND:40,BRKT:41,linkStatement:42,arrowText:43,ARROW_POINT:44,ARROW_CIRCLE:45,ARROW_CROSS:46,ARROW_OPEN:47,PIPE:48,textToken:49,textStatement:50,CLASSDEF:51,stylesOpt:52,CLASS:53,CLICK:54,STYLE:55,HEX:56,style:57,styleComponent:58,UNIT:59,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",8:"GRAPH",9:"SPACE",10:"DIR",11:"SEMI",21:"SQS",23:"SQE",24:"PS",25:"PE",26:"DIAMOND_START",27:"DIAMOND_STOP",30:"MINUS",31:"ALPHA",32:"NUM",33:"COLON",34:"COMMA",35:"PLUS",36:"EQUALS",37:"MULT",38:"DOT",39:"TAGSTART",40:"TAGEND",41:"BRKT",44:"ARROW_POINT",45:"ARROW_CIRCLE",46:"ARROW_CROSS",47:"ARROW_OPEN",48:"PIPE",51:"CLASSDEF",53:"CLASS",54:"CLICK",55:"STYLE",56:"HEX",59:"UNIT"},productions_:[0,[3,3],[3,4],[4,4],[5,3],[5,1],[7,2],[7,1],[12,2],[12,2],[12,2],[12,2],[12,2],[13,3],[13,1],[18,4],[18,4],[18,4],[18,1],[20,1],[20,2],[28,1],[28,3],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[19,2],[19,1],[42,1],[42,1],[42,1],[42,1],[43,3],[22,1],[22,2],[50,1],[50,2],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[15,5],[16,5],[17,5],[14,5],[14,5],[52,1],[52,3],[57,1],[57,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1]],performAction:function(t,e,n,s,i,r){var a=r.length-1;switch(i){case 2:this.$=r[a-3];break;case 3:s.setDirection(r[a-1]),this.$=r[a-1];break;case 13:s.addLink(r[a-2],r[a],r[a-1]),this.$="oy";break;case 14:this.$="yo";break;case 15:this.$=r[a-3],s.addVertex(r[a-3],r[a-1],"square");break;case 16:this.$=r[a-3],s.addVertex(r[a-3],r[a-1],"round");break;case 17:this.$=r[a-3],s.addVertex(r[a-3],r[a-1],"diamond");break;case 18:this.$=r[a],s.addVertex(r[a]);break;case 19:case 21:case 23:case 24:case 41:case 45:case 46:case 65:this.$=r[a];break;case 20:case 42:this.$=r[a-1]+""+r[a];break;case 22:this.$=r[a-2]+"-"+r[a];break;case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 35:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 56:case 57:this.$=r[a];break;case 33:case 55:this.$="
";break;case 34:r[a-1].text=r[a],this.$=r[a-1];break;case 36:this.$={type:"arrow"};break;case 37:this.$={type:"arrow_circle"};break;case 38:this.$={type:"arrow_cross"};break;case 39:this.$={type:"arrow_open"};break;case 40:this.$=r[a-1];break;case 58:this.$=r[a-4],s.addClass(r[a-2],r[a]);break;case 59:this.$=r[a-4],s.setClass(r[a-2],r[a]);break;case 60:this.$=r[a-4],s.setClickEvent(r[a-2],r[a]);break;case 61:this.$=r[a-4],s.addVertex(r[a-2],void 0,void 0,r[a]);break;case 62:this.$=r[a-4],s.updateLink(r[a-2],r[a]);break;case 63:this.$=[r[a]];break;case 64:r[a-2].push(r[a]),this.$=r[a-2];break;case 66:this.$=r[a-1]+r[a];break;case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:this.$=r[a]}},table:[{3:1,4:2,8:[1,3]},{1:[3]},{5:4,7:5,9:n,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f,51:p,53:d,54:g,55:m},{9:[1,32]},{6:[1,33]},{5:34,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f,51:p,53:d,54:g,55:m},{6:[2,5],7:35,9:n},e(_,[2,7],{7:36,9:n}),{11:[1,37]},{11:[1,38]},{11:[1,39]},{11:[1,40]},{11:[1,41]},{11:[2,14],19:42,42:43,44:[1,44],45:[1,45],46:[1,46],47:[1,47]},{9:[1,48]},{9:[1,49]},{9:[1,50]},{9:[1,51]},e(k,[2,18],{21:[1,52],24:[1,53],26:[1,54]}),e(b,[2,19],{28:19,29:20,20:55,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f}),e(v,[2,21],{30:[1,56]}),e(x,[2,23]),e(x,[2,24]),e(x,[2,25]),e(x,[2,26]),e(x,[2,27]),e(x,[2,28]),e(x,[2,29]),e(x,[2,30]),e(x,[2,31]),e(x,[2,32]),e(x,[2,33]),{10:[1,57]},{1:[2,1]},{6:[1,58]},{5:59,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f,51:p,53:d,54:g,55:m},e(_,[2,6]),e(S,[2,8]),e(S,[2,9]),e(S,[2,10]),e(S,[2,11]),e(S,[2,12]),{18:60,20:18,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f},e(w,[2,35],{43:61,48:[1,62]}),e(E,[2,36]),e(E,[2,37]),e(E,[2,38]),e(E,[2,39]),{20:63,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f,56:[1,64]},{20:65,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f},{20:66,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f},{20:67,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f},{9:A,22:68,30:I,31:L,32:O,33:$,34:P,35:T,36:N,37:C,38:D,39:R,40:M,41:U,49:69},{9:A,22:83,30:I,31:L,32:O,33:$,34:P,35:T,36:N,37:C,38:D,39:R,40:M,41:U,49:69},{9:A,22:84,30:I,31:L,32:O,33:$,34:P,35:T,36:N,37:C,38:D,39:R,40:M,41:U,49:69},e(b,[2,20]),{29:85,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f},{11:[1,86]},{1:[2,2]},{6:[2,4]},{11:[2,13]},e(w,[2,34]),{9:A,22:87,30:I,31:L,32:O,33:$,34:P,35:T,36:N,37:C,38:D,39:R,40:M,41:U,49:69},{9:[1,88]},{9:[1,89]},{9:[1,90]},{9:[1,91]},{9:[1,92]},{9:A,23:[1,93],30:I,31:L,32:O,33:$,34:P,35:T,36:N,37:C,38:D,39:R,40:M,41:U,49:94},e(j,[2,41]),e(j,[2,45]),e(j,[2,46]),e(j,[2,47]),e(j,[2,48]),e(j,[2,49]),e(j,[2,50]),e(j,[2,51]),e(j,[2,52]),e(j,[2,53]),e(j,[2,54]),e(j,[2,55]),e(j,[2,56]),e(j,[2,57]),{9:A,25:[1,95],30:I,31:L,32:O,33:$,34:P,35:T,36:N,37:C,38:D,39:R,40:M,41:U,49:94},{9:A,27:[1,96],30:I,31:L,32:O,33:$,34:P,35:T,36:N,37:C,38:D,39:R,40:M,41:U,49:94},e(v,[2,22]),e([9,31,32,33,34,35,36,37,38,39,40,41,51,53,54,55],[2,3]),{9:A,30:I,31:L,32:O,33:$,34:P,35:T,36:N,37:C,38:D,39:R,40:M,41:U,48:[1,97],49:94},{9:q,30:F,31:H,32:Q,33:W,38:z,41:Y,52:98,56:G,57:99,58:100,59:B},{9:q,30:F,31:H,32:Q,33:W,38:z,41:Y,52:110,56:G,57:99,58:100,59:B},{9:q,30:F,31:H,32:Q,33:W,38:z,41:Y,52:111,56:G,57:99,58:100,59:B},{20:112,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f},{20:113,28:19,29:20,31:s,32:i,33:r,34:a,35:o,36:c,37:l,38:h,39:u,40:y,41:f},e(k,[2,15]),e(j,[2,42]),e(k,[2,16]),e(k,[2,17]),e(w,[2,40]),{11:[2,61],34:V},e(Z,[2,63],{58:115,9:q,30:F,31:H,32:Q,33:W,38:z,41:Y,56:G,59:B}),e(K,[2,65]),e(K,[2,67]),e(K,[2,68]),e(K,[2,69]),e(K,[2,70]),e(K,[2,71]),e(K,[2,72]),e(K,[2,73]),e(K,[2,74]),e(K,[2,75]),{11:[2,62],34:V},{11:[2,58],34:V},{11:[2,59]},{11:[2,60]},{9:q,30:F,31:H,32:Q,33:W,38:z,41:Y,56:G,57:116,58:100,59:B},e(K,[2,66]),e(Z,[2,64],{58:115,9:q,30:F,31:H,32:Q,33:W,38:z,41:Y,56:G,59:B})],defaultActions:{33:[2,1],58:[2,2],59:[2,4],60:[2,13],112:[2,59],113:[2,60]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=p.lex()||y,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,s=[0],i=[null],r=[],a=this.table,o="",c=0,l=0,h=0,u=2,y=1,f=r.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(d.yy[g]=this.yy[g]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,"undefined"==typeof p.yylloc&&(p.yylloc={});var m=p.yylloc;r.push(m);var _=p.options&&p.options.ranges;this.parseError="function"==typeof d.yy.parseError?d.yy.parseError:Object.getPrototypeOf(this).parseError;for(var k,b,v,x,S,w,E,A,I,L={};;){if(v=s[s.length-1],this.defaultActions[v]?x=this.defaultActions[v]:((null===k||"undefined"==typeof k)&&(k=e()),x=a[v]&&a[v][k]),"undefined"==typeof x||!x.length||!x[0]){var O="";I=[];for(w in a[v])this.terminals_[w]&&w>u&&I.push("'"+this.terminals_[w]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+I.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(c+1)+": Unexpected "+(k==y?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[k]||k,line:p.yylineno,loc:m,expected:I})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+k);switch(x[0]){case 1:s.push(k),i.push(p.yytext),r.push(p.yylloc),s.push(x[1]),k=null,b?(k=b,b=null):(l=p.yyleng,o=p.yytext,c=p.yylineno,m=p.yylloc,h>0&&h--);break;case 2:if(E=this.productions_[x[1]][1],L.$=i[i.length-E],L._$={first_line:r[r.length-(E||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(E||1)].first_column,last_column:r[r.length-1].last_column},_&&(L._$.range=[r[r.length-(E||1)].range[0],r[r.length-1].range[1]]),S=this.performAction.apply(L,[o,l,c,d.yy,x[1],i,r].concat(f)),"undefined"!=typeof S)return S;E&&(s=s.slice(0,-1*E*2),i=i.slice(0,-1*E),r=r.slice(0,-1*E)),s.push(this.productions_[x[1]][0]),i.push(L.$),r.push(L._$),A=a[s[s.length-2]][s[s.length-1]],s.push(A);break;case 3:return!0}}return!0}},J=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=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),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),s=t[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,s;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;re[0].length)){if(e=n,s=r,this.options.backtrack_lexer){if(t=this.test_match(n,i[r]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[s]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,s){switch(n){case 0:return 55;case 1:return 51;case 2:return 53;case 3:return 54;case 4:return 8;case 5:return 10;case 6:return 10;case 7:return 10;case 8:return 10;case 9:return 10;case 10:return 10;case 11:return 32;case 12:return 41;case 13:return 33;case 14:return 11;case 15:return 34;case 16:return 36;case 17:return 37;case 18:return 38;case 19:return 39;case 20:return 40;case 21:return 46;case 22:return 44;case 23:return 45;case 24:return 47;case 25:return 30;case 26:return 35;case 27:return 36;case 28:return 31;case 29:return 48;case 30:return 24;case 31:return 25;case 32:return 21;case 33:return 23;case 34:return 26;case 35:return 27;case 36:return 9;case 37:return"NEWLINE";case 38:return 6}},rules:[/^(?:style\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9])/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:<)/,/^(?:>)/,/^(?:--[x])/,/^(?:-->)/,/^(?:--[o])/,/^(?:---)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[a-zåäöæøA-ZÅÄÖÆØ_])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:\s)/,/^(?:\n)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,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],inclusive:!0}}};return t}();return X.lexer=J,t.prototype=X,X.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),s.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(s.argv.slice(1)))}).call(this,t("1YiZ5S"))},{"1YiZ5S":3,fs:1,path:2}],7:[function(t,e,n){(function(s){var i=function(){function t(){this.yy={}}var e=function(t,e,n,s){for(n=n||{},s=t.length;s--;n[t[s]]=e);return n},n=[1,11],s=[1,12],i=[1,17],r=[1,16],a=[6,8,28],o=[6,8,14,16,28,31,32],c=[6,8,14,16,18,28,31,32],l=[6,31,32],h=[1,35],u=[6,8,16,18,28,31,32],y={trace:function(){},yy:{},symbols_:{error:2,expressions:3,sequenceConfig:4,statements:5,EOF:6,SEQ:7,SPACE:8,DIR:9,newlines:10,statement:11,preStatement:12,alphaNum:13,COLON:14,text:15,DOT:16,message:17,EQUALS:18,callee:19,action:20,SQS:21,SQE:22,actorDefinition:23,messageDefinition:24,caller:25,answer:26,spaceList:27,NEWLINE:28,alphaNumStatement:29,alphaNumToken:30,ALPHA:31,NUM:32,textStatement:33,textToken:34,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"SEQ",8:"SPACE",9:"DIR",14:"COLON",16:"DOT",18:"EQUALS",21:"SQS",22:"SQE",28:"NEWLINE",31:"ALPHA",32:"NUM"},productions_:[0,[3,2],[3,1],[4,4],[5,3],[5,2],[5,3],[12,3],[11,1],[11,3],[11,5],[20,2],[23,3],[24,7],[25,1],[26,1],[19,1],[17,1],[27,2],[27,1],[10,2],[10,2],[10,1],[10,1],[13,1],[29,2],[29,1],[30,1],[30,1],[15,1],[33,2],[33,1],[34,1],[34,1]],performAction:function(t,e,n,s,i,r){var a=r.length-1;switch(i){case 1:case 5:this.$=r[a-1];break;case 3:this.$=r[a-1];break;case 4:case 6:this.$=r[a-2];break;case 7:this.$={a:r[a-2],b:r[a]};break;case 8:s.addActor(r[a].a,"actor",r[a].b),this.$="actor";break;case 9:s.addMessage(r[a-2].a,r[a-2].b,r[a]),this.$="message";break;case 10:s.addMessage(r[a-4].a,r[a-2],r[a],r[a-4].b),this.$="actor";break;case 11:this.$="action";break;case 12:this.$="actor";break;case 13:console.log("Got new message from="+r[a-6]+" to="+r[a-2]+" message="+r[a]+" answer="+r[a-4]),this.$="actor";break;case 24:case 27:case 28:case 29:case 33:this.$=r[a];break;case 25:case 30:this.$=r[a-1]+""+r[a]}},table:[{3:1,4:2,6:[1,3],7:[1,4]},{1:[3]},{5:5,11:6,12:7,13:8,29:9,30:10,31:n,32:s},{1:[2,2]},{8:[1,13]},{1:[2,1]},{6:[1,15],8:i,10:14,28:r},e(a,[2,8],{16:[1,18],18:[1,19]}),{14:[1,20],30:21,31:n,32:s},e(o,[2,24]),e(o,[2,26]),e(c,[2,27]),e(c,[2,28]),{9:[1,22]},{5:23,6:[1,24],11:6,12:7,13:8,29:9,30:10,31:n,32:s},{1:[2,5]},e(l,[2,22],{10:25,8:i,28:r}),e(l,[2,23],{10:26,8:i,28:r}),{13:28,17:27,29:9,30:10,31:n,32:s},{13:30,19:29,29:9,30:10,31:n,32:s},{8:h,15:31,30:34,31:n,32:s,33:32,34:33},e(o,[2,25]),{8:i,10:36,28:r},{1:[2,4]},{1:[2,6]},e(l,[2,20]),e(l,[2,21]),e(a,[2,9]),e(a,[2,17],{30:21,31:n,32:s}),{16:[1,37]},{16:[2,16],30:21,31:n,32:s},e([6,16,18,28],[2,7],{30:34,34:38,8:h,31:n,32:s}),e(u,[2,29]),e(u,[2,31]),e(u,[2,32]),e(u,[2,33]),e([31,32],[2,3]),{13:28,17:39,29:9,30:10,31:n,32:s},e(u,[2,30]),e(a,[2,10])],defaultActions:{3:[2,2],5:[2,1],15:[2,5],23:[2,4],24:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=p.lex()||y,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,s=[0],i=[null],r=[],a=this.table,o="",c=0,l=0,h=0,u=2,y=1,f=r.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(d.yy[g]=this.yy[g]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,"undefined"==typeof p.yylloc&&(p.yylloc={});var m=p.yylloc;r.push(m);var _=p.options&&p.options.ranges;this.parseError="function"==typeof d.yy.parseError?d.yy.parseError:Object.getPrototypeOf(this).parseError;for(var k,b,v,x,S,w,E,A,I,L={};;){if(v=s[s.length-1],this.defaultActions[v]?x=this.defaultActions[v]:((null===k||"undefined"==typeof k)&&(k=e()),x=a[v]&&a[v][k]),"undefined"==typeof x||!x.length||!x[0]){var O="";I=[];for(w in a[v])this.terminals_[w]&&w>u&&I.push("'"+this.terminals_[w]+"'");O=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+I.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(c+1)+": Unexpected "+(k==y?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(O,{text:p.match,token:this.terminals_[k]||k,line:p.yylineno,loc:m,expected:I})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+k);switch(x[0]){case 1:s.push(k),i.push(p.yytext),r.push(p.yylloc),s.push(x[1]),k=null,b?(k=b,b=null):(l=p.yyleng,o=p.yytext,c=p.yylineno,m=p.yylloc,h>0&&h--);break;case 2:if(E=this.productions_[x[1]][1],L.$=i[i.length-E],L._$={first_line:r[r.length-(E||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(E||1)].first_column,last_column:r[r.length-1].last_column},_&&(L._$.range=[r[r.length-(E||1)].range[0],r[r.length-1].range[1]]),S=this.performAction.apply(L,[o,l,c,d.yy,x[1],i,r].concat(f)),"undefined"!=typeof S)return S;E&&(s=s.slice(0,-1*E*2),i=i.slice(0,-1*E),r=r.slice(0,-1*E)),s.push(this.productions_[x[1]][0]),i.push(L.$),r.push(L._$),A=a[s[s.length-2]][s[s.length-1]],s.push(A);break;case 3:return!0}}return!0}},f=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=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),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length); +return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),s=t[0].match(/(?:\r\n?|\n).*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,s;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;re[0].length)){if(e=n,s=r,this.options.backtrack_lexer){if(t=this.test_match(n,i[r]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[s]),t!==!1?t:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,s){switch(n){case 0:return 28;case 1:return 7;case 2:return 9;case 3:return 32;case 4:return 14;case 5:return"MINUS";case 6:return"PLUS";case 7:return 18;case 8:return 31;case 9:return"SLASH";case 10:return"PS";case 11:return"PE";case 12:return 21;case 13:return 22;case 14:return 16;case 15:return 8;case 16:return 6}},rules:[/^(?:\n)/,/^(?:sequence\b)/,/^(?:TB\b)/,/^(?:[0-9]+)/,/^(?::)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[a-zåäöæøA-ZÅÄÖÆØ()]+)/,/^(?:\/)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\.)/,/^(?:\s)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],inclusive:!0}}};return t}();return y.lexer=f,t.prototype=y,y.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=i,n.Parser=i.Parser,n.parse=function(){return i.parse.apply(i,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),s.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&n.main(s.argv.slice(1)))}).call(this,t("1YiZ5S"))},{"1YiZ5S":3,fs:1,path:2}],8:[function(t,e,n){var s={},i=[],r=[];n.addActor=function(t,e,n){console.log("Adding actor: "+t),s[t]={name:e,description:n},i.push(t)},n.addMessage=function(t,e,n,s){r.push({from:t,to:e,message:n,answer:s})},n.getMessages=function(){return r},n.getActors=function(){return s},n.getActorKeys=function(){return i},n.clear=function(){s={},r=[]}},{}],9:[function(t,e){var n=t("./parser/sequence").parser;n.yy=t("./sequenceDb"),e.exports.draw=function(t){n.yy.clear(),n.parse(t);var e,s=n.yy.getActors(),i=n.yy.getActorKeys();for(e=0;e> return 'EOF'; /lex @@ -70,7 +67,7 @@ graphConfig ; statements - : statements spaceList statement + : statement spaceList statements | statement ; @@ -88,9 +85,9 @@ statement ; verticeStatement: - | vertex link vertex + vertex link vertex { yy.addLink($1,$3,$2);$$ = 'oy'} - | vertex + | vertex {$$ = 'yo';} ; @@ -139,6 +136,8 @@ alphaNumToken {$$ = $1;} | TAGEND {$$ = $1;} + | BRKT + {$$ = '
';} ; link: linkStatement arrowText @@ -163,12 +162,51 @@ arrowText: ; // Characters and spaces -text: alphaNum SPACE text - {$$ = $1 + ' ' +$3;} - | alphaNum spaceList MINUS spaceList text - {$$ = $1 + ' - ' +$5;} - | alphaNum - {$$ = $1;} +//text: alphaNum SPACE text +// {$$ = $1 + ' ' +$3;} +// | alphaNum spaceList MINUS spaceList text +// {$$ = $1 + ' - ' +$5;} +// | alphaNum spaceList TAGSTART DIR TAGEND spaceList text +// {$$ = $1 + ' - ' +$5;} +// | alphaNum +// {$$ = $1;} +// ; +text: textToken + {$$=$1;} + | text textToken + {$$=$1+''+$2;} + ; + +textStatement: textToken + | textToken textStatement + ; + +textToken: ALPHA + {$$=$1;} + | NUM + {$$=$1;} + | COLON + {$$ = $1;} + | COMMA + {$$ = $1;} + | PLUS + {$$ = $1;} + | EQUALS + {$$ = $1;} + | MULT + {$$ = $1;} + | DOT + {$$ = $1;} + | TAGSTART + {$$ = $1;} + | TAGEND + {$$ = $1;} + | BRKT + {$$ = '
';} + | SPACE + {$$ = $1;} + | MINUS + {$$ = $1;} ; classDefStatement:CLASSDEF SPACE alphaNum SPACE stylesOpt @@ -215,5 +253,9 @@ styleComponent: ALPHA {$$=$1} | HEX {$$=$1} + | BRKT + {$$=$1} + | DOT + {$$=$1} ; %% \ No newline at end of file diff --git a/src/parser/flow.js b/src/parser/flow.js index b49711434..87a37ba62 100644 --- a/src/parser/flow.js +++ b/src/parser/flow.js @@ -72,12 +72,12 @@ } */ 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,7],$V1=[2,13],$V2=[1,21],$V3=[1,22],$V4=[1,23],$V5=[1,24],$V6=[1,25],$V7=[1,26],$V8=[1,27],$V9=[1,28],$Va=[1,29],$Vb=[1,30],$Vc=[1,15],$Vd=[1,16],$Ve=[1,17],$Vf=[1,14],$Vg=[6,9],$Vh=[11,30,31,32,33,34,35,36,37,38,39,40,48,50,51,52],$Vi=[2,7],$Vj=[11,43,44,45,46],$Vk=[9,11,21,23,24,25,26,27,43,44,45,46,47],$Vl=[9,11,21,23,24,25,26,27,31,32,33,34,35,36,37,38,39,40,43,44,45,46,47],$Vm=[9,11,21,23,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,43,44,45,46,47],$Vn=[31,32,33,34,35,36,37,38,39,40],$Vo=[31,32,33,34,35,36,37,38,39,40,47],$Vp=[23,25,27,47],$Vq=[1,93],$Vr=[1,90],$Vs=[1,88],$Vt=[1,91],$Vu=[1,89],$Vv=[1,94],$Vw=[1,92],$Vx=[1,101],$Vy=[11,34],$Vz=[9,11,30,31,32,33,34,53,56]; +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,7],$V1=[1,21],$V2=[1,22],$V3=[1,23],$V4=[1,24],$V5=[1,25],$V6=[1,26],$V7=[1,27],$V8=[1,28],$V9=[1,29],$Va=[1,30],$Vb=[1,31],$Vc=[1,15],$Vd=[1,16],$Ve=[1,17],$Vf=[1,14],$Vg=[31,32,33,34,35,36,37,38,39,40,41,51,53,54,55],$Vh=[11,44,45,46,47],$Vi=[9,11,21,24,26,44,45,46,47],$Vj=[9,11,21,24,26,31,32,33,34,35,36,37,38,39,40,41,44,45,46,47],$Vk=[9,11,21,24,26,30,31,32,33,34,35,36,37,38,39,40,41,44,45,46,47],$Vl=[6,9],$Vm=[31,32,33,34,35,36,37,38,39,40,41],$Vn=[31,32,33,34,35,36,37,38,39,40,41,48],$Vo=[1,81],$Vp=[1,82],$Vq=[1,70],$Vr=[1,71],$Vs=[1,72],$Vt=[1,73],$Vu=[1,74],$Vv=[1,75],$Vw=[1,76],$Vx=[1,77],$Vy=[1,78],$Vz=[1,79],$VA=[1,80],$VB=[9,23,25,27,30,31,32,33,34,35,36,37,38,39,40,41,48],$VC=[1,106],$VD=[1,103],$VE=[1,101],$VF=[1,104],$VG=[1,102],$VH=[1,109],$VI=[1,108],$VJ=[1,107],$VK=[1,105],$VL=[1,114],$VM=[11,34],$VN=[9,11,30,31,32,33,34,38,41,56,59]; var parser = {trace: function trace() { }, yy: {}, -symbols_: {"error":2,"expressions":3,"graphConfig":4,"statements":5,"EOF":6,"spaceList":7,"GRAPH":8,"SPACE":9,"DIR":10,"SEMI":11,"statement":12,"verticeStatement":13,"styleStatement":14,"classDefStatement":15,"classStatement":16,"clickStatement":17,"vertex":18,"link":19,"alphaNum":20,"SQS":21,"text":22,"SQE":23,"PS":24,"PE":25,"DIAMOND_START":26,"DIAMOND_STOP":27,"alphaNumStatement":28,"alphaNumToken":29,"MINUS":30,"ALPHA":31,"NUM":32,"COLON":33,"COMMA":34,"PLUS":35,"EQUALS":36,"MULT":37,"DOT":38,"TAGSTART":39,"TAGEND":40,"linkStatement":41,"arrowText":42,"ARROW_POINT":43,"ARROW_CIRCLE":44,"ARROW_CROSS":45,"ARROW_OPEN":46,"PIPE":47,"CLASSDEF":48,"stylesOpt":49,"CLASS":50,"CLICK":51,"STYLE":52,"HEX":53,"style":54,"styleComponent":55,"UNIT":56,"$accept":0,"$end":1}, -terminals_: {2:"error",6:"EOF",8:"GRAPH",9:"SPACE",10:"DIR",11:"SEMI",21:"SQS",23:"SQE",24:"PS",25:"PE",26:"DIAMOND_START",27:"DIAMOND_STOP",30:"MINUS",31:"ALPHA",32:"NUM",33:"COLON",34:"COMMA",35:"PLUS",36:"EQUALS",37:"MULT",38:"DOT",39:"TAGSTART",40:"TAGEND",43:"ARROW_POINT",44:"ARROW_CIRCLE",45:"ARROW_CROSS",46:"ARROW_OPEN",47:"PIPE",48:"CLASSDEF",50:"CLASS",51:"CLICK",52:"STYLE",53:"HEX",56:"UNIT"}, -productions_: [0,[3,3],[3,4],[4,4],[5,3],[5,1],[7,2],[7,1],[12,2],[12,2],[12,2],[12,2],[12,2],[13,0],[13,3],[13,1],[18,4],[18,4],[18,4],[18,1],[20,1],[20,2],[28,1],[28,3],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[19,2],[19,1],[41,1],[41,1],[41,1],[41,1],[42,3],[22,3],[22,5],[22,1],[15,5],[16,5],[17,5],[14,5],[14,5],[49,1],[49,3],[54,1],[54,2],[55,1],[55,1],[55,1],[55,1],[55,1],[55,1],[55,1]], +symbols_: {"error":2,"expressions":3,"graphConfig":4,"statements":5,"EOF":6,"spaceList":7,"GRAPH":8,"SPACE":9,"DIR":10,"SEMI":11,"statement":12,"verticeStatement":13,"styleStatement":14,"classDefStatement":15,"classStatement":16,"clickStatement":17,"vertex":18,"link":19,"alphaNum":20,"SQS":21,"text":22,"SQE":23,"PS":24,"PE":25,"DIAMOND_START":26,"DIAMOND_STOP":27,"alphaNumStatement":28,"alphaNumToken":29,"MINUS":30,"ALPHA":31,"NUM":32,"COLON":33,"COMMA":34,"PLUS":35,"EQUALS":36,"MULT":37,"DOT":38,"TAGSTART":39,"TAGEND":40,"BRKT":41,"linkStatement":42,"arrowText":43,"ARROW_POINT":44,"ARROW_CIRCLE":45,"ARROW_CROSS":46,"ARROW_OPEN":47,"PIPE":48,"textToken":49,"textStatement":50,"CLASSDEF":51,"stylesOpt":52,"CLASS":53,"CLICK":54,"STYLE":55,"HEX":56,"style":57,"styleComponent":58,"UNIT":59,"$accept":0,"$end":1}, +terminals_: {2:"error",6:"EOF",8:"GRAPH",9:"SPACE",10:"DIR",11:"SEMI",21:"SQS",23:"SQE",24:"PS",25:"PE",26:"DIAMOND_START",27:"DIAMOND_STOP",30:"MINUS",31:"ALPHA",32:"NUM",33:"COLON",34:"COMMA",35:"PLUS",36:"EQUALS",37:"MULT",38:"DOT",39:"TAGSTART",40:"TAGEND",41:"BRKT",44:"ARROW_POINT",45:"ARROW_CIRCLE",46:"ARROW_CROSS",47:"ARROW_OPEN",48:"PIPE",51:"CLASSDEF",53:"CLASS",54:"CLICK",55:"STYLE",56:"HEX",59:"UNIT"}, +productions_: [0,[3,3],[3,4],[4,4],[5,3],[5,1],[7,2],[7,1],[12,2],[12,2],[12,2],[12,2],[12,2],[13,3],[13,1],[18,4],[18,4],[18,4],[18,1],[20,1],[20,2],[28,1],[28,3],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[29,1],[19,2],[19,1],[42,1],[42,1],[42,1],[42,1],[43,3],[22,1],[22,2],[50,1],[50,2],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[15,5],[16,5],[17,5],[14,5],[14,5],[52,1],[52,3],[57,1],[57,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ @@ -89,36 +89,39 @@ break; case 3: yy.setDirection($$[$0-1]);this.$ = $$[$0-1]; break; -case 14: +case 13: yy.addLink($$[$0-2],$$[$0],$$[$0-1]);this.$ = 'oy' break; -case 15: +case 14: this.$ = 'yo'; break; -case 16: +case 15: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'square'); break; -case 17: +case 16: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'round'); break; -case 18: +case 17: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'diamond'); break; -case 19: +case 18: this.$ = $$[$0];yy.addVertex($$[$0]); break; -case 20: case 22: case 24: case 25: case 51: +case 19: case 21: case 23: case 24: case 41: case 45: case 46: case 65: this.$=$$[$0]; break; -case 21: +case 20: case 42: this.$=$$[$0-1]+''+$$[$0]; break; -case 23: +case 22: this.$=$$[$0-2]+'-'+$$[$0]; break; -case 26: case 27: case 28: case 29: case 30: case 31: case 32: case 33: case 35: case 43: +case 25: case 26: case 27: case 28: case 29: case 30: case 31: case 32: case 35: case 47: case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 56: case 57: this.$ = $$[$0]; break; +case 33: case 55: +this.$ = '
'; +break; case 34: $$[$0-1].text = $$[$0];this.$ = $$[$0-1]; break; @@ -137,43 +140,37 @@ break; case 40: this.$ = $$[$0-1]; break; -case 41: -this.$ = $$[$0-2] + ' ' +$$[$0]; -break; -case 42: -this.$ = $$[$0-4] + ' - ' +$$[$0]; -break; -case 44: +case 58: this.$ = $$[$0-4];yy.addClass($$[$0-2],$$[$0]); break; -case 45: +case 59: this.$ = $$[$0-4];yy.setClass($$[$0-2], $$[$0]); break; -case 46: +case 60: this.$ = $$[$0-4];yy.setClickEvent($$[$0-2], $$[$0]); break; -case 47: +case 61: this.$ = $$[$0-4];yy.addVertex($$[$0-2],undefined,undefined,$$[$0]); break; -case 48: +case 62: this.$ = $$[$0-4];yy.updateLink($$[$0-2],$$[$0]); break; -case 49: +case 63: this.$ = [$$[$0]] break; -case 50: +case 64: $$[$0-2].push($$[$0]);this.$ = $$[$0-2]; break; -case 52: +case 66: this.$ = $$[$0-1] + $$[$0]; break; -case 53: case 54: case 55: case 56: case 57: case 58: case 59: +case 67: case 68: case 69: case 70: case 71: case 72: case 73: case 74: case 75: this.$=$$[$0] break; } }, -table: [{3:1,4:2,8:[1,3]},{1:[3]},{5:4,7:5,9:$V0,11:$V1,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb,48:$Vc,50:$Vd,51:$Ve,52:$Vf},{9:[1,31]},{6:[1,32],7:33,9:$V0},{5:34,11:$V1,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb,48:$Vc,50:$Vd,51:$Ve,52:$Vf},o($Vg,[2,5]),o($Vh,$Vi,{7:35,9:$V0}),{11:[1,36]},{11:[1,37]},{11:[1,38]},{11:[1,39]},{11:[1,40]},{11:[2,15],19:41,41:42,43:[1,43],44:[1,44],45:[1,45],46:[1,46]},{9:[1,47]},{9:[1,48]},{9:[1,49]},{9:[1,50]},o($Vj,[2,19],{21:[1,51],24:[1,52],26:[1,53]}),o($Vk,[2,20],{28:19,29:20,20:54,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb}),o($Vl,[2,22],{30:[1,55]}),o($Vm,[2,24]),o($Vm,[2,25]),o($Vm,[2,26]),o($Vm,[2,27]),o($Vm,[2,28]),o($Vm,[2,29]),o($Vm,[2,30]),o($Vm,[2,31]),o($Vm,[2,32]),o($Vm,[2,33]),{10:[1,56]},{1:[2,1]},{11:$V1,12:57,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb,48:$Vc,50:$Vd,51:$Ve,52:$Vf},{6:[1,58],7:33,9:$V0},o($Vh,[2,6]),o($Vg,[2,8]),o($Vg,[2,9]),o($Vg,[2,10]),o($Vg,[2,11]),o($Vg,[2,12]),{18:59,20:18,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},o($Vn,[2,35],{42:60,47:[1,61]}),o($Vo,[2,36]),o($Vo,[2,37]),o($Vo,[2,38]),o($Vo,[2,39]),{20:62,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb,53:[1,63]},{20:64,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{20:65,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{20:66,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{20:68,22:67,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{20:68,22:69,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{20:68,22:70,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},o($Vk,[2,21]),{29:71,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{11:[1,72]},o($Vg,[2,4]),{1:[2,2]},{11:[2,14]},o($Vn,[2,34]),{20:68,22:73,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{9:[1,74]},{9:[1,75]},{9:[1,76]},{9:[1,77]},{9:[1,78]},{23:[1,79]},o($Vp,[2,43],{7:81,9:[1,80]}),{25:[1,82]},{27:[1,83]},o($Vl,[2,23]),o([9,11,31,32,33,34,35,36,37,38,39,40,48,50,51,52],[2,3]),{47:[1,84]},{9:$Vq,30:$Vr,31:$Vs,32:$Vt,33:$Vu,49:85,53:$Vv,54:86,55:87,56:$Vw},{9:$Vq,30:$Vr,31:$Vs,32:$Vt,33:$Vu,49:95,53:$Vv,54:86,55:87,56:$Vw},{9:$Vq,30:$Vr,31:$Vs,32:$Vt,33:$Vu,49:96,53:$Vv,54:86,55:87,56:$Vw},{20:97,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{20:98,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},o($Vj,[2,16]),{7:35,9:$V0,20:68,22:99,28:19,29:20,30:$Vi,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},{30:[1,100]},o($Vj,[2,17]),o($Vj,[2,18]),o($Vn,[2,40]),{11:[2,47],34:$Vx},o($Vy,[2,49],{55:102,9:$Vq,30:$Vr,31:$Vs,32:$Vt,33:$Vu,53:$Vv,56:$Vw}),o($Vz,[2,51]),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]),{11:[2,48],34:$Vx},{11:[2,44],34:$Vx},{11:[2,45]},{11:[2,46]},o($Vp,[2,41]),{7:103,9:$V0},{9:$Vq,30:$Vr,31:$Vs,32:$Vt,33:$Vu,53:$Vv,54:104,55:87,56:$Vw},o($Vz,[2,52]),{20:68,22:105,28:19,29:20,31:$V2,32:$V3,33:$V4,34:$V5,35:$V6,36:$V7,37:$V8,38:$V9,39:$Va,40:$Vb},o($Vy,[2,50],{55:102,9:$Vq,30:$Vr,31:$Vs,32:$Vt,33:$Vu,53:$Vv,56:$Vw}),o($Vp,[2,42])], -defaultActions: {32:[2,1],58:[2,2],59:[2,14],97:[2,45],98:[2,46]}, +table: [{3:1,4:2,8:[1,3]},{1:[3]},{5:4,7:5,9:$V0,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb,51:$Vc,53:$Vd,54:$Ve,55:$Vf},{9:[1,32]},{6:[1,33]},{5:34,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb,51:$Vc,53:$Vd,54:$Ve,55:$Vf},{6:[2,5],7:35,9:$V0},o($Vg,[2,7],{7:36,9:$V0}),{11:[1,37]},{11:[1,38]},{11:[1,39]},{11:[1,40]},{11:[1,41]},{11:[2,14],19:42,42:43,44:[1,44],45:[1,45],46:[1,46],47:[1,47]},{9:[1,48]},{9:[1,49]},{9:[1,50]},{9:[1,51]},o($Vh,[2,18],{21:[1,52],24:[1,53],26:[1,54]}),o($Vi,[2,19],{28:19,29:20,20:55,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb}),o($Vj,[2,21],{30:[1,56]}),o($Vk,[2,23]),o($Vk,[2,24]),o($Vk,[2,25]),o($Vk,[2,26]),o($Vk,[2,27]),o($Vk,[2,28]),o($Vk,[2,29]),o($Vk,[2,30]),o($Vk,[2,31]),o($Vk,[2,32]),o($Vk,[2,33]),{10:[1,57]},{1:[2,1]},{6:[1,58]},{5:59,12:6,13:8,14:9,15:10,16:11,17:12,18:13,20:18,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb,51:$Vc,53:$Vd,54:$Ve,55:$Vf},o($Vg,[2,6]),o($Vl,[2,8]),o($Vl,[2,9]),o($Vl,[2,10]),o($Vl,[2,11]),o($Vl,[2,12]),{18:60,20:18,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb},o($Vm,[2,35],{43:61,48:[1,62]}),o($Vn,[2,36]),o($Vn,[2,37]),o($Vn,[2,38]),o($Vn,[2,39]),{20:63,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb,56:[1,64]},{20:65,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb},{20:66,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb},{20:67,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb},{9:$Vo,22:68,30:$Vp,31:$Vq,32:$Vr,33:$Vs,34:$Vt,35:$Vu,36:$Vv,37:$Vw,38:$Vx,39:$Vy,40:$Vz,41:$VA,49:69},{9:$Vo,22:83,30:$Vp,31:$Vq,32:$Vr,33:$Vs,34:$Vt,35:$Vu,36:$Vv,37:$Vw,38:$Vx,39:$Vy,40:$Vz,41:$VA,49:69},{9:$Vo,22:84,30:$Vp,31:$Vq,32:$Vr,33:$Vs,34:$Vt,35:$Vu,36:$Vv,37:$Vw,38:$Vx,39:$Vy,40:$Vz,41:$VA,49:69},o($Vi,[2,20]),{29:85,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb},{11:[1,86]},{1:[2,2]},{6:[2,4]},{11:[2,13]},o($Vm,[2,34]),{9:$Vo,22:87,30:$Vp,31:$Vq,32:$Vr,33:$Vs,34:$Vt,35:$Vu,36:$Vv,37:$Vw,38:$Vx,39:$Vy,40:$Vz,41:$VA,49:69},{9:[1,88]},{9:[1,89]},{9:[1,90]},{9:[1,91]},{9:[1,92]},{9:$Vo,23:[1,93],30:$Vp,31:$Vq,32:$Vr,33:$Vs,34:$Vt,35:$Vu,36:$Vv,37:$Vw,38:$Vx,39:$Vy,40:$Vz,41:$VA,49:94},o($VB,[2,41]),o($VB,[2,45]),o($VB,[2,46]),o($VB,[2,47]),o($VB,[2,48]),o($VB,[2,49]),o($VB,[2,50]),o($VB,[2,51]),o($VB,[2,52]),o($VB,[2,53]),o($VB,[2,54]),o($VB,[2,55]),o($VB,[2,56]),o($VB,[2,57]),{9:$Vo,25:[1,95],30:$Vp,31:$Vq,32:$Vr,33:$Vs,34:$Vt,35:$Vu,36:$Vv,37:$Vw,38:$Vx,39:$Vy,40:$Vz,41:$VA,49:94},{9:$Vo,27:[1,96],30:$Vp,31:$Vq,32:$Vr,33:$Vs,34:$Vt,35:$Vu,36:$Vv,37:$Vw,38:$Vx,39:$Vy,40:$Vz,41:$VA,49:94},o($Vj,[2,22]),o([9,31,32,33,34,35,36,37,38,39,40,41,51,53,54,55],[2,3]),{9:$Vo,30:$Vp,31:$Vq,32:$Vr,33:$Vs,34:$Vt,35:$Vu,36:$Vv,37:$Vw,38:$Vx,39:$Vy,40:$Vz,41:$VA,48:[1,97],49:94},{9:$VC,30:$VD,31:$VE,32:$VF,33:$VG,38:$VH,41:$VI,52:98,56:$VJ,57:99,58:100,59:$VK},{9:$VC,30:$VD,31:$VE,32:$VF,33:$VG,38:$VH,41:$VI,52:110,56:$VJ,57:99,58:100,59:$VK},{9:$VC,30:$VD,31:$VE,32:$VF,33:$VG,38:$VH,41:$VI,52:111,56:$VJ,57:99,58:100,59:$VK},{20:112,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb},{20:113,28:19,29:20,31:$V1,32:$V2,33:$V3,34:$V4,35:$V5,36:$V6,37:$V7,38:$V8,39:$V9,40:$Va,41:$Vb},o($Vh,[2,15]),o($VB,[2,42]),o($Vh,[2,16]),o($Vh,[2,17]),o($Vm,[2,40]),{11:[2,61],34:$VL},o($VM,[2,63],{58:115,9:$VC,30:$VD,31:$VE,32:$VF,33:$VG,38:$VH,41:$VI,56:$VJ,59:$VK}),o($VN,[2,65]),o($VN,[2,67]),o($VN,[2,68]),o($VN,[2,69]),o($VN,[2,70]),o($VN,[2,71]),o($VN,[2,72]),o($VN,[2,73]),o($VN,[2,74]),o($VN,[2,75]),{11:[2,62],34:$VL},{11:[2,58],34:$VL},{11:[2,59]},{11:[2,60]},{9:$VC,30:$VD,31:$VE,32:$VF,33:$VG,38:$VH,41:$VI,56:$VJ,57:116,58:100,59:$VK},o($VN,[2,66]),o($VM,[2,64],{58:115,9:$VC,30:$VD,31:$VE,32:$VF,33:$VG,38:$VH,41:$VI,56:$VJ,59:$VK})], +defaultActions: {33:[2,1],58:[2,2],59:[2,4],60:[2,13],112:[2,59],113:[2,60]}, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); @@ -646,13 +643,13 @@ options: {}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { var YYSTATE=YY_START; switch($avoiding_name_collisions) { -case 0:return 52; +case 0:return 55; break; -case 1:return 48; +case 1:return 51; break; -case 2:return 50; +case 2:return 53; break; -case 3:return 51; +case 3:return 54; break; case 4:return 8; break; @@ -668,74 +665,66 @@ case 9:return 10; break; case 10:return 10; break; -case 11:return 53; +case 11:return 32; break; -case 12:return 32; +case 12:return 41; break; -case 13:return 'BRKT'; +case 13:return 33; break; -case 14:return 56; +case 14:return 11; break; -case 15:return 56; +case 15:return 34; break; -case 16:return 56; +case 16:return 36; break; -case 17:return 33; +case 17:return 37; break; -case 18:return 11; +case 18:return 38; break; -case 19:return 34; +case 19:return 39; break; -case 20:return 36; +case 20:return 40; break; -case 21:return 37; +case 21:return 46; break; -case 22:return 38; +case 22:return 44; break; -case 23:return 39; +case 23:return 45; break; -case 24:return 40; +case 24:return 47; break; -case 25:return 45; +case 25:return 30; break; -case 26:return 43; +case 26:return 35; break; -case 27:return 44; +case 27:return 36; break; -case 28:return 46; +case 28:return 31; break; -case 29:return 30; +case 29:return 48; break; -case 30:return 35; +case 30:return 24; break; -case 31:return 36; +case 31:return 25; break; -case 32:return 31; +case 32:return 21; break; -case 33:return 47; +case 33:return 23; break; -case 34:return 24; +case 34:return 26 break; -case 35:return 25; +case 35:return 27 break; -case 36:return 21; +case 36:return 9; break; -case 37:return 23; +case 37:return 'NEWLINE'; break; -case 38:return 26 -break; -case 39:return 27 -break; -case 40:return 9; -break; -case 41:return 'NEWLINE'; -break; -case 42:return 6; +case 38:return 6; break; } }, -rules: [/^(?:style\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:#[a-f0-9]+)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?:px\b)/,/^(?:pt\b)/,/^(?:dot\b)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:<)/,/^(?:>)/,/^(?:--[x])/,/^(?:-->)/,/^(?:--[o])/,/^(?:---)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[a-zåäöæøA-ZÅÄÖÆØ_]+)/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:\s)/,/^(?:\n)/,/^(?:$)/], -conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,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],"inclusive":true}} +rules: [/^(?:style\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:LR\b)/,/^(?:RL\b)/,/^(?:TB\b)/,/^(?:BT\b)/,/^(?:TD\b)/,/^(?:BR\b)/,/^(?:[0-9])/,/^(?:#)/,/^(?::)/,/^(?:;)/,/^(?:,)/,/^(?:=)/,/^(?:\*)/,/^(?:\.)/,/^(?:<)/,/^(?:>)/,/^(?:--[x])/,/^(?:-->)/,/^(?:--[o])/,/^(?:---)/,/^(?:-)/,/^(?:\+)/,/^(?:=)/,/^(?:[a-zåäöæøA-ZÅÄÖÆØ_])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:\s)/,/^(?:\n)/,/^(?:$)/], +conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,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],"inclusive":true}} }); return lexer; })(); diff --git a/src/parser/flow.spec.js b/src/parser/flow.spec.js index aafe093f9..505ea4db6 100644 --- a/src/parser/flow.spec.js +++ b/src/parser/flow.spec.js @@ -164,14 +164,14 @@ describe('when parsing ',function(){ expect(vert['C'].type).toBe('diamond'); expect(vert['C'].text).toBe('Chimpansen hoppar åäö-ÅÄÖ'); }); - it('should handle text in vertices with åäö, minus and space',function(){ - var res = flow.parser.parse('graph TD;A-->C{Chimpansen hoppar åäö - ÅÄÖ};'); + it('should handle text in vertices with åäö, minus and space and br',function(){ + var res = flow.parser.parse('graph TD;A-->C{Chimpansen hoppar åäö
- ÅÄÖ};'); var vert = flow.parser.yy.getVertices(); var edges = flow.parser.yy.getEdges(); expect(vert['C'].type).toBe('diamond'); - expect(vert['C'].text).toBe('Chimpansen hoppar åäö - ÅÄÖ'); + expect(vert['C'].text).toBe('Chimpansen hoppar åäö
- ÅÄÖ'); }); it('should handle a single node',function(){ @@ -184,6 +184,49 @@ describe('when parsing ',function(){ expect(edges.length).toBe(0); expect(vert['A'].styles.length).toBe(0); }); + + it('should handle a single square node',function(){ + // Silly but syntactically correct + var res = flow.parser.parse('graph TD;a[A];'); + + var vert = flow.parser.yy.getVertices(); + var edges = flow.parser.yy.getEdges(); + + expect(edges.length).toBe(0); + expect(vert['a'].styles.length).toBe(0); + expect(vert['a'].type).toBe('square'); + }); + it('should handle a single round square node',function(){ + // Silly but syntactically correct + var res = flow.parser.parse('graph TD;a(A);'); + + var vert = flow.parser.yy.getVertices(); + var edges = flow.parser.yy.getEdges(); + + expect(edges.length).toBe(0); + expect(vert['a'].styles.length).toBe(0); + expect(vert['a'].type).toBe('round'); + }); + it('should handle a single diamond node',function(){ + // Silly but syntactically correct + var res = flow.parser.parse('graph TD;a{A};'); + + var vert = flow.parser.yy.getVertices(); + var edges = flow.parser.yy.getEdges(); + + expect(edges.length).toBe(0); + expect(vert['a'].type).toBe('diamond'); + }); + it('should handle a single odd node',function(){ + // Silly but syntactically correct + var res = flow.parser.parse('graph TD;a>A];'); + + var vert = flow.parser.yy.getVertices(); + var edges = flow.parser.yy.getEdges(); + + expect(edges.length).toBe(0); + expect(vert['a'].type).toBe('diamond'); + }); it('should handle a single node with alphanumerics starting on a char',function(){ // Silly but syntactically correct var res = flow.parser.parse('graph TD;id1;'); @@ -348,6 +391,27 @@ describe('when parsing ',function(){ expect(classes['exClass'].styles[0]).toBe('background:#bbb'); expect(classes['exClass'].styles[1]).toBe('border:1px solid red'); }); + + it('should be possible to declare a class with a dot in the style',function(){ + var res = flow.parser.parse('graph TD;classDef exClass background:#bbb,border:1.5px solid red;'); + //var res = flow.parser.parse('graph TD;style T background: #bbb;'); + + var classes = flow.parser.yy.getClasses(); + + expect(classes['exClass'].styles.length).toBe(2); + expect(classes['exClass'].styles[0]).toBe('background:#bbb'); + expect(classes['exClass'].styles[1]).toBe('border:1.5px solid red'); + }); + it('should be possible to declare a class with a space in the style',function(){ + var res = flow.parser.parse('graph TD;classDef exClass background: #bbb,border:1.5px solid red;'); + //var res = flow.parser.parse('graph TD;style T background : #bbb;'); + + var classes = flow.parser.yy.getClasses(); + + expect(classes['exClass'].styles.length).toBe(2); + expect(classes['exClass'].styles[0]).toBe('background: #bbb'); + expect(classes['exClass'].styles[1]).toBe('border:1.5px solid red'); + }); it('should be possible to apply a class to a vertex',function(){ var statement = ''; diff --git a/src/sequenceRenderer.js b/src/sequenceRenderer.js new file mode 100644 index 000000000..a65d04d6a --- /dev/null +++ b/src/sequenceRenderer.js @@ -0,0 +1,165 @@ +/** + * Created by knut on 14-11-23. + */ + +var sq = require('./parser/sequence').parser; +sq.yy = require('./sequenceDb'); + +/** + * Draws a flowchart in the tag with id: id based on the graph definition in text. + * @param text + * @param id + */ +module.exports.draw = function (text, id) { + sq.yy.clear(); + sq.parse(text); + + var actors = sq.yy.getActors(); + var actorKeys = sq.yy.getActorKeys(); + + var i; + //console.log('Len = ' + ) + for(i=0;i
- graph TB;A(Astrid)-->B[Irene]; + graph TB;A(Astrid # a)-->B[Irene]; A-->C[Christer]; B-->D[Micke]; B-->E[Maria];