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