mermaid
Version:
Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.
1 lines • 332 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.mermaid=e():t.mermaid=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=35)}([function(t,e){t.exports=require("d3")},function(t,e,r){(function(t,i){var n=function(){var t=function(t,e,r,i){for(r=r||{},i=t.length;i--;r[t[i]]=e);return r},e=[1,2],r=[1,3],i=[1,4],n=[2,4],a=[1,9],s=[1,11],o=[1,12],l=[1,14],c=[1,15],u=[1,16],h=[1,18],d=[1,19],f=[1,20],p=[1,21],y=[1,22],g=[1,23],m=[1,25],b=[1,26],x=[1,4,5,10,15,16,17,19,21,22,23,24,25,27,29,30,31,42],k=[1,34],v=[4,5,10,15,16,17,19,21,22,23,24,25,27,31,42],E=[4,5,10,15,16,17,19,21,22,23,24,25,27,30,31,42],_=[4,5,10,15,16,17,19,21,22,23,24,25,27,29,31,42],w=[40,41,42],A={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,participant:10,actor:11,AS:12,restOfLine:13,signal:14,autonumber:15,activate:16,deactivate:17,note_statement:18,title:19,text2:20,loop:21,end:22,rect:23,opt:24,alt:25,else_sections:26,par:27,par_sections:28,and:29,else:30,note:31,placement:32,over:33,actor_pair:34,spaceList:35,",":36,left_of:37,right_of:38,signaltype:39,"+":40,"-":41,ACTOR:42,SOLID_OPEN_ARROW:43,DOTTED_OPEN_ARROW:44,SOLID_ARROW:45,DOTTED_ARROW:46,SOLID_CROSS:47,DOTTED_CROSS:48,TXT:49,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",10:"participant",12:"AS",13:"restOfLine",15:"autonumber",16:"activate",17:"deactivate",19:"title",21:"loop",22:"end",23:"rect",24:"opt",25:"alt",27:"par",29:"and",30:"else",31:"note",33:"over",36:",",37:"left_of",38:"right_of",40:"+",41:"-",42:"ACTOR",43:"SOLID_OPEN_ARROW",44:"DOTTED_OPEN_ARROW",45:"SOLID_ARROW",46:"DOTTED_ARROW",47:"SOLID_CROSS",48:"DOTTED_CROSS",49:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,5],[9,3],[9,2],[9,1],[9,3],[9,3],[9,2],[9,3],[9,4],[9,4],[9,4],[9,4],[9,4],[28,1],[28,4],[26,1],[26,4],[18,4],[18,4],[35,2],[35,1],[34,3],[34,1],[32,1],[32,1],[14,5],[14,5],[14,4],[11,1],[39,1],[39,1],[39,1],[39,1],[39,1],[39,1],[20,1]],performAction:function(t,e,r,i,n,a,s){var o=a.length-1;switch(n){case 3:return i.apply(a[o]),a[o];case 4:this.$=[];break;case 5:a[o-1].push(a[o]),this.$=a[o-1];break;case 6:case 7:this.$=a[o];break;case 8:this.$=[];break;case 9:a[o-3].description=a[o-1],this.$=a[o-3];break;case 10:this.$=a[o-1];break;case 12:i.enableSequenceNumbers();break;case 13:this.$={type:"activeStart",signalType:i.LINETYPE.ACTIVE_START,actor:a[o-1]};break;case 14:this.$={type:"activeEnd",signalType:i.LINETYPE.ACTIVE_END,actor:a[o-1]};break;case 16:this.$=[{type:"setTitle",text:a[o-1]}];break;case 17:a[o-1].unshift({type:"loopStart",loopText:a[o-2],signalType:i.LINETYPE.LOOP_START}),a[o-1].push({type:"loopEnd",loopText:a[o-2],signalType:i.LINETYPE.LOOP_END}),this.$=a[o-1];break;case 18:a[o-1].unshift({type:"rectStart",color:a[o-2],signalType:i.LINETYPE.RECT_START}),a[o-1].push({type:"rectEnd",color:a[o-2],signalType:i.LINETYPE.RECT_END}),this.$=a[o-1];break;case 19:a[o-1].unshift({type:"optStart",optText:a[o-2],signalType:i.LINETYPE.OPT_START}),a[o-1].push({type:"optEnd",optText:a[o-2],signalType:i.LINETYPE.OPT_END}),this.$=a[o-1];break;case 20:a[o-1].unshift({type:"altStart",altText:a[o-2],signalType:i.LINETYPE.ALT_START}),a[o-1].push({type:"altEnd",signalType:i.LINETYPE.ALT_END}),this.$=a[o-1];break;case 21:a[o-1].unshift({type:"parStart",parText:a[o-2],signalType:i.LINETYPE.PAR_START}),a[o-1].push({type:"parEnd",signalType:i.LINETYPE.PAR_END}),this.$=a[o-1];break;case 23:this.$=a[o-3].concat([{type:"and",parText:a[o-1],signalType:i.LINETYPE.PAR_AND},a[o]]);break;case 25:this.$=a[o-3].concat([{type:"else",altText:a[o-1],signalType:i.LINETYPE.ALT_ELSE},a[o]]);break;case 26:this.$=[a[o-1],{type:"addNote",placement:a[o-2],actor:a[o-1].actor,text:a[o]}];break;case 27:a[o-2]=[].concat(a[o-1],a[o-1]).slice(0,2),a[o-2][0]=a[o-2][0].actor,a[o-2][1]=a[o-2][1].actor,this.$=[a[o-1],{type:"addNote",placement:i.PLACEMENT.OVER,actor:a[o-2].slice(0,2),text:a[o]}];break;case 30:this.$=[a[o-2],a[o]];break;case 31:this.$=a[o];break;case 32:this.$=i.PLACEMENT.LEFTOF;break;case 33:this.$=i.PLACEMENT.RIGHTOF;break;case 34:this.$=[a[o-4],a[o-1],{type:"addMessage",from:a[o-4].actor,to:a[o-1].actor,signalType:a[o-3],msg:a[o]},{type:"activeStart",signalType:i.LINETYPE.ACTIVE_START,actor:a[o-1]}];break;case 35:this.$=[a[o-4],a[o-1],{type:"addMessage",from:a[o-4].actor,to:a[o-1].actor,signalType:a[o-3],msg:a[o]},{type:"activeEnd",signalType:i.LINETYPE.ACTIVE_END,actor:a[o-4]}];break;case 36:this.$=[a[o-3],a[o-1],{type:"addMessage",from:a[o-3].actor,to:a[o-1].actor,signalType:a[o-2],msg:a[o]}];break;case 37:this.$={type:"addActor",actor:a[o]};break;case 38:this.$=i.LINETYPE.SOLID_OPEN;break;case 39:this.$=i.LINETYPE.DOTTED_OPEN;break;case 40:this.$=i.LINETYPE.SOLID;break;case 41:this.$=i.LINETYPE.DOTTED;break;case 42:this.$=i.LINETYPE.SOLID_CROSS;break;case 43:this.$=i.LINETYPE.DOTTED_CROSS;break;case 44:this.$=a[o].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:e,5:r,6:i},{1:[3]},{3:5,4:e,5:r,6:i},{3:6,4:e,5:r,6:i},t([1,4,5,10,15,16,17,19,21,23,24,25,27,31,42],n,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:o,11:24,14:13,15:l,16:c,17:u,18:17,19:h,21:d,23:f,24:p,25:y,27:g,31:m,42:b},t(x,[2,5]),{9:27,10:o,11:24,14:13,15:l,16:c,17:u,18:17,19:h,21:d,23:f,24:p,25:y,27:g,31:m,42:b},t(x,[2,7]),t(x,[2,8]),{11:28,42:b},{5:[1,29]},t(x,[2,12]),{11:30,42:b},{11:31,42:b},{5:[1,32]},{20:33,49:k},{13:[1,35]},{13:[1,36]},{13:[1,37]},{13:[1,38]},{13:[1,39]},{39:40,43:[1,41],44:[1,42],45:[1,43],46:[1,44],47:[1,45],48:[1,46]},{32:47,33:[1,48],37:[1,49],38:[1,50]},t([5,12,36,43,44,45,46,47,48,49],[2,37]),t(x,[2,6]),{5:[1,52],12:[1,51]},t(x,[2,11]),{5:[1,53]},{5:[1,54]},t(x,[2,15]),{5:[1,55]},{5:[2,44]},t(v,n,{7:56}),t(v,n,{7:57}),t(v,n,{7:58}),t(E,n,{26:59,7:60}),t(_,n,{28:61,7:62}),{11:65,40:[1,63],41:[1,64],42:b},t(w,[2,38]),t(w,[2,39]),t(w,[2,40]),t(w,[2,41]),t(w,[2,42]),t(w,[2,43]),{11:66,42:b},{11:68,34:67,42:b},{42:[2,32]},{42:[2,33]},{13:[1,69]},t(x,[2,10]),t(x,[2,13]),t(x,[2,14]),t(x,[2,16]),{4:a,5:s,8:8,9:10,10:o,11:24,14:13,15:l,16:c,17:u,18:17,19:h,21:d,22:[1,70],23:f,24:p,25:y,27:g,31:m,42:b},{4:a,5:s,8:8,9:10,10:o,11:24,14:13,15:l,16:c,17:u,18:17,19:h,21:d,22:[1,71],23:f,24:p,25:y,27:g,31:m,42:b},{4:a,5:s,8:8,9:10,10:o,11:24,14:13,15:l,16:c,17:u,18:17,19:h,21:d,22:[1,72],23:f,24:p,25:y,27:g,31:m,42:b},{22:[1,73]},{4:a,5:s,8:8,9:10,10:o,11:24,14:13,15:l,16:c,17:u,18:17,19:h,21:d,22:[2,24],23:f,24:p,25:y,27:g,30:[1,74],31:m,42:b},{22:[1,75]},{4:a,5:s,8:8,9:10,10:o,11:24,14:13,15:l,16:c,17:u,18:17,19:h,21:d,22:[2,22],23:f,24:p,25:y,27:g,29:[1,76],31:m,42:b},{11:77,42:b},{11:78,42:b},{20:79,49:k},{20:80,49:k},{20:81,49:k},{36:[1,82],49:[2,31]},{5:[1,83]},t(x,[2,17]),t(x,[2,18]),t(x,[2,19]),t(x,[2,20]),{13:[1,84]},t(x,[2,21]),{13:[1,85]},{20:86,49:k},{20:87,49:k},{5:[2,36]},{5:[2,26]},{5:[2,27]},{11:88,42:b},t(x,[2,9]),t(E,n,{7:60,26:89}),t(_,n,{7:62,28:90}),{5:[2,34]},{5:[2,35]},{49:[2,30]},{22:[2,25]},{22:[2,23]}],defaultActions:{5:[2,1],6:[2,2],34:[2,44],49:[2,32],50:[2,33],79:[2,36],80:[2,26],81:[2,27],86:[2,34],87:[2,35],88:[2,30],89:[2,25],90:[2,23]},parseError:function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)},parse:function(t){var e=this,r=[0],i=[],n=[null],a=[],s=this.table,o="",l=0,c=0,u=0,h=2,d=1,f=a.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y.yy[g]=this.yy[g]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var m=p.yylloc;a.push(m);var b=p.options&&p.options.ranges;function x(){var t;return"number"!=typeof(t=i.pop()||p.lex()||d)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var k,v,E,_,w,A,T,S,O,C={};;){if(E=r[r.length-1],this.defaultActions[E]?_=this.defaultActions[E]:(null==k&&(k=x()),_=s[E]&&s[E][k]),void 0===_||!_.length||!_[0]){var D="";for(A in O=[],s[E])this.terminals_[A]&&A>h&&O.push("'"+this.terminals_[A]+"'");D=p.showPosition?"Parse error on line "+(l+1)+":\n"+p.showPosition()+"\nExpecting "+O.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(l+1)+": Unexpected "+(k==d?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(D,{text:p.match,token:this.terminals_[k]||k,line:p.yylineno,loc:m,expected:O})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+E+", token: "+k);switch(_[0]){case 1:r.push(k),n.push(p.yytext),a.push(p.yylloc),r.push(_[1]),k=null,v?(k=v,v=null):(c=p.yyleng,o=p.yytext,l=p.yylineno,m=p.yylloc,u>0&&u--);break;case 2:if(T=this.productions_[_[1]][1],C.$=n[n.length-T],C._$={first_line:a[a.length-(T||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(T||1)].first_column,last_column:a[a.length-1].last_column},b&&(C._$.range=[a[a.length-(T||1)].range[0],a[a.length-1].range[1]]),void 0!==(w=this.performAction.apply(C,[o,c,l,y.yy,_[1],n,a].concat(f))))return w;T&&(r=r.slice(0,-1*T*2),n=n.slice(0,-1*T),a=a.slice(0,-1*T)),r.push(this.productions_[_[1]][0]),n.push(C.$),a.push(C._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}},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];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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,r=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 i=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),r.length-1&&(this.yylineno-=r.length-1);var n=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:r?(r.length===i.length?this.yylloc.first_column:0)+i[i.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[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 r,i,n;if(this.options.backtrack_lexer&&(n={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&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in n)this[a]=n[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,r,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),a=0;a<n.length;a++)if((r=this._input.match(this.rules[n[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,n[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===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||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>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))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,r,i){switch(r){case 0:return 5;case 1:case 2:case 3:case 4:break;case 5:return this.begin("ID"),10;case 6:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),42;case 7:return this.popState(),this.popState(),this.begin("LINE"),12;case 8:return this.popState(),this.popState(),5;case 9:return this.begin("LINE"),21;case 10:return this.begin("LINE"),23;case 11:return this.begin("LINE"),24;case 12:return this.begin("LINE"),25;case 13:return this.begin("LINE"),30;case 14:return this.begin("LINE"),27;case 15:return this.begin("LINE"),29;case 16:return this.popState(),13;case 17:return 22;case 18:return 37;case 19:return 38;case 20:return 33;case 21:return 31;case 22:return this.begin("ID"),16;case 23:return this.begin("ID"),17;case 24:return 19;case 25:return 6;case 26:return 15;case 27:return 36;case 28:return 5;case 29:return e.yytext=e.yytext.trim(),42;case 30:return 45;case 31:return 46;case 32:return 43;case 33:return 44;case 34:return 47;case 35:return 48;case 36:return 49;case 37:return 40;case 38:return 41;case 39:return 5;case 40:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:participant\b)/i,/^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?::[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[2,3,16],inclusive:!1},ALIAS:{rules:[2,3,7,8],inclusive:!1},ID:{rules:[2,3,6],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,9,10,11,12,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],inclusive:!0}}};function S(){this.yy={}}return A.lexer=T,S.prototype=A,A.Parser=S,new S}();e.parser=n,e.Parser=n.Parser,e.parse=function(){return n.parse.apply(n,arguments)},e.main=function(i){i[1]||(console.log("Usage: "+i[0]+" FILE"),t.exit(1));var n=r(6).readFileSync(r(7).normalize(i[1]),"utf8");return e.parser.parse(n)},r.c[r.s]===i&&e.main(t.argv.slice(1))}).call(this,r(4),r(5)(t))},function(t,e){t.exports=require("graphlib")},function(t,e){t.exports=require("dagre-d3")},function(t,e){var r,i,n=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var l,c=[],u=!1,h=-1;function d(){u&&l&&(u=!1,l.length?c=l.concat(c):h=-1,c.length&&f())}function f(){if(!u){var t=o(d);u=!0;for(var e=c.length;e;){for(l=c,c=[];++h<e;)l&&l[h].run();h=-1,e=c.length}l=null,u=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function y(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new p(t,e)),1!==c.length||u||o(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=y,n.addListener=y,n.once=y,n.off=y,n.removeListener=y,n.removeAllListeners=y,n.emit=y,n.prependListener=y,n.prependOnceListener=y,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){(function(t){function r(t,e){for(var r=0,i=t.length-1;i>=0;i--){var n=t[i];"."===n?t.splice(i,1):".."===n?(t.splice(i,1),r++):r&&(t.splice(i,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var r=[],i=0;i<t.length;i++)e(t[i],i,t)&&r.push(t[i]);return r}e.resolve=function(){for(var e="",n=!1,a=arguments.length-1;a>=-1&&!n;a--){var s=a>=0?arguments[a]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(e=s+"/"+e,n="/"===s.charAt(0))}return(n?"/":"")+(e=r(i(e.split("/"),(function(t){return!!t})),!n).join("/"))||"."},e.normalize=function(t){var a=e.isAbsolute(t),s="/"===n(t,-1);return(t=r(i(t.split("/"),(function(t){return!!t})),!a).join("/"))||a||(t="."),t&&s&&(t+="/"),(a?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(i(t,(function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))},e.relative=function(t,r){function i(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=e.resolve(t).substr(1),r=e.resolve(r).substr(1);for(var n=i(t.split("/")),a=i(r.split("/")),s=Math.min(n.length,a.length),o=s,l=0;l<s;l++)if(n[l]!==a[l]){o=l;break}var c=[];for(l=o;l<n.length;l++)c.push("..");return(c=c.concat(a.slice(o))).join("/")},e.sep="/",e.delimiter=":",e.dirname=function(t){if("string"!=typeof t&&(t+=""),0===t.length)return".";for(var e=t.charCodeAt(0),r=47===e,i=-1,n=!0,a=t.length-1;a>=1;--a)if(47===(e=t.charCodeAt(a))){if(!n){i=a;break}}else n=!1;return-1===i?r?"/":".":r&&1===i?"/":t.slice(0,i)},e.basename=function(t,e){var r=function(t){"string"!=typeof t&&(t+="");var e,r=0,i=-1,n=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!n){r=e+1;break}}else-1===i&&(n=!1,i=e+1);return-1===i?"":t.slice(r,i)}(t);return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},e.extname=function(t){"string"!=typeof t&&(t+="");for(var e=-1,r=0,i=-1,n=!0,a=0,s=t.length-1;s>=0;--s){var o=t.charCodeAt(s);if(47!==o)-1===i&&(n=!1,i=s+1),46===o?-1===e?e=s:1!==a&&(a=1):-1!==e&&(a=-1);else if(!n){r=s+1;break}}return-1===e||-1===i||0===a||1===a&&e===i-1&&e===r+1?"":t.slice(e,i)};var n="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,r(4))},function(t,e,r){(function(t,i){var n=function(){var t=function(t,e,r,i){for(r=r||{},i=t.length;i--;r[t[i]]=e);return r},e=[1,2],r=[1,3],i=[1,4],n=[2,4],a=[1,9],s=[1,11],o=[1,13],l=[1,14],c=[1,15],u=[1,16],h=[1,21],d=[1,17],f=[1,18],p=[1,19],y=[1,20],g=[1,22],m=[1,4,5,13,14,16,18,19,21,22,23,24,25,28],b=[1,4,5,11,12,13,14,16,18,19,21,22,23,24,25,28],x=[4,5,13,14,16,18,19,21,22,23,24,25,28],k={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,idStatement:10,DESCR:11,"--\x3e":12,HIDE_EMPTY:13,scale:14,WIDTH:15,COMPOSIT_STATE:16,STRUCT_START:17,STRUCT_STOP:18,STATE_DESCR:19,AS:20,ID:21,FORK:22,JOIN:23,CONCURRENT:24,note:25,notePosition:26,NOTE_TEXT:27,EDGE_STATE:28,left_of:29,right_of:30,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",11:"DESCR",12:"--\x3e",13:"HIDE_EMPTY",14:"scale",15:"WIDTH",16:"COMPOSIT_STATE",17:"STRUCT_START",18:"STRUCT_STOP",19:"STATE_DESCR",20:"AS",21:"ID",22:"FORK",23:"JOIN",24:"CONCURRENT",25:"note",27:"NOTE_TEXT",28:"EDGE_STATE",29:"left_of",30:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,4],[9,4],[10,1],[10,1],[26,1],[26,1]],performAction:function(t,e,r,i,n,a,s){var o=a.length-1;switch(n){case 3:return i.setRootDoc(a[o]),a[o];case 4:this.$=[];break;case 5:"nl"!=a[o]&&(a[o-1].push(a[o]),this.$=a[o-1]);break;case 6:case 7:this.$=a[o];break;case 8:this.$="nl";break;case 9:this.$={stmt:"state",id:a[o],type:"default",description:""};break;case 10:this.$={stmt:"state",id:a[o-1],type:"default",description:i.trimColon(a[o])};break;case 11:this.$={stmt:"relation",state1:{stmt:"state",id:a[o-2],type:"default",description:""},state2:{stmt:"state",id:a[o],type:"default",description:""}};break;case 12:this.$={stmt:"relation",state1:{stmt:"state",id:a[o-3],type:"default",description:""},state2:{stmt:"state",id:a[o-1],type:"default",description:""},description:a[o].substr(1).trim()};break;case 16:this.$={stmt:"state",id:a[o-3],type:"default",description:"",doc:a[o-1]};break;case 17:var l=a[o],c=a[o-2].trim();if(a[o].match(":")){var u=a[o].split(":");l=u[0],c=[c,u[1]]}this.$={stmt:"state",id:l,type:"default",description:c};break;case 18:this.$={stmt:"state",id:a[o-3],type:"default",description:a[o-5],doc:a[o-1]};break;case 19:this.$={stmt:"state",id:a[o],type:"fork"};break;case 20:this.$={stmt:"state",id:a[o],type:"join"};break;case 21:this.$={stmt:"state",id:i.getDividerId(),type:"divider"};break;case 22:this.$={stmt:"state",id:a[o-1].trim(),note:{position:a[o-2].trim(),text:a[o].trim()}};break;case 24:case 25:this.$=a[o]}},table:[{3:1,4:e,5:r,6:i},{1:[3]},{3:5,4:e,5:r,6:i},{3:6,4:e,5:r,6:i},t([1,4,5,13,14,16,19,21,22,23,24,25,28],n,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:a,5:s,8:8,9:10,10:12,13:o,14:l,16:c,19:u,21:h,22:d,23:f,24:p,25:y,28:g},t(m,[2,5]),{9:23,10:12,13:o,14:l,16:c,19:u,21:h,22:d,23:f,24:p,25:y,28:g},t(m,[2,7]),t(m,[2,8]),t(m,[2,9],{11:[1,24],12:[1,25]}),t(m,[2,13]),{15:[1,26]},t(m,[2,15],{17:[1,27]}),{20:[1,28]},t(m,[2,19]),t(m,[2,20]),t(m,[2,21]),{26:29,27:[1,30],29:[1,31],30:[1,32]},t(b,[2,24]),t(b,[2,25]),t(m,[2,6]),t(m,[2,10]),{10:33,21:h,28:g},t(m,[2,14]),t(x,n,{7:34}),{21:[1,35]},{21:[1,36]},{20:[1,37]},{21:[2,26]},{21:[2,27]},t(m,[2,11],{11:[1,38]}),{4:a,5:s,8:8,9:10,10:12,13:o,14:l,16:c,18:[1,39],19:u,21:h,22:d,23:f,24:p,25:y,28:g},t(m,[2,17],{17:[1,40]}),{27:[1,41]},{21:[1,42]},t(m,[2,12]),t(m,[2,16]),t(x,n,{7:43}),t(m,[2,22]),t(m,[2,23]),{4:a,5:s,8:8,9:10,10:12,13:o,14:l,16:c,18:[1,44],19:u,21:h,22:d,23:f,24:p,25:y,28:g},t(m,[2,18])],defaultActions:{5:[2,1],6:[2,2],31:[2,26],32:[2,27]},parseError:function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)},parse:function(t){var e=this,r=[0],i=[],n=[null],a=[],s=this.table,o="",l=0,c=0,u=0,h=2,d=1,f=a.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y.yy[g]=this.yy[g]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var m=p.yylloc;a.push(m);var b=p.options&&p.options.ranges;function x(){var t;return"number"!=typeof(t=i.pop()||p.lex()||d)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var k,v,E,_,w,A,T,S,O,C={};;){if(E=r[r.length-1],this.defaultActions[E]?_=this.defaultActions[E]:(null==k&&(k=x()),_=s[E]&&s[E][k]),void 0===_||!_.length||!_[0]){var D="";for(A in O=[],s[E])this.terminals_[A]&&A>h&&O.push("'"+this.terminals_[A]+"'");D=p.showPosition?"Parse error on line "+(l+1)+":\n"+p.showPosition()+"\nExpecting "+O.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(l+1)+": Unexpected "+(k==d?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(D,{text:p.match,token:this.terminals_[k]||k,line:p.yylineno,loc:m,expected:O})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+E+", token: "+k);switch(_[0]){case 1:r.push(k),n.push(p.yytext),a.push(p.yylloc),r.push(_[1]),k=null,v?(k=v,v=null):(c=p.yyleng,o=p.yytext,l=p.yylineno,m=p.yylloc,u>0&&u--);break;case 2:if(T=this.productions_[_[1]][1],C.$=n[n.length-T],C._$={first_line:a[a.length-(T||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(T||1)].first_column,last_column:a[a.length-1].last_column},b&&(C._$.range=[a[a.length-(T||1)].range[0],a[a.length-1].range[1]]),void 0!==(w=this.performAction.apply(C,[o,c,l,y.yy,_[1],n,a].concat(f))))return w;T&&(r=r.slice(0,-1*T*2),n=n.slice(0,-1*T),a=a.slice(0,-1*T)),r.push(this.productions_[_[1]][0]),n.push(C.$),a.push(C._$),S=s[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}},v={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];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(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,r=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 i=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),r.length-1&&(this.yylineno-=r.length-1);var n=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:r?(r.length===i.length?this.yylloc.first_column:0)+i[i.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[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 r,i,n;if(this.options.backtrack_lexer&&(n={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&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in n)this[a]=n[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,r,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),a=0;a<n.length;a++)if((r=this._input.match(this.rules[n[a]]))&&(!e||r[0].length>e[0].length)){if(e=r,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,n[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===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||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>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))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,r,i){switch(r){case 0:return 5;case 1:case 2:case 3:case 4:break;case 5:return this.pushState("SCALE"),14;case 6:return 15;case 7:this.popState();break;case 8:this.pushState("STATE");break;case 9:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),22;case 10:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),23;case 11:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),22;case 12:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),23;case 13:this.begin("STATE_STRING");break;case 14:return this.popState(),this.pushState("STATE_ID"),"AS";case 15:return this.popState(),"ID";case 16:this.popState();break;case 17:return"STATE_DESCR";case 18:return 16;case 19:this.popState();break;case 20:return this.popState(),this.pushState("struct"),17;case 21:return this.popState(),18;case 22:break;case 23:return this.begin("NOTE"),25;case 24:return this.popState(),this.pushState("NOTE_ID"),29;case 25:return this.popState(),this.pushState("NOTE_ID"),30;case 26:this.popState(),this.pushState("FLOATING_NOTE");break;case 27:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 28:break;case 29:return"NOTE_TEXT";case 30:return this.popState(),"ID";case 31:return this.popState(),this.pushState("NOTE_TEXT"),21;case 32:return this.popState(),e.yytext=e.yytext.substr(2).trim(),27;case 33:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),27;case 34:case 35:return 6;case 36:return 13;case 37:return 28;case 38:return 21;case 39:return e.yytext=e.yytext.trim(),11;case 40:return 12;case 41:return 24;case 42:return 5;case 43:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:\s*[^:;]+end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[2,3],inclusive:!1},struct:{rules:[2,3,8,21,22,23,37,38,39,40,41],inclusive:!1},FLOATING_NOTE_ID:{rules:[30],inclusive:!1},FLOATING_NOTE:{rules:[27,28,29],inclusive:!1},NOTE_TEXT:{rules:[32,33],inclusive:!1},NOTE_ID:{rules:[31],inclusive:!1},NOTE:{rules:[24,25,26],inclusive:!1},SCALE:{rules:[6,7],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[15],inclusive:!1},STATE_STRING:{rules:[16,17],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[2,3,9,10,11,12,13,14,18,19,20],inclusive:!1},ID:{rules:[2,3],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,8,20,23,34,35,36,37,38,39,40,42,43],inclusive:!0}}};function E(){this.yy={}}return k.lexer=v,E.prototype=k,k.Parser=E,new E}();e.parser=n,e.Parser=n.Parser,e.parse=function(){return n.parse.apply(n,arguments)},e.main=function(i){i[1]||(console.log("Usage: "+i[0]+" FILE"),t.exit(1));var n=r(6).readFileSync(r(7).normalize(i[1]),"utf8");return e.parser.parse(n)},r.c[r.s]===i&&e.main(t.argv.slice(1))}).call(this,r(4),r(5)(t))},function(t,e){t.exports=require("moment-mini")},function(t,e,r){(function(t,i){var n=function(){var t=function(t,e,r,i){for(r=r||{},i=t.length;i--;r[t[i]]=e);return r},e=[1,4],r=[1,3],i=[1,5],n=[1,8,9,10,11,26,34,63,64,65,66,67,68,78,79,82,83,84,86,87,93,94,95,96,97,98],a=[2,2],s=[1,12],o=[1,13],l=[1,14],c=[1,15],u=[1,22],h=[1,46],d=[1,24],f=[1,25],p=[1,26],y=[1,27],g=[1,28],m=[1,40],b=[1,35],x=[1,37],k=[1,32],v=[1,36],E=[1,39],_=[1,43],w=[1,44],A=[1,45],T=[1,34],S=[1,38],O=[1,41],C=[1,42],D=[1,33],F=[1,51],N=[1,8,9,10,11,26,30,34,63,64,65,66,67,68,78,79,82,83,84,86,87,93,94,95,96,97,98],L=[1,55],I=[1,54],B=[1,56],M=[8,9,11,57,58],P=[8,9,10,11,57,58],R=[8,9,10,11,35,57,58],j=[8,9,10,11,28,34,35,37,39,41,43,45,47,49,50,52,57,58,68,78,79,82,83,84,86,87,93,94,95,96,97,98],$=[8,9,11,34,57,58,68,78,79,82,83,84,86,87,93,94,95,96,97,98],z=[34,68,78,79,82,83,84,86,87,93,94,95,96,97,98],Y=[1,101],G=[1,122],V=[1,123],U=[1,124],H=[1,125],W=[1,105],q=[1,96],X=[1,97],Z=[1,93],J=[1,117],K=[1,118],Q=[1,119],tt=[1,120],et=[1,121],rt=[1,126],it=[1,127],nt=[1,99],at=[1,107],st=[1,110],ot=[1,108],lt=[1,109],ct=[1,102],ut=[1,115],ht=[1,114],dt=[1,98],ft=[1,95],pt=[1,104],yt=[1,106],gt=[1,111],mt=[1,112],bt=[1,113],xt=[1,116],kt=[8,9,10,11,26,30,34,63,64,65,66,67,68,78,79,82,83,84,86,87,93,94,95,96,97,98],vt=[1,130],Et=[1,134],_t=[1,136],wt=[1,137],At=[8,9,10,11,12,13,26,28,29,30,34,38,40,42,44,46,48,49,51,53,57,58,59,63,64,65,66,67,68,69,72,78,79,82,83,84,86,87,88,89,93,94,95,96,97,98],Tt=[8,9,10,11,13,34,68,78,79,82,83,84,86,87,93,94,95,96,97,98],St=[10,79],Ot=[1,204],Ct=[1,208],Dt=[1,205],Ft=[1,202],Nt=[1,199],Lt=[1,200],It=[1,201],Bt=[1,203],Mt=[1,206],Pt=[1,207],Rt=[1,209],jt=[8,9,11],$t=[1,225],zt=[8,9,11,79],Yt=[8,9,10,11,63,75,78,79,82,83,84,85,86,87,88],Gt={trace:function(){},yy:{},symbols_:{error:2,mermaidDoc:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,DIR:13,FirstStmtSeperator:14,ending:15,endToken:16,spaceList:17,spaceListNewline:18,verticeStatement:19,separator:20,styleStatement:21,linkStyleStatement:22,classDefStatement:23,classStatement:24,clickStatement:25,subgraph:26,text:27,SQS:28,SQE:29,end:30,link:31,node:32,vertex:33,AMP:34,STYLE_SEPARATOR:35,idString:36,PS:37,PE:38,"(-":39,"-)":40,STADIUMSTART:41,STADIUMEND:42,SUBROUTINESTART:43,SUBROUTINEEND:44,CYLINDERSTART:45,CYLINDEREND:46,DIAMOND_START:47,DIAMOND_STOP:48,TAGEND:49,TRAPSTART:50,TRAPEND:51,INVTRAPSTART:52,INVTRAPEND:53,linkStatement:54,arrowText:55,TESTSTR:56,START_LINK:57,LINK:58,PIPE:59,textToken:60,STR:61,keywords:62,STYLE:63,LINKSTYLE:64,CLASSDEF:65,CLASS:66,CLICK:67,DOWN:68,UP:69,textNoTags:70,textNoTagsToken:71,DEFAULT:72,stylesOpt:73,alphaNum:74,HEX:75,numList:76,INTERPOLATE:77,NUM:78,COMMA:79,style:80,styleComponent:81,ALPHA:82,COLON:83,MINUS:84,UNIT:85,BRKT:86,DOT:87,PCT:88,TAGSTART:89,alphaNumToken:90,idStringToken:91,alphaNumStatement:92,PUNCTUATION:93,UNICODE_TEXT:94,PLUS:95,EQUALS:96,MULT:97,UNDERSCORE:98,graphCodeTokens:99,ARROW_CROSS:100,ARROW_POINT:101,ARROW_CIRCLE:102,ARROW_OPEN:103,QUOTE:104,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"DIR",26:"subgraph",28:"SQS",29:"SQE",30:"end",34:"AMP",35:"STYLE_SEPARATOR",37:"PS",38:"PE",39:"(-",40:"-)",41:"STADIUMSTART",42:"STADIUMEND",43:"SUBROUTINESTART",44:"SUBROUTINEEND",45:"CYLINDERSTART",46:"CYLINDEREND",47:"DIAMOND_START",48:"DIAMOND_STOP",49:"TAGEND",50:"TRAPSTART",51:"TRAPEND",52:"INVTRAPSTART",53:"INVTRAPEND",56:"TESTSTR",57:"START_LINK",58:"LINK",59:"PIPE",61:"STR",63:"STYLE",64:"LINKSTYLE",65:"CLASSDEF",66:"CLASS",67:"CLICK",68:"DOWN",69:"UP",72:"DEFAULT",75:"HEX",77:"INTERPOLATE",78:"NUM",79:"COMMA",82:"ALPHA",83:"COLON",84:"MINUS",85:"UNIT",86:"BRKT",87:"DOT",88:"PCT",89:"TAGSTART",93:"PUNCTUATION",94:"UNICODE_TEXT",95:"PLUS",96:"EQUALS",97:"MULT",98:"UNDERSCORE",100:"ARROW_CROSS",101:"ARROW_POINT",102:"ARROW_CIRCLE",103:"ARROW_OPEN",104:"QUOTE"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,3],[15,2],[15,1],[16,1],[16,1],[16,1],[14,1],[14,1],[14,2],[18,2],[18,2],[18,1],[18,1],[17,2],[17,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[20,1],[20,1],[20,1],[19,3],[19,4],[19,2],[19,1],[32,1],[32,5],[32,3],[33,4],[33,6],[33,4],[33,4],[33,4],[33,4],[33,4],[33,4],[33,6],[33,4],[33,4],[33,4],[33,4],[33,4],[33,1],[31,2],[31,3],[31,3],[31,1],[31,3],[54,1],[55,3],[27,1],[27,2],[27,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[70,1],[70,2],[23,5],[23,5],[24,5],[25,5],[25,7],[25,5],[25,7],[21,5],[21,5],[22,5],[22,5],[22,9],[22,9],[22,7],[22,7],[76,1],[76,3],[73,1],[73,3],[80,1],[80,2],[81,1],[81,1],[81,1],[81,1],[81,1],[81,1],[81,1],[81,1],[81,1],[81,1],[81,1],[60,1],[60,1],[60,1],[60,1],[60,1],[60,1],[71,1],[71,1],[71,1],[71,1],[36,1],[36,2],[74,1],[74,2],[92,1],[92,1],[92,1],[92,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[90,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1],[99,1]],performAction:function(t,e,r,i,n,a,s){var o=a.length-1;switch(n){case 2:this.$=[];break;case 3:a[o]!==[]&&a[o-1].push(a[o]),this.$=a[o-1];break;case 4:case 67:case 69:case 81:case 127:case 129:case 130:this.$=a[o];break;case 11:i.setDirection(a[o-1]),this.$=a[o-1];break;case 26:this.$=a[o-1].nodes;break;case 27:case 28:case 29:case 30:case 31:this.$=[];break;case 32:this.$=i.addSubGraph(a[o-6],a[o-1],a[o-4]);break;case 33:this.$=i.addSubGraph(a[o-3],a[o-1],a[o-3]);break;case 34:this.$=i.addSubGraph(void 0,a[o-1],void 0);break;case 38:i.addLink(a[o-2].stmt,a[o],a[o-1]),this.$={stmt:a[o],nodes:a[o].concat(a[o-2].nodes)};break;case 39:i.addLink(a[o-3].stmt,a[o-1],a[o-2]),this.$={stmt:a[o-1],nodes:a[o-1].concat(a[o-3].nodes)};break;case 40:this.$={stmt:a[o-1],nodes:a[o-1]};break;case 41:this.$={stmt:a[o],nodes:a[o]};break;case 42:this.$=[a[o]];break;case 43:this.$=a[o-4].concat(a[o]);break;case 44:this.$=[a[o-2]],i.setClass(a[o-2],a[o]);break;case 45:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"square");break;case 46:this.$=a[o-5],i.addVertex(a[o-5],a[o-2],"circle");break;case 47:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"ellipse");break;case 48:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"stadium");break;case 49:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"subroutine");break;case 50:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"cylinder");break;case 51:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"round");break;case 52:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"diamond");break;case 53:this.$=a[o-5],i.addVertex(a[o-5],a[o-2],"hexagon");break;case 54:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"odd");break;case 55:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"trapezoid");break;case 56:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"inv_trapezoid");break;case 57:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"lean_right");break;case 58:this.$=a[o-3],i.addVertex(a[o-3],a[o-1],"lean_left");break;case 59:this.$=a[o],i.addVertex(a[o]);break;case 60:a[o-1].text=a[o],this.$=a[o-1];break;case 61:case 62:a[o-2].text=a[o-1],this.$=a[o-2];break;case 63:this.$=a[o];break;case 64:var l=i.destructLink(a[o],a[o-2]);this.$={type:l.type,stroke:l.stroke,text:a[o-1]};break;case 65:l=i.destructLink(a[o]);this.$={type:l.type,stroke:l.stroke};break;case 66:this.$=a[o-1];break;case 68:case 82:case 128:this.$=a[o-1]+""+a[o];break;case 83:case 84:this.$=a[o-4],i.addClass(a[o-2],a[o]);break;case 85:this.$=a[o-4],i.setClass(a[o-2],a[o]);break;case 86:this.$=a[o-4],i.setClickEvent(a[o-2],a[o],void 0);break;case 87:this.$=a[o-6],i.setClickEvent(a[o-4],a[o-2],a[o]);break;case 88:this.$=a[o-4],i.setLink(a[o-2],a[o],void 0);break;case 89:this.$=a[o-6],i.setLink(a[o-4],a[o-2],a[o]);break;case 90:this.$=a[o-4],i.addVertex(a[o-2],void 0,void 0,a[o]);break;case 91:case 93:this.$=a[o-4],i.updateLink(a[o-2],a[o]);break;case 92:this.$=a[o-4],i.updateLink([a[o-2]],a[o]);break;case 94:this.$=a[o-8],i.updateLinkInterpolate([a[o-6]],a[o-2]),i.updateLink([a[o-6]],a[o]);break;case 95:this.$=a[o-8],i.updateLinkInterpolate(a[o-6],a[o-2]),i.updateLink(a[o-6],a[o]);break;case 96:this.$=a[o-6],i.updateLinkInterpolate([a[o-4]],a[o]);break;case 97:this.$=a[o-6],i.updateLinkInterpolate(a[o-4],a[o]);break;case 98:case 100:this.$=[a[o]];break;case 99:case 101:a[o-2].push(a[o]),this.$=a[o-2];break;case 103:this.$=a[o-1]+a[o];break;case 125:this.$=a[o];break;case 126:this.$=a[o-1]+""+a[o];break;case 131:this.$="v";break;case 132:this.$="-"}},table:[{3:1,4:2,9:e,10:r,12:i},{1:[3]},t(n,a,{5:6}),{4:7,9:e,10:r,12:i},{4:8,9:e,10:r,12:i},{13:[1,9]},{1:[2,1],6:10,7:11,8:s,9:o,10:l,11:c,19:16,21:17,22:18,23:19,24:20,25:21,26:u,32:23,33:29,34:h,36:30,63:d,64:f,65:p,66:y,67:g,68:m,78:b,79:x,82:k,83:v,84:E,86:_,87:w,91:31,93:A,94:T,95:S,96:O,97:C,98:D},t(n,[2,9]),t(n,[2,10]),{8:[1,48],9:[1,49],10:F,14:47,17:50},t(N,[2,3]),t(N,[2,4]),t(N,[2,5]),t(N,[2,6]),t(N,[2,7]),t(N,[2,8]),{8:L,9:I,11:B,20:52,31:53,54:57,57:[1,58],58:[1,59]},{8:L,9:I,11:B,20:60},{8:L,9:I,11:B,20:61},{8:L,9:I,11:B,20:62},{8:L,9:I,11:B,20:63},{8:L,9:I,11:B,20:64},{8:L,9:I,10:[1,65],11:B,20:66},t(M,[2,41],{17:67,10:F}),{10:[1,68]},{10:[1,69]},{10:[1,70]},{10:[1,71]},{10:[1,72]},t(P,[2,42],{35:[1,73]}),t(R,[2,59],{91:84,28:[1,74],34:h,37:[1,75],39:[1,76],41:[1,77],43:[1,78],45:[1,79],47:[1,80],49:[1,81],50:[1,82],52:[1,83],68:m,78:b,79:x,82:k,83:v,84:E,86:_,87:w,93:A,94:T,95:S,96:O,97:C,98:D}),t(j,[2,125]),t(j,[2,146]),t(j,[2,147]),t(j,[2,148]),t(j,[2,149]),t(j,[2,150]),t(j,[2,151]),t(j,[2,152]),t(j,[2,153]),t(j,[2,154]),t(j,[2,155]),t(j,[2,156]),t(j,[2,157]),t(j,[2,158]),t(j,[2,159]),t(j,[2,160]),t(n,[2,11]),t(n,[2,17]),t(n,[2,18]),{9:[1,85]},t($,[2,25],{17:86,10:F}),t(N,[2,26]),{32:87,33:29,34:h,36:30,68:m,78:b,79:x,82:k,83:v,84:E,86:_,87:w,91:31,93:A,94:T,95:S,96:O,97:C,98:D},t(N,[2,35]),t(N,[2,36]),t(N,[2,37]),t(z,[2,63],{55:88,56:[1,89],59:[1,90]}),{10:Y,12:G,13:V,26:U,27:91,30:H,34:W,49:q,57:X,60:92,61:Z,62:103,63:J,64:K,65:Q,66:tt,67:et,68:rt,69:it,71:94,72:nt,78:at,79:st,82:ot,83:lt,84:ct,86:ut,87:ht,88:dt,89:ft,90:100,93:pt,94:yt,95:gt,96:mt,97:bt,98:xt},t([34,56,59,68,78,79,82,83,84,86,87,93,94,95,96,97,98],[2,65]),t(N,[2,27]),t(N,[2,28]),t(N,[2,29]),t(N,[2,30]),t(N,[2,31]),{10:Y,12:G,13:V,26:U,27:128,30:H,34:W,49:q,57:X,60:92,61:Z,62:103,63:J,64:K,65:Q,66:tt,67:et,68:rt,69:it,71:94,72:nt,78:at,79:st,82:ot,83:lt,84:ct,86:ut,87:ht,88:dt,89:ft,90:100,93:pt,94:yt,95:gt,96:mt,97:bt,98:xt},t(kt,a,{5:129}),t(M,[2,40],{34:vt}),{13:Et,34:W,68:_t,74:131,75:[1,132],78:at,79:st,82:ot,83:lt,84:wt,86:ut,87:ht,90:135,92:133,93:pt,94:yt,95:gt,96:mt,97:bt,98:xt},{72:[1,138],76:139,78:[1,140]},{13:Et,34:W,68:_t,72:[1,141],74:142,78:at,79:st,82:ot,83:lt,84:wt,86:ut,87:ht,90:135,92:133,93:pt,94:yt,95:gt,96:mt,97:bt,98:xt},{13:Et,34:W,68:_t,74:143,78:at,79:st,82:ot,83:lt,84:wt,86:ut,87:ht,90:135,92:133,93:pt,94:yt,95:gt,96:mt,97:bt,98:xt},{13:Et,34:W,68:_t,74:144,78:at,79:st,82:ot,83:lt,84:wt,86:ut,87:ht,90:135,92:133,93:pt,94:yt,95:gt,96:mt,97:bt,98:xt},{34:h,36:145,68:m,78:b,79:x,82:k,83:v,84:E,86:_,87:w,91:31,93:A,94:T,95:S,96:O,97:C,98:D},{10:Y,12:G,13:V,26:U,27:146,30:H,34:W,49:q,57:X,60:92,61:Z,62:103,63:J,64:K,65:Q,66:tt,67:et,68:rt,69:it,71:94,72:nt,78:at,79:st,82:ot,83:lt,84:ct,86:ut,87:ht,88:dt,89:ft,90:100,93:pt,94:yt,95:gt,96:mt,97:bt,98:xt},{10:Y,12:G,13:V,26:U,27:148,30:H,34:W,37:[1,147],49:q,57:X,60:92,61:Z,62:103,63:J,64:K,65:Q,66:tt,67:et,68:rt,69:it,71:94,72:nt,78:at,79:st,82:ot,83:lt,84:ct,86:ut,87:ht,88:dt,89:ft,90:100,93:pt,94:yt,95:gt,96:mt,97:bt,98:xt},{10:Y,12:G,13:V,26:U,27:149,30:H,34:W,49:q,57:X,60:92,61:Z,62:103,63:J,64:K,65:Q,66:tt,67:et,68:rt,69:it,71:94,72:nt,78:at,79:st,82:ot,83:lt,84:ct,86:ut,87:ht,88:dt,89:ft,90:100,93:pt,94:yt,95:gt,96:mt,97:bt,98:xt},{10:Y,12:G,13:V,26:U,27:150,30:H,34:W,49:q,57:X,60:92,61:Z,62:103,63:J,64:K,65:Q,66:tt,67:et,68:rt,69:it,71:94,72:nt,78:at,79:st,82:ot,83:lt,84:ct,86:ut,87:ht,88:dt,89:ft,90:100,93:pt,94:yt,95:gt,96:mt,97:bt,98:xt},{10:Y,12:G,13:V,26:U,27:151,30:H,34:W,49:q,57:X,60:92,61:Z,62:103,63:J,64:K,65:Q,66:tt,67:et,68:rt,69:it,71:94,72:nt,78:at,79:st,82:ot,83:lt,84:ct,86:ut,87:ht,88:dt,89:ft,90:100,93:pt,94:yt,95:gt,96:mt,97:bt,98:xt},{10:Y,12:G,13:V,26:U,27:152,30:H,34:W,49:q,57:X,60:92,61:Z,62:103,63:J,64:K,65:Q,66:tt,67:et,68:rt,69:it,71:94,72:nt,78:at,79:st,82:ot,83:lt,84:ct,86:ut,87:ht,88:dt,89:ft,90:100,93:pt,94:yt,95:gt,96:mt,97:bt,98:xt},{10:Y,12:G,13:V,26:U,27:153,30:H,34:W,47:[1,154],49:q,57:X,60:92,61:Z,62:103,63:J,64:K,65:Q,66:tt,67:et,68:rt,69:it,71:94,72:nt,78:at,79:st,82:ot,83:lt,84:ct,86:ut,87:ht,88:dt,89:ft,90:100,93:pt,94:yt,95:gt,96:mt,97:bt,98:xt},{10:Y,12:G,13:V,26:U,27:155,30:H,34:W,49:q,57:X,60:92,61:Z,62:103,63:J,64:K,65:Q,66:tt,67:et,68:rt,69:it,71:94,72:nt,78:at,79:st,82:ot,83:lt,84:ct,86:ut,87:ht,88:dt,89:ft,90:100,93:pt,94:yt,95:gt,96:mt,97:bt,98:xt},{10:Y,12:G,13:V,26:U,27:156,30:H,34:W,49:q,57:X,60:92,61:Z,62:103,63:J,64:K,65:Q,66:tt,67:et,68:rt,69:it,71:94,72:nt,78:at,79:st,82:ot,83:lt,84:ct,86:ut,87:ht,88:dt,89:ft,90:100,93:pt,94:yt,95:gt,96:mt,97:bt,98:xt},{10:Y,12:G,13:V,26:U,27:157,30:H,34:W,49:q,57:X,60:92,61:Z,62:103,63:J,64:K,65:Q,66:tt,67:et,68:rt,69:it,71:94,72:nt,78:at,79:st,82:ot,83:lt,84:ct,86:ut,87:ht,88:dt,89:ft,90:100,93:pt,94:yt,95:gt,96:mt,97:bt,98:xt},t(j,[2,126]),t(n,[2,19]),t($,[2,24]),t(M,[2,38],{17:158,10:F}),t(z,[2,60],{10:[1,159]}),{10:[1,160]},{10:Y,12:G,13:V,26:U,27:161,30:H,34:W,49:q,57:X,60:92,61:Z,62:103,63:J,64:K,65:Q,66:tt,67:et,68:rt,69:it,71:94,72:nt,78:at,79:st,82:ot,83:lt,84:ct,86:ut,87:ht,88:dt,89:ft,90:100,93:pt,94:yt,95:gt,96:mt,97:bt,98:xt},{10:Y,12:G,13:V,26:U,30:H,34:W,49:q,57:X,58:[1,162],60