mermaid/dist/mermaid.slim.min.js
knsv 472310fbef Support for class definitions for nodes
Support multiple edges from one node to another
2014-11-22 15:34:21 +01:00

1 line
22 KiB
JavaScript

!function t(e,n,r){function s(a,o){if(!n[a]){if(!e[a]){var c="function"==typeof require&&require;if(!o&&c)return c(a,!0);if(i)return i(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 s(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)s(r[a]);return s}({1:[function(){},{}],2:[function(t,e,n){(function(t){function e(t,e){for(var n=0,r=t.length-1;r>=0;r--){var s=t[r];"."===s?t.splice(r,1):".."===s?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r<t.length;r++)e(t[r],r,t)&&n.push(t[r]);return n}var s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(t){return s.exec(t).slice(1)};n.resolve=function(){for(var n="",s=!1,i=arguments.length-1;i>=-1&&!s;i--){var a=i>=0?arguments[i]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(n=a+"/"+n,s="/"===a.charAt(0))}return n=e(r(n.split("/"),function(t){return!!t}),!s).join("/"),(s?"/":"")+n||"."},n.normalize=function(t){var s=n.isAbsolute(t),i="/"===a(t,-1);return t=e(r(t.split("/"),function(t){return!!t}),!s).join("/"),t||s||(t="."),t&&i&&(t+="/"),(s?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(r(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 r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var n=t.length-1;n>=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 s=r(t.split("/")),i=r(e.split("/")),a=Math.min(s.length,i.length),o=a,c=0;a>c;c++)if(s[c]!==i[c]){o=c;break}for(var l=[],c=o;c<s.length;c++)l.push("..");return l=l.concat(i.slice(o)),l.join("/")},n.sep="/",n.delimiter=":",n.dirname=function(t){var e=i(t),n=e[0],r=e[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},n.basename=function(t,e){var n=i(t)[2];return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},n.extname=function(t){return i(t)[3]};var a="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return 0>e&&(e=t.length+e),t.substr(e,n)}}).call(this,t("1YiZ5S"))},{"1YiZ5S":3}],3:[function(t,e){function n(){}var r=e.exports={};r.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 r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],4:[function(t,e,n){(function(e){var r=t("./graphDb"),s=t("./parser/flow"),a=function(t,e){var n=Object.keys(t),s=function(t,e){var n;for(n=0;n<e.length;n++)"undefined"!=typeof e[n]&&(t=t+e[n]+";");return t};n.forEach(function(n){var i,a,o=t[n],c="",l=r.getClasses();for(a=0;a<o.classes.length;a++)c=s(c,l[o.classes[a]].styles);c=s(c,o.styles),i=void 0===o.text?o.id:o.text,"round"===o.type?e.setNode(o.id,{label:i,rx:5,ry:5,style:c}):"diamond"===o.type?e.setNode(o.id,{shape:"question",label:i,rx:0,ry:0,style:c}):e.setNode(o.id,{label:i,rx:0,ry:0,style:c})})},o=function(t,e){var n=0;t.forEach(function(t){n++,aHead="arrow_open"===t.type?"none":"vee","undefined"==typeof t.text?"undefined"==typeof t.style?e.setEdge(t.start,t.end,{arrowheadStyle:"fill: #333",arrowhead:aHead},n):e.setEdge(t.start,t.end,{style:t.style,arrowheadStyle:"fill: #333",arrowhead:aHead},n):"undefined"==typeof t.style?(console.log("Edge with Text no style: "+t.text),e.setEdge(t.start,t.end,{label:t.text,arrowheadStyle:"fill: #33f",arrowhead:aHead},n)):e.setEdge(t.start,t.end,{style:t.style,arrowheadStyle:"fill: #333",label:t.text,arrowhead:aHead},n)})},c=function(t,e){r.clear(),s.parser.yy=r,s.parser.parse(t);var n;n=r.getDirection(),"undefined"==typeof n&&(n="TD");var i=new dagreD3.graphlib.Graph({multigraph:!0}).setGraph({rankdir:n,marginx:20,marginy:20}).setDefaultEdgeLabel(function(){return{}}),c=r.getVertices(),l=r.getEdges();a(c,i),o(l,i);var h=new dagreD3.render;h.shapes().question=function(t,e,n){var r=e.width,s=3*e.height,i=[{x:r/2,y:0},{x:r,y:-s/2},{x:r/2,y:-s},{x:0,y:-s/2}];return shapeSvg=t.insert("polygon",":first-child").attr("points",i.map(function(t){return t.x+","+t.y}).join(" ")).style("fill","#fff").style("stroke","#333").attr("rx",5).attr("ry",5).attr("transform","translate("+-r/2+","+2*s/4+")"),n.intersect=function(t){return dagreD3.intersect.polygon(n,i,t)},shapeSvg},h.arrows().none=function(t,e,n,r){var s=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),i=s.append("path").attr("d","M 0 0 L 0 0 L 0 0 z");dagreD3.util.applyStyle(i,n[r+"Style"])};var u=d3.select("#"+e);svgGroup=d3.select("#"+e+" g"),h(d3.select("#"+e+" g"),i);(u.attr("width")-i.graph().width)/2;u.attr("height",i.graph().height+40)},l=function(){console.log("Mermaid v"+n.version()+" starting");var t=document.querySelectorAll(".mermaid"),e=0;for(i=0;i<t.length;i++){var r,s=t[i];r="mermaidChart"+e,e++;var a=s.textContent.trim();s.innerHTML='<svg id="'+r+'" width="100%"><g /></svg>',c(a,r)}};n.version=function(){return"0.2.1"};var h=function(t,e){return"undefined"!=typeof e?!1:t===e};document.addEventListener("DOMContentLoaded",function(){"undefined"!=typeof mermaid_config?h(!0,mermaid_config.startOnLoad)&&l():l()},!1),e.mermaid={init:function(){l()},version:function(){return n.version()}}}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./graphDb":5,"./parser/flow":6}],5:[function(t,e,n){var r,s={},i=[],a=[];n.addVertex=function(t,e,n,r){"undefined"==typeof s[t]&&(s[t]={id:t,styles:[],classes:[]}),"undefined"!=typeof e&&(s[t].text=e),"undefined"!=typeof n&&(s[t].type=n),"undefined"!=typeof n&&(s[t].type=n),"undefined"!=typeof r&&null!==r&&r.forEach(function(e){s[t].styles.push(e)})},n.addLink=function(t,e,n,r){var s={start:t,end:e,type:void 0,text:""},r=n.text;"undefined"!=typeof r&&(s.text=r),"undefined"!=typeof n&&(s.type=n.type),i.push(s)},n.updateLink=function(t,e){var n=t.substr(1);i[n].style=e},n.addClass=function(t,e){"undefined"==typeof a[t]&&(a[t]={id:t,styles:[]}),"undefined"!=typeof e&&null!==e&&e.forEach(function(e){console.log("Adding style"+e),a[t].styles.push(e)})},n.setDirection=function(t){r=t},n.setClass=function(t,e){console.log("Got id:"+t),t.indexOf(",")>0?t.split(",").forEach(function(t){"undefined"!=typeof s[t]&&s[t].classes.push(e)}):"undefined"!=typeof s[t]&&s[t].classes.push(e)},n.getDirection=function(){return r},n.getVertices=function(){return s},n.getEdges=function(){return i},n.getClasses=function(){return a},n.clear=function(){s={},a={},i=[]},n.defaultStyle=function(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}},{}],6:[function(t,e,n){(function(r){var s=function(){function t(){this.yy={}}var e=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},n=[1,7],r=[2,12],s=[1,19],i=[1,20],a=[1,21],o=[1,22],c=[1,23],l=[1,24],h=[1,25],u=[1,26],f=[1,27],y=[1,28],d=[1,14],p=[1,15],g=[1,13],m=[6,9],_=[11,29,30,31,32,33,34,35,36,37,38,39,47,49,50],v=[2,7],b=[11,42,43,44,45],k=[9,11,20,22,23,24,25,26,42,43,44,45,46],x=[9,11,20,22,23,24,25,26,30,31,32,33,34,35,36,37,38,39,42,43,44,45,46],S=[9,11,20,22,23,24,25,26,29,30,31,32,33,34,35,36,37,38,39,42,43,44,45,46],w=[30,31,32,33,34,35,36,37,38,39],E=[30,31,32,33,34,35,36,37,38,39,46],A=[22,24,26,46],L=[1,87],O=[1,84],I=[1,82],T=[1,85],$=[1,83],P=[1,88],D=[1,86],R=[1,94],N=[11,33],C=[9,11,29,30,31,32,33,51,54],M={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,vertex:17,link:18,alphaNum:19,SQS:20,text:21,SQE:22,PS:23,PE:24,DIAMOND_START:25,DIAMOND_STOP:26,alphaNumStatement:27,alphaNumToken:28,MINUS:29,ALPHA:30,NUM:31,COLON:32,COMMA:33,PLUS:34,EQUALS:35,MULT:36,DOT:37,TAGSTART:38,TAGEND:39,linkStatement:40,arrowText:41,ARROW_POINT:42,ARROW_CIRCLE:43,ARROW_CROSS:44,ARROW_OPEN:45,PIPE:46,CLASSDEF:47,stylesOpt:48,CLASS:49,STYLE:50,HEX:51,style:52,styleComponent:53,UNIT:54,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",8:"GRAPH",9:"SPACE",10:"DIR",11:"SEMI",20:"SQS",22:"SQE",23:"PS",24:"PE",25:"DIAMOND_START",26:"DIAMOND_STOP",29:"MINUS",30:"ALPHA",31:"NUM",32:"COLON",33:"COMMA",34:"PLUS",35:"EQUALS",36:"MULT",37:"DOT",38:"TAGSTART",39:"TAGEND",42:"ARROW_POINT",43:"ARROW_CIRCLE",44:"ARROW_CROSS",45:"ARROW_OPEN",46:"PIPE",47:"CLASSDEF",49:"CLASS",50:"STYLE",51:"HEX",54:"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],[13,0],[13,3],[13,1],[17,4],[17,4],[17,4],[17,1],[19,1],[19,2],[27,1],[27,3],[28,1],[28,1],[28,1],[28,1],[28,1],[28,1],[28,1],[28,1],[28,1],[28,1],[18,2],[18,1],[40,1],[40,1],[40,1],[40,1],[41,3],[21,3],[21,5],[21,1],[15,5],[16,5],[14,5],[14,5],[48,1],[48,3],[52,1],[52,2],[53,1],[53,1],[53,1],[53,1],[53,1],[53,1],[53,1]],performAction:function(t,e,n,r,s,i){var a=i.length-1;switch(s){case 2:this.$=i[a-3];break;case 3:r.setDirection(i[a-1]),this.$=i[a-1];break;case 13:r.addLink(i[a-2],i[a],i[a-1]),this.$="oy";break;case 14:this.$="yo";break;case 15:this.$=i[a-3],r.addVertex(i[a-3],i[a-1],"square");break;case 16:this.$=i[a-3],r.addVertex(i[a-3],i[a-1],"round");break;case 17:this.$=i[a-3],r.addVertex(i[a-3],i[a-1],"diamond");break;case 18:this.$=i[a],r.addVertex(i[a]);break;case 19:case 21:case 23:case 24:case 49:this.$=i[a];break;case 20:this.$=i[a-1]+""+i[a];break;case 22:this.$=i[a-2]+"-"+i[a];break;case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 34:case 42:this.$=i[a];break;case 33:i[a-1].text=i[a],this.$=i[a-1];break;case 35:this.$={type:"arrow"};break;case 36:this.$={type:"arrow_circle"};break;case 37:this.$={type:"arrow_cross"};break;case 38:this.$={type:"arrow_open"};break;case 39:this.$=i[a-1];break;case 40:this.$=i[a-2]+" "+i[a];break;case 41:this.$=i[a-4]+" - "+i[a];break;case 43:this.$=i[a-4],r.addClass(i[a-2],i[a]);break;case 44:this.$=i[a-4],r.setClass(i[a-2],i[a]);break;case 45:this.$=i[a-4],r.addVertex(i[a-2],void 0,void 0,i[a]);break;case 46:this.$=i[a-4],r.updateLink(i[a-2],i[a]);break;case 47:this.$=[i[a]];break;case 48:i[a-2].push(i[a]),this.$=i[a-2];break;case 50:this.$=i[a-1]+i[a];break;case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.$=i[a]}},table:[{3:1,4:2,8:[1,3]},{1:[3]},{5:4,7:5,9:n,11:r,12:6,13:8,14:9,15:10,16:11,17:12,19:16,27:17,28:18,30:s,31:i,32:a,33:o,34:c,35:l,36:h,37:u,38:f,39:y,47:d,49:p,50:g},{9:[1,29]},{6:[1,30],7:31,9:n},{5:32,11:r,12:6,13:8,14:9,15:10,16:11,17:12,19:16,27:17,28:18,30:s,31:i,32:a,33:o,34:c,35:l,36:h,37:u,38:f,39:y,47:d,49:p,50:g},e(m,[2,5]),e(_,v,{7:33,9:n}),{11:[1,34]},{11:[1,35]},{11:[1,36]},{11:[1,37]},{11:[2,14],18:38,40:39,42:[1,40],43:[1,41],44:[1,42],45:[1,43]},{9:[1,44]},{9:[1,45]},{9:[1,46]},e(b,[2,18],{20:[1,47],23:[1,48],25:[1,49]}),e(k,[2,19],{27:17,28:18,19:50,30:s,31:i,32:a,33:o,34:c,35:l,36:h,37:u,38:f,39:y}),e(x,[2,21],{29:[1,51]}),e(S,[2,23]),e(S,[2,24]),e(S,[2,25]),e(S,[2,26]),e(S,[2,27]),e(S,[2,28]),e(S,[2,29]),e(S,[2,30]),e(S,[2,31]),e(S,[2,32]),{10:[1,52]},{1:[2,1]},{11:r,12:53,13:8,14:9,15:10,16:11,17:12,19:16,27:17,28:18,30:s,31:i,32:a,33:o,34:c,35:l,36:h,37:u,38:f,39:y,47:d,49:p,50:g},{6:[1,54],7:31,9:n},e(_,[2,6]),e(m,[2,8]),e(m,[2,9]),e(m,[2,10]),e(m,[2,11]),{17:55,19:16,27:17,28:18,30:s,31:i,32:a,33:o,34:c,35:l,36:h,37:u,38:f,39:y},e(w,[2,34],{41:56,46:[1,57]}),e(E,[2,35]),e(E,[2,36]),e(E,[2,37]),e(E,[2,38]),{19:58,27:17,28:18,30:s,31:i,32:a,33:o,34:c,35:l,36:h,37:u,38:f,39:y,51:[1,59]},{19:60,27:17,28:18,30:s,31:i,32:a,33:o,34:c,35:l,36:h,37:u,38:f,39:y},{19:61,27:17,28:18,30:s,31:i,32:a,33:o,34:c,35:l,36:h,37:u,38:f,39:y},{19:63,21:62,27:17,28:18,30:s,31:i,32:a,33:o,34:c,35:l,36:h,37:u,38:f,39:y},{19:63,21:64,27:17,28:18,30:s,31:i,32:a,33:o,34:c,35:l,36:h,37:u,38:f,39:y},{19:63,21:65,27:17,28:18,30:s,31:i,32:a,33:o,34:c,35:l,36:h,37:u,38:f,39:y},e(k,[2,20]),{28:66,30:s,31:i,32:a,33:o,34:c,35:l,36:h,37:u,38:f,39:y},{11:[1,67]},e(m,[2,4]),{1:[2,2]},{11:[2,13]},e(w,[2,33]),{19:63,21:68,27:17,28:18,30:s,31:i,32:a,33:o,34:c,35:l,36:h,37:u,38:f,39:y},{9:[1,69]},{9:[1,70]},{9:[1,71]},{9:[1,72]},{22:[1,73]},e(A,[2,42],{7:75,9:[1,74]}),{24:[1,76]},{26:[1,77]},e(x,[2,22]),e([9,11,30,31,32,33,34,35,36,37,38,39,47,49,50],[2,3]),{46:[1,78]},{9:L,29:O,30:I,31:T,32:$,48:79,51:P,52:80,53:81,54:D},{9:L,29:O,30:I,31:T,32:$,48:89,51:P,52:80,53:81,54:D},{9:L,29:O,30:I,31:T,32:$,48:90,51:P,52:80,53:81,54:D},{19:91,27:17,28:18,30:s,31:i,32:a,33:o,34:c,35:l,36:h,37:u,38:f,39:y},e(b,[2,15]),{7:33,9:n,19:63,21:92,27:17,28:18,29:v,30:s,31:i,32:a,33:o,34:c,35:l,36:h,37:u,38:f,39:y},{29:[1,93]},e(b,[2,16]),e(b,[2,17]),e(w,[2,39]),{11:[2,45],33:R},e(N,[2,47],{53:95,9:L,29:O,30:I,31:T,32:$,51:P,54:D}),e(C,[2,49]),e(C,[2,51]),e(C,[2,52]),e(C,[2,53]),e(C,[2,54]),e(C,[2,55]),e(C,[2,56]),e(C,[2,57]),{11:[2,46],33:R},{11:[2,43],33:R},{11:[2,44]},e(A,[2,40]),{7:96,9:n},{9:L,29:O,30:I,31:T,32:$,51:P,52:97,53:81,54:D},e(C,[2,50]),{19:63,21:98,27:17,28:18,30:s,31:i,32:a,33:o,34:c,35:l,36:h,37:u,38:f,39:y},e(N,[2,48],{53:95,9:L,29:O,30:I,31:T,32:$,51:P,54:D}),e(A,[2,41])],defaultActions:{30:[2,1],54:[2,2],55:[2,13],91:[2,44]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){function e(){var t;return t=d.lex()||f,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,r=[0],s=[null],i=[],a=this.table,o="",c=0,l=0,h=0,u=2,f=1,y=i.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,"undefined"==typeof d.yylloc&&(d.yylloc={});var m=d.yylloc;i.push(m);var _=d.options&&d.options.ranges;this.parseError="function"==typeof p.yy.parseError?p.yy.parseError:Object.getPrototypeOf(this).parseError;for(var v,b,k,x,S,w,E,A,L,O={};;){if(k=r[r.length-1],this.defaultActions[k]?x=this.defaultActions[k]:((null===v||"undefined"==typeof v)&&(v=e()),x=a[k]&&a[k][v]),"undefined"==typeof x||!x.length||!x[0]){var I="";L=[];for(w in a[k])this.terminals_[w]&&w>u&&L.push("'"+this.terminals_[w]+"'");I=d.showPosition?"Parse error on line "+(c+1)+":\n"+d.showPosition()+"\nExpecting "+L.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(c+1)+": Unexpected "+(v==f?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(I,{text:d.match,token:this.terminals_[v]||v,line:d.yylineno,loc:m,expected:L})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+v);switch(x[0]){case 1:r.push(v),s.push(d.yytext),i.push(d.yylloc),r.push(x[1]),v=null,b?(v=b,b=null):(l=d.yyleng,o=d.yytext,c=d.yylineno,m=d.yylloc,h>0&&h--);break;case 2:if(E=this.productions_[x[1]][1],O.$=s[s.length-E],O._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},_&&(O._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),S=this.performAction.apply(O,[o,l,c,p.yy,x[1],s,i].concat(y)),"undefined"!=typeof S)return S;E&&(r=r.slice(0,-1*E*2),s=s.slice(0,-1*E),i=i.slice(0,-1*E)),r.push(this.productions_[x[1]][0]),s.push(O.$),i.push(O._$),A=a[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0}},U=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 r=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 s=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===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[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,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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 i in s)this[i]=s[i];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,n,r;this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),i=0;i<s.length;i++)if(n=this._input.match(this.rules[s[i]]),n&&(!e||n[0].length>e[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(t=this.test_match(n,s[i]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,s[r]),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,r){switch(n){case 0:return 50;case 1:return 47;case 2:return 49;case 3:return 8;case 4:return 10;case 5:return 10;case 6:return 51;case 7:return 31;case 8:return"BRKT";case 9:return 54;case 10:return 54;case 11:return 54;case 12:return 32;case 13:return 11;case 14:return 33;case 15:return 35;case 16:return 36;case 17:return 37;case 18:return 38;case 19:return 39;case 20:return 44;case 21:return 42;case 22:return 43;case 23:return 45;case 24:return 29;case 25:return 34;case 26:return 35;case 27:return 30;case 28:return 46;case 29:return 23;case 30:return 24;case 31:return 20;case 32:return 22;case 33:return 25;case 34:return 26;case 35:return 9;case 36:return"NEWLINE";case 37:return 6}},rules:[/^(?:style\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:graph\b)/,/^(?:LR\b)/,/^(?:TD\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],inclusive:!0}}};return t}();return M.lexer=U,t.prototype=M,M.Parser=t,new t}();"undefined"!=typeof t&&"undefined"!=typeof n&&(n.parser=s,n.Parser=s.Parser,n.parse=function(){return s.parse.apply(s,arguments)},n.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),r.exit(1));var s=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return n.parser.parse(s)},"undefined"!=typeof e&&t.main===e&&n.main(r.argv.slice(1)))}).call(this,t("1YiZ5S"))},{"1YiZ5S":3,fs:1,path:2}]},{},[4]);