Current section

Files

Jump to
livebook static assets blockDiagram-TCMKQVZ6-MULQO6NL.js
Raw

static/assets/blockDiagram-TCMKQVZ6-MULQO6NL.js

import{a as Ne,e as ce,h as ve,j as Ie,k as Te,l as Oe}from"./chunk-CUHU5CRX.js";import"./chunk-QMNP6MOC.js";import"./chunk-QY4OGOKK.js";import{a as De}from"./chunk-ZIY7VF5V.js";import{d as we}from"./chunk-NQ4DUWMN.js";import"./chunk-XHGORZV2.js";import{D as X,N as ye,O as Ee,S as _e,Z as le,b as Le,c as me,h,ha as q,j as y}from"./chunk-ZOEWSKT6.js";import{e as ke}from"./chunk-UEXLG4I5.js";import"./chunk-SISR4MA5.js";import"./chunk-24JW6VB3.js";import{a as H,b as G}from"./chunk-MGYUK2XN.js";var he=function(){var e=h(function(I,c,s,i){for(s=s||{},i=I.length;i--;s[I[i]]=c);return s},"o"),o=[1,7],g=[1,13],n=[1,14],d=[1,15],p=[1,19],a=[1,16],b=[1,17],l=[1,18],m=[8,30],L=[8,21,28,29,30,31,32,40,44,47],E=[1,23],D=[1,24],C=[8,15,16,21,28,29,30,31,32,40,44,47],N=[8,15,16,21,27,28,29,30,31,32,40,44,47],T=[1,49],_={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,block:31,NODE_ID:32,nodeShapeNLabel:33,dirList:34,DIR:35,NODE_DSTART:36,NODE_DEND:37,BLOCK_ARROW_START:38,BLOCK_ARROW_END:39,classDef:40,CLASSDEF_ID:41,CLASSDEF_STYLEOPTS:42,DEFAULT:43,class:44,CLASSENTITY_IDS:45,STYLECLASS:46,style:47,STYLE_ENTITY_IDS:48,STYLE_DEFINITION_DATA:49,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"block",32:"NODE_ID",35:"DIR",36:"NODE_DSTART",37:"NODE_DEND",38:"BLOCK_ARROW_START",39:"BLOCK_ARROW_END",40:"classDef",41:"CLASSDEF_ID",42:"CLASSDEF_STYLEOPTS",43:"DEFAULT",44:"class",45:"CLASSENTITY_IDS",46:"STYLECLASS",47:"style",48:"STYLE_ENTITY_IDS",49:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[34,1],[34,2],[33,3],[33,4],[23,3],[23,3],[24,3],[25,3]],performAction:h(function(c,s,i,u,S,t,v){var r=t.length-1;switch(S){case 4:u.getLogger().debug("Rule: separator (NL) ");break;case 5:u.getLogger().debug("Rule: separator (Space) ");break;case 6:u.getLogger().debug("Rule: separator (EOF) ");break;case 7:u.getLogger().debug("Rule: hierarchy: ",t[r-1]),u.setHierarchy(t[r-1]);break;case 8:u.getLogger().debug("Stop NL ");break;case 9:u.getLogger().debug("Stop EOF ");break;case 10:u.getLogger().debug("Stop NL2 ");break;case 11:u.getLogger().debug("Stop EOF2 ");break;case 12:u.getLogger().debug("Rule: statement: ",t[r]),typeof t[r].length=="number"?this.$=t[r]:this.$=[t[r]];break;case 13:u.getLogger().debug("Rule: statement #2: ",t[r-1]),this.$=[t[r-1]].concat(t[r]);break;case 14:u.getLogger().debug("Rule: link: ",t[r],c),this.$={edgeTypeStr:t[r],label:""};break;case 15:u.getLogger().debug("Rule: LABEL link: ",t[r-3],t[r-1],t[r]),this.$={edgeTypeStr:t[r],label:t[r-1]};break;case 18:let x=parseInt(t[r]),A=u.generateId();this.$={id:A,type:"space",label:"",width:x,children:[]};break;case 23:u.getLogger().debug("Rule: (nodeStatement link node) ",t[r-2],t[r-1],t[r]," typestr: ",t[r-1].edgeTypeStr);let f=u.edgeStrToEdgeData(t[r-1].edgeTypeStr);this.$=[{id:t[r-2].id,label:t[r-2].label,type:t[r-2].type,directions:t[r-2].directions},{id:t[r-2].id+"-"+t[r].id,start:t[r-2].id,end:t[r].id,label:t[r-1].label,type:"edge",directions:t[r].directions,arrowTypeEnd:f,arrowTypeStart:"arrow_open"},{id:t[r].id,label:t[r].label,type:u.typeStr2Type(t[r].typeStr),directions:t[r].directions}];break;case 24:u.getLogger().debug("Rule: nodeStatement (abc88 node size) ",t[r-1],t[r]),this.$={id:t[r-1].id,label:t[r-1].label,type:u.typeStr2Type(t[r-1].typeStr),directions:t[r-1].directions,widthInColumns:parseInt(t[r],10)};break;case 25:u.getLogger().debug("Rule: nodeStatement (node) ",t[r]),this.$={id:t[r].id,label:t[r].label,type:u.typeStr2Type(t[r].typeStr),directions:t[r].directions,widthInColumns:1};break;case 26:u.getLogger().debug("APA123",this?this:"na"),u.getLogger().debug("COLUMNS: ",t[r]),this.$={type:"column-setting",columns:t[r]==="auto"?-1:parseInt(t[r])};break;case 27:u.getLogger().debug("Rule: id-block statement : ",t[r-2],t[r-1]);let R=u.generateId();this.$=G(H({},t[r-2]),{type:"composite",children:t[r-1]});break;case 28:u.getLogger().debug("Rule: blockStatement : ",t[r-2],t[r-1],t[r]);let Y=u.generateId();this.$={id:Y,type:"composite",label:"",children:t[r-1]};break;case 29:u.getLogger().debug("Rule: node (NODE_ID separator): ",t[r]),this.$={id:t[r]};break;case 30:u.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",t[r-1],t[r]),this.$={id:t[r-1],label:t[r].label,typeStr:t[r].typeStr,directions:t[r].directions};break;case 31:u.getLogger().debug("Rule: dirList: ",t[r]),this.$=[t[r]];break;case 32:u.getLogger().debug("Rule: dirList: ",t[r-1],t[r]),this.$=[t[r-1]].concat(t[r]);break;case 33:u.getLogger().debug("Rule: nodeShapeNLabel: ",t[r-2],t[r-1],t[r]),this.$={typeStr:t[r-2]+t[r],label:t[r-1]};break;case 34:u.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",t[r-3],t[r-2]," #3:",t[r-1],t[r]),this.$={typeStr:t[r-3]+t[r],label:t[r-2],directions:t[r-1]};break;case 35:case 36:this.$={type:"classDef",id:t[r-1].trim(),css:t[r].trim()};break;case 37:this.$={type:"applyClass",id:t[r-1].trim(),styleClass:t[r].trim()};break;case 38:this.$={type:"applyStyles",id:t[r-1].trim(),stylesStr:t[r].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:g,29:n,31:d,32:p,40:a,44:b,47:l},{8:[1,20]},e(m,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:o,28:g,29:n,31:d,32:p,40:a,44:b,47:l}),e(L,[2,16],{14:22,15:E,16:D}),e(L,[2,17]),e(L,[2,18]),e(L,[2,19]),e(L,[2,20]),e(L,[2,21]),e(L,[2,22]),e(C,[2,25],{27:[1,25]}),e(L,[2,26]),{19:26,26:12,32:p},{11:27,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:g,29:n,31:d,32:p,40:a,44:b,47:l},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},e(N,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},e(m,[2,13]),{26:35,32:p},{32:[2,14]},{17:[1,36]},e(C,[2,24]),{11:37,13:4,14:22,15:E,16:D,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:g,29:n,31:d,32:p,40:a,44:b,47:l},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},e(N,[2,30]),{18:[1,43]},{18:[1,44]},e(C,[2,23]),{18:[1,45]},{30:[1,46]},e(L,[2,28]),e(L,[2,35]),e(L,[2,36]),e(L,[2,37]),e(L,[2,38]),{37:[1,47]},{34:48,35:T},{15:[1,50]},e(L,[2,27]),e(N,[2,33]),{39:[1,51]},{34:52,35:T,39:[2,31]},{32:[2,15]},e(N,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:h(function(c,s){if(s.recoverable)this.trace(c);else{var i=new Error(c);throw i.hash=s,i}},"parseError"),parse:h(function(c){var s=this,i=[0],u=[],S=[null],t=[],v=this.table,r="",x=0,A=0,f=0,R=2,Y=1,Z=t.slice.call(arguments,1),k=Object.create(this.lexer),F={yy:{}};for(var W in this.yy)Object.prototype.hasOwnProperty.call(this.yy,W)&&(F.yy[W]=this.yy[W]);k.setInput(c,F.yy),F.yy.lexer=k,F.yy.parser=this,typeof k.yylloc=="undefined"&&(k.yylloc={});var ie=k.yylloc;t.push(ie);var Je=k.options&&k.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ze(B){i.length=i.length-2*B,S.length=S.length-B,t.length=t.length-B}h(Ze,"popStack");function Se(){var B;return B=u.pop()||k.lex()||Y,typeof B!="number"&&(B instanceof Array&&(u=B,B=u.pop()),B=s.symbols_[B]||B),B}h(Se,"lex");for(var z,ae,j,K,wt,ne,U={},Q,V,xe,$;;){if(j=i[i.length-1],this.defaultActions[j]?K=this.defaultActions[j]:((z===null||typeof z=="undefined")&&(z=Se()),K=v[j]&&v[j][z]),typeof K=="undefined"||!K.length||!K[0]){var oe="";$=[];for(Q in v[j])this.terminals_[Q]&&Q>R&&$.push("'"+this.terminals_[Q]+"'");k.showPosition?oe="Parse error on line "+(x+1)+`:
`+k.showPosition()+`
Expecting `+$.join(", ")+", got '"+(this.terminals_[z]||z)+"'":oe="Parse error on line "+(x+1)+": Unexpected "+(z==Y?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(oe,{text:k.match,token:this.terminals_[z]||z,line:k.yylineno,loc:ie,expected:$})}if(K[0]instanceof Array&&K.length>1)throw new Error("Parse Error: multiple actions possible at state: "+j+", token: "+z);switch(K[0]){case 1:i.push(z),S.push(k.yytext),t.push(k.yylloc),i.push(K[1]),z=null,ae?(z=ae,ae=null):(A=k.yyleng,r=k.yytext,x=k.yylineno,ie=k.yylloc,f>0&&f--);break;case 2:if(V=this.productions_[K[1]][1],U.$=S[S.length-V],U._$={first_line:t[t.length-(V||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(V||1)].first_column,last_column:t[t.length-1].last_column},Je&&(U._$.range=[t[t.length-(V||1)].range[0],t[t.length-1].range[1]]),ne=this.performAction.apply(U,[r,A,x,F.yy,K[1],S,t].concat(Z)),typeof ne!="undefined")return ne;V&&(i=i.slice(0,-1*V*2),S=S.slice(0,-1*V),t=t.slice(0,-1*V)),i.push(this.productions_[K[1]][0]),S.push(U.$),t.push(U._$),xe=v[i[i.length-2]][i[i.length-1]],i.push(xe);break;case 3:return!0}}return!0},"parse")},P=function(){var I={EOF:1,parseError:h(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:h(function(c,s){return this.yy=s||this.yy||{},this._input=c,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},"setInput"),input:h(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var s=c.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:h(function(c){var s=c.length,i=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=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),i.length-1&&(this.yylineno-=i.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:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:h(function(c){this.unput(this.match.slice(c))},"less"),pastInput:h(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var c=this.pastInput(),s=new Array(c.length+1).join("-");return c+this.upcomingInput()+`
`+s+"^"},"showPosition"),test_match:h(function(c,s){var i,u,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))),u=c[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,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(c[0].length),this.matched+=c[0],i=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var t in S)this[t]=S[t];return!1}return!1},"test_match"),next:h(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,s,i,u;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),t=0;t<S.length;t++)if(i=this._input.match(this.rules[S[t]]),i&&(!s||i[0].length>s[0].length)){if(s=i,u=t,this.options.backtrack_lexer){if(c=this.test_match(i,S[t]),c!==!1)return c;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(c=this.test_match(s,S[u]),c!==!1?c:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:h(function(){var s=this.next();return s||this.lex()},"lex"),begin:h(function(s){this.conditionStack.push(s)},"begin"),popState:h(function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:h(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:h(function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},"topState"),pushState:h(function(s){this.begin(s)},"pushState"),stateStackSize:h(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:h(function(s,i,u,S){var t=S;switch(u){case 0:return 10;case 1:return s.getLogger().debug("Found space-block"),31;break;case 2:return s.getLogger().debug("Found nl-block"),31;break;case 3:return s.getLogger().debug("Found space-block"),29;break;case 4:s.getLogger().debug(".",i.yytext);break;case 5:s.getLogger().debug("_",i.yytext);break;case 6:return 5;case 7:return i.yytext=-1,28;break;case 8:return i.yytext=i.yytext.replace(/columns\s+/,""),s.getLogger().debug("COLUMNS (LEX)",i.yytext),28;break;case 9:this.pushState("md_string");break;case 10:return"MD_STR";case 11:this.popState();break;case 12:this.pushState("string");break;case 13:s.getLogger().debug("LEX: POPPING STR:",i.yytext),this.popState();break;case 14:return s.getLogger().debug("LEX: STR end:",i.yytext),"STR";break;case 15:return i.yytext=i.yytext.replace(/space\:/,""),s.getLogger().debug("SPACE NUM (LEX)",i.yytext),21;break;case 16:return i.yytext="1",s.getLogger().debug("COLUMNS (LEX)",i.yytext),21;break;case 17:return 43;case 18:return"LINKSTYLE";case 19:return"INTERPOLATE";case 20:return this.pushState("CLASSDEF"),40;break;case 21:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";break;case 22:return this.popState(),this.pushState("CLASSDEFID"),41;break;case 23:return this.popState(),42;break;case 24:return this.pushState("CLASS"),44;break;case 25:return this.popState(),this.pushState("CLASS_STYLE"),45;break;case 26:return this.popState(),46;break;case 27:return this.pushState("STYLE_STMNT"),47;break;case 28:return this.popState(),this.pushState("STYLE_DEFINITION"),48;break;case 29:return this.popState(),49;break;case 30:return this.pushState("acc_title"),"acc_title";break;case 31:return this.popState(),"acc_title_value";break;case 32:return this.pushState("acc_descr"),"acc_descr";break;case 33:return this.popState(),"acc_descr_value";break;case 34:this.pushState("acc_descr_multiline");break;case 35:this.popState();break;case 36:return"acc_descr_multiline_value";case 37:return 30;case 38:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";break;case 39:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";break;case 40:return this.popState(),s.getLogger().debug("Lex: ))"),"NODE_DEND";break;case 41:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";break;case 42:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";break;case 43:return this.popState(),s.getLogger().debug("Lex: (-"),"NODE_DEND";break;case 44:return this.popState(),s.getLogger().debug("Lex: -)"),"NODE_DEND";break;case 45:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";break;case 46:return this.popState(),s.getLogger().debug("Lex: ]]"),"NODE_DEND";break;case 47:return this.popState(),s.getLogger().debug("Lex: ("),"NODE_DEND";break;case 48:return this.popState(),s.getLogger().debug("Lex: ])"),"NODE_DEND";break;case 49:return this.popState(),s.getLogger().debug("Lex: /]"),"NODE_DEND";break;case 50:return this.popState(),s.getLogger().debug("Lex: /]"),"NODE_DEND";break;case 51:return this.popState(),s.getLogger().debug("Lex: )]"),"NODE_DEND";break;case 52:return this.popState(),s.getLogger().debug("Lex: )"),"NODE_DEND";break;case 53:return this.popState(),s.getLogger().debug("Lex: ]>"),"NODE_DEND";break;case 54:return this.popState(),s.getLogger().debug("Lex: ]"),"NODE_DEND";break;case 55:return s.getLogger().debug("Lexa: -)"),this.pushState("NODE"),36;break;case 56:return s.getLogger().debug("Lexa: (-"),this.pushState("NODE"),36;break;case 57:return s.getLogger().debug("Lexa: ))"),this.pushState("NODE"),36;break;case 58:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;break;case 59:return s.getLogger().debug("Lex: ((("),this.pushState("NODE"),36;break;case 60:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;break;case 61:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;break;case 62:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;break;case 63:return s.getLogger().debug("Lexc: >"),this.pushState("NODE"),36;break;case 64:return s.getLogger().debug("Lexa: (["),this.pushState("NODE"),36;break;case 65:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;break;case 66:return this.pushState("NODE"),36;break;case 67:return this.pushState("NODE"),36;break;case 68:return this.pushState("NODE"),36;break;case 69:return this.pushState("NODE"),36;break;case 70:return this.pushState("NODE"),36;break;case 71:return this.pushState("NODE"),36;break;case 72:return this.pushState("NODE"),36;break;case 73:return s.getLogger().debug("Lexa: ["),this.pushState("NODE"),36;break;case 74:return this.pushState("BLOCK_ARROW"),s.getLogger().debug("LEX ARR START"),38;break;case 75:return s.getLogger().debug("Lex: NODE_ID",i.yytext),32;break;case 76:return s.getLogger().debug("Lex: EOF",i.yytext),8;break;case 77:this.pushState("md_string");break;case 78:this.pushState("md_string");break;case 79:return"NODE_DESCR";case 80:this.popState();break;case 81:s.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 82:s.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 83:return s.getLogger().debug("LEX: NODE_DESCR:",i.yytext),"NODE_DESCR";break;case 84:s.getLogger().debug("LEX POPPING"),this.popState();break;case 85:s.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 86:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (right): dir:",i.yytext),"DIR";break;case 87:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (left):",i.yytext),"DIR";break;case 88:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (x):",i.yytext),"DIR";break;case 89:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (y):",i.yytext),"DIR";break;case 90:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (up):",i.yytext),"DIR";break;case 91:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (down):",i.yytext),"DIR";break;case 92:return i.yytext="]>",s.getLogger().debug("Lex (ARROW_DIR end):",i.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";break;case 93:return s.getLogger().debug("Lex: LINK","#"+i.yytext+"#"),15;break;case 94:return s.getLogger().debug("Lex: LINK",i.yytext),15;break;case 95:return s.getLogger().debug("Lex: LINK",i.yytext),15;break;case 96:return s.getLogger().debug("Lex: LINK",i.yytext),15;break;case 97:return s.getLogger().debug("Lex: START_LINK",i.yytext),this.pushState("LLABEL"),16;break;case 98:return s.getLogger().debug("Lex: START_LINK",i.yytext),this.pushState("LLABEL"),16;break;case 99:return s.getLogger().debug("Lex: START_LINK",i.yytext),this.pushState("LLABEL"),16;break;case 100:this.pushState("md_string");break;case 101:return s.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";break;case 102:return this.popState(),s.getLogger().debug("Lex: LINK","#"+i.yytext+"#"),15;break;case 103:return this.popState(),s.getLogger().debug("Lex: LINK",i.yytext),15;break;case 104:return this.popState(),s.getLogger().debug("Lex: LINK",i.yytext),15;break;case 105:return s.getLogger().debug("Lex: COLON",i.yytext),i.yytext=i.yytext.slice(1),27;break}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block\s+)/,/^(?:block\n+)/,/^(?:block:)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[29],inclusive:!1},STYLE_STMNT:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[23],inclusive:!1},CLASSDEF:{rules:[21,22],inclusive:!1},CLASS_STYLE:{rules:[26],inclusive:!1},CLASS:{rules:[25],inclusive:!1},LLABEL:{rules:[100,101,102,103,104],inclusive:!1},ARROW_DIR:{rules:[86,87,88,89,90,91,92],inclusive:!1},BLOCK_ARROW:{rules:[77,82,85],inclusive:!1},NODE:{rules:[38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,78,81],inclusive:!1},md_string:{rules:[10,11,79,80],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[13,14,83,84],inclusive:!1},acc_descr_multiline:{rules:[35,36],inclusive:!1},acc_descr:{rules:[33],inclusive:!1},acc_title:{rules:[31],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,12,15,16,17,18,19,20,24,27,30,32,34,37,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,93,94,95,96,97,98,99,105],inclusive:!0}}};return I}();_.lexer=P;function O(){this.yy={}}return h(O,"Parser"),O.prototype=_,_.Parser=O,new O}();he.parser=he;var Qe=he,M=new Map,ue=[],ge=new Map,ze="color",Ce="fill",$e="bgFill",Fe=",",et=le(),te=new Map,tt=h(e=>ye.sanitizeText(e,et),"sanitizeText"),st=h(function(e,o=""){let g=te.get(e);g||(g={id:e,styles:[],textStyles:[]},te.set(e,g)),o!=null&&o.split(Fe).forEach(n=>{let d=n.replace(/([^;]*);/,"$1").trim();if(RegExp(ze).exec(n)){let a=d.replace(Ce,$e).replace(ze,Ce);g.textStyles.push(a)}g.styles.push(d)})},"addStyleClass"),rt=h(function(e,o=""){let g=M.get(e);o!=null&&(g.styles=o.split(Fe))},"addStyle2Node"),it=h(function(e,o){e.split(",").forEach(function(g){let n=M.get(g);if(n===void 0){let d=g.trim();n={id:d,type:"na",children:[]},M.set(d,n)}n.classes||(n.classes=[]),n.classes.push(o)})},"setCssClass"),Ke=h((e,o)=>{var d,p,a,b;let g=e.flat(),n=[];for(let l of g){if(l.label&&(l.label=tt(l.label)),l.type==="classDef"){st(l.id,l.css);continue}if(l.type==="applyClass"){it(l.id,(d=l==null?void 0:l.styleClass)!=null?d:"");continue}if(l.type==="applyStyles"){l!=null&&l.stylesStr&&rt(l.id,l==null?void 0:l.stylesStr);continue}if(l.type==="column-setting")o.columns=(p=l.columns)!=null?p:-1;else if(l.type==="edge"){let m=((a=ge.get(l.id))!=null?a:0)+1;ge.set(l.id,m),l.id=m+"-"+l.id,ue.push(l)}else{l.label||(l.type==="composite"?l.label="":l.label=l.id);let m=M.get(l.id);if(m===void 0?M.set(l.id,l):(l.type!=="na"&&(m.type=l.type),l.label!==l.id&&(m.label=l.label)),l.children&&Ke(l.children,l),l.type==="space"){let L=(b=l.width)!=null?b:1;for(let E=0;E<L;E++){let D=ke(l);D.id=D.id+"-"+E,M.set(D.id,D),n.push(D)}}else m===void 0&&n.push(l)}}o.children=n},"populateBlockDatabase"),de=[],J={id:"root",type:"composite",children:[],columns:-1},at=h(()=>{y.debug("Clear called"),_e(),J={id:"root",type:"composite",children:[],columns:-1},M=new Map([["root",J]]),de=[],te=new Map,ue=[],ge=new Map},"clear");function Me(e){switch(y.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return y.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}h(Me,"typeStr2Type");function Ye(e){switch(y.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}h(Ye,"edgeTypeStr2Type");function We(e){switch(e.trim()){case"--x":return"arrow_cross";case"--o":return"arrow_circle";default:return"arrow_point"}}h(We,"edgeStrToEdgeData");var Ae=0,nt=h(()=>(Ae++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Ae),"generateId"),ot=h(e=>{J.children=e,Ke(e,J),de=J.children},"setHierarchy"),lt=h(e=>{let o=M.get(e);return o?o.columns?o.columns:o.children?o.children.length:-1:-1},"getColumns"),ct=h(()=>[...M.values()],"getBlocksFlat"),ht=h(()=>de||[],"getBlocks"),gt=h(()=>ue,"getEdges"),ut=h(e=>M.get(e),"getBlock"),dt=h(e=>{M.set(e.id,e)},"setBlock"),pt=h(()=>console,"getLogger"),ft=h(function(){return te},"getClasses"),bt={getConfig:h(()=>X().block,"getConfig"),typeStr2Type:Me,edgeTypeStr2Type:Ye,edgeStrToEdgeData:We,getLogger:pt,getBlocksFlat:ct,getBlocks:ht,getEdges:gt,setHierarchy:ot,getBlock:ut,setBlock:dt,getColumns:lt,getClasses:ft,clear:at,generateId:nt},St=bt,ee=h((e,o)=>{let g=me,n=g(e,"r"),d=g(e,"g"),p=g(e,"b");return Le(n,d,p,o)},"fade"),xt=h(e=>`.label {
font-family: ${e.fontFamily};
color: ${e.nodeTextColor||e.textColor};
}
.cluster-label text {
fill: ${e.titleColor};
}
.cluster-label span,p {
color: ${e.titleColor};
}
.label text,span,p {
fill: ${e.nodeTextColor||e.textColor};
color: ${e.nodeTextColor||e.textColor};
}
.node rect,
.node circle,
.node ellipse,
.node polygon,
.node path {
fill: ${e.mainBkg};
stroke: ${e.nodeBorder};
stroke-width: 1px;
}
.flowchart-label text {
text-anchor: middle;
}
// .flowchart-label .text-outer-tspan {
// text-anchor: middle;
// }
// .flowchart-label .text-inner-tspan {
// text-anchor: start;
// }
.node .label {
text-align: center;
}
.node.clickable {
cursor: pointer;
}
.arrowheadPath {
fill: ${e.arrowheadColor};
}
.edgePath .path {
stroke: ${e.lineColor};
stroke-width: 2.0px;
}
.flowchart-link {
stroke: ${e.lineColor};
fill: none;
}
.edgeLabel {
background-color: ${e.edgeLabelBackground};
rect {
opacity: 0.5;
background-color: ${e.edgeLabelBackground};
fill: ${e.edgeLabelBackground};
}
text-align: center;
}
/* For html labels only */
.labelBkg {
background-color: ${ee(e.edgeLabelBackground,.5)};
// background-color:
}
.node .cluster {
// fill: ${ee(e.mainBkg,.5)};
fill: ${ee(e.clusterBkg,.5)};
stroke: ${ee(e.clusterBorder,.2)};
box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
stroke-width: 1px;
}
.cluster text {
fill: ${e.titleColor};
}
.cluster span,p {
color: ${e.titleColor};
}
/* .cluster div {
color: ${e.titleColor};
} */
div.mermaidTooltip {
position: absolute;
text-align: center;
max-width: 200px;
padding: 2px;
font-family: ${e.fontFamily};
font-size: 12px;
background: ${e.tertiaryColor};
border: 1px solid ${e.border2};
border-radius: 2px;
pointer-events: none;
z-index: 100;
}
.flowchartTitleText {
text-anchor: middle;
font-size: 18px;
fill: ${e.textColor};
}
`,"getStyles"),Lt=xt,Re,Be,Pe,w=(Pe=(Be=(Re=le())==null?void 0:Re.block)==null?void 0:Be.padding)!=null?Pe:8;function Ve(e,o){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(o<0||!Number.isInteger(o))throw new Error("Position must be a non-negative integer."+o);if(e<0)return{px:o,py:0};if(e===1)return{px:0,py:o};let g=o%e,n=Math.floor(o/e);return{px:g,py:n}}h(Ve,"calculateBlockPosition");var mt=h(e=>{var n,d;let o=0,g=0;for(let p of e.children){let{width:a,height:b,x:l,y:m}=(n=p.size)!=null?n:{width:0,height:0,x:0,y:0};y.debug("getMaxChildSize abc95 child:",p.id,"width:",a,"height:",b,"x:",l,"y:",m,p.type),p.type!=="space"&&(a>o&&(o=a/((d=e.widthInColumns)!=null?d:1)),b>g&&(g=b))}return{width:o,height:g}},"getMaxChildSize");function se(e,o,g=0,n=0){var a,b,l,m,L,E,D,C,N,T,_,P,O,I,c;y.debug("setBlockSizes abc95 (start)",e.id,(a=e==null?void 0:e.size)==null?void 0:a.x,"block width =",e==null?void 0:e.size,"sieblingWidth",g),(b=e==null?void 0:e.size)!=null&&b.width||(e.size={width:g,height:n,x:0,y:0});let d=0,p=0;if(((l=e.children)==null?void 0:l.length)>0){for(let x of e.children)se(x,o);let s=mt(e);d=s.width,p=s.height,y.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",d,p);for(let x of e.children)x.size&&(y.debug(`abc95 Setting size of children of ${e.id} id=${x.id} ${d} ${p} ${JSON.stringify(x.size)}`),x.size.width=d*((m=x.widthInColumns)!=null?m:1)+w*(((L=x.widthInColumns)!=null?L:1)-1),x.size.height=p,x.size.x=0,x.size.y=0,y.debug(`abc95 updating size of ${e.id} children child:${x.id} maxWidth:${d} maxHeight:${p}`));for(let x of e.children)se(x,o,d,p);let i=(E=e.columns)!=null?E:-1,u=0;for(let x of e.children)u+=(D=x.widthInColumns)!=null?D:1;let S=e.children.length;i>0&&i<u&&(S=i);let t=Math.ceil(u/S),v=S*(d+w)+w,r=t*(p+w)+w;if(v<g){y.debug(`Detected to small siebling: abc95 ${e.id} sieblingWidth ${g} sieblingHeight ${n} width ${v}`),v=g,r=n;let x=(g-S*w-w)/S,A=(n-t*w-w)/t;y.debug("Size indata abc88",e.id,"childWidth",x,"maxWidth",d),y.debug("Size indata abc88",e.id,"childHeight",A,"maxHeight",p),y.debug("Size indata abc88 xSize",S,"padding",w);for(let f of e.children)f.size&&(f.size.width=x,f.size.height=A,f.size.x=0,f.size.y=0)}if(y.debug(`abc95 (finale calc) ${e.id} xSize ${S} ySize ${t} columns ${i}${e.children.length} width=${Math.max(v,((C=e.size)==null?void 0:C.width)||0)}`),v<(((N=e==null?void 0:e.size)==null?void 0:N.width)||0)){v=((T=e==null?void 0:e.size)==null?void 0:T.width)||0;let x=i>0?Math.min(e.children.length,i):e.children.length;if(x>0){let A=(v-x*w-w)/x;y.debug("abc95 (growing to fit) width",e.id,v,(_=e.size)==null?void 0:_.width,A);for(let f of e.children)f.size&&(f.size.width=A)}}e.size={width:v,height:r,x:0,y:0}}y.debug("setBlockSizes abc94 (done)",e.id,(P=e==null?void 0:e.size)==null?void 0:P.x,(O=e==null?void 0:e.size)==null?void 0:O.width,(I=e==null?void 0:e.size)==null?void 0:I.y,(c=e==null?void 0:e.size)==null?void 0:c.height)}h(se,"setBlockSizes");function pe(e,o){var n,d,p,a,b,l,m,L,E,D,C,N,T,_,P,O,I,c,s,i,u,S;y.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(n=e==null?void 0:e.size)==null?void 0:n.x} y: ${(d=e==null?void 0:e.size)==null?void 0:d.y} width: ${(p=e==null?void 0:e.size)==null?void 0:p.width}`);let g=(a=e.columns)!=null?a:-1;if(y.debug("layoutBlocks columns abc95",e.id,"=>",g,e),e.children&&e.children.length>0){let t=(m=(l=(b=e==null?void 0:e.children[0])==null?void 0:b.size)==null?void 0:l.width)!=null?m:0,v=e.children.length*t+(e.children.length-1)*w;y.debug("widthOfChildren 88",v,"posX");let r=0;y.debug("abc91 block?.size?.x",e.id,(L=e==null?void 0:e.size)==null?void 0:L.x);let x=(E=e==null?void 0:e.size)!=null&&E.x?((D=e==null?void 0:e.size)==null?void 0:D.x)+(-((C=e==null?void 0:e.size)==null?void 0:C.width)/2||0):-w,A=0;for(let f of e.children){let R=e;if(!f.size)continue;let{width:Y,height:Z}=f.size,{px:k,py:F}=Ve(g,r);if(F!=A&&(A=F,x=(N=e==null?void 0:e.size)!=null&&N.x?((T=e==null?void 0:e.size)==null?void 0:T.x)+(-((_=e==null?void 0:e.size)==null?void 0:_.width)/2||0):-w,y.debug("New row in layout for block",e.id," and child ",f.id,A)),y.debug(`abc89 layout blocks (child) id: ${f.id} Pos: ${r} (px, py) ${k},${F} (${(P=R==null?void 0:R.size)==null?void 0:P.x},${(O=R==null?void 0:R.size)==null?void 0:O.y}) parent: ${R.id} width: ${Y}${w}`),R.size){let W=Y/2;f.size.x=x+w+W,y.debug(`abc91 layout blocks (calc) px, pyid:${f.id} startingPos=X${x} new startingPosX${f.size.x} ${W} padding=${w} width=${Y} halfWidth=${W} => x:${f.size.x} y:${f.size.y} ${f.widthInColumns} (width * (child?.w || 1)) / 2 ${Y*((I=f==null?void 0:f.widthInColumns)!=null?I:1)/2}`),x=f.size.x+W,f.size.y=R.size.y-R.size.height/2+F*(Z+w)+Z/2+w,y.debug(`abc88 layout blocks (calc) px, pyid:${f.id}startingPosX${x}${w}${W}=>x:${f.size.x}y:${f.size.y}${f.widthInColumns}(width * (child?.w || 1)) / 2${Y*((c=f==null?void 0:f.widthInColumns)!=null?c:1)/2}`)}f.children&&pe(f,o),r+=(s=f==null?void 0:f.widthInColumns)!=null?s:1,y.debug("abc88 columnsPos",f,r)}}y.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${(i=e==null?void 0:e.size)==null?void 0:i.x} y: ${(u=e==null?void 0:e.size)==null?void 0:u.y} width: ${(S=e==null?void 0:e.size)==null?void 0:S.width}`)}h(pe,"layoutBlocks");function fe(e,{minX:o,minY:g,maxX:n,maxY:d}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){let{x:p,y:a,width:b,height:l}=e.size;p-b/2<o&&(o=p-b/2),a-l/2<g&&(g=a-l/2),p+b/2>n&&(n=p+b/2),a+l/2>d&&(d=a+l/2)}if(e.children)for(let p of e.children)({minX:o,minY:g,maxX:n,maxY:d}=fe(p,{minX:o,minY:g,maxX:n,maxY:d}));return{minX:o,minY:g,maxX:n,maxY:d}}h(fe,"findBounds");function je(e){let o=e.getBlock("root");if(!o)return;se(o,e,0,0),pe(o,e),y.debug("getBlocks",JSON.stringify(o,null,2));let{minX:g,minY:n,maxX:d,maxY:p}=fe(o),a=p-n,b=d-g;return{x:g,y:n,width:b,height:a}}h(je,"layout");function be(e,o,g=!1){var D,C,N,T,_,P,O;let n=e,d="default";(((D=n==null?void 0:n.classes)==null?void 0:D.length)||0)>0&&(d=((C=n==null?void 0:n.classes)!=null?C:[]).join(" ")),d=d+" flowchart-label";let p=0,a="",b;switch(n.type){case"round":p=5,a="rect";break;case"composite":p=0,a="composite",b=0;break;case"square":a="rect";break;case"diamond":a="question";break;case"hexagon":a="hexagon";break;case"block_arrow":a="block_arrow";break;case"odd":a="rect_left_inv_arrow";break;case"lean_right":a="lean_right";break;case"lean_left":a="lean_left";break;case"trapezoid":a="trapezoid";break;case"inv_trapezoid":a="inv_trapezoid";break;case"rect_left_inv_arrow":a="rect_left_inv_arrow";break;case"circle":a="circle";break;case"ellipse":a="ellipse";break;case"stadium":a="stadium";break;case"subroutine":a="subroutine";break;case"cylinder":a="cylinder";break;case"group":a="rect";break;case"doublecircle":a="doublecircle";break;default:a="rect"}let l=we((N=n==null?void 0:n.styles)!=null?N:[]),m=n.label,L=(T=n.size)!=null?T:{width:0,height:0,x:0,y:0};return{labelStyle:l.labelStyle,shape:a,labelText:m,rx:p,ry:p,class:d,style:l.style,id:n.id,directions:n.directions,width:L.width,height:L.height,x:L.x,y:L.y,positioned:g,intersect:void 0,type:n.type,padding:(O=b!=null?b:(P=(_=X())==null?void 0:_.block)==null?void 0:P.padding)!=null?O:0}}h(be,"getNodeFromBlock");async function Ue(e,o,g){let n=be(o,g,!1);if(n.type==="group")return;let d=X(),p=await ce(e,n,{config:d}),a=p.node().getBBox(),b=g.getBlock(n.id);b.size={width:a.width,height:a.height,x:0,y:0,node:p},g.setBlock(b),p.remove()}h(Ue,"calculateBlockSize");async function Xe(e,o,g){let n=be(o,g,!0);if(g.getBlock(n.id).type!=="space"){let p=X();await ce(e,n,{config:p}),o.intersect=n==null?void 0:n.intersect,ve(n)}}h(Xe,"insertBlockPositioned");async function re(e,o,g,n){for(let d of o)await n(e,d,g),d.children&&await re(e,d.children,g,n)}h(re,"performOperations");async function He(e,o,g){await re(e,o,g,Ue)}h(He,"calculateBlockSizes");async function Ge(e,o,g){await re(e,o,g,Xe)}h(Ge,"insertBlocks");async function qe(e,o,g,n,d){let p=new De({multigraph:!0,compound:!0});p.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(let a of g)a.size&&p.setNode(a.id,{width:a.size.width,height:a.size.height,intersect:a.intersect});for(let a of o)if(a.start&&a.end){let b=n.getBlock(a.start),l=n.getBlock(a.end);if(b!=null&&b.size&&(l!=null&&l.size)){let m=b.size,L=l.size,E=[{x:m.x,y:m.y},{x:m.x+(L.x-m.x)/2,y:m.y+(L.y-m.y)/2},{x:L.x,y:L.y}];Oe(e,{v:a.start,w:a.end,name:a.id},G(H({},a),{arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:E,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),void 0,"block",p,d),a.label&&(await Ie(e,G(H({},a),{label:a.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:a.arrowTypeEnd,arrowTypeStart:a.arrowTypeStart,points:E,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"})),Te(G(H({},a),{x:E[1].x,y:E[1].y}),{originalPath:E}))}}}h(qe,"insertEdges");var yt=h(function(e,o){return o.db.getClasses()},"getClasses"),Et=h(async function(e,o,g,n){let{securityLevel:d,block:p}=X(),a=n.db,b;d==="sandbox"&&(b=q("#i"+o));let l=d==="sandbox"?q(b.nodes()[0].contentDocument.body):q("body"),m=d==="sandbox"?l.select(`[id="${o}"]`):q(`[id="${o}"]`);Ne(m,["point","circle","cross"],n.type,o);let E=a.getBlocks(),D=a.getBlocksFlat(),C=a.getEdges(),N=m.insert("g").attr("class","block");await He(N,E,a);let T=je(a);if(await Ge(N,E,a),await qe(N,C,D,a,o),T){let _=T,P=Math.max(1,Math.round(.125*(_.width/_.height))),O=_.height+P+10,I=_.width+10,{useMaxWidth:c}=p;Ee(m,O,I,!!c),y.debug("Here Bounds",T,_),m.attr("viewBox",`${_.x-5} ${_.y-5} ${_.width+10} ${_.height+10}`)}},"draw"),_t={draw:Et,getClasses:yt},At={parser:Qe,db:St,renderer:_t,styles:Lt};export{At as diagram};