mermaid
Version:
Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.
133 lines • 71.9 kB
JavaScript
import{D as jt}from"./chunk-W44A43WB.mjs";import{a as Vt}from"./chunk-AZZRMDJM.mjs";import{a as et,d as Kt}from"./chunk-5VCL7Z4A.mjs";import{a as Wt,b as Yt}from"./chunk-UAT7B5JY.mjs";import{c as tt}from"./chunk-SZD42YQK.mjs";import"./chunk-2SREHG4O.mjs";import{a as Ht,f as Pt,p as $,r as yt}from"./chunk-7CWYLC5S.mjs";import"./chunk-STOV2HOB.mjs";import{A as bt,B as Ot,G as Rt,O as zt,S as At,_ as B,b as Nt,c as It,t as q,x as R}from"./chunk-2AEHWXPW.mjs";import{H as Mt,L as Ft,b as S,h as _}from"./chunk-LIEV3EAG.mjs";import{a as l}from"./chunk-AQ6EADP3.mjs";var mt=(function(){var e=l(function(T,k,p,x){for(p=p||{},x=T.length;x--;p[T[x]]=k);return p},"o"),t=[1,15],s=[1,7],i=[1,13],a=[1,14],o=[1,19],r=[1,16],n=[1,17],c=[1,18],u=[8,30],g=[8,10,21,28,29,30,31,39,43,46],d=[1,23],y=[1,24],m=[8,10,15,16,21,28,29,30,31,39,43,46],b=[8,10,15,16,21,27,28,29,30,31,39,43,46],E=[1,49],w={trace:l(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,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$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:"NODE_ID",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"},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],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:l(function(k,p,x,L,D,h,P){var f=h.length-1;switch(D){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",h[f-1]),L.setHierarchy(h[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",h[f]),typeof h[f].length=="number"?this.$=h[f]:this.$=[h[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",h[f-1]),this.$=[h[f-1]].concat(h[f]);break;case 14:L.getLogger().debug("Rule: link: ",h[f],k),this.$={edgeTypeStr:h[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",h[f-3],h[f-1],h[f]),this.$={edgeTypeStr:h[f],label:h[f-1]};break;case 18:let O=parseInt(h[f]),Z=L.generateId();this.$={id:Z,type:"space",label:"",width:O,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",h[f-2],h[f-1],h[f]," typestr: ",h[f-1].edgeTypeStr);let U=L.edgeStrToEdgeData(h[f-1].edgeTypeStr),ht=L.edgeStrToEdgeStartData(h[f-1].edgeTypeStr),st=L.edgeStrToThickness(h[f-1].edgeTypeStr),gt=L.edgeStrToPattern(h[f-1].edgeTypeStr);this.$=[{id:h[f-2].id,label:h[f-2].label,type:h[f-2].type,directions:h[f-2].directions},{id:h[f-2].id+"-"+h[f].id,start:h[f-2].id,end:h[f].id,label:h[f-1].label,type:"edge",thickness:st,pattern:gt,directions:h[f].directions,arrowTypeEnd:U,arrowTypeStart:ht},{id:h[f].id,label:h[f].label,type:L.typeStr2Type(h[f].typeStr),directions:h[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",h[f-1],h[f]),this.$={id:h[f-1].id,label:h[f-1].label,type:L.typeStr2Type(h[f-1].typeStr),directions:h[f-1].directions,widthInColumns:parseInt(h[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",h[f]),this.$={id:h[f].id,label:h[f].label,type:L.typeStr2Type(h[f].typeStr),directions:h[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",h[f]),this.$={type:"column-setting",columns:h[f]==="auto"?-1:parseInt(h[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",h[f-2],h[f-1]);let A=L.generateId();this.$={...h[f-2],type:"composite",children:h[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",h[f-2],h[f-1],h[f]);let X=L.generateId();this.$={id:X,type:"composite",label:"",children:h[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",h[f]),this.$={id:h[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",h[f-1],h[f]),this.$={id:h[f-1],label:h[f].label,typeStr:h[f].typeStr,directions:h[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",h[f]),this.$=[h[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",h[f-1],h[f]),this.$=[h[f-1]].concat(h[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",h[f-2],h[f-1],h[f]),this.$={typeStr:h[f-2]+h[f],label:h[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",h[f-3],h[f-2]," #3:",h[f-1],h[f]),this.$={typeStr:h[f-3]+h[f],label:h[f-2],directions:h[f-1]};break;case 35:case 36:this.$={type:"classDef",id:h[f-1].trim(),css:h[f].trim()};break;case 37:this.$={type:"applyClass",id:h[f-1].trim(),styleClass:h[f].trim()};break;case 38:this.$={type:"applyStyles",id:h[f-1].trim(),stylesStr:h[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:s,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:r,43:n,46:c},{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,10:t,21:s,28:i,29:a,31:o,39:r,43:n,46:c}),e(g,[2,16],{14:22,15:d,16:y}),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(m,[2,25],{27:[1,25]}),e(g,[2,26]),{19:26,26:12,31:o},{10:t,11:27,13:4,19:5,20:6,21:s,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:r,43:n,46:c},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(b,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:o},{31:[2,14]},{17:[1,36]},e(m,[2,24]),{10:t,11:37,13:4,14:22,15:d,16:y,19:5,20:6,21:s,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:r,43:n,46:c},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(b,[2,30]),{18:[1,43]},{18:[1,44]},e(m,[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]),{36:[1,47]},{33:48,34:E},{15:[1,50]},e(g,[2,27]),e(b,[2,33]),{38:[1,51]},{33:52,34:E,38:[2,31]},{31:[2,15]},e(b,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:l(function(k,p){if(p.recoverable)this.trace(k);else{var x=new Error(k);throw x.hash=p,x}},"parseError"),parse:l(function(k){var p=this,x=[0],L=[],D=[null],h=[],P=this.table,f="",O=0,Z=0,U=0,ht=2,st=1,gt=h.slice.call(arguments,1),A=Object.create(this.lexer),X={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(X.yy[ut]=this.yy[ut]);A.setInput(k,X.yy),X.yy.lexer=A,X.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var dt=A.yylloc;h.push(dt);var Te=A.options&&A.options.ranges;typeof X.yy.parseError=="function"?this.parseError=X.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function $r(W){x.length=x.length-2*W,D.length=D.length-W,h.length=h.length-W}l($r,"popStack");function Ce(){var W;return W=L.pop()||A.lex()||st,typeof W!="number"&&(W instanceof Array&&(L=W,W=L.pop()),W=p.symbols_[W]||W),W}l(Ce,"lex");for(var F,pt,J,K,ts,ft,Q={},at,G,Ct,it;;){if(J=x[x.length-1],this.defaultActions[J]?K=this.defaultActions[J]:((F===null||typeof F>"u")&&(F=Ce()),K=P[J]&&P[J][F]),typeof K>"u"||!K.length||!K[0]){var xt="";it=[];for(at in P[J])this.terminals_[at]&&at>ht&&it.push("'"+this.terminals_[at]+"'");A.showPosition?xt="Parse error on line "+(O+1)+`:
`+A.showPosition()+`
Expecting `+it.join(", ")+", got '"+(this.terminals_[F]||F)+"'":xt="Parse error on line "+(O+1)+": Unexpected "+(F==st?"end of input":"'"+(this.terminals_[F]||F)+"'"),this.parseError(xt,{text:A.match,token:this.terminals_[F]||F,line:A.yylineno,loc:dt,expected:it})}if(K[0]instanceof Array&&K.length>1)throw new Error("Parse Error: multiple actions possible at state: "+J+", token: "+F);switch(K[0]){case 1:x.push(F),D.push(A.yytext),h.push(A.yylloc),x.push(K[1]),F=null,pt?(F=pt,pt=null):(Z=A.yyleng,f=A.yytext,O=A.yylineno,dt=A.yylloc,U>0&&U--);break;case 2:if(G=this.productions_[K[1]][1],Q.$=D[D.length-G],Q._$={first_line:h[h.length-(G||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(G||1)].first_column,last_column:h[h.length-1].last_column},Te&&(Q._$.range=[h[h.length-(G||1)].range[0],h[h.length-1].range[1]]),ft=this.performAction.apply(Q,[f,Z,O,X.yy,K[1],D,h].concat(gt)),typeof ft<"u")return ft;G&&(x=x.slice(0,-1*G*2),D=D.slice(0,-1*G),h=h.slice(0,-1*G)),x.push(this.productions_[K[1]][0]),D.push(Q.$),h.push(Q._$),Ct=P[x[x.length-2]][x[x.length-1]],x.push(Ct);break;case 3:return!0}}return!0},"parse")},I=(function(){var T={EOF:1,parseError:l(function(p,x){if(this.yy.parser)this.yy.parser.parseError(p,x);else throw new Error(p)},"parseError"),setInput:l(function(k,p){return this.yy=p||this.yy||{},this._input=k,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:l(function(){var k=this._input[0];this.yytext+=k,this.yyleng++,this.offset++,this.match+=k,this.matched+=k;var p=k.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),k},"input"),unput:l(function(k){var p=k.length,x=k.split(/(?:\r\n?|\n)/g);this._input=k+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var L=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),x.length-1&&(this.yylineno-=x.length-1);var D=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:x?(x.length===L.length?this.yylloc.first_column:0)+L[L.length-x.length].length-x[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(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:l(function(k){this.unput(this.match.slice(k))},"less"),pastInput:l(function(){var k=this.matched.substr(0,this.matched.length-this.match.length);return(k.length>20?"...":"")+k.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var k=this.match;return k.length<20&&(k+=this._input.substr(0,20-k.length)),(k.substr(0,20)+(k.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var k=this.pastInput(),p=new Array(k.length+1).join("-");return k+this.upcomingInput()+`
`+p+"^"},"showPosition"),test_match:l(function(k,p){var x,L,D;if(this.options.backtrack_lexer&&(D={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&&(D.yylloc.range=this.yylloc.range.slice(0))),L=k[0].match(/(?:\r\n?|\n).*/g),L&&(this.yylineno+=L.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:L?L[L.length-1].length-L[L.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+k[0].length},this.yytext+=k[0],this.match+=k[0],this.matches=k,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(k[0].length),this.matched+=k[0],x=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var h in D)this[h]=D[h];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var k,p,x,L;this._more||(this.yytext="",this.match="");for(var D=this._currentRules(),h=0;h<D.length;h++)if(x=this._input.match(this.rules[D[h]]),x&&(!p||x[0].length>p[0].length)){if(p=x,L=h,this.options.backtrack_lexer){if(k=this.test_match(x,D[h]),k!==!1)return k;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(k=this.test_match(p,D[L]),k!==!1?k:!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:l(function(){var p=this.next();return p||this.lex()},"lex"),begin:l(function(p){this.conditionStack.push(p)},"begin"),popState:l(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(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:l(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:l(function(p){this.begin(p)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:l(function(p,x,L,D){var h=D;switch(L){case 0:return p.getLogger().debug("Found block-beta"),10;break;case 1:return p.getLogger().debug("Found id-block"),29;break;case 2:return p.getLogger().debug("Found block"),10;break;case 3:p.getLogger().debug(".",x.yytext);break;case 4:p.getLogger().debug("_",x.yytext);break;case 5:return 5;case 6:return x.yytext=-1,28;break;case 7:return x.yytext=x.yytext.replace(/columns\s+/,""),p.getLogger().debug("COLUMNS (LEX)",x.yytext),28;break;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:p.getLogger().debug("LEX: POPPING STR:",x.yytext),this.popState();break;case 13:return p.getLogger().debug("LEX: STR end:",x.yytext),"STR";break;case 14:return x.yytext=x.yytext.replace(/space\:/,""),p.getLogger().debug("SPACE NUM (LEX)",x.yytext),21;break;case 15:return x.yytext="1",p.getLogger().debug("COLUMNS (LEX)",x.yytext),21;break;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;break;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";break;case 21:return this.popState(),this.pushState("CLASSDEFID"),40;break;case 22:return this.popState(),41;break;case 23:return this.pushState("CLASS"),43;break;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;break;case 25:return this.popState(),45;break;case 26:return this.pushState("STYLE_STMNT"),46;break;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;break;case 28:return this.popState(),48;break;case 29:return this.pushState("acc_title"),"acc_title";break;case 30:return this.popState(),"acc_title_value";break;case 31:return this.pushState("acc_descr"),"acc_descr";break;case 32:return this.popState(),"acc_descr_value";break;case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),p.getLogger().debug("Lex: (("),"NODE_DEND";break;case 38:return this.popState(),p.getLogger().debug("Lex: (("),"NODE_DEND";break;case 39:return this.popState(),p.getLogger().debug("Lex: ))"),"NODE_DEND";break;case 40:return this.popState(),p.getLogger().debug("Lex: (("),"NODE_DEND";break;case 41:return this.popState(),p.getLogger().debug("Lex: (("),"NODE_DEND";break;case 42:return this.popState(),p.getLogger().debug("Lex: (-"),"NODE_DEND";break;case 43:return this.popState(),p.getLogger().debug("Lex: -)"),"NODE_DEND";break;case 44:return this.popState(),p.getLogger().debug("Lex: (("),"NODE_DEND";break;case 45:return this.popState(),p.getLogger().debug("Lex: ]]"),"NODE_DEND";break;case 46:return this.popState(),p.getLogger().debug("Lex: ("),"NODE_DEND";break;case 47:return this.popState(),p.getLogger().debug("Lex: ])"),"NODE_DEND";break;case 48:return this.popState(),p.getLogger().debug("Lex: /]"),"NODE_DEND";break;case 49:return this.popState(),p.getLogger().debug("Lex: /]"),"NODE_DEND";break;case 50:return this.popState(),p.getLogger().debug("Lex: )]"),"NODE_DEND";break;case 51:return this.popState(),p.getLogger().debug("Lex: )"),"NODE_DEND";break;case 52:return this.popState(),p.getLogger().debug("Lex: ]>"),"NODE_DEND";break;case 53:return this.popState(),p.getLogger().debug("Lex: ]"),"NODE_DEND";break;case 54:return p.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;break;case 55:return p.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;break;case 56:return p.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;break;case 57:return p.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 58:return p.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;break;case 59:return p.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 60:return p.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 61:return p.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 62:return p.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;break;case 63:return p.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;break;case 64:return p.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;break;case 65:return this.pushState("NODE"),35;break;case 66:return this.pushState("NODE"),35;break;case 67:return this.pushState("NODE"),35;break;case 68:return this.pushState("NODE"),35;break;case 69:return this.pushState("NODE"),35;break;case 70:return this.pushState("NODE"),35;break;case 71:return this.pushState("NODE"),35;break;case 72:return p.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;break;case 73:return this.pushState("BLOCK_ARROW"),p.getLogger().debug("LEX ARR START"),37;break;case 74:return p.getLogger().debug("Lex: NODE_ID",x.yytext),31;break;case 75:return p.getLogger().debug("Lex: EOF",x.yytext),8;break;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:p.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:p.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return p.getLogger().debug("LEX: NODE_DESCR:",x.yytext),"NODE_DESCR";break;case 83:p.getLogger().debug("LEX POPPING"),this.popState();break;case 84:p.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (right): dir:",x.yytext),"DIR";break;case 86:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (left):",x.yytext),"DIR";break;case 87:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (x):",x.yytext),"DIR";break;case 88:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (y):",x.yytext),"DIR";break;case 89:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (up):",x.yytext),"DIR";break;case 90:return x.yytext=x.yytext.replace(/^,\s*/,""),p.getLogger().debug("Lex (down):",x.yytext),"DIR";break;case 91:return x.yytext="]>",p.getLogger().debug("Lex (ARROW_DIR end):",x.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";break;case 92:return p.getLogger().debug("Lex: LINK","#"+x.yytext+"#"),15;break;case 93:return p.getLogger().debug("Lex: LINK",x.yytext),15;break;case 94:return p.getLogger().debug("Lex: LINK",x.yytext),15;break;case 95:return p.getLogger().debug("Lex: LINK",x.yytext),15;break;case 96:return p.getLogger().debug("Lex: START_LINK",x.yytext),this.pushState("LLABEL"),16;break;case 97:return p.getLogger().debug("Lex: START_LINK",x.yytext),this.pushState("LLABEL"),16;break;case 98:return p.getLogger().debug("Lex: START_LINK",x.yytext),this.pushState("LLABEL"),16;break;case 99:this.pushState("md_string");break;case 100:return p.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";break;case 101:return this.popState(),p.getLogger().debug("Lex: LINK","#"+x.yytext+"#"),15;break;case 102:return this.popState(),p.getLogger().debug("Lex: LINK",x.yytext),15;break;case 103:return this.popState(),p.getLogger().debug("Lex: LINK",x.yytext),15;break;case 104:return p.getLogger().debug("Lex: COLON",x.yytext),x.yytext=x.yytext.slice(1),27;break}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\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:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return T})();w.lexer=I;function C(){this.yy={}}return l(C,"Parser"),C.prototype=w,w.Parser=C,new C})();mt.parser=mt;var Ut=mt;var j=new Map,wt=[],kt=new Map,Xt="color",Gt="fill",Ie="bgFill",qt=",",nt=new Map,St="",Oe=l(e=>Rt.sanitizeText(e,B()),"sanitizeText"),Re=l(function(e,t=""){let s=nt.get(e);s||(s={id:e,styles:[],textStyles:[]},nt.set(e,s)),t?.split(qt).forEach(i=>{let a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(Xt).exec(i)){let r=a.replace(Gt,Ie).replace(Xt,Gt);s.textStyles.push(r)}s.styles.push(a)})},"addStyleClass"),ze=l(function(e,t=""){let s=j.get(e);t!=null&&(s.styles=t.split(qt))},"addStyle2Node"),Ae=l(function(e,t){e.split(",").forEach(function(s){let i=j.get(s);if(i===void 0){let a=s.trim();i={id:a,type:"na",children:[]},j.set(a,i)}i.classes||(i.classes=[]),i.classes.push(t)})},"setCssClass"),Jt=l((e,t)=>{let s=e.flat(),i=[],o=s.find(r=>r?.type==="column-setting")?.columns??-1;for(let r of s){if(typeof o=="number"&&o>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>o&&S.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${o}`),r.label&&(r.label=Oe(r.label)),r.type==="classDef"){Re(r.id,r.css);continue}if(r.type==="applyClass"){Ae(r.id,r?.styleClass??"");continue}if(r.type==="applyStyles"){r?.stylesStr&&ze(r.id,r?.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){let n=(kt.get(r.id)??0)+1;kt.set(r.id,n),r.id=n+"-"+r.id,wt.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);let n=j.get(r.id);if(n===void 0?j.set(r.id,r):(r.type!=="na"&&(n.type=r.type),r.label!==r.id&&(n.label=r.label)),r.children&&Jt(r.children,r),r.type==="space"){let c=r.width??1;for(let u=0;u<c;u++){let g=Ht(r);g.id=g.id+"-"+u,j.set(g.id,g),i.push(g)}}else n===void 0&&i.push(r)}}t.children=i},"populateBlockDatabase"),Lt=[],rt={id:"root",type:"composite",children:[],columns:-1},Me=l(()=>{S.debug("Clear called"),At(),rt={id:"root",type:"composite",children:[],columns:-1},j=new Map([["root",rt]]),Lt=[],nt=new Map,wt=[],kt=new Map,St=""},"clear");function Fe(e){switch(S.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return S.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"}}l(Fe,"typeStr2Type");function He(e){switch(S.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}l(He,"edgeTypeStr2Type");function Pe(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}l(Pe,"edgeStrToEdgeData");function We(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}l(We,"edgeStrToEdgeStartData");function Ye(e){return e.includes("==")?"thick":"normal"}l(Ye,"edgeStrToThickness");function Ke(e){return e.includes(".-")?"dotted":"solid"}l(Ke,"edgeStrToPattern");var Zt=0,je=l(()=>(Zt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Zt),"generateId"),Ve=l(e=>{rt.children=e,Jt(e,rt),Lt=rt.children},"setHierarchy"),Ue=l(e=>{let t=j.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),Xe=l(()=>[...j.values()],"getBlocksFlat"),Ge=l(()=>Lt||[],"getBlocks"),Ze=l(()=>wt,"getEdges"),qe=l(e=>j.get(e),"getBlock"),Je=l(e=>{j.set(e.id,e)},"setBlock"),Qe=l(e=>{St=e},"setDiagramId"),$e=l(()=>St,"getDiagramId"),tr=l(()=>S,"getLogger"),er=l(function(){return nt},"getClasses"),rr={getConfig:l(()=>q().block,"getConfig"),typeStr2Type:Fe,edgeTypeStr2Type:He,edgeStrToEdgeData:Pe,edgeStrToEdgeStartData:We,edgeStrToThickness:Ye,edgeStrToPattern:Ke,getLogger:tr,getBlocksFlat:Xe,getBlocks:Ge,getEdges:Ze,setHierarchy:Ve,getBlock:qe,setBlock:Je,getColumns:Ue,getClasses:er,clear:Me,generateId:je,setDiagramId:Qe,getDiagramId:$e},Qt=rr;var Et=l((e,t)=>{let s=It,i=s(e,"r"),a=s(e,"g"),o=s(e,"b");return Nt(i,a,o,t)},"fade"),sr=l(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};
/*
* This is for backward compatibility with existing code that didn't
* add a \`<p>\` around edge labels.
*
* TODO: We should probably remove this in a future release.
*/
p {
margin: 0;
padding: 0;
display: inline;
}
rect {
opacity: 0.5;
background-color: ${e.edgeLabelBackground};
fill: ${e.edgeLabelBackground};
}
text-align: center;
}
/* For html labels only */
.labelBkg {
background-color: ${e.edgeLabelBackground};
}
.node .cluster {
// fill: ${Et(e.mainBkg,.5)};
fill: ${Et(e.clusterBkg,.5)};
stroke: ${Et(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};
}
${Vt()}
`,"getStyles"),$t=sr;var ar=l((e,t,s,i)=>{t.forEach(a=>{pr[a](e,s,i)})},"insertMarkers"),ir=l((e,t,s)=>{S.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"),nr=l((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"),or=l((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"),cr=l((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"),lr=l((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"),hr=l((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"),gr=l((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"),ur=l((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"),dr=l((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"),pr={extension:ir,composition:nr,aggregation:or,dependency:cr,lollipop:lr,point:hr,circle:gr,cross:ur,barb:dr},te=ar;function ee(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};let s=t%e,i=Math.floor(t/e);return{px:s,py:i}}l(ee,"calculateBlockPosition");var fr=l(e=>{let t=0,s=0;for(let i of e.children){let{width:a,height:o,x:r,y:n}=i.size??{width:0,height:0,x:0,y:0};if(S.debug("getMaxChildSize abc95 child:",i.id,"width:",a,"height:",o,"x:",r,"y:",n,i.type),i.type==="space")continue;let c=a/(i.widthInColumns??1);c>t&&(t=c),o>s&&(s=o)}return{width:t,height:s}},"getMaxChildSize");function Dt(e,t,s=0,i=0,a=8){S.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",s),e?.size?.width||(e.size={width:s,height:i,x:0,y:0});let o=0,r=0;if(e.children?.length>0){for(let b of e.children)Dt(b,t,0,0,a);let n=fr(e);o=n.width,r=n.height,S.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",o,r);for(let b of e.children)b.size&&(S.debug(`abc95 Setting size of children of ${e.id} id=${b.id} ${o} ${r} ${JSON.stringify(b.size)}`),b.size.width=o*(b.widthInColumns??1)+a*((b.widthInColumns??1)-1),b.size.height=r,b.size.x=0,b.size.y=0,S.debug(`abc95 updating size of ${e.id} children child:${b.id} maxWidth:${o} maxHeight:${r}`));for(let b of e.children)Dt(b,t,o,r,a);let c=e.columns??-1,u=0;for(let b of e.children)u+=b.widthInColumns??1;let g=e.children.length;c>0&&c<u&&(g=c);let d=Math.ceil(u/g),y=g*(o+a)+a,m=d*(r+a)+a;if(y<s){S.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${s} siblingHeight ${i} width ${y}`),y=s,m=i;let b=(s-g*a-a)/g,E=(i-d*a-a)/d;S.debug("Size indata abc88",e.id,"childWidth",b,"maxWidth",o),S.debug("Size indata abc88",e.id,"childHeight",E,"maxHeight",r),S.debug("Size indata abc88 xSize",g,"padding",a);for(let w of e.children)w.size&&(w.size.width=b,w.size.height=E,w.size.x=0,w.size.y=0)}if(S.debug(`abc95 (finale calc) ${e.id} xSize ${g} ySize ${d} columns ${c}${e.children.length} width=${Math.max(y,e.size?.width||0)}`),y<(e?.size?.width||0)){y=e?.size?.width||0;let b=c>0?Math.min(e.children.length,c):e.children.length;if(b>0){let E=(y-b*a-a)/b;S.debug("abc95 (growing to fit) width",e.id,y,e.size?.width,E);for(let w of e.children)w.size&&(w.size.width=E)}}e.size={width:y,height:m,x:0,y:0}}S.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}l(Dt,"setBlockSizes");function re(e,t,s=8){S.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);let i=e.columns??-1;if(S.debug("layoutBlocks columns abc95",e.id,"=>",i,e),e.children&&e.children.length>0){let a=e?.children[0]?.size?.width??0,o=e.children.length*a+(e.children.length-1)*s;S.debug("widthOfChildren 88",o,"posX");let r=new Map;{let d=0;for(let y of e.children){if(!y.size)continue;let{py:m}=ee(i,d),b=r.get(m)??0;y.size.height>b&&r.set(m,y.size.height);let E=y?.widthInColumns??1;i>0&&(E=Math.min(E,i-d%i)),d+=E}}let n=new Map;{let d=0,y=[...r.keys()].sort((m,b)=>m-b);for(let m of y)n.set(m,d),d+=(r.get(m)??0)+s}let c=0;S.debug("abc91 block?.size?.x",e.id,e?.size?.x);let u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-s,g=0;for(let d of e.children){let y=e;if(!d.size)continue;let{width:m,height:b}=d.size,{px:E,py:w}=ee(i,c);if(w!=g&&(g=w,u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-s,S.debug("New row in layout for block",e.id," and child ",d.id,g)),S.debug(`abc89 layout blocks (child) id: ${d.id} Pos: ${c} (px, py) ${E},${w} (${y?.size?.x},${y?.size?.y}) parent: ${y.id} width: ${m}${s}`),y.size){let C=m/2;d.size.x=u+s+C,S.debug(`abc91 layout blocks (calc) px, pyid:${d.id} startingPos=X${u} new startingPosX${d.size.x} ${C} padding=${s} width=${m} halfWidth=${C} => x:${d.size.x} y:${d.size.y} ${d.widthInColumns} (width * (child?.w || 1)) / 2 ${m*(d?.widthInColumns??1)/2}`),u=d.size.x+C;let T=n.get(w)??0,k=r.get(w)??b;d.size.y=y.size.y-y.size.height/2+T+k/2+s,S.debug(`abc88 layout blocks (calc) px, pyid:${d.id}startingPosX${u}${s}${C}=>x:${d.size.x}y:${d.size.y}${d.widthInColumns}(width * (child?.w || 1)) / 2${m*(d?.widthInColumns??1)/2}`)}d.children&&re(d,t,s);let I=d?.widthInColumns??1;i>0&&(I=Math.min(I,i-c%i)),c+=I,S.debug("abc88 columnsPos",d,c)}}S.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}l(re,"layoutBlocks");function se(e,{minX:t,minY:s,maxX:i,maxY:a}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){let{x:o,y:r,width:n,height:c}=e.size;o-n/2<t&&(t=o-n/2),r-c/2<s&&(s=r-c/2),o+n/2>i&&(i=o+n/2),r+c/2>a&&(a=r+c/2)}if(e.children)for(let o of e.children)({minX:t,minY:s,maxX:i,maxY:a}=se(o,{minX:t,minY:s,maxX:i,maxY:a}));return{minX:t,minY:s,maxX:i,maxY:a}}l(se,"findBounds");function ae(e){let t=e.getBlock("root");if(!t)return;let s=B()?.block?.padding??8;Dt(t,e,0,0,s),re(t,e,s),S.debug("getBlocks",JSON.stringify(t,null,2));let{minX:i,minY:a,maxX:o,maxY:r}=se(t),n=r-a,c=o-i;return{x:i,y:a,width:c,height:n}}l(ae,"layout");var xr=l(async(e,t,s,i=!1,a=!1)=>{let o=t||"";typeof o=="object"&&(o=o[0]);let r=B(),n=R(r);return await tt(e,o,{style:s,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:a,width:Number.POSITIVE_INFINITY},r)},"createLabel"),H=xr;var ne=l((e,t,s,i,a)=>{t.arrowTypeStart&&ie(e,"start",t.arrowTypeStart,s,i,a),t.arrowTypeEnd&&ie(e,"end",t.arrowTypeEnd,s,i,a)},"addEdgeMarkers"),br={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},ie=l((e,t,s,i,a,o)=>{let r=br[s];if(!r){S.warn(`Unknown arrow type: ${s}`);return}let n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${i}#${a}_${o}-${r}${n})`)},"addEdgeMarker");var _t={},M={};var ce=l(async(e,t)=>{let s=B(),i=R(s),a=e.insert("g").attr("class","edgeLabel"),o=a.insert("g").attr("class","label"),r=t.labelType==="markdown",n=await tt(e,t.label,{style:t.labelStyle,useHtmlLabels:i,addSvgBackground:r,isNode:!1,markdown:r,width:r?void 0:Number.POSITIVE_INFINITY},s);o.node().appendChild(n);let c=n.getBBox(),u=c;if(i){let d=n.children[0],y=_(n);c=d.getBoundingClientRect(),u=c,y.attr("width",c.width),y.attr("height",c.height)}else{let d=_(n).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}o.attr("transform",et(u,i)),_t[t.id]=a,t.width=c.width,t.height=c.height;let g;if(t.startLabelLeft){let d=e.insert("g").attr("class","edgeTerminals"),y=d.insert("g").attr("class","inner"),m=await H(y,t.startLabelLeft,t.labelStyle);g=m;let b=m.getBBox();if(i){let E=m.children[0],w=_(m);b=E.getBoundingClientRect(),w.attr("width",b.width),w.attr("height",b.height)}y.attr("transform",et(b,i)),M[t.id]||(M[t.id]={}),M[t.id].startLeft=d,ot(g,t.startLabelLeft)}if(t.startLabelRight){let d=e.insert("g").attr("class","edgeTerminals"),y=d.insert("g").attr("class","inner"),m=await H(y,t.startLabelRight,t.labelStyle);g=m;let b=m.getBBox();if(i){let E=m.children[0],w=_(m);b=E.getBoundingClientRect(),w.attr("width",b.width),w.attr("height",b.height)}y.attr("transform",et(b,i)),M[t.id]||(M[t.id]={}),M[t.id].startRight=d,ot(g,t.startLabelRight)}if(t.endLabelLeft){let d=e.insert("g").attr("class","edgeTerminals"),y=d.insert("g").attr("class","inner"),m=await H(d,t.endLabelLeft,t.labelStyle);g=m;let b=m.getBBox();if(i){let E=m.children[0],w=_(m);b=E.getBoundingClientRect(),w.attr("width",b.width),w.attr("height",b.height)}y.attr("transform",et(b,i)),M[t.id]||(M[t.id]={}),M[t.id].endLeft=d,ot(g,t.endLabelLeft)}if(t.endLabelRight){let d=e.insert("g").attr("class","edgeTerminals"),y=d.insert("g").attr("class","inner"),m=await H(d,t.endLabelRight,t.labelStyle);g=m;let b=m.getBBox();if(i){let E=m.children[0],w=_(m);b=E.getBoundingClientRect(),w.attr("width",b.width),w.attr("height",b.height)}y.attr("transform",et(b,i)),M[t.id]||(M[t.id]={}),M[t.id].endRight=d,ot(g,t.endLabelRight)}return n},"insertEdgeLabel");function ot(e,t){R(B())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}l(ot,"setTerminalWidth");var le=l((e,t)=>{S.debug("Moving label abc88 ",e.id,e.label,_t[e.id],t);let s=t.updatedPath?t.updatedPath:t.originalPath,i=B(),{subGraphTitleTotalMargin:a}=Yt(i);if(e.label){let o=_t[e.id],r=e.x,n=e.y;if(s){let c=$.calcLabelPosition(s);S.debug("Moving label "+e.label+" from (",r,",",n,") to (",c.x,",",c.y,") abc88"),t.updatedPath&&(r=c.x,n=c.y)}o.attr("transform",`translate(${r}, ${n+a/2})`)}if(e.startLabelLeft){let o=M[e.id].startLeft,r=e.x,n=e.y;if(s){let c=$.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",s);r=c.x,n=c.y}o.attr("transform",`translate(${r}, ${n})`)}if(e.startLabelRight){let o=M[e.id].startRight,r=e.x,n=e.y;if(s){let c=$.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",s);r=c.x,n=c.y}o.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelLeft){let o=M[e.id].endLeft,r=e.x,n=e.y;if(s){let c=$.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",s);r=c.x,n=c.y}o.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelRight){let o=M[e.id].endRight,r=e.x,n=e.y;if(s){let c=$.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",s);r=c.x,n=c.y}o.attr("transform",`translate(${r}, ${n})`)}},"positionEdgeLabel"),yr=l((e,t)=>{let s=e.x,i=e.y,a=Math.abs(t.x-s),o=Math.abs(t.y-i),r=e.width/2,n=e.height/2;return a>=r||o>=n},"outsideNode"),mr=l((e,t,s)=>{S.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}`);let i=e.x,a=e.y,o=Math.abs(i-s.x),r=e.width/2,n=s.x<t.x?r-o:r+o,c=e.height/2,u=Math.abs(t.y-s.y),g=Math.abs(t.x-s.x);if(Math.abs(a-t.y)*r>Math.abs(i-t.x)*c){let d=s.y<t.y?t.y-c-a:a-c-t.y;n=g*d/u;let y={x:s.x<t.x?s.x+n:s.x-g+n,y:s.y<t.y?s.y+u-d:s.y-u+d};return n===0&&(y.x=t.x,y.y=t.y),g===0&&(y.x=t.x),u===0&&(y.y=t.y),S.debug(`abc89 topp/bott calc, Q ${u}, q ${d}, R ${g}, r ${n}`,y),y}else{s.x<t.x?n=t.x-r-i:n=i-r-t.x;let d=u*n/g,y=s.x<t.x?s.x+g-n:s.x-g+n,m=s.y<t.y?s.y+d:s.y-d;return S.debug(`sides calc abc89, Q ${u}, q ${d}, R ${g}, r ${n}`,{_x:y,_y:m}),n===0&&(y=t.x,m=t.y),g===0&&(y=t.x),u===0&&(m=t.y),{x:y,y:m}}},"intersection"),oe=l((e,t)=>{S.debug("abc88 cutPathAtIntersect",e,t);let s=[],i=e[0],a=!1;return e.forEach(o=>{if(!yr(t,o)&&!a){let r=mr(t,i,o),n=!1;s.forEach(c=>{n=n||c.x===r.x&&c.y===r.y}),s.some(c=>c.x===r.x&&c.y===r.y)||s.push(r),a=!0}else i=o,a||s.push(o)}),s},"cutPathAtIntersect"),he=l(function(e,t,s,i,a,o,r){let n=s.points;S.debug("abc88 InsertEdge: edge=",s,"e=",t);let c=!1,u=o.node(t.v);var g=o.node(t.w);g?.intersect&&u?.intersect&&(n=n.slice(1,s.points.length-1),n.unshift(u.intersect(n[0])),n.push(g.intersect(n[n.length-1]))),s.toCluster&&(S.debug("to cluster abc88",i[s.toCluster]),n=oe(s.points,i[s.toCluster].node),c=!0),s.fromCluster&&(S.debug("from cluster abc88",i[s.fromCluster]),n=oe(n.reverse(),i[s.fromCluster].node).reverse(),c=!0);let d=n.filter(k=>!Number.isNaN(k.y)),y=Ft;s.curve&&(a==="graph"||a==="flowchart")&&(y=s.curve);let{x:m,y:b}=Kt(s),E=Mt().x(m).y(b).curve(y),w;switch(s.thickness){case"normal":w="edge-thickness-normal";break;case"thick":w="edge-thickness-thick";break;case"invisible":w="edge-thickness-thick";break;default:w=""}switch(s.pattern){case"solid":w+=" edge-pattern-solid";break;case"dotted":w+=" edge-pattern-dotted";break;case"dashed":w+=" edge-pattern-dashed";break}let I=e.append("path").attr("d",E(d)).attr("id",s.id).attr("class"," "+w+(s.classes?" "+s.classes:"")).attr("style",s.style),C="";(B().flowchart.arrowMarkerAbsolute||B().state.arrowMarkerAbsolute)&&(C=Ot(!0)),ne(I,s,C,r,a);let T={};return c&&(T.updatedPath=n),T.originalPath=s.points,T},"insertEdge");var kr=l(e=>{let t=new Set;for(let 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"),ge=l((e,t,s,i)=>{let a=kr(e),o=2,r=t.height+2*s.padding,n=r/o,c=i??t.width+2*n+s.padding,u=s.padding/2;return a.has("right")&&a.has("left")&&a.has("up")&&a.has("down")?[{x:0,y:0},{x:n,y:0},{x:c/2,y:2*u},{x:c-n,y:0},{x:c,y:0},{x:c,y:-r/3},{x:c+2*u,y:-r/2},{x:c,y:-2*r/3},{x:c,y:-r},{x:c-n,y:-r},{x:c/2,y:-r-2*u},{x:n,y:-r},{x:0,y:-r},{x:0,y:-2*r/3},{x:-2*u,y:-r/2},{x:0,y:-r/3}]:a.has("right")&&a.has("left")&&a.has("up")?[{x:n,y:0},{x:c-n,y:0},{x:c,y:-r/2},{x:c-n,y:-r},{x:n,y:-r},{x:0,y:-r/2}]:a.has("right")&&a.has("left")&&a.has("down")?[{x:0,y:0},{x:n,y:-r},{x:c-n,y:-r},{x:c,y:0}]:a.has("right")&&a.has("up")&&a.has("down")?[{x:0,y:0},{x:c,y:-n},{x:c,y:-r+n},{x:0,y:-r}]:a.has("left")&&a.has("up")&&a.has("down")?[{x:c,y:0},{x:0,y:-n},{x:0,y:-r+n},{x:c,y:-r}]:a.has("right")&&a.has("left")?[{x:n,y:0},{x:n,y:-u},{x:c-n,y:-u},{x:c-n,y:0},{x:c,y:-r/2},{x:c-n,y:-r},{x:c-n,y:-r+u},{x:n,y:-r+u},{x:n,y:-r},{x:0,y:-r/2}]:a.has("up")&&a.has("down")?[{x:c/2,y:0},{x:0,y:-u},{x:n,y:-u},{x:n,y:-r+u},{x:0,y:-r+u},{x:c/2,y:-r},{x:c,y:-r+u},{x:c-n,y:-r+u},{x:c-n,y:-u},{x:c,y:-u}]:a.has("right")&&a.has("up")?[{x:0,y:0},{x:c,y:-n},{x:0,y:-r}]:a.has("right")&&a.has("down")?[{x:0,y:0},{x:c,y:0},{x:0,y:-r}]:a.has("left")&&a.has("up")?[{x:c,y:0},{x:0,y:-n},{x:c,y:-r}]:a.has("left")&&a.has("down")?[{x:c,y:0},{x:0,y:0},{x:c,y:-r}]:a.has("right")?[{x:n,y:-u},{x:n,y:-u},{x:c-n,y:-u},{x:c-n,y:0},{x:c,y:-r/2},{x:c-n,y:-r},{x:c-n,y:-r+u},{x:n,y:-r+u},{x:n,y:-r+u}]:a.has("left")?[{x:n,y:0},{x:n,y:-u},{x:c-n,y:-u},{x:c-n,y:-r+u},{x:n,y:-r+u},{x:n,y:-r},{x:0,y:-r/2}]:a.has("up")?[{x:n,y:-u},{x:n,y:-r+u},{x:0,y:-r+u},{x:c/2,y:-r},{x:c,y:-r+u},{x:c-n,y:-r+u},{x:c-n,y:-u}]:a.has("down")?[{x:c/2,y:0},{x:0,y:-u},{x:n,y:-u},{x:n,y:-r+u},{x:c-n,y:-r+u},{x:c-n,y:-u},{x:c,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function wr(e,t){return e.intersect(t)}l(wr,"intersectNode");var ue=wr;function Sr(e,t,s,i){var a=e.x,o=e.y,r=a-i.x,n=o-i.y,c=Math.sqrt(t*t*n*n+s*s*r*r),u=Math.abs(t*s*r/c);i.x<a&&(u=-u);var g=Math.abs(t*s*n/c);return i.y<o&&(g=-g),{x:a+u,y:o+g}}l(Sr,"intersectEllipse");var ct=Sr;function Lr(e,t,s){return ct(e,t,t,s)}l(Lr,"intersectCircle");var de=Lr;function Er(e,t,s,i){var a,o,r,n,c,u,g,d,y,m,b,E,w,I,C;if(a=t.y-e.y,r=e.x-t.x,c=t.x*e.y-e.x*t.y,y=a*s.x+r*s.y+c,m=a*i.x+r*i.y+c,!(y!==0&&m!==0&&pe(y,m))&&(o=i.y-s.y,n=s.x-i.x,u=i.x*s.y-s.x*i.y,g=o*e.x+n*e.y+u,d=o*t.x+n*t.y+u,!(g!==0&&d!==0&&pe(g,d))&&(b=a*n-o*r,b!==0)))return E=Math.abs(b/2),w=r*u-n*c,I=w<0?(w-E)/b:(w+E)/b,w=o*c-a*u,C=w<0?(w-E)/b:(w+E)/b,{x:I,y:C}}l(Er,"intersectLine");function pe(e,t){return e*t>0}l(pe,"sameSign");var fe=Er;var xe=Dr;function Dr(e,t,s){var i=e.x,a=e.y,o=[],r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(b){r=Math.min(r,b.x),n=Math.min(n,b.y)}):(r=Math.min(r,t.x),n=Math.min(n,t.y));for(var c=i-e.width/2-r,u=a-e.height/2-n,g=0;g<t.length;g++){var d=t[g],y=t[g<t.length-1?g+1:0],m=fe(e,s,{x:c+d.x,y:u+d.y},{x:c+y.x,y:u+y.y});m&&o.push(m)}return o.length?(o.length>1&&o.sort(function(b,E){var w=b.x-s.x,I=b.y-s.y,C=Math.sqrt(w*w+I*I),T=E.x-s.x,k=E.y-s.y,p=Math.sqrt(T*T+k*k);return C<p?-1:C===p?0:1}),o[0]):e}l(Dr,"intersectPolygon");var _r=l((e,t)=>{var s=e.x,i=e.y,a=t.x-s,o=t.y-i,r=e.width/2,n=e.height/2,c,u;return Math.abs(o)*r>Math.abs(a)*n?(o<0&&(n=-n),c=o===0?0:n*a/o,u=n):(a<0&&(r=-r),c=r,u=a===0?0:r*o/a),{x:s+c,y:i+u}},"intersectRect"),be=_r;var v={node:ue,circle:de,ellipse:ct,polygon:xe,rect:be};var z=l(async(e,t,s,i)=>{let a=B(),o,r=t.useHtmlLabels||R(a);s?o=s:o="node default";let n=e.insert("g").attr("class",o).attr("id",t.domId||t.id),c=n.insert("g").attr("class","label").attr("style",t.labelStyle),u;t.labelText===void 0?u="":u=typeof t.labelText=="string"?t.labelText:t.labelText[0];let g;t.labelType==="markdown"?g=tt(c,bt(yt(u),a),{useHtmlLabels:r,width:t.width||a.flowchart.wrappingWidth,classes:"markdown-node-label"},a):g=await H(c,bt(yt(u),a),t.labelStyle,!1,i);let d=g.getBBox(),y=t.padding/2;if(R(a)){let m=g.children[0],b=_(g);await Wt(m,u),d=m.getBoundingClientRect(),b.attr("width",d.width),b.attr("height",d.height)}return r?c.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):c.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&c.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:n,bbox:d,halfPadding:y,label:c}},"labelHelper"),N=l((e,t)=>{let s=t.node().getBBox();e.width=s.width,e.height=s.height},"updateNodeBounds");function V(e,t,s,i){return e.insert("polygon",":first-child").attr("points",i.map(function(a){return a.x+","+a.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+s/2+")")}l(V,"insertPolygonShape");var Br=l(async(e,t)=>{t.useHtmlLabels||R(B())||(t.centerLabel=!0);let{shapeSvg:i,bbox:a,halfPadding:o}=await z(e,t,"node "+t.classes,!0);S.info("Classes = ",t.classes);let r=i.insert("rect",":first-child");return r.attr("rx",t.rx).attr("ry",t.ry).attr("x",-a.width/2-o).attr("y",-a.height/2-o).attr("width",a.width+t.padding).attr("height",a.height+t.padding),N(t,r),t.intersect=function(n){return v.rect(t,n)},i},"note"),ye=Br;var me=l(e=>e?" "+e:"","formatClass"),Y=l((e,t)=>`${t||"node default"}${me(e.classes)} ${me(e.class)}`,"getClassesFromNode"),ke=l(async(e,t)=>{let{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),a=i.width+t.padding,o=i.height+t.padding,r=a+o,n=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];S.info("Question main (Circle)");let c=V(s,r,r,n);return c.attr("style",t.style),N(t,c),t.intersect=function(u){return S.warn("Intersect called"),v.polygon(t,n,u)},s},"question"),vr=l((e,t)=>{let s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=28,a=[{x:0,y:i/2},{x:i/2,y:0},{x:0,y:-i/2},{x:-i/2,y:0}];return s.insert("polygon",":first-child").attr("points",a.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 v.circle(t,14,r)},s},"choice"),Tr=l(async(e,t)=>{let{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),a=4,o=t.positioned?t.height:i.height+t.padding,r=o/a,n=t.positioned?t.width:i.width+2*r+t.padding,c=[{x:r,y:0},{x:n-r,y:0},{x:n,y:-o/2},{x:n-r,y:-o},{x:r,y:-o},{x:0,y:-o/2}],u=V(s,n,o,c);return u.attr("style",t.style),N(t,u),t.intersect=function(g){return v.polygon(t,c,g)},s},"hexagon"),Cr=l(async(e,t)=>{let{shapeSvg:s,bbox:i}=await z(e,t,void 0,!0),a=2,o=i.height+2*t.padding,r=o/a,n=i.width+2*r+t.padding,u=t.positioned&&(t.widthInColumns??1)>1&&t.width>n?t.width:n,g=ge(t.directions,i,t,u),d=V(s,u,o,g);return d.attr("style",t.style),N(t,d),t.intersect=function(y){return v.polygon(t,g,y)},s},"block_arrow"),Nr=l(async(e,t)=>{let{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),a=i.width+t.padding,o=i.height+t.padding,r=[{x:-o/2,y:0},{x:a,y:0},{x:a,y:-o},{x:-o/2,y:-o},{x:0,y:-o/2}];return V(s,a,o,r).attr("style",t.style),t.width=a+o,t.height=o,t.intersect=function(c){return v.polygon(t,r,c)},s},"rect_left_inv_arrow"),Ir=l(async(e,t)=>{let{shapeSvg:s,bbox:i}=await z(e,t,Y(t),!0),a=i.width+t.padding,o=i.height+t.padding,r=[{x:-2*o/6,y:0},{x:a-o/6,y:0},{x:a+2*o/6,y:-o},{x:o/6,y:-o}],n=V(s,a,o,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return v.polygon(t,r,c)},s},"lean_right"),Or=l(async(e,t)=>{let{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),a=i.width+t.padding,o=i.height+t.padding,r=[{x:2*o/6,y:0},{x:a+o/6,y:0},{x:a-2*o/6,y:-o},{x:-o/6,y:-o}],n=V(s,a,o,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return v.polygon(t,r,c)},s},"lean_left"),Rr=l(async(e,t)=>{let{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),a=i.width+t.padding,o=i.height+t.padding,r=[{x:-2*o/6,y:0},{x:a+2*o/6,y:0},{x:a-o/6,y:-o},{x:o/6,y:-o}],n=V(s,a,o,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return v.polygon(t,r,c)},s},"trapezoid"),zr=l(async(e,t)=>{let{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),a=i.width+t.padding,o=i.height+t.padding,r=[{x:o/6,y:0},{x:a-o/6,y:0},{x:a+2*o/6,y:-o},{x:-2*o/6,y:-o}],n=V(s,a,o,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return v.polygon(t,r,c)},s},"inv_trapezoid"),Ar=l(async(e,t)=>{let{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),a=i.width+t.padding,o=i.height+t.padding,r=[{x:0,y:0},{x:a+o/2,y:0},{x:a,y:-o/2},{x:a+o/2,y:-o},{x:0,y:-o}],n=V(s,a,o,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return v.polygon(t,r,c)},s},"rect_right_inv_arrow"),Mr=l(async(e,t)=>{let{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),a=i.width+t.padding,o=a/2,r=o/(2.5+a/50),n=i.height+r+t.padding,c="M 0,"+r+" a "+o+","+r+" 0,0,0 "+a+" 0 a "+o+","+r+" 0,0,0 "+-a+" 0 l 0,"+n+" a "+o+","+r+" 0,0,0 "+a+" 0 l 0,"+-n,u=s.attr("label-offset-y",r).insert("path",":first-child").attr("style",t.style).attr("d",c).attr("transform","translate("+-a/2+","+-(n/2+r)+")");return N(t,u),t.intersect=function(g){let d=v.rect(t,g),y=d.x-t.x;if(o!=0&&(Math.abs(y)<t.width/2||Math.abs(y)==t.width/2&&Math.abs(d.y-t.y)>t.height/2-r)){let m=r*r*(1-y*y/(o*o));m!=0&&(m=Math.sqrt(m)),m=r-m,g.y-t.y>0&&(m=-m),d.y+=m}return d},s},"cylinder"),Fr=l(async(e,t)=>{let{shapeSvg:s,bbox:i,halfPadding:a}=await z(e,t,"node "+t.classes+" "+t.class,!0),o=s.insert("rect",":first-child"),r=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-r/2:-i.width/2-a,u=t.positioned?-n/2:-i.height/2-a;if(o.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",u).attr("width",r).attr("height",n),t.props){let g=new Set(Object.keys(t.props));t.props.borders&&(Bt(o,t.props.borders,r,n),g.delete("borders")),g.forEach(d=>{S.warn(`Unknown node property ${d}`)})}return N(t,o),t.intersect=function(g){return v.rect(t,g)},s},"rect"),Hr=l(async(e,t)=>{let{shapeSvg:s,bbox:i,halfPadding:a}=await z(e,t,"node "+t.classes,!0),o=s.insert("rect",":first-child"),r=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,c=t.positioned?-r/2:-i.width/2-a,u=t.positioned?-n/2:-i.height/2-a;if(o.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",c).attr("y",u).attr("width",r).attr("height",n),t.props){let g=new Set(Object.keys(t.props));t.props.borders&&(Bt(o,t.props.borders,r,n),g.delete("borders")),g.forEach(d=>{S.warn(`Unknown node property ${d}`)})}return N(t,o),t.intersect=function(g){return v.rect(t,g)},s},"composite"),Pr=l(async(e,t)=>{let{shapeSvg:s}=await z(e,t,"label",!0);S.trace("Classes = ",t.class);let i=s.insert("rect",":first-child"),a=0,o=0;if(i.attr("width",a).attr("height",o),s.attr("class","label edgeLabel"),t.props){let r=new Set(Object.keys(t.props));t.props.borders&&(Bt(i,t.props.borders,a,o),r.delete("borders")),r.forEach(n=>{S.warn(`Unknown node property ${n}`)})}return N(t,i),t.intersect=function(r){return v.rect(t,r)},s},"labelRect");function Bt(e,t,s,i){let a=[],o=l(n=>{a.push(n,0)},"addBorder"),r=l(n=>{a.push(0,n)},"skipBorder");t.includes("t")?(S.debug("add top border"),o(s)):r(s),t.includes("r")?(S.debug("add right border"),o(i)):r(i),t.includes("b")?(S.debug("add bottom border"),o(s)):r(s),t.includes("l")?(S.debug("add left border"),o(i)):r(i),e.attr("stroke-dasharray",a.join(" "))}l(Bt,"applyNodePropertyBorders");var Wr=l(async(e,t)=>{let s;t.classes?s="node "+t.classes:s="node default";let i=e.insert("g").attr("class",s).attr("id",t.domId||t.id),a=i.insert("rect",":first-child"),o=i.insert("line"),r=i.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText,c="";typeof n=="object"?c=n[0]:c=n,S.info("Label text abc79",c,n,typeof n=="object");let u=await H(r,c,t.labelStyle,!0,!0),g={width:0,height:0};if(R(B())){let E=u.children[0],w=_(u);g=E.getBoundingClientRect(),w.attr("width",g.width),w.attr("height",g.height)}S.info("Text 2",n);let d=n.slice(1,n.length),y=u.getBBox(),m=await H(r,d.join?d.join("<br/>"):d,t.labelStyle,!0,!0);if(R(B())){let E=m.children[0],w=_(m);g=E.getBoundingClientRect(),w.attr("width",g.width),w.attr("height",g.height)}let b=t.padding/2;return _(m).attr("transform","translate( "+(g.width>y.width?0:(y.width-g.width)/2)+", "+(y.height+b+5)+")"),_(u).attr("transform","translate( "+(g.width<y.width?0:-(y.width-g.width)/2)+", 0)"),g=r.node().getBBox(),r.attr("transform","translate("+-g.width/2+", "+(-g.height/2-b+3)+")"),a.attr("class","outer title-state").attr("x",-g.width/2-b).attr("y",-g.height/2-b).attr("width",g.width+t.padding).attr("height",g.height+t.padding),o.attr("class","divider").attr("x1",-g.width/2-b).attr("x2",g.width/2+b).attr("y1",-g.height/2-b+y.height+b).attr("y2",-g.height/2-b+y.height+b),N(t,a),t.intersect=function(E){return v.rect(t,E)},i},"rectWithTitle"),Yr=l(async(e,t)=>{let{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),a=i.height+t.padding,o=i.width+a/4+t.padding,r=s.insert("rect",":first-child").attr("style",t.style).attr("rx",a/2).attr("ry",a/2).attr("x",-o/2).attr("y",-a/2).attr("width",o).attr("height",a);return N(t,r),t.intersect=function(n){return v.rect(t,n)},s},"stadium"),Kr=l(async(e,t)=>{let{shapeSvg:s,bbox:i,halfPadding:a}=await z(e,t,Y(t,void 0),!0),o=s.insert("circle",":first-child");return o.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+a).attr("width",i.width+t.padding).attr("height",i.height+t.padding),S.info("Circle main"),N(t,o),t.intersect=function(r){return S.info("Circle intersect",t,i.width/2+a,r),v.circle(t,i.width/2+a,r)},s},"circle"),jr=l(async(e,t)=>{let{shapeSvg:s,bbox:i,halfPadding:a}=await z(e,t,Y(t,void 0),!0),o=5,r=s.insert("g",":first-child"),n=r.insert("circle"),c=r.insert("circle");return r.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+a+o).attr("width",i.width+t.padding+o*2).attr("height",i.height+t.padding+o*2),c.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+a).attr("width",i.width+t.padding).attr("height",i.height+t.padding),S.info("DoubleCircle main"),N(t,n),t.intersect=function(u){return S.info("DoubleCircle intersect",t,i.width/2+a+o,u),v.circle(t,i.width/2+a+o,u)},s},"doublecircle"),Vr=l(async(e,t)=>{let{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),a=i.width+t.padding,o=i.height+t.padding,r=[{x:0,y:0},{x:a,y:0},{x:a,y:-o},{x:0,y:-o},{x:0,y:0},{x:-8,y:0},{x:a+8,y:0},{x:a+8,y:-o},{x:-8,y:-o},{x:-8,y:0}],n=V(s,a,o,r);return n.attr("style",t.style),N(t,n),t.intersect=function(c){return v.polygon(t,r,c)},s},"subroutine"),Ur=l((e,t)=>{let s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=s.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),N(t,i),t.intersect=function(a){return v.circle(t,7,a)},s},"start"),we=l((e,t,s)=>{let i=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),a=70,o=10;s==="LR"&&(a=10,o=70);let r=i.append("rect").attr("x",-1*a/2).attr("y",-1*o/2).attr("width",a).attr("height",o).attr("class","fork-join");return N(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return v.rect(t,n)},i},"forkJoin"),Xr=l((e,t)=>{let s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=s.insert("circle",":first-child"),a=s.insert("circle",":first-child");return a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),i.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),N(t,a),t.intersect=function(o){return v.circle(t,7,o)},s},"end"),Gr=l(async(e,t)=>{let s=t.padding/2,i=4,a=8,o;t.classes?o="node "+t.classes:o="node default";let r=e.insert("g").attr("class",o).attr("id",t.domId||t.id),n=r.insert("rect",":first-child"),c=r.insert("line"),u=r.insert("line"),g=0,d=i,y=r.insert("g").attr("class","label"),m=0,b=t.classData.annotations?.[0],E=t.classData.annotations[0]?"\xAB"+t.classData.annotations[0]+"\xBB":"",w=await H(y,E,t.labelStyle,!0,!0),I=w.getBBox();if(R(B())){let D=w.children[0],h=_(w);I=D.getBoundingClientRect(),h.attr("width",I.width),h.attr("height",I.height)}t.classData.annotations[0]&&(d+=I.height+i,g+=I.width);let C=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(R(B())?C+="<"+t.classData.type+">":C+="<"+t.classData.type+">");let T=await H(y,C,t.labelStyle,!0,!0);_(T).attr("class","classTitle");let k=T.getBBox();if(R(B())){let D=T.children[0],h=_(T);k=D.getBoundingClientRect(),h.attr("width",k.width),h.attr("height",k.height)}d+=k.height+i,k.width>g&&(g=k.width);let p=[];t.classData.members.forEach(async D=>{let h=D.getDisplayDetails(),P=h.displayText;R(B())&&(P=P.replace(/</g,"<").replace(/>/g,">"));let f=await H(y,P,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0),O=f.getBBox();if(R(B())){let Z=f.children[0],U=_(f);O=Z.getBoundingClientRect(),U.attr("width",O.width),U.attr("height",O.height)}O.width>g&&(g=O.width),d+=O.height+i,p.push(f)}),d+=a;let x=[];if(t.classData.methods.forEach(async D=>{let h=D.getDisplayDetails(),P=h.displayText;R(B())&&(P=P.replace(/</g,"<").replace(/>/g,">"));let f=await H(y,P,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0),O=f.getBBox();if(R(B())){let Z=f.children[0],U=_(f);O=Z.getBoundingClientRect(),U.attr("width",O.width),U.attr("height",O.height)}O.width>g&&(g=O.width),d+=O.height+i,x.push(f)}),d+=a,b){let D=(g-I.width)/2;_(w).attr("transform","translate( "+(-1*g/2+D)+", "+-1*d/2+")"),m=I.height+i}let L=(g-k.width)/2;return _(T).attr("transform","translate( "+(-1*g/2+L)+", "+(-1*d/2+m)+")"),m+=k.height+i,c.attr("class","divider").attr("x1",-g/2-s).attr("x2",g/2+s).attr("y1",-d/2-s+a+m).attr("y2",-d/2-s+a+m),m+=a,p.forEach(D=>{_(D).attr("transform","translate( "+-g/2+", "+(-1*d/2+m+a/2)+")");let h=D?.getBBox();m+=(h?.height??0)+i}),m+=a,u.attr("class","divider").attr("x1",-g/2-s).attr("x2",g/2+s).attr("y1",-d/2-s+a+m).attr("y2",-d/2-s+a+m),m+=a,x.forEach(D=>{_(D).attr("transform","translate( "+-g/2+", "+(-1*d/2+m)+")");let h=D?.getBBox();m+=(h?.height??0)+i}),n.attr("style",t.style).attr("class","outer title-state").attr("x",-g/2-s).attr("y",-(d/2)-s).attr("width",g+t.padding).attr("height",d+t.padding),N(t,n),t.intersect=function(D){return v.rect(t,D)},r},"class_box"),Se={rhombus:ke,composite:Hr,question:ke,rect:Fr,labelRect:Pr,rectWithTitle:Wr,choice:vr,circle:Kr,doublecircle:jr,stadium:Yr,hexagon:Tr,block_arrow:Cr,rect_left_inv_arrow:Nr,lean_right:Ir,lean_left:Or,trapezoid:Rr,inv_trapezoid:zr,rect_right_inv_arrow:Ar,cylinder:Mr,start:Ur,end:Xr,note:ye,subroutine:Vr,fork:we,join:we,class_box:Gr},lt={},vt=l(async(e,t,s)=>{let i,a;if(t.link){let o;B().securityLevel==="sandbox"?o="_top":t.linkTarget&&(o=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",o),a=await Se[t.shape](i,t,s)}else a=await Se[t.shape](e,t,s),i=a;return t.tooltip&&a.attr("title",t.tooltip),t.class&&a.attr("class","node default "+t.class),lt[t.id]=i,t.haveCallback&<[t.id].attr("class",lt[t.id].attr("class")+" clickable"),i},"insertNode");var Le=l(e=>{let t=lt[e.id];S.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");let s=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-s)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode");function Ee(e,t,s=!1){let i=e,a="default";(i?.classes?.length||0)>0&&(a=(i?.classes??[]).join(" ")),a=a+" flowchart-label";let o=0,r="",n;switch(i.type){case"round":o=5,r="rect";break;case"composite":o=0,r="composite",n=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"}let c=Pt(i?.styles??[]),u=i.label,g=i.size??{width:0,height:0,x:0,y:0},d=t.getDiagramId();return{labelStyle:c.labelStyle,shape:r,labelText:u,rx:o,ry:o,class:a,style:c.style,id:i.id,domId:d?`${d}-${i.id}`:i.id,directions:i.directions,width:g.width,height:g.height,x:g.x,y:g.y,positioned:s,intersect:void 0,type:i.type,padding:n??q()?.block?.padding??0,widthInColumns:i.widthInColumns??1}}l(Ee,"getNodeFromBlock");async function Zr(e,t,s){let i=Ee(t,s,!1);if(i.type==="group")return;let a=q(),o=await vt(e,i,{config:a}),r=o.node().getBBox(),n=s.getBlock(i.id);n.size={width:r.width,height:r.height,x:0,y:0,node:o},s.setBlock(n),o.remove()}l(Zr,"calculateBlockSize");async function qr(e,t,s){let i=Ee(t,s,!0);if(s.getBlock(i.id).type!=="space"){let o=q();await vt(e,i,{config:o}),t.intersect=i?.intersect,Le(i)}}l(qr,"insertBlockPositioned");async function Tt(e,t,s,i){for(let a of t)await i(e,a,s),a.children&&await Tt(e,a.children,s,i)}l(Tt,"performOperations");async function De(e,t,s){await Tt(e,t,s,Zr)}l(De,"calculateBlockSizes");async function _e(e,t,s){await Tt(e,t,s,qr)}l(_e,"insertBlocks");async function Be(e,t,s,i,a){let o=new jt({multigraph:!0,compound:!0});o.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(let r of s)r.size&&o.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(let r of t)if(r.start&&r.end){let n=i.getBlock(r.start),c=i.getBlock(r.end);if(n?.size&&c?.size){let u=n.size,g=c.size,d=[{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}],y=a?`${a}-${r.id}`:r.id,m=r.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",b=r.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",E=`${m} ${b} flowchart-link LS-a1 LE-b1`;he(e,{v:r.start,w:r.end,name:y},{...r,id:y,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:d,classes:E},void 0,"block",o,a),r.label&&(await ce(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:d,classes:E}),le({...r,x:d[1].x,y:d[1].y},{originalPath:d}))}}}l(Be,"insertEdges");var Jr=l(function(e,t){return t.db.getClasses()},"getClasses"),Qr=l(async function(e,t,s,i){let{securityLevel:a,block:o}=q(),r=i.db;r.setDiagramId(t);let n;a==="sandbox"&&(n=_("#i"+t));let c=a==="sandbox"?_(n.nodes()[0].contentDocument.body):_("body"),u=a==="sandbox"?c.select(`[id="${t}"]`):_(`[id="${t}"]`);te(u,["point","circle","cross"],i.type,t);let d=r.getBlocks(),y=r.getBlocksFlat(),m=r.getEdges(),b=u.insert("g").attr("class","block");await De(b,d,r);let E=ae(r);if(await _e(b,d,r),await Be(b,m,y,r,t),E){let w=E,I=Math.max(1,Math.round(.125*(w.width/w.height))),C=w.height+I+10,T=w.width+10,{useMaxWidth:k}=o;zt(u,C,T,!!k),S.debug("Here Bounds",E,w),u.attr("viewBox",`${w.x-5} ${w.y-5} ${w.width+10} ${w.height+10}`)}},"draw"),ve={draw:Qr,getClasses:Jr};var ai={parser:Ut,db:Qt,renderer:ve,styles:$t};export{ai as diagram};