UNPKG

vitepress-mermaid-preview

Version:

Mermaid preview for vitepress

123 lines 73.3 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const te=require("./chunk-E2GYISFI-CdFqj7nU.cjs"),n=require("./component-EjRj2lD0.cjs"),ee=require("./clone-DVddR9sG.cjs"),re=require("./graph-aKvBWkWV.cjs"),ae=require("./channel-BPIRB1PL.cjs");var ht=function(){var e=n.__name(function(E,y,d,f){for(d=d||{},f=E.length;f--;d[E[f]]=y);return d},"o"),t=[1,7],s=[1,13],l=[1,14],i=[1,15],a=[1,19],r=[1,16],c=[1,17],o=[1,18],u=[8,30],g=[8,21,28,29,30,31,32,40,44,47],x=[1,23],m=[1,24],b=[8,15,16,21,28,29,30,31,32,40,44,47],w=[8,15,16,21,27,28,29,30,31,32,40,44,47],v=[1,49],L={trace:n.__name(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:n.__name(function(y,d,f,_,S,h,A){var p=h.length-1;switch(S){case 4:_.getLogger().debug("Rule: separator (NL) ");break;case 5:_.getLogger().debug("Rule: separator (Space) ");break;case 6:_.getLogger().debug("Rule: separator (EOF) ");break;case 7:_.getLogger().debug("Rule: hierarchy: ",h[p-1]),_.setHierarchy(h[p-1]);break;case 8:_.getLogger().debug("Stop NL ");break;case 9:_.getLogger().debug("Stop EOF ");break;case 10:_.getLogger().debug("Stop NL2 ");break;case 11:_.getLogger().debug("Stop EOF2 ");break;case 12:_.getLogger().debug("Rule: statement: ",h[p]),typeof h[p].length=="number"?this.$=h[p]:this.$=[h[p]];break;case 13:_.getLogger().debug("Rule: statement #2: ",h[p-1]),this.$=[h[p-1]].concat(h[p]);break;case 14:_.getLogger().debug("Rule: link: ",h[p],y),this.$={edgeTypeStr:h[p],label:""};break;case 15:_.getLogger().debug("Rule: LABEL link: ",h[p-3],h[p-1],h[p]),this.$={edgeTypeStr:h[p],label:h[p-1]};break;case 18:const B=parseInt(h[p]),U=_.generateId();this.$={id:U,type:"space",label:"",width:B,children:[]};break;case 23:_.getLogger().debug("Rule: (nodeStatement link node) ",h[p-2],h[p-1],h[p]," typestr: ",h[p-1].edgeTypeStr);const K=_.edgeStrToEdgeData(h[p-1].edgeTypeStr);this.$=[{id:h[p-2].id,label:h[p-2].label,type:h[p-2].type,directions:h[p-2].directions},{id:h[p-2].id+"-"+h[p].id,start:h[p-2].id,end:h[p].id,label:h[p-1].label,type:"edge",directions:h[p].directions,arrowTypeEnd:K,arrowTypeStart:"arrow_open"},{id:h[p].id,label:h[p].label,type:_.typeStr2Type(h[p].typeStr),directions:h[p].directions}];break;case 24:_.getLogger().debug("Rule: nodeStatement (abc88 node size) ",h[p-1],h[p]),this.$={id:h[p-1].id,label:h[p-1].label,type:_.typeStr2Type(h[p-1].typeStr),directions:h[p-1].directions,widthInColumns:parseInt(h[p],10)};break;case 25:_.getLogger().debug("Rule: nodeStatement (node) ",h[p]),this.$={id:h[p].id,label:h[p].label,type:_.typeStr2Type(h[p].typeStr),directions:h[p].directions,widthInColumns:1};break;case 26:_.getLogger().debug("APA123",this?this:"na"),_.getLogger().debug("COLUMNS: ",h[p]),this.$={type:"column-setting",columns:h[p]==="auto"?-1:parseInt(h[p])};break;case 27:_.getLogger().debug("Rule: id-block statement : ",h[p-2],h[p-1]),_.generateId(),this.$={...h[p-2],type:"composite",children:h[p-1]};break;case 28:_.getLogger().debug("Rule: blockStatement : ",h[p-2],h[p-1],h[p]);const J=_.generateId();this.$={id:J,type:"composite",label:"",children:h[p-1]};break;case 29:_.getLogger().debug("Rule: node (NODE_ID separator): ",h[p]),this.$={id:h[p]};break;case 30:_.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",h[p-1],h[p]),this.$={id:h[p-1],label:h[p].label,typeStr:h[p].typeStr,directions:h[p].directions};break;case 31:_.getLogger().debug("Rule: dirList: ",h[p]),this.$=[h[p]];break;case 32:_.getLogger().debug("Rule: dirList: ",h[p-1],h[p]),this.$=[h[p-1]].concat(h[p]);break;case 33:_.getLogger().debug("Rule: nodeShapeNLabel: ",h[p-2],h[p-1],h[p]),this.$={typeStr:h[p-2]+h[p],label:h[p-1]};break;case 34:_.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",h[p-3],h[p-2]," #3:",h[p-1],h[p]),this.$={typeStr:h[p-3]+h[p],label:h[p-2],directions:h[p-1]};break;case 35:case 36:this.$={type:"classDef",id:h[p-1].trim(),css:h[p].trim()};break;case 37:this.$={type:"applyClass",id:h[p-1].trim(),styleClass:h[p].trim()};break;case 38:this.$={type:"applyStyles",id:h[p-1].trim(),stylesStr:h[p].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:t,22:8,23:9,24:10,25:11,26:12,28:s,29:l,31:i,32:a,40:r,44:c,47:o},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:t,28:s,29:l,31:i,32:a,40:r,44:c,47:o}),e(g,[2,16],{14:22,15:x,16:m}),e(g,[2,17]),e(g,[2,18]),e(g,[2,19]),e(g,[2,20]),e(g,[2,21]),e(g,[2,22]),e(b,[2,25],{27:[1,25]}),e(g,[2,26]),{19:26,26:12,32:a},{11:27,13:4,19:5,20:6,21:t,22:8,23:9,24:10,25:11,26:12,28:s,29:l,31:i,32:a,40:r,44:c,47:o},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},e(w,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,32:a},{32:[2,14]},{17:[1,36]},e(b,[2,24]),{11:37,13:4,14:22,15:x,16:m,19:5,20:6,21:t,22:8,23:9,24:10,25:11,26:12,28:s,29:l,31:i,32:a,40:r,44:c,47:o},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},e(w,[2,30]),{18:[1,43]},{18:[1,44]},e(b,[2,23]),{18:[1,45]},{30:[1,46]},e(g,[2,28]),e(g,[2,35]),e(g,[2,36]),e(g,[2,37]),e(g,[2,38]),{37:[1,47]},{34:48,35:v},{15:[1,50]},e(g,[2,27]),e(w,[2,33]),{39:[1,51]},{34:52,35:v,39:[2,31]},{32:[2,15]},e(w,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:n.__name(function(y,d){if(d.recoverable)this.trace(y);else{var f=new Error(y);throw f.hash=d,f}},"parseError"),parse:n.__name(function(y){var d=this,f=[0],_=[],S=[null],h=[],A=this.table,p="",B=0,U=0,K=2,J=1,Jt=h.slice.call(arguments,1),I=Object.create(this.lexer),j={yy:{}};for(var nt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,nt)&&(j.yy[nt]=this.yy[nt]);I.setInput(y,j.yy),j.yy.lexer=I,j.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var lt=I.yylloc;h.push(lt);var Qt=I.options&&I.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function $t(M){f.length=f.length-2*M,S.length=S.length-M,h.length=h.length-M}n.__name($t,"popStack");function _t(){var M;return M=_.pop()||I.lex()||J,typeof M!="number"&&(M instanceof Array&&(_=M,M=_.pop()),M=d.symbols_[M]||M),M}n.__name(_t,"lex");for(var z,V,W,ct,q={},Q,X,wt,$;;){if(V=f[f.length-1],this.defaultActions[V]?W=this.defaultActions[V]:((z===null||typeof z>"u")&&(z=_t()),W=A[V]&&A[V][z]),typeof W>"u"||!W.length||!W[0]){var ot="";$=[];for(Q in A[V])this.terminals_[Q]&&Q>K&&$.push("'"+this.terminals_[Q]+"'");I.showPosition?ot="Parse error on line "+(B+1)+`:
`+I.showPosition()+`
Expecting `+$.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ot="Parse error on line "+(B+1)+": Unexpected "+(z==J?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(ot,{text:I.match,token:this.terminals_[z]||z,line:I.yylineno,loc:lt,expected:$})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+z);switch(W[0]){case 1:f.push(z),S.push(I.yytext),h.push(I.yylloc),f.push(W[1]),z=null,U=I.yyleng,p=I.yytext,B=I.yylineno,lt=I.yylloc;break;case 2:if(X=this.productions_[W[1]][1],q.$=S[S.length-X],q._$={first_line:h[h.length-(X||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(X||1)].first_column,last_column:h[h.length-1].last_column},Qt&&(q._$.range=[h[h.length-(X||1)].range[0],h[h.length-1].range[1]]),ct=this.performAction.apply(q,[p,U,B,j.yy,W[1],S,h].concat(Jt)),typeof ct<"u")return ct;X&&(f=f.slice(0,-1*X*2),S=S.slice(0,-1*X),h=h.slice(0,-1*X)),f.push(this.productions_[W[1]][0]),S.push(q.$),h.push(q._$),wt=A[f[f.length-2]][f[f.length-1]],f.push(wt);break;case 3:return!0}}return!0},"parse")},T=function(){var E={EOF:1,parseError:n.__name(function(d,f){if(this.yy.parser)this.yy.parser.parseError(d,f);else throw new Error(d)},"parseError"),setInput:n.__name(function(y,d){return this.yy=d||this.yy||{},this._input=y,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:n.__name(function(){var y=this._input[0];this.yytext+=y,this.yyleng++,this.offset++,this.match+=y,this.matched+=y;var d=y.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),y},"input"),unput:n.__name(function(y){var d=y.length,f=y.split(/(?:\r\n?|\n)/g);this._input=y+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var _=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),f.length-1&&(this.yylineno-=f.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:f?(f.length===_.length?this.yylloc.first_column:0)+_[_.length-f.length].length-f[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:n.__name(function(){return this._more=!0,this},"more"),reject:n.__name(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:n.__name(function(y){this.unput(this.match.slice(y))},"less"),pastInput:n.__name(function(){var y=this.matched.substr(0,this.matched.length-this.match.length);return(y.length>20?"...":"")+y.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n.__name(function(){var y=this.match;return y.length<20&&(y+=this._input.substr(0,20-y.length)),(y.substr(0,20)+(y.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n.__name(function(){var y=this.pastInput(),d=new Array(y.length+1).join("-");return y+this.upcomingInput()+`
`+d+"^"},"showPosition"),test_match:n.__name(function(y,d){var f,_,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))),_=y[0].match(/(?:\r\n?|\n).*/g),_&&(this.yylineno+=_.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:_?_[_.length-1].length-_[_.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+y[0].length},this.yytext+=y[0],this.match+=y[0],this.matches=y,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(y[0].length),this.matched+=y[0],f=this.performAction.call(this,this.yy,this,d,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)return f;if(this._backtrack){for(var h in S)this[h]=S[h];return!1}return!1},"test_match"),next:n.__name(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var y,d,f,_;this._more||(this.yytext="",this.match="");for(var S=this._currentRules(),h=0;h<S.length;h++)if(f=this._input.match(this.rules[S[h]]),f&&(!d||f[0].length>d[0].length)){if(d=f,_=h,this.options.backtrack_lexer){if(y=this.test_match(f,S[h]),y!==!1)return y;if(this._backtrack){d=!1;continue}else return!1}else if(!this.options.flex)break}return d?(y=this.test_match(d,S[_]),y!==!1?y:!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:n.__name(function(){var d=this.next();return d||this.lex()},"lex"),begin:n.__name(function(d){this.conditionStack.push(d)},"begin"),popState:n.__name(function(){var d=this.conditionStack.length-1;return d>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:n.__name(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:n.__name(function(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:n.__name(function(d){this.begin(d)},"pushState"),stateStackSize:n.__name(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:n.__name(function(d,f,_,S){switch(_){case 0:return 10;case 1:return d.getLogger().debug("Found space-block"),31;case 2:return d.getLogger().debug("Found nl-block"),31;case 3:return d.getLogger().debug("Found space-block"),29;case 4:d.getLogger().debug(".",f.yytext);break;case 5:d.getLogger().debug("_",f.yytext);break;case 6:return 5;case 7:return f.yytext=-1,28;case 8:return f.yytext=f.yytext.replace(/columns\s+/,""),d.getLogger().debug("COLUMNS (LEX)",f.yytext),28;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:d.getLogger().debug("LEX: POPPING STR:",f.yytext),this.popState();break;case 14:return d.getLogger().debug("LEX: STR end:",f.yytext),"STR";case 15:return f.yytext=f.yytext.replace(/space\:/,""),d.getLogger().debug("SPACE NUM (LEX)",f.yytext),21;case 16:return f.yytext="1",d.getLogger().debug("COLUMNS (LEX)",f.yytext),21;case 17:return 43;case 18:return"LINKSTYLE";case 19:return"INTERPOLATE";case 20:return this.pushState("CLASSDEF"),40;case 21:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 22:return this.popState(),this.pushState("CLASSDEFID"),41;case 23:return this.popState(),42;case 24:return this.pushState("CLASS"),44;case 25:return this.popState(),this.pushState("CLASS_STYLE"),45;case 26:return this.popState(),46;case 27:return this.pushState("STYLE_STMNT"),47;case 28:return this.popState(),this.pushState("STYLE_DEFINITION"),48;case 29:return this.popState(),49;case 30:return this.pushState("acc_title"),"acc_title";case 31:return this.popState(),"acc_title_value";case 32:return this.pushState("acc_descr"),"acc_descr";case 33:return this.popState(),"acc_descr_value";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(),d.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),d.getLogger().debug("Lex: (("),"NODE_DEND";case 40:return this.popState(),d.getLogger().debug("Lex: ))"),"NODE_DEND";case 41:return this.popState(),d.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),d.getLogger().debug("Lex: (("),"NODE_DEND";case 43:return this.popState(),d.getLogger().debug("Lex: (-"),"NODE_DEND";case 44:return this.popState(),d.getLogger().debug("Lex: -)"),"NODE_DEND";case 45:return this.popState(),d.getLogger().debug("Lex: (("),"NODE_DEND";case 46:return this.popState(),d.getLogger().debug("Lex: ]]"),"NODE_DEND";case 47:return this.popState(),d.getLogger().debug("Lex: ("),"NODE_DEND";case 48:return this.popState(),d.getLogger().debug("Lex: ])"),"NODE_DEND";case 49:return this.popState(),d.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),d.getLogger().debug("Lex: /]"),"NODE_DEND";case 51:return this.popState(),d.getLogger().debug("Lex: )]"),"NODE_DEND";case 52:return this.popState(),d.getLogger().debug("Lex: )"),"NODE_DEND";case 53:return this.popState(),d.getLogger().debug("Lex: ]>"),"NODE_DEND";case 54:return this.popState(),d.getLogger().debug("Lex: ]"),"NODE_DEND";case 55:return d.getLogger().debug("Lexa: -)"),this.pushState("NODE"),36;case 56:return d.getLogger().debug("Lexa: (-"),this.pushState("NODE"),36;case 57:return d.getLogger().debug("Lexa: ))"),this.pushState("NODE"),36;case 58:return d.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 59:return d.getLogger().debug("Lex: ((("),this.pushState("NODE"),36;case 60:return d.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 61:return d.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 62:return d.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 63:return d.getLogger().debug("Lexc: >"),this.pushState("NODE"),36;case 64:return d.getLogger().debug("Lexa: (["),this.pushState("NODE"),36;case 65:return d.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 66:return this.pushState("NODE"),36;case 67:return this.pushState("NODE"),36;case 68:return this.pushState("NODE"),36;case 69:return this.pushState("NODE"),36;case 70:return this.pushState("NODE"),36;case 71:return this.pushState("NODE"),36;case 72:return this.pushState("NODE"),36;case 73:return d.getLogger().debug("Lexa: ["),this.pushState("NODE"),36;case 74:return this.pushState("BLOCK_ARROW"),d.getLogger().debug("LEX ARR START"),38;case 75:return d.getLogger().debug("Lex: NODE_ID",f.yytext),32;case 76:return d.getLogger().debug("Lex: EOF",f.yytext),8;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:d.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 82:d.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 83:return d.getLogger().debug("LEX: NODE_DESCR:",f.yytext),"NODE_DESCR";case 84:d.getLogger().debug("LEX POPPING"),this.popState();break;case 85:d.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 86:return f.yytext=f.yytext.replace(/^,\s*/,""),d.getLogger().debug("Lex (right): dir:",f.yytext),"DIR";case 87:return f.yytext=f.yytext.replace(/^,\s*/,""),d.getLogger().debug("Lex (left):",f.yytext),"DIR";case 88:return f.yytext=f.yytext.replace(/^,\s*/,""),d.getLogger().debug("Lex (x):",f.yytext),"DIR";case 89:return f.yytext=f.yytext.replace(/^,\s*/,""),d.getLogger().debug("Lex (y):",f.yytext),"DIR";case 90:return f.yytext=f.yytext.replace(/^,\s*/,""),d.getLogger().debug("Lex (up):",f.yytext),"DIR";case 91:return f.yytext=f.yytext.replace(/^,\s*/,""),d.getLogger().debug("Lex (down):",f.yytext),"DIR";case 92:return f.yytext="]>",d.getLogger().debug("Lex (ARROW_DIR end):",f.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 93:return d.getLogger().debug("Lex: LINK","#"+f.yytext+"#"),15;case 94:return d.getLogger().debug("Lex: LINK",f.yytext),15;case 95:return d.getLogger().debug("Lex: LINK",f.yytext),15;case 96:return d.getLogger().debug("Lex: LINK",f.yytext),15;case 97:return d.getLogger().debug("Lex: START_LINK",f.yytext),this.pushState("LLABEL"),16;case 98:return d.getLogger().debug("Lex: START_LINK",f.yytext),this.pushState("LLABEL"),16;case 99:return d.getLogger().debug("Lex: START_LINK",f.yytext),this.pushState("LLABEL"),16;case 100:this.pushState("md_string");break;case 101:return d.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 102:return this.popState(),d.getLogger().debug("Lex: LINK","#"+f.yytext+"#"),15;case 103:return this.popState(),d.getLogger().debug("Lex: LINK",f.yytext),15;case 104:return this.popState(),d.getLogger().debug("Lex: LINK",f.yytext),15;case 105:return d.getLogger().debug("Lex: COLON",f.yytext),f.yytext=f.yytext.slice(1),27}},"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 E}();L.lexer=T;function k(){this.yy={}}return n.__name(k,"Parser"),k.prototype=L,L.Parser=k,new k}();ht.parser=ht;var se=ht,Y=new Map,ft=[],gt=new Map,Lt="color",St="fill",ie="bgFill",Bt=",",ne=n.getConfig2(),rt=new Map,le=n.__name(e=>n.common_default.sanitizeText(e,ne),"sanitizeText"),ce=n.__name(function(e,t=""){let s=rt.get(e);s||(s={id:e,styles:[],textStyles:[]},rt.set(e,s)),t?.split(Bt).forEach(l=>{const i=l.replace(/([^;]*);/,"$1").trim();if(RegExp(Lt).exec(l)){const r=i.replace(St,ie).replace(Lt,St);s.textStyles.push(r)}s.styles.push(i)})},"addStyleClass"),oe=n.__name(function(e,t=""){const s=Y.get(e);t!=null&&(s.styles=t.split(Bt))},"addStyle2Node"),he=n.__name(function(e,t){e.split(",").forEach(function(s){let l=Y.get(s);if(l===void 0){const i=s.trim();l={id:i,type:"na",children:[]},Y.set(i,l)}l.classes||(l.classes=[]),l.classes.push(t)})},"setCssClass"),It=n.__name((e,t)=>{const s=e.flat(),l=[];for(const i of s){if(i.label&&(i.label=le(i.label)),i.type==="classDef"){ce(i.id,i.css);continue}if(i.type==="applyClass"){he(i.id,i?.styleClass??"");continue}if(i.type==="applyStyles"){i?.stylesStr&&oe(i.id,i?.stylesStr);continue}if(i.type==="column-setting")t.columns=i.columns??-1;else if(i.type==="edge"){const a=(gt.get(i.id)??0)+1;gt.set(i.id,a),i.id=a+"-"+i.id,ft.push(i)}else{i.label||(i.type==="composite"?i.label="":i.label=i.id);const a=Y.get(i.id);if(a===void 0?Y.set(i.id,i):(i.type!=="na"&&(a.type=i.type),i.label!==i.id&&(a.label=i.label)),i.children&&It(i.children,i),i.type==="space"){const r=i.width??1;for(let c=0;c<r;c++){const o=ee.clone(i);o.id=o.id+"-"+c,Y.set(o.id,o),l.push(o)}}else a===void 0&&l.push(i)}}t.children=l},"populateBlockDatabase"),xt=[],Z={id:"root",type:"composite",children:[],columns:-1},ge=n.__name(()=>{n.log.debug("Clear called"),n.clear(),Z={id:"root",type:"composite",children:[],columns:-1},Y=new Map([["root",Z]]),xt=[],rt=new Map,ft=[],gt=new Map},"clear");function Ot(e){switch(n.log.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return n.log.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"}}n.__name(Ot,"typeStr2Type");function Rt(e){switch(n.log.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}n.__name(Rt,"edgeTypeStr2Type");function zt(e){switch(e.trim()){case"--x":return"arrow_cross";case"--o":return"arrow_circle";default:return"arrow_point"}}n.__name(zt,"edgeStrToEdgeData");var vt=0,de=n.__name(()=>(vt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+vt),"generateId"),ue=n.__name(e=>{Z.children=e,It(e,Z),xt=Z.children},"setHierarchy"),pe=n.__name(e=>{const t=Y.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),fe=n.__name(()=>[...Y.values()],"getBlocksFlat"),xe=n.__name(()=>xt||[],"getBlocks"),ye=n.__name(()=>ft,"getEdges"),be=n.__name(e=>Y.get(e),"getBlock"),me=n.__name(e=>{Y.set(e.id,e)},"setBlock"),_e=n.__name(()=>n.log,"getLogger"),we=n.__name(function(){return rt},"getClasses"),Le={getConfig:n.__name(()=>n.getConfig().block,"getConfig"),typeStr2Type:Ot,edgeTypeStr2Type:Rt,edgeStrToEdgeData:zt,getLogger:_e,getBlocksFlat:fe,getBlocks:xe,getEdges:ye,setHierarchy:ue,getBlock:be,setBlock:me,getColumns:pe,getClasses:we,clear:ge,generateId:de},Se=Le,tt=n.__name((e,t)=>{const s=ae.channel,l=s(e,"r"),i=s(e,"g"),a=s(e,"b");return n.rgba(l,i,a,t)},"fade"),ve=n.__name(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: ${tt(e.edgeLabelBackground,.5)};
    // background-color:
  }

  .node .cluster {
    // fill: ${tt(e.mainBkg,.5)};
    fill: ${tt(e.clusterBkg,.5)};
    stroke: ${tt(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};
  }
  ${te.getIconStyles()}
`,"getStyles"),ke=ve,Ee=n.__name((e,t,s,l)=>{t.forEach(i=>{Ae[i](e,s,l)})},"insertMarkers"),De=n.__name((e,t,s)=>{n.log.trace("Making markers for ",s),e.append("defs").append("marker").attr("id",s+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",s+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Ce=n.__name((e,t,s)=>{e.append("defs").append("marker").attr("id",s+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",s+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Te=n.__name((e,t,s)=>{e.append("defs").append("marker").attr("id",s+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",s+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Ne=n.__name((e,t,s)=>{e.append("defs").append("marker").attr("id",s+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",s+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),Be=n.__name((e,t,s)=>{e.append("defs").append("marker").attr("id",s+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",s+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Ie=n.__name((e,t,s)=>{e.append("marker").attr("id",s+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",s+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Oe=n.__name((e,t,s)=>{e.append("marker").attr("id",s+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",s+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),Re=n.__name((e,t,s)=>{e.append("marker").attr("id",s+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",s+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),ze=n.__name((e,t,s)=>{e.append("defs").append("marker").attr("id",s+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Ae={extension:De,composition:Ce,aggregation:Te,dependency:Ne,lollipop:Be,point:Ie,circle:Oe,cross:Re,barb:ze},Me=Ee,N=n.getConfig2()?.block?.padding??8;function At(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(e===1)return{px:0,py:t};const s=t%e,l=Math.floor(t/e);return{px:s,py:l}}n.__name(At,"calculateBlockPosition");var Fe=n.__name(e=>{let t=0,s=0;for(const l of e.children){const{width:i,height:a,x:r,y:c}=l.size??{width:0,height:0,x:0,y:0};n.log.debug("getMaxChildSize abc95 child:",l.id,"width:",i,"height:",a,"x:",r,"y:",c,l.type),l.type!=="space"&&(i>t&&(t=i/(e.widthInColumns??1)),a>s&&(s=a))}return{width:t,height:s}},"getMaxChildSize");function at(e,t,s=0,l=0){n.log.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",s),e?.size?.width||(e.size={width:s,height:l,x:0,y:0});let i=0,a=0;if(e.children?.length>0){for(const b of e.children)at(b,t);const r=Fe(e);i=r.width,a=r.height,n.log.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",i,a);for(const b of e.children)b.size&&(n.log.debug(`abc95 Setting size of children of ${e.id} id=${b.id} ${i} ${a} ${JSON.stringify(b.size)}`),b.size.width=i*(b.widthInColumns??1)+N*((b.widthInColumns??1)-1),b.size.height=a,b.size.x=0,b.size.y=0,n.log.debug(`abc95 updating size of ${e.id} children child:${b.id} maxWidth:${i} maxHeight:${a}`));for(const b of e.children)at(b,t,i,a);const c=e.columns??-1;let o=0;for(const b of e.children)o+=b.widthInColumns??1;let u=e.children.length;c>0&&c<o&&(u=c);const g=Math.ceil(o/u);let x=u*(i+N)+N,m=g*(a+N)+N;if(x<s){n.log.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${s} siblingHeight ${l} width ${x}`),x=s,m=l;const b=(s-u*N-N)/u,w=(l-g*N-N)/g;n.log.debug("Size indata abc88",e.id,"childWidth",b,"maxWidth",i),n.log.debug("Size indata abc88",e.id,"childHeight",w,"maxHeight",a),n.log.debug("Size indata abc88 xSize",u,"padding",N);for(const v of e.children)v.size&&(v.size.width=b,v.size.height=w,v.size.x=0,v.size.y=0)}if(n.log.debug(`abc95 (finale calc) ${e.id} xSize ${u} ySize ${g} columns ${c}${e.children.length} width=${Math.max(x,e.size?.width||0)}`),x<(e?.size?.width||0)){x=e?.size?.width||0;const b=c>0?Math.min(e.children.length,c):e.children.length;if(b>0){const w=(x-b*N-N)/b;n.log.debug("abc95 (growing to fit) width",e.id,x,e.size?.width,w);for(const v of e.children)v.size&&(v.size.width=w)}}e.size={width:x,height:m,x:0,y:0}}n.log.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}n.__name(at,"setBlockSizes");function yt(e,t){n.log.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const s=e.columns??-1;if(n.log.debug("layoutBlocks columns abc95",e.id,"=>",s,e),e.children&&e.children.length>0){const l=e?.children[0]?.size?.width??0,i=e.children.length*l+(e.children.length-1)*N;n.log.debug("widthOfChildren 88",i,"posX");let a=0;n.log.debug("abc91 block?.size?.x",e.id,e?.size?.x);let r=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-N,c=0;for(const o of e.children){const u=e;if(!o.size)continue;const{width:g,height:x}=o.size,{px:m,py:b}=At(s,a);if(b!=c&&(c=b,r=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-N,n.log.debug("New row in layout for block",e.id," and child ",o.id,c)),n.log.debug(`abc89 layout blocks (child) id: ${o.id} Pos: ${a} (px, py) ${m},${b} (${u?.size?.x},${u?.size?.y}) parent: ${u.id} width: ${g}${N}`),u.size){const w=g/2;o.size.x=r+N+w,n.log.debug(`abc91 layout blocks (calc) px, pyid:${o.id} startingPos=X${r} new startingPosX${o.size.x} ${w} padding=${N} width=${g} halfWidth=${w} => x:${o.size.x} y:${o.size.y} ${o.widthInColumns} (width * (child?.w || 1)) / 2 ${g*(o?.widthInColumns??1)/2}`),r=o.size.x+w,o.size.y=u.size.y-u.size.height/2+b*(x+N)+x/2+N,n.log.debug(`abc88 layout blocks (calc) px, pyid:${o.id}startingPosX${r}${N}${w}=>x:${o.size.x}y:${o.size.y}${o.widthInColumns}(width * (child?.w || 1)) / 2${g*(o?.widthInColumns??1)/2}`)}o.children&&yt(o),a+=o?.widthInColumns??1,n.log.debug("abc88 columnsPos",o,a)}}n.log.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}n.__name(yt,"layoutBlocks");function bt(e,{minX:t,minY:s,maxX:l,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:a,y:r,width:c,height:o}=e.size;a-c/2<t&&(t=a-c/2),r-o/2<s&&(s=r-o/2),a+c/2>l&&(l=a+c/2),r+o/2>i&&(i=r+o/2)}if(e.children)for(const a of e.children)({minX:t,minY:s,maxX:l,maxY:i}=bt(a,{minX:t,minY:s,maxX:l,maxY:i}));return{minX:t,minY:s,maxX:l,maxY:i}}n.__name(bt,"findBounds");function Mt(e){const t=e.getBlock("root");if(!t)return;at(t,e,0,0),yt(t),n.log.debug("getBlocks",JSON.stringify(t,null,2));const{minX:s,minY:l,maxX:i,maxY:a}=bt(t),r=a-l,c=i-s;return{x:s,y:l,width:c,height:r}}n.__name(Mt,"layout");function dt(e,t){t&&e.attr("style",t)}n.__name(dt,"applyStyle");function Ft(e){const t=n.select(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),s=t.append("xhtml:div"),l=e.label,i=e.isNode?"nodeLabel":"edgeLabel",a=s.append("span");return a.html(l),dt(a,e.labelStyle),a.attr("class",i),dt(s,e.labelStyle),s.style("display","inline-block"),s.style("white-space","nowrap"),s.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}n.__name(Ft,"addHtmlLabel");var We=n.__name(async(e,t,s,l)=>{let i=e||"";if(typeof i=="object"&&(i=i[0]),n.evaluate(n.getConfig2().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g,"<br />"),n.log.debug("vertexText"+i);const a=await n.replaceIconSubstring(n.decodeEntities(i)),r={isNode:l,label:a,labelStyle:t.replace("fill:","color:")};return Ft(r)}else{const a=document.createElementNS("http://www.w3.org/2000/svg","text");a.setAttribute("style",t.replace("color:","fill:"));let r=[];typeof i=="string"?r=i.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(i)?r=i:r=[];for(const c of r){const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),s?o.setAttribute("class","title-row"):o.setAttribute("class","row"),o.textContent=c.trim(),a.appendChild(o)}return a}},"createLabel"),P=We,Pe=n.__name((e,t,s,l,i)=>{t.arrowTypeStart&&kt(e,"start",t.arrowTypeStart,s,l,i),t.arrowTypeEnd&&kt(e,"end",t.arrowTypeEnd,s,l,i)},"addEdgeMarkers"),Ye={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},kt=n.__name((e,t,s,l,i,a)=>{const r=Ye[s];if(!r){n.log.warn(`Unknown arrow type: ${s}`);return}const c=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${l}#${i}_${a}-${r}${c})`)},"addEdgeMarker"),ut={},R={},He=n.__name(async(e,t)=>{const s=n.getConfig2(),l=n.evaluate(s.flowchart.htmlLabels),i=t.labelType==="markdown"?n.createText(e,t.label,{style:t.labelStyle,useHtmlLabels:l,addSvgBackground:!0},s):await P(t.label,t.labelStyle),a=e.insert("g").attr("class","edgeLabel"),r=a.insert("g").attr("class","label");r.node().appendChild(i);let c=i.getBBox();if(l){const u=i.children[0],g=n.select(i);c=u.getBoundingClientRect(),g.attr("width",c.width),g.attr("height",c.height)}r.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),ut[t.id]=a,t.width=c.width,t.height=c.height;let o;if(t.startLabelLeft){const u=await P(t.startLabelLeft,t.labelStyle),g=e.insert("g").attr("class","edgeTerminals"),x=g.insert("g").attr("class","inner");o=x.node().appendChild(u);const m=u.getBBox();x.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),R[t.id]||(R[t.id]={}),R[t.id].startLeft=g,G(o,t.startLabelLeft)}if(t.startLabelRight){const u=await P(t.startLabelRight,t.labelStyle),g=e.insert("g").attr("class","edgeTerminals"),x=g.insert("g").attr("class","inner");o=g.node().appendChild(u),x.node().appendChild(u);const m=u.getBBox();x.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),R[t.id]||(R[t.id]={}),R[t.id].startRight=g,G(o,t.startLabelRight)}if(t.endLabelLeft){const u=await P(t.endLabelLeft,t.labelStyle),g=e.insert("g").attr("class","edgeTerminals"),x=g.insert("g").attr("class","inner");o=x.node().appendChild(u);const m=u.getBBox();x.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),g.node().appendChild(u),R[t.id]||(R[t.id]={}),R[t.id].endLeft=g,G(o,t.endLabelLeft)}if(t.endLabelRight){const u=await P(t.endLabelRight,t.labelStyle),g=e.insert("g").attr("class","edgeTerminals"),x=g.insert("g").attr("class","inner");o=x.node().appendChild(u);const m=u.getBBox();x.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),g.node().appendChild(u),R[t.id]||(R[t.id]={}),R[t.id].endRight=g,G(o,t.endLabelRight)}return i},"insertEdgeLabel");function G(e,t){n.getConfig2().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}n.__name(G,"setTerminalWidth");var Ke=n.__name((e,t)=>{n.log.debug("Moving label abc88 ",e.id,e.label,ut[e.id],t);let s=t.updatedPath?t.updatedPath:t.originalPath;const l=n.getConfig2(),{subGraphTitleTotalMargin:i}=n.getSubGraphTitleMargins(l);if(e.label){const a=ut[e.id];let r=e.x,c=e.y;if(s){const o=n.utils_default.calcLabelPosition(s);n.log.debug("Moving label "+e.label+" from (",r,",",c,") to (",o.x,",",o.y,") abc88"),t.updatedPath&&(r=o.x,c=o.y)}a.attr("transform",`translate(${r}, ${c+i/2})`)}if(e.startLabelLeft){const a=R[e.id].startLeft;let r=e.x,c=e.y;if(s){const o=n.utils_default.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",s);r=o.x,c=o.y}a.attr("transform",`translate(${r}, ${c})`)}if(e.startLabelRight){const a=R[e.id].startRight;let r=e.x,c=e.y;if(s){const o=n.utils_default.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",s);r=o.x,c=o.y}a.attr("transform",`translate(${r}, ${c})`)}if(e.endLabelLeft){const a=R[e.id].endLeft;let r=e.x,c=e.y;if(s){const o=n.utils_default.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",s);r=o.x,c=o.y}a.attr("transform",`translate(${r}, ${c})`)}if(e.endLabelRight){const a=R[e.id].endRight;let r=e.x,c=e.y;if(s){const o=n.utils_default.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",s);r=o.x,c=o.y}a.attr("transform",`translate(${r}, ${c})`)}},"positionEdgeLabel"),Xe=n.__name((e,t)=>{const s=e.x,l=e.y,i=Math.abs(t.x-s),a=Math.abs(t.y-l),r=e.width/2,c=e.height/2;return i>=r||a>=c},"outsideNode"),Ue=n.__name((e,t,s)=>{n.log.debug(`intersection calc abc89:
  outsidePoint: ${JSON.stringify(t)}
  insidePoint : ${JSON.stringify(s)}
  node        : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const l=e.x,i=e.y,a=Math.abs(l-s.x),r=e.width/2;let c=s.x<t.x?r-a:r+a;const o=e.height/2,u=Math.abs(t.y-s.y),g=Math.abs(t.x-s.x);if(Math.abs(i-t.y)*r>Math.abs(l-t.x)*o){let x=s.y<t.y?t.y-o-i:i-o-t.y;c=g*x/u;const m={x:s.x<t.x?s.x+c:s.x-g+c,y:s.y<t.y?s.y+u-x:s.y-u+x};return c===0&&(m.x=t.x,m.y=t.y),g===0&&(m.x=t.x),u===0&&(m.y=t.y),n.log.debug(`abc89 topp/bott calc, Q ${u}, q ${x}, R ${g}, r ${c}`,m),m}else{s.x<t.x?c=t.x-r-l:c=l-r-t.x;let x=u*c/g,m=s.x<t.x?s.x+g-c:s.x-g+c,b=s.y<t.y?s.y+x:s.y-x;return n.log.debug(`sides calc abc89, Q ${u}, q ${x}, R ${g}, r ${c}`,{_x:m,_y:b}),c===0&&(m=t.x,b=t.y),g===0&&(m=t.x),u===0&&(b=t.y),{x:m,y:b}}},"intersection"),Et=n.__name((e,t)=>{n.log.debug("abc88 cutPathAtIntersect",e,t);let s=[],l=e[0],i=!1;return e.forEach(a=>{if(!Xe(t,a)&&!i){const r=Ue(t,l,a);let c=!1;s.forEach(o=>{c=c||o.x===r.x&&o.y===r.y}),s.some(o=>o.x===r.x&&o.y===r.y)||s.push(r),i=!0}else l=a,i||s.push(a)}),s},"cutPathAtIntersect"),je=n.__name(function(e,t,s,l,i,a,r){let c=s.points;n.log.debug("abc88 InsertEdge: edge=",s,"e=",t);let o=!1;const u=a.node(t.v);var g=a.node(t.w);g?.intersect&&u?.intersect&&(c=c.slice(1,s.points.length-1),c.unshift(u.intersect(c[0])),c.push(g.intersect(c[c.length-1]))),s.toCluster&&(n.log.debug("to cluster abc88",l[s.toCluster]),c=Et(s.points,l[s.toCluster].node),o=!0),s.fromCluster&&(n.log.debug("from cluster abc88",l[s.fromCluster]),c=Et(c.reverse(),l[s.fromCluster].node).reverse(),o=!0);const x=c.filter(y=>!Number.isNaN(y.y));let m=n.curveBasis;s.curve&&(i==="graph"||i==="flowchart")&&(m=s.curve);const{x:b,y:w}=n.getLineFunctionsWithOffset(s),v=n.line().x(b).y(w).curve(m);let L;switch(s.thickness){case"normal":L="edge-thickness-normal";break;case"thick":L="edge-thickness-thick";break;case"invisible":L="edge-thickness-thick";break;default:L=""}switch(s.pattern){case"solid":L+=" edge-pattern-solid";break;case"dotted":L+=" edge-pattern-dotted";break;case"dashed":L+=" edge-pattern-dashed";break}const T=e.append("path").attr("d",v(x)).attr("id",s.id).attr("class"," "+L+(s.classes?" "+s.classes:"")).attr("style",s.style);let k="";(n.getConfig2().flowchart.arrowMarkerAbsolute||n.getConfig2().state.arrowMarkerAbsolute)&&(k=n.getUrl(!0)),Pe(T,s,k,r,i);let E={};return o&&(E.updatedPath=c),E.originalPath=s.points,E},"insertEdge"),Ve=n.__name(e=>{const t=new Set;for(const s of e)switch(s){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(s);break}return t},"expandAndDeduplicateDirections"),qe=n.__name((e,t,s)=>{const l=Ve(e),i=2,a=t.height+2*s.padding,r=a/i,c=t.width+2*r+s.padding,o=s.padding/2;return l.has("right")&&l.has("left")&&l.has("up")&&l.has("down")?[{x:0,y:0},{x:r,y:0},{x:c/2,y:2*o},{x:c-r,y:0},{x:c,y:0},{x:c,y:-a/3},{x:c+2*o,y:-a/2},{x:c,y:-2*a/3},{x:c,y:-a},{x:c-r,y:-a},{x:c/2,y:-a-2*o},{x:r,y:-a},{x:0,y:-a},{x:0,y:-2*a/3},{x:-2*o,y:-a/2},{x:0,y:-a/3}]:l.has("right")&&l.has("left")&&l.has("up")?[{x:r,y:0},{x:c-r,y:0},{x:c,y:-a/2},{x:c-r,y:-a},{x:r,y:-a},{x:0,y:-a/2}]:l.has("right")&&l.has("left")&&l.has("down")?[{x:0,y:0},{x:r,y:-a},{x:c-r,y:-a},{x:c,y:0}]:l.has("right")&&l.has("up")&&l.has("down")?[{x:0,y:0},{x:c,y:-r},{x:c,y:-a+r},{x:0,y:-a}]:l.has("left")&&l.has("up")&&l.has("down")?[{x:c,y:0},{x:0,y:-r},{x:0,y:-a+r},{x:c,y:-a}]:l.has("right")&&l.has("left")?[{x:r,y:0},{x:r,y:-o},{x:c-r,y:-o},{x:c-r,y:0},{x:c,y:-a/2},{x:c-r,y:-a},{x:c-r,y:-a+o},{x:r,y:-a+o},{x:r,y:-a},{x:0,y:-a/2}]:l.has("up")&&l.has("down")?[{x:c/2,y:0},{x:0,y:-o},{x:r,y:-o},{x:r,y:-a+o},{x:0,y:-a+o},{x:c/2,y:-a},{x:c,y:-a+o},{x:c-r,y:-a+o},{x:c-r,y:-o},{x:c,y:-o}]:l.has("right")&&l.has("up")?[{x:0,y:0},{x:c,y:-r},{x:0,y:-a}]:l.has("right")&&l.has("down")?[{x:0,y:0},{x:c,y:0},{x:0,y:-a}]:l.has("left")&&l.has("up")?[{x:c,y:0},{x:0,y:-r},{x:c,y:-a}]:l.has("left")&&l.has("down")?[{x:c,y:0},{x:0,y:0},{x:c,y:-a}]:l.has("right")?[{x:r,y:-o},{x:r,y:-o},{x:c-r,y:-o},{x:c-r,y:0},{x:c,y:-a/2},{x:c-r,y:-a},{x:c-r,y:-a+o},{x:r,y:-a+o},{x:r,y:-a+o}]:l.has("left")?[{x:r,y:0},{x:r,y:-o},{x:c-r,y:-o},{x:c-r,y:-a+o},{x:r,y:-a+o},{x:r,y:-a},{x:0,y:-a/2}]:l.has("up")?[{x:r,y:-o},{x:r,y:-a+o},{x:0,y:-a+o},{x:c/2,y:-a},{x:c,y:-a+o},{x:c-r,y:-a+o},{x:c-r,y:-o}]:l.has("down")?[{x:c/2,y:0},{x:0,y:-o},{x:r,y:-o},{x:r,y:-a+o},{x:c-r,y:-a+o},{x:c-r,y:-o},{x:c,y:-o}]:[{x:0,y:0}]},"getArrowPoints");function Wt(e,t){return e.intersect(t)}n.__name(Wt,"intersectNode");var Ge=Wt;function Pt(e,t,s,l){var i=e.x,a=e.y,r=i-l.x,c=a-l.y,o=Math.sqrt(t*t*c*c+s*s*r*r),u=Math.abs(t*s*r/o);l.x<i&&(u=-u);var g=Math.abs(t*s*c/o);return l.y<a&&(g=-g),{x:i+u,y:a+g}}n.__name(Pt,"intersectEllipse");var Yt=Pt;function Ht(e,t,s){return Yt(e,t,t,s)}n.__name(Ht,"intersectCircle");var Ze=Ht;function Kt(e,t,s,l){var i,a,r,c,o,u,g,x,m,b,w,v,L,T,k;if(i=t.y-e.y,r=e.x-t.x,o=t.x*e.y-e.x*t.y,m=i*s.x+r*s.y+o,b=i*l.x+r*l.y+o,!(m!==0&&b!==0&&pt(m,b))&&(a=l.y-s.y,c=s.x-l.x,u=l.x*s.y-s.x*l.y,g=a*e.x+c*e.y+u,x=a*t.x+c*t.y+u,!(g!==0&&x!==0&&pt(g,x))&&(w=i*c-a*r,w!==0)))return v=Math.abs(w/2),L=r*u-c*o,T=L<0?(L-v)/w:(L+v)/w,L=a*o-i*u,k=L<0?(L-v)/w:(L+v)/w,{x:T,y:k}}n.__name(Kt,"intersectLine");function pt(e,t){return e*t>0}n.__name(pt,"sameSign");var Je=Kt,Qe=Xt;function Xt(e,t,s){var l=e.x,i=e.y,a=[],r=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(w){r=Math.min(r,w.x),c=Math.min(c,w.y)}):(r=Math.min(r,t.x),c=Math.min(c,t.y));for(var o=l-e.width/2-r,u=i-e.height/2-c,g=0;g<t.length;g++){var x=t[g],m=t[g<t.length-1?g+1:0],b=Je(e,s,{x:o+x.x,y:u+x.y},{x:o+m.x,y:u+m.y});b&&a.push(b)}return a.length?(a.length>1&&a.sort(function(w,v){var L=w.x-s.x,T=w.y-s.y,k=Math.sqrt(L*L+T*T),E=v.x-s.x,y=v.y-s.y,d=Math.sqrt(E*E+y*y);return k<d?-1:k===d?0:1}),a[0]):e}n.__name(Xt,"intersectPolygon");var $e=n.__name((e,t)=>{var s=e.x,l=e.y,i=t.x-s,a=t.y-l,r=e.width/2,c=e.height/2,o,u;return Math.abs(a)*r>Math.abs(i)*c?(a<0&&(c=-c),o=a===0?0:c*i/a,u=c):(i<0&&(r=-r),o=r,u=i===0?0:r*a/i),{x:s+o,y:l+u}},"intersectRect"),tr=$e,D={node:Ge,circle:Ze,ellipse:Yt,polygon:Qe,rect:tr},O=n.__name(async(e,t,s,l)=>{const i=n.getConfig2();let a;const r=t.useHtmlLabels||n.evaluate(i.flowchart.htmlLabels);s?a=s:a="node default";const c=e.insert("g").attr("class",a).attr("id",t.domId||t.id),o=c.insert("g").attr("class","label").attr("style",t.labelStyle);let u;t.labelText===void 0?u="":u=typeof t.labelText=="string"?t.labelText:t.labelText[0];const g=o.node();let x;t.labelType==="markdown"?x=n.createText(o,n.sanitizeText(n.decodeEntities(u),i),{useHtmlLabels:r,width:t.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):x=g.appendChild(await P(n.sanitizeText(n.decodeEntities(u),i),t.labelStyle,!1,l));let m=x.getBBox();const b=t.padding/2;if(n.evaluate(i.flowchart.htmlLabels)){const w=x.children[0],v=n.select(x),L=w.getElementsByTagName("img");if(L){const T=u.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...L].map(k=>new Promise(E=>{function y(){if(k.style.display="flex",k.style.flexDirection="column",T){const d=i.fontSize?i.fontSize:window.getComputedStyle(document.body).fontSize,_=parseInt(d,10)*5+"px";k.style.minWidth=_,k.style.maxWidth=_}else k.style.width="100%";E(k)}n.__name(y,"setupImage"),setTimeout(()=>{k.complete&&y()}),k.addEventListener("error",y),k.addEventListener("load",y)})))}m=w.getBoundingClientRect(),v.attr("width",m.width),v.attr("height",m.height)}return r?o.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"):o.attr("transform","translate(0, "+-m.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:c,bbox:m,halfPadding:b,label:o}},"labelHelper"),C=n.__name((e,t)=>{const s=t.node().getBBox();e.width=s.width,e.height=s.height},"updateNodeBounds");function H(e,t,s,l){return e.insert("polygon",":first-child").attr("points",l.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+s/2+")")}n.__name(H,"insertPolygonShape");var er=n.__name(async(e,t)=>{t.useHtmlLabels||n.getConfig2().flowchart.htmlLabels||(t.centerLabel=!0);const{shapeSvg:l,bbox:i,halfPadding:a}=await O(e,t,"node "+t.classes,!0);n.log.info("Classes = ",t.classes);const r=l.insert("rect",":first-child");return r.attr("rx",t.rx).attr("ry",t.ry).attr("x",-i.width/2-a).attr("y",-i.height/2-a).attr("width",i.width+t.padding).attr("height",i.height+t.padding),C(t,r),t.intersect=function(c){return D.rect(t,c)},l},"note"),rr=er,Dt=n.__name(e=>e?" "+e:"","formatClass"),F=n.__name((e,t)=>`${t||"node default"}${Dt(e.classes)} ${Dt(e.class)}`,"getClassesFromNode"),Ct=n.__name(async(e,t)=>{const{shapeSvg:s,bbox:l}=await O(e,t,F(t,void 0),!0),i=l.width+t.padding,a=l.height+t.padding,r=i+a,c=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];n.log.info("Question main (Circle)");const o=H(s,r,r,c);return o.attr("style",t.style),C(t,o),t.intersect=function(u){return n.log.warn("Intersect called"),D.polygon(t,c,u)},s},"question"),ar=n.__name((e,t)=>{const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),l=28,i=[{x:0,y:l/2},{x:l/2,y:0},{x:0,y:-l/2},{x:-l/2,y:0}];return s.insert("polygon",":first-child").attr("points",i.map(function(r){return r.x+","+r.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(r){return D.circle(t,14,r)},s},"choice"),sr=n.__name(async(e,t)=>{const{shapeSvg:s,bbox:l}=await O(e,t,F(t,void 0),!0),i=4,a=l.height+t.padding,r=a/i,c=l.width+2*r+t.padding,o=[{x:r,y:0},{x:c-r,y:0},{x:c,y:-a/2},{x:c-r,y:-a},{x:r,y:-a},{x:0,y:-a/2}],u=H(s,c,a,o);return u.attr("style",t.style),C(t,u),t.intersect=function(g){return D.polygon(t,o,g)},s},"hexagon"),ir=n.__name(async(e,t)=>{const{shapeSvg:s,bbox:l}=await O(e,t,void 0,!0),i=2,a=l.height+2*t.padding,r=a/i,c=l.width+2*r+t.padding,o=qe(t.directions,l,t),u=H(s,c,a,o);return u.attr("style",t.style),C(t,u),t.intersect=function(g){return D.polygon(t,o,g)},s},"block_arrow"),nr=n.__name(async(e,t)=>{const{shapeSvg:s,bbox:l}=await O(e,t,F(t,void 0),!0),i=l.width+t.padding,a=l.height+t.padding,r=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return H(s,i,a,r).attr("style",t.style),t.width=i+a,t.height=a,t.intersect=function(o){return D.polygon(t,r,o)},s},"rect_left_inv_arrow"),lr=n.__name(async(e,t)=>{const{shapeSvg:s,bbox:l}=await O(e,t,F(t),!0),i=l.width+t.padding,a=l.height+t.padding,r=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],c=H(s,i,a,r);return c.attr("style",t.style),C(t,c),t.intersect=function(o){return D.polygon(t,r,o)},s},"lean_right"),cr=n.__name(async(e,t)=>{const{shapeSvg:s,bbox:l}=await O(e,t,F(t,void 0),!0),i=l.width+t.padding,a=l.height+t.padding,r=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],c=H(s,i,a,r);return c.attr("style",t.style),C(t,c),t.intersect=function(o){return D.polygon(t,r,o)},s},"lean_left"),or=n.__name(async(e,t)=>{const{shapeSvg:s,bbox:l}=await O(e,t,F(t,void 0),!0),i=l.width+t.padding,a=l.height+t.padding,r=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],c=H(s,i,a,r);return c.attr("style",t.style),C(t,c),t.intersect=function(o){return D.polygon(t,r,o)},s},"trapezoid"),hr=n.__name(async(e,t)=>{const{shapeSvg:s,bbox:l}=await O(e,t,F(t,void 0),!0),i=l.width+t.padding,a=l.height+t.padding,r=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],c=H(s,i,a,r);return c.attr("style",t.style),C(t,c),t.intersect=function(o){return D.polygon(t,r,o)},s},"inv_trapezoid"),gr=n.__name(async(e,t)=>{const{shapeSvg:s,bbox:l}=await O(e,t,F(t,void 0),!0),i=l.width+t.padding,a=l.height+t.padding,r=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],c=H(s,i,a,r);return c.attr("style",t.style),C(t,c),t.intersect=function(o){return D.polygon(t,r,o)},s},"rect_right_inv_arrow"),dr=n.__name(async(e,t)=>{const{shapeSvg:s,bbox:l}=await O(e,t,F(t,void 0),!0),i=l.width+t.padding,a=i/2,r=a/(2.5+i/50),c=l.height+r+t.padding,o="M 0,"+r+" a "+a+","+r+" 0,0,0 "+i+" 0 a "+a+","+r+" 0,0,0 "+-i+" 0 l 0,"+c+" a "+a+","+r+" 0,0,0 "+i+" 0 l 0,"+-c,u=s.attr("label-offset-y",r).insert("path",":first-child").attr("style",t.style).attr("d",o).attr("transform","translate("+-i/2+","+-(c/2+r)+")");return C(t,u),t.intersect=function(g){const x=D.rect(t,g),m=x.x-t.x;if(a!=0&&(Math.abs(m)<t.width/2||Math.abs(m)==t.width/2&&Math.abs(x.y-t.y)>t.height/2-r)){let b=r*r*(1-m*m/(a*a));b!=0&&(b=Math.sqrt(b)),b=r-b,g.y-t.y>0&&(b=-b),x.y+=b}return x},s},"cylinder"),ur=n.__name(async(e,t)=>{const{shapeSvg:s,bbox:l,halfPadding:i}=await O(e,t,"node "+t.classes+" "+t.class,!0),a=s.insert("rect",":first-child"),r=t.positioned?t.width:l.width+t.padding,c=t.positioned?t.height:l.height+t.padding,o=t.positioned?-r/2:-l.width/2-i,u=t.positioned?-c/2:-l.height/2-i;if(a.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",u).attr("width",r).attr("height",c),t.props){const g=new Set(Object.keys(t.props));t.props.borders&&(st(a,t.props.borders,r,c),g.delete("borders")),g.forEach(x=>{n.log.warn(`Unknown node property ${x}`)})}return C(t,a),t.intersect=function(g){return D.rect(t,g)},s},"rect"),pr=n.__name(async(e,t)=>{const{shapeSvg:s,bbox:l,halfPadding:i}=await O(e,t,"node "+t.classes,!0),a=s.insert("rect",":first-child"),r=t.positioned?t.width:l.width+t.padding,c=t.positioned?t.height:l.height+t.padding,o=t.positioned?-r/2:-l.width/2-i,u=t.positioned?-c/2:-l.height/2-i;if(a.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",u).attr("width",r).attr("height",c),t.props){const g=new Set(Object.keys(t.props));t.props.borders&&(st(a,t.props.borders,r,c),g.delete("borders")),g.forEach(x=>{n.log.warn(`Unknown node property ${x}`)})}return C(t,a),t.intersect=function(g){return D.rect(t,g)},s},"composite"),fr=n.__name(async(e,t)=>{const{shapeSvg:s}=await O(e,t,"label",!0);n.log.trace("Classes = ",t.class);const l=s.insert("rect",":first-child"),i=0,a=0;if(l.attr("width",i).attr("height",a),s.attr("class","label edgeLabel"),t.props){const r=new Set(Object.keys(t.props));t.props.borders&&(st(l,t.props.borders,i,a),r.delete("borders")),r.forEach(c=>{n.log.warn(`Unknown node property ${c}`)})}return C(t,l),t.intersect=function(r){return D.rect(t,r)},s},"labelRect");function st(e,t,s,l){const i=[],a=n.__name(c=>{i.push(c,0)},"addBorder"),r=n.__name(c=>{i.push(0,c)},"skipBorder");t.includes("t")?(n.log.debug("add top border"),a(s)):r(s),t.includes("r")?(n.log.debug("add right border"),a(l)):r(l),t.includes("b")?(n.log.debug("add bottom border"),a(s)):r(s),t.includes("l")?(n.log.debug("add left border"),a(l)):r(l),e.attr("stroke-dasharray",i.join(" "))}n.__name(st,"applyNodePropertyBorders");var xr=n.__name(async(e,t)=>{let s;t.classes?s="node "+t.classes:s="node default";const l=e.insert("g").attr("class",s).attr("id",t.domId||t.id),i=l.insert("rect",":first-child"),a=l.insert("line"),r=l.insert("g").attr("class","label"),c=t.labelText.flat?t.labelText.flat():t.labelText;let o="";typeof c=="object"?o=c[0]:o=c,n.log.info("Label text abc79",o,c,typeof c=="object");const u=r.node().appendChild(await P(o,t.labelStyle,!0,!0));let g={width:0,height:0};if(n.evaluate(n.getConfig2().flowchart.htmlLabels)){const v=u.children[0],L=n.select(u);g=v.getBoundingClientRect(),L.attr("width",g.width),L.attr("height",g.height)}n.log.info("Text 2",c);const x=c.slice(1,c.length);let m=u.getBBox();const b=r.node().appendChild(await P(x.join?x.join("<br/>"):x,t.labelStyle,!0,!0));if(n.evaluate(n.getConfig2().flowchart.htmlLabels)){const v=b.children[0],L=n.select(b);g=v.getBoundingClientRect(),L.attr("width",g.width),L.attr("height",g.height)}const w=t.padding/2;return n.select(b).attr("transform","translate( "+(g.width>m.width?0:(m.width-g.width)/2)+", "+(m.height+w+5)+")"),n.select(u).attr("transform","translate( "+(g.width<m.width?0:-(m.width-g.width)/2)+", 0)"),g=r.node().getBBox(),r.attr("transform","translate("+-g.width/2+", "+(-g.height/2-w+3)+")"),i.attr("class","outer title-state").attr("x",-g.width/2-w).attr("y",-g.height/2-w).attr("width",g.width+t.padding).attr("height",g.height+t.padding),a.attr("class","divider").attr("x1",-g.width/2-w).attr("x2",g.width/2+w).attr("y1",-g.height/2-w+m.height+w).attr("y2",-g.height/2-w+m.height+w),C(t,i),t.intersect=function(v){return D.rect(t,v)},l},"rectWithTitle"),yr=n.__name(async(e,t)=>{const{shapeSvg:s,bbox:l}=await O(e,t,F(t,void 0),!0),i=l.height+t.padding,a=l.width+i/4+t.padding,r=s.insert("rect",":first-child").attr("style",t.style).attr("rx",i/2).attr("ry",i/2).attr("x",-a/2).attr("y",-i/2).attr("width",a).attr("height",i);return C(t,r),t.intersect=function(c){return D.rect(t,c)},s},"stadium"),br=n.__name(async(e,t)=>{const{shapeSvg:s,bbox:l,halfPadding:i}=await O(e,t,F(t,void 0),!0),a=s.insert("circle",":first-child");return a.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",l.width/2+i).attr("width",l.width+t.padding).attr("height",l.height+t.padding),n.log.info("Circle main"),C(t,a),t.intersect=function(r){return n.log.info("Circle intersect",t,l.width/2+i,r),D.circle(t,l.width/2+i,r)},s},"circle"),mr=n.__name(async(e,t)=>{const{shapeSvg:s,bbox:l,halfPadding:i}=await O(e,t,F(t,void 0),!0),a=5,r=s.insert("g",":first-child"),c=r.insert("circle"),o=r.insert("circle");return r.attr("class",t.class),c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",l.width/2+i+a).attr("width",l.width+t.padding+a*2).attr("height",l.height+t.padding+a*2),o.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",l.width/2+i).attr("width",l.width+t.padding).attr("height",l.height+t.padding),n.log.info("DoubleCircle main"),C(t,c),t.intersect=function(u){return n.log.info("DoubleCircle intersect",t,l.width/2+i+a,u),D.circle(t,l.width/2+i+a,u)},s},"doublecircle"),_r=n.__name(async(e,t)=>{const{shapeSvg:s,bbox:l}=await O(e,t,F(t,void 0),!0),i=l.width+t.padding,a=l.height+t.padding,r=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],c=H(s,i,a,r);return c.attr("style",t.style),C(t,c),t.intersect=function(o){return D.polygon(t,r,o)},s},"subroutine"),wr=n.__name((e,t)=>{const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),l=s.insert("circle",":first-child");return l.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),C(t,l),t.intersect=function(i){return D.circle(t,7,i)},s},"start"),Tt=n.__name((e,t,s)=>{const l=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let i=70,a=10;s==="LR"&&(i=10,a=70);const r=l.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return C(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(c){return D.rect(t,c)},l},"forkJoin"),Lr=n.__name((e,t)=>{const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),l=s.insert("circle",":first-child"),i=s.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),l.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),C(t,i),t.intersect=function(a){return D.circle(t,7,a)},s},"end"),Sr=n.__name(async(e,t)=>{const s=t.padding/2,l=4,i=8;let a;t.classes?a="node "+t.classes:a="node default";const r=e.insert("g").attr("class",a).attr("id",t.domId||t.id),c=r.insert("rect",":first-child"),o=r.insert("line"),u=r.insert("line");let g=0,x=l;const m=r.insert("g").attr("class","label");let b=0;const w=t.classData.annotations?.[0],v=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",L=m.node().appendChild(await P(v,t.labelStyle,!0,!0));let T=L.getBBox();if(n.evaluate(n.getConfig2().flowchart.htmlLabels)){const S=L.children[0],h=n.select(L);T=S.getBoundingClientRect(),h.attr("width",T.width),h.attr("height",T.height)}t.classData.annotations[0]&&(x+=T.height+l,g+=T.width);let k=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(n.getConfig2().flowchart.htmlLabels?k+="&lt;"+t.classData.type+"&gt;":k+="<"+t.classData.type+">");const E=m.node().appendChild(await P(k,t.labelStyle,!0,!0));n.select(E).attr("class","classTitle");let y=E.getBBox();if(n.evaluate(n.getConfig2().flowchart.htmlLabels)){const S=E.children[0],h=n.select(E);y=S.getBoundingClientRect(),h.attr("width",y.width),h.attr("height",y.height)}x+=y.height+l,y.width>g&&(g=y.width);const d=[];t.classData.members.forEach(async S=>{const h=S.getDisplayDetails();let A=h.displayText;n.getConfig2().flowchart.htmlLabels&&(A=A.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const p=m.node().appendChild(await P(A,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0));let B=p.getBBox();if(n.evaluate(n.getConfig2().flowchart.htmlLabels)){const U=p.children[0],K=n.select(p);B=U.getBoundingClientRect(),K.attr("width",B.width),K.attr("height",B.height)}B.width>g&&(g=B.width),x+=B.height+l,d.push(p)}),x+=i;const f=[];if(t.classData.methods.forEach(async S=>{const h=S.getDisplayDetails();let A=h.displayText;n.getConfig2().flowchart.htmlLabels&&(A=A.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const p=m.node().appendChild(await P(A,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0));let B=p.getBBox();if(n.evaluate(n.getConfig2().flowchart.htmlLabels)){const U=p.children[0],K=n.select(p);B=U.getBoundingClientRect(),K.attr("width",B.width),K.attr("height",B.height)}B.width>g&&(g=B.width),x+=B.height+l,f.push(p)}),x+=i,w){let S=(g-T.width)/2;n.select(L).attr("transform","translate( "+(-1*g/2+S)+", "+-1*x/2+")"),b=T.height+l}let _=(g-y.width)/2;return n.select(E).attr("transform","translate( "+(-1*g/2+_)+", "+(-1*x/2+b)+")"),b+=y.height+l,o.attr("class","divider").attr("x1",-g/2-s).attr("x2",g/2+s).attr("y1",-x/2-s+i+b).attr("y2",-x/2-s+i+b),b+=i,d.forEach(S=>{n.select(S).attr("transform","translate( "+-g/2+", "+(-1*x/2+b+i/2)+")");const h=S?.getBBox();b+=(h?.height??0)+l}),b+=i,u.attr("class","divider").attr("x1",-g/2-s).attr("x2",g/2+s).attr("y1",-x/2-s+i+b).attr("y2",-x/2-s+i+b),b+=i,f.forEach(S=>{n.select(S).attr("transform","translate( "+-g/2+", "+(-1*x/2+b)+")");const h=S?.getBBox();b+=(h?.height??0)+l}),c.attr("style",t.style).attr("class","outer title-state").attr("x",-g/2-s).attr("y",-(x/2)-s).attr("width",g+t.padding).attr("height",x+t.padding),C(t,c),t.intersect=function(S){return D.rect(t,S)},r},"class_box"),Nt={rhombus:Ct,composite:pr,question:Ct,rect:ur,labelRect:fr,rectWithTitle:xr,choice:ar,circle:br,doublecircle:mr,stadium:yr,hexagon:sr,block_arrow:ir,rect_left_inv_arrow:nr,lean_right:lr,lean_left:cr,trapezoid:or,inv_trapezoid:hr,rect_right_inv_arrow:gr,cylinder:dr,start:wr,end:Lr,note:rr,subroutine:_r,fork:Tt,join:Tt,class_box:Sr},et={},Ut=n.__name(async(e,t,s)=>{let l,i;if(t.link){let a;n.getConfig2().securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),l=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a),i=await Nt[t.shape](l,t,s)}else i=await Nt[t.shape](e,t,s),l=i;return t.tooltip&&i.attr("title",t.tooltip),t.class&&i.attr("class","node default "+t.class),et[t.id]=l,t.haveCallback&&et[t.id].attr("class",et[t.id].attr("class")+" clickable"),l},"insertNode"),vr=n.__name(e=>{const t=et[e.id];n.log.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const s=8,l=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+l-e.width/2)+", "+(e.y-e.height/2-s)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),l},"positionNode");function mt(e,t,s=!1){const l=e;let i="default";(l?.classes?.length||0)>0&&(i=(l?.classes??[]).join(" ")),i=i+" flowchart-label";let a=0,r="",c;switch(l.type){case"round":a=5,r="rect";break;case"composite":a=0,r="composite",c=0;break;case"square":r="rect";break;case"diamond":r="question";break;case"hexagon":r="hexagon";break;case"block_arrow":r="block_arrow";break;case"odd":r="rect_left_inv_arrow";break;case"lean_right":r="lean_right";break;case"lean_left":r="lean_left";break;case"trapezoid":r="trapezoid";break;case"inv_trapezoid":r="inv_trapezoid";break;case"rect_left_inv_arrow":r="rect_left_inv_arrow";break;case"circle":r="circle";break;case"ellipse":r="ellipse";break;case"stadium":r="stadium";break;case"subroutine":r="subroutine";break;case"cylinder":r="cylinder";break;case"group":r="rect";break;case"doublecircle":r="doublecircle";break;default:r="rect"}const o=n.getStylesFromArray(l?.styles??[]),u=l.label,g=l.size??{width:0,height:0,x:0,y:0};return{labelStyle:o.labelStyle,shape:r,labelText:u,rx:a,ry:a,class:i,style:o.style,id:l.id,directions:l.directions,width:g.width,height:g.height,x:g.x,y:g.y,positioned:s,intersect:void 0,type:l.type,padding:c??n.getConfig()?.block?.padding??0}}n.__name(mt,"getNodeFromBlock");async function jt(e,t,s){const l=mt(t,s,!1);if(l.type==="group")return;const i=n.getConfig(),a=await Ut(e,l,{config:i}),r=a.node().getBBox(),c=s.getBlock(l.id);c.size={width:r.width,height:r.height,x:0,y:0,node:a},s.setBlock(c),a.remove()}n.__name(jt,"calculateBlockSize");async function Vt(e,t,s){const l=mt(t,s,!0);if(s.getBlock(l.id).type!=="space"){const a=n.getConfig();await Ut(e,l,{config:a}),t.intersect=l?.intersect,vr(l)}}n.__name(Vt,"insertBlockPositioned");async function it(e,t,s,l){for(const i of t)await l(e,i,s),i.children&&await it(e,i.children,s,l)}n.__name(it,"performOperations");async function qt(e,t,s){await it(e,t,s,jt)}n.__name(qt,"calculateBlockSizes");async function Gt(e,t,s){await it(e,t,s,Vt)}n.__name(Gt,"insertBlocks");async function Zt(e,t,s,l,i){const a=new re.Graph({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const r of s)r.size&&a.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(const r of t)if(r.start&&r.end){const c=l.getBlock(r.start),o=l.getBlock(r.end);if(c?.size&&o?.size){const u=c.size,g=o.size,x=[{x:u.x,y:u.y},{x:u.x+(g.x-u.x)/2,y:u.y+(g.y-u.y)/2},{x:g.x,y:g.y}];je(e,{v:r.start,w:r.end,name:r.id},{...r,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:x,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",a,i),r.label&&(await He(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:x,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),Ke({...r,x:x[1].x,y:x[1].y},{originalPath:x}))}}}n.__name(Zt,"insertEdges");var kr=n.__name(function(e,t){return t.db.getClasses()},"getClasses"),Er=n.__name(async function(e,t,s,l){const{securityLevel:i,block:a}=n.getConfig(),r=l.db;let c;i==="sandbox"&&(c=n.select("#i"+t));const o=i==="sandbox"?n.select(c.nodes()[0].contentDocument.body):n.select("body"),u=i==="sandbox"?o.select(`[id="${t}"]`):n.select(`[id="${t}"]`);Me(u,["point","circle","cross"],l.type,t);const x=r.getBlocks(),m=r.getBlocksFlat(),b=r.getEdges(),w=u.insert("g").attr("class","block");await qt(w,x,r);const v=Mt(r);if(await Gt(w,x,r),await Zt(w,b,m,r,t),v){const L=v,T=Math.max(1,Math.round(.125*(L.width/L.height))),k=L.height+T+10,E=L.width+10,{useMaxWidth:y}=a;n.configureSvgSize(u,k,E,!!y),n.log.debug("Here Bounds",v,L),u.attr("viewBox",`${L.x-5} ${L.y-5} ${L.width+10} ${L.height+10}`)}},"draw"),Dr={draw:Er,getClasses:kr},Cr={parser:se,db:Se,renderer:Dr,styles:ke};exports.diagram=Cr;