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