You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
venv/PyCharm 2025.2.1.1/plugins/python/jupyter-web/7468.js

1 line
78 KiB

"use strict";(self.webpackChunkjupyter_web=self.webpackChunkjupyter_web||[]).push([[7468],{77468:(Rt,lt,N)=>{N.r(lt),N.d(lt,{diagram:()=>Fr});var W=N(53420),pt=N(11930),bt=N(25333),ut=N(50027),X=N(62477),c=N(3685),ft=N(38884),vt=N(84647),ct=N(29016),I=N(31083),Et=N(75788),tt=function(){var r=(0,c.eW)(function(T,_,g,x){for(g=g||{},x=T.length;x--;g[T[x]]=_);return g},"o"),e=[1,7],t=[1,13],l=[1,14],n=[1,15],a=[1,19],s=[1,16],i=[1,17],o=[1,18],p=[8,30],h=[8,21,28,29,30,31,32,40,44,47],b=[1,23],L=[1,24],m=[8,15,16,21,28,29,30,31,32,40,44,47],w=[8,15,16,21,27,28,29,30,31,32,40,44,47],C=[1,49],D={trace:(0,c.eW)(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,block:31,NODE_ID:32,nodeShapeNLabel:33,dirList:34,DIR:35,NODE_DSTART:36,NODE_DEND:37,BLOCK_ARROW_START:38,BLOCK_ARROW_END:39,classDef:40,CLASSDEF_ID:41,CLASSDEF_STYLEOPTS:42,DEFAULT:43,class:44,CLASSENTITY_IDS:45,STYLECLASS:46,style:47,STYLE_ENTITY_IDS:48,STYLE_DEFINITION_DATA:49,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"block",32:"NODE_ID",35:"DIR",36:"NODE_DSTART",37:"NODE_DEND",38:"BLOCK_ARROW_START",39:"BLOCK_ARROW_END",40:"classDef",41:"CLASSDEF_ID",42:"CLASSDEF_STYLEOPTS",43:"DEFAULT",44:"class",45:"CLASSENTITY_IDS",46:"STYLECLASS",47:"style",48:"STYLE_ENTITY_IDS",49:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[34,1],[34,2],[33,3],[33,4],[23,3],[23,3],[24,3],[25,3]],performAction:(0,c.eW)(function(_,g,x,k,v,u,J){var f=u.length-1;switch(v){case 4:k.getLogger().debug("Rule: separator (NL) ");break;case 5:k.getLogger().debug("Rule: separator (Space) ");break;case 6:k.getLogger().debug("Rule: separator (EOF) ");break;case 7:k.getLogger().debug("Rule: hierarchy: ",u[f-1]),k.setHierarchy(u[f-1]);break;case 8:k.getLogger().debug("Stop NL ");break;case 9:k.getLogger().debug("Stop EOF ");break;case 10:k.getLogger().debug("Stop NL2 ");break;case 11:k.getLogger().debug("Stop EOF2 ");break;case 12:k.getLogger().debug("Rule: statement: ",u[f]),"number"==typeof u[f].length?this.$=u[f]:this.$=[u[f]];break;case 13:k.getLogger().debug("Rule: statement #2: ",u[f-1]),this.$=[u[f-1]].concat(u[f]);break;case 14:k.getLogger().debug("Rule: link: ",u[f],_),this.$={edgeTypeStr:u[f],label:""};break;case 15:k.getLogger().debug("Rule: LABEL link: ",u[f-3],u[f-1],u[f]),this.$={edgeTypeStr:u[f],label:u[f-1]};break;case 18:const Y=parseInt(u[f]),ht=k.generateId();this.$={id:ht,type:"space",label:"",width:Y,children:[]};break;case 23:k.getLogger().debug("Rule: (nodeStatement link node) ",u[f-2],u[f-1],u[f]," typestr: ",u[f-1].edgeTypeStr);const at=k.edgeStrToEdgeData(u[f-1].edgeTypeStr);this.$=[{id:u[f-2].id,label:u[f-2].label,type:u[f-2].type,directions:u[f-2].directions},{id:u[f-2].id+"-"+u[f].id,start:u[f-2].id,end:u[f].id,label:u[f-1].label,type:"edge",directions:u[f].directions,arrowTypeEnd:at,arrowTypeStart:"arrow_open"},{id:u[f].id,label:u[f].label,type:k.typeStr2Type(u[f].typeStr),directions:u[f].directions}];break;case 24:k.getLogger().debug("Rule: nodeStatement (abc88 node size) ",u[f-1],u[f]),this.$={id:u[f-1].id,label:u[f-1].label,type:k.typeStr2Type(u[f-1].typeStr),directions:u[f-1].directions,widthInColumns:parseInt(u[f],10)};break;case 25:k.getLogger().debug("Rule: nodeStatement (node) ",u[f]),this.$={id:u[f].id,label:u[f].label,type:k.typeStr2Type(u[f].typeStr),directions:u[f].directions,widthInColumns:1};break;case 26:k.getLogger().debug("APA123",this?this:"na"),k.getLogger().debug("COLUMNS: ",u[f]),this.$={type:"column-setting",columns:"auto"===u[f]?-1:parseInt(u[f])};break;case 27:k.getLogger().debug("Rule: id-block statement : ",u[f-2],u[f-1]);k.generateId();this.$={...u[f-2],type:"composite",children:u[f-1]};break;case 28:k.getLogger().debug("Rule: blockStatement : ",u[f-2],u[f-1],u[f]);const Mt=k.generateId();this.$={id:Mt,type:"composite",label:"",children:u[f-1]};break;case 29:k.getLogger().debug("Rule: node (NODE_ID separator): ",u[f]),this.$={id:u[f]};break;case 30:k.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",u[f-1],u[f]),this.$={id:u[f-1],label:u[f].label,typeStr:u[f].typeStr,directions:u[f].directions};break;case 31:k.getLogger().debug("Rule: dirList: ",u[f]),this.$=[u[f]];break;case 32:k.getLogger().debug("Rule: dirList: ",u[f-1],u[f]),this.$=[u[f-1]].concat(u[f]);break;case 33:k.getLogger().debug("Rule: nodeShapeNLabel: ",u[f-2],u[f-1],u[f]),this.$={typeStr:u[f-2]+u[f],label:u[f-1]};break;case 34:k.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",u[f-3],u[f-2]," #3:",u[f-1],u[f]),this.$={typeStr:u[f-3]+u[f],label:u[f-2],directions:u[f-1]};break;case 35:case 36:this.$={type:"classDef",id:u[f-1].trim(),css:u[f].trim()};break;case 37:this.$={type:"applyClass",id:u[f-1].trim(),styleClass:u[f].trim()};break;case 38:this.$={type:"applyStyles",id:u[f-1].trim(),stylesStr:u[f].trim()}}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:t,29:l,31:n,32:a,40:s,44:i,47:o},{8:[1,20]},r(p,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:e,28:t,29:l,31:n,32:a,40:s,44:i,47:o}),r(h,[2,16],{14:22,15:b,16:L}),r(h,[2,17]),r(h,[2,18]),r(h,[2,19]),r(h,[2,20]),r(h,[2,21]),r(h,[2,22]),r(m,[2,25],{27:[1,25]}),r(h,[2,26]),{19:26,26:12,32:a},{11:27,13:4,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:t,29:l,31:n,32:a,40:s,44:i,47:o},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},r(w,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},r(p,[2,13]),{26:35,32:a},{32:[2,14]},{17:[1,36]},r(m,[2,24]),{11:37,13:4,14:22,15:b,16:L,19:5,20:6,21:e,22:8,23:9,24:10,25:11,26:12,28:t,29:l,31:n,32:a,40:s,44:i,47:o},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},r(w,[2,30]),{18:[1,43]},{18:[1,44]},r(m,[2,23]),{18:[1,45]},{30:[1,46]},r(h,[2,28]),r(h,[2,35]),r(h,[2,36]),r(h,[2,37]),r(h,[2,38]),{37:[1,47]},{34:48,35:C},{15:[1,50]},r(h,[2,27]),r(w,[2,33]),{39:[1,51]},{34:52,35:C,39:[2,31]},{32:[2,15]},r(w,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:(0,c.eW)(function(_,g){if(!g.recoverable){var x=new Error(_);throw x.hash=g,x}this.trace(_)},"parseError"),parse:(0,c.eW)(function(_){var g=this,x=[0],k=[],v=[null],u=[],J=this.table,f="",Y=0,ht=0,at=0,we=2,Mt=1,jr=u.slice.call(arguments,1),j=Object.create(this.lexer),dt={yy:{}};for(var Jt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Jt)&&(dt.yy[Jt]=this.yy[Jt]);j.setInput(_,dt.yy),dt.yy.lexer=j,dt.yy.parser=this,typeof j.yylloc>"u"&&(j.yylloc={});var Qt=j.yylloc;u.push(Qt);var Kr=j.options&&j.options.ranges;function Ur(Q){x.length=x.length-2*Q,v.length=v.length-Q,u.length=u.length-Q}function Se(){var Q;return"number"!=typeof(Q=k.pop()||j.lex()||Mt)&&(Q instanceof Array&&(Q=(k=Q).pop()),Q=g.symbols_[Q]||Q),Q}"function"==typeof dt.yy.parseError?this.parseError=dt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,c.eW)(Ur,"popStack"),(0,c.eW)(Se,"lex");for(var H,$t,gt,q,qt,Bt,nt,ve,It,xt={};;){if(gt=x[x.length-1],this.defaultActions[gt]?q=this.defaultActions[gt]:((null===H||typeof H>"u")&&(H=Se()),q=J[gt]&&J[gt][H]),typeof q>"u"||!q.length||!q[0]){var te="";for(Bt in It=[],J[gt])this.terminals_[Bt]&&Bt>we&&It.push("'"+this.terminals_[Bt]+"'");te=j.showPosition?"Parse error on line "+(Y+1)+":\n"+j.showPosition()+"\nExpecting "+It.join(", ")+", got '"+(this.terminals_[H]||H)+"'":"Parse error on line "+(Y+1)+": Unexpected "+(H==Mt?"end of input":"'"+(this.terminals_[H]||H)+"'"),this.parseError(te,{text:j.match,token:this.terminals_[H]||H,line:j.yylineno,loc:Qt,expected:It})}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+gt+", token: "+H);switch(q[0]){case 1:x.push(H),v.push(j.yytext),u.push(j.yylloc),x.push(q[1]),H=null,$t?(H=$t,$t=null):(ht=j.yyleng,f=j.yytext,Y=j.yylineno,Qt=j.yylloc,at>0&&at--);break;case 2:if(nt=this.productions_[q[1]][1],xt.$=v[v.length-nt],xt._$={first_line:u[u.length-(nt||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(nt||1)].first_column,last_column:u[u.length-1].last_column},Kr&&(xt._$.range=[u[u.length-(nt||1)].range[0],u[u.length-1].range[1]]),typeof(qt=this.performAction.apply(xt,[f,ht,Y,dt.yy,q[1],v,u].concat(jr)))<"u")return qt;nt&&(x=x.slice(0,-1*nt*2),v=v.slice(0,-1*nt),u=u.slice(0,-1*nt)),x.push(this.productions_[q[1]][0]),v.push(xt.$),u.push(xt._$),ve=J[x[x.length-2]][x[x.length-1]],x.push(ve);break;case 3:return!0}}return!0},"parse")},B=function(){return{EOF:1,parseError:(0,c.eW)(function(g,x){if(!this.yy.parser)throw new Error(g);this.yy.parser.parseError(g,x)},"parseError"),setInput:(0,c.eW)(function(_,g){return this.yy=g||this.yy||{},this._input=_,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:(0,c.eW)(function(){var _=this._input[0];return this.yytext+=_,this.yyleng++,this.offset++,this.match+=_,this.matched+=_,_.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),_},"input"),unput:(0,c.eW)(function(_){var g=_.length,x=_.split(/(?:\r\n?|\n)/g);this._input=_+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var k=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var v=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===k.length?this.yylloc.first_column:0)+k[k.length-x.length].length-x[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:(0,c.eW)(function(){return this._more=!0,this},"more"),reject:(0,c.eW)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,c.eW)(function(_){this.unput(this.match.slice(_))},"less"),pastInput:(0,c.eW)(function(){var _=this.matched.substr(0,this.matched.length-this.match.length);return(_.length>20?"...":"")+_.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,c.eW)(function(){var _=this.match;return _.length<20&&(_+=this._input.substr(0,20-_.length)),(_.substr(0,20)+(_.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,c.eW)(function(){var _=this.pastInput(),g=new Array(_.length+1).join("-");return _+this.upcomingInput()+"\n"+g+"^"},"showPosition"),test_match:(0,c.eW)(function(_,g){var x,k,v;if(this.options.backtrack_lexer&&(v={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&&(v.yylloc.range=this.yylloc.range.slice(0))),(k=_[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=k.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+_[0].length},this.yytext+=_[0],this.match+=_[0],this.matches=_,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(_[0].length),this.matched+=_[0],x=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var u in v)this[u]=v[u];return!1}return!1},"test_match"),next:(0,c.eW)(function(){if(this.done)return this.EOF;var _,g,x,k;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),u=0;u<v.length;u++)if((x=this._input.match(this.rules[v[u]]))&&(!g||x[0].length>g[0].length)){if(g=x,k=u,this.options.backtrack_lexer){if(!1!==(_=this.test_match(x,v[u])))return _;if(this._backtrack){g=!1;continue}return!1}if(!this.options.flex)break}return g?!1!==(_=this.test_match(g,v[k]))&&_:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,c.eW)(function(){return this.next()||this.lex()},"lex"),begin:(0,c.eW)(function(g){this.conditionStack.push(g)},"begin"),popState:(0,c.eW)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,c.eW)(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:(0,c.eW)(function(g){return(g=this.conditionStack.length-1-Math.abs(g||0))>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:(0,c.eW)(function(g){this.begin(g)},"pushState"),stateStackSize:(0,c.eW)(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:(0,c.eW)(function(g,x,k,v){switch(k){case 0:return 10;case 1:return g.getLogger().debug("Found space-block"),31;case 2:return g.getLogger().debug("Found nl-block"),31;case 3:return g.getLogger().debug("Found space-block"),29;case 4:g.getLogger().debug(".",x.yytext);break;case 5:g.getLogger().debug("_",x.yytext);break;case 6:return 5;case 7:return x.yytext=-1,28;case 8:return x.yytext=x.yytext.replace(/columns\s+/,""),g.getLogger().debug("COLUMNS (LEX)",x.yytext),28;case 9:case 77:case 78:case 100:this.pushState("md_string");break;case 10:return"MD_STR";case 11:case 35:case 80:this.popState();break;case 12:this.pushState("string");break;case 13:g.getLogger().debug("LEX: POPPING STR:",x.yytext),this.popState();break;case 14:return g.getLogger().debug("LEX: STR end:",x.yytext),"STR";case 15:return x.yytext=x.yytext.replace(/space\:/,""),g.getLogger().debug("SPACE NUM (LEX)",x.yytext),21;case 16:return x.yytext="1",g.getLogger().debug("COLUMNS (LEX)",x.yytext),21;case 17:return 43;case 18:return"LINKSTYLE";case 19:return"INTERPOLATE";case 20:return this.pushState("CLASSDEF"),40;case 21:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 22:return this.popState(),this.pushState("CLASSDEFID"),41;case 23:return this.popState(),42;case 24:return this.pushState("CLASS"),44;case 25:return this.popState(),this.pushState("CLASS_STYLE"),45;case 26:return this.popState(),46;case 27:return this.pushState("STYLE_STMNT"),47;case 28:return this.popState(),this.pushState("STYLE_DEFINITION"),48;case 29:return this.popState(),49;case 30:return this.pushState("acc_title"),"acc_title";case 31:return this.popState(),"acc_title_value";case 32:return this.pushState("acc_descr"),"acc_descr";case 33:return this.popState(),"acc_descr_value";case 34:this.pushState("acc_descr_multiline");break;case 36:return"acc_descr_multiline_value";case 37:return 30;case 38:case 39:case 41:case 42:case 45:return this.popState(),g.getLogger().debug("Lex: (("),"NODE_DEND";case 40:return this.popState(),g.getLogger().debug("Lex: ))"),"NODE_DEND";case 43:return this.popState(),g.getLogger().debug("Lex: (-"),"NODE_DEND";case 44:return this.popState(),g.getLogger().debug("Lex: -)"),"NODE_DEND";case 46:return this.popState(),g.getLogger().debug("Lex: ]]"),"NODE_DEND";case 47:return this.popState(),g.getLogger().debug("Lex: ("),"NODE_DEND";case 48:return this.popState(),g.getLogger().debug("Lex: ])"),"NODE_DEND";case 49:case 50:return this.popState(),g.getLogger().debug("Lex: /]"),"NODE_DEND";case 51:return this.popState(),g.getLogger().debug("Lex: )]"),"NODE_DEND";case 52:return this.popState(),g.getLogger().debug("Lex: )"),"NODE_DEND";case 53:return this.popState(),g.getLogger().debug("Lex: ]>"),"NODE_DEND";case 54:return this.popState(),g.getLogger().debug("Lex: ]"),"NODE_DEND";case 55:return g.getLogger().debug("Lexa: -)"),this.pushState("NODE"),36;case 56:return g.getLogger().debug("Lexa: (-"),this.pushState("NODE"),36;case 57:return g.getLogger().debug("Lexa: ))"),this.pushState("NODE"),36;case 58:case 60:case 61:case 62:case 65:return g.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 59:return g.getLogger().debug("Lex: ((("),this.pushState("NODE"),36;case 63:return g.getLogger().debug("Lexc: >"),this.pushState("NODE"),36;case 64:return g.getLogger().debug("Lexa: (["),this.pushState("NODE"),36;case 66:case 67:case 68:case 69:case 70:case 71:case 72:return this.pushState("NODE"),36;case 73:return g.getLogger().debug("Lexa: ["),this.pushState("NODE"),36;case 74:return this.pushState("BLOCK_ARROW"),g.getLogger().debug("LEX ARR START"),38;case 75:return g.getLogger().debug("Lex: NODE_ID",x.yytext),32;case 76:return g.getLogger().debug("Lex: EOF",x.yytext),8;case 79:return"NODE_DESCR";case 81:g.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 82:g.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 83:return g.getLogger().debug("LEX: NODE_DESCR:",x.yytext),"NODE_DESCR";case 84:g.getLogger().debug("LEX POPPING"),this.popState();break;case 85:g.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 86:return x.yytext=x.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (right): dir:",x.yytext),"DIR";case 87:return x.yytext=x.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (left):",x.yytext),"DIR";case 88:return x.yytext=x.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (x):",x.yytext),"DIR";case 89:return x.yytext=x.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (y):",x.yytext),"DIR";case 90:return x.yytext=x.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (up):",x.yytext),"DIR";case 91:return x.yytext=x.yytext.replace(/^,\s*/,""),g.getLogger().debug("Lex (down):",x.yytext),"DIR";case 92:return x.yytext="]>",g.getLogger().debug("Lex (ARROW_DIR end):",x.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 93:return g.getLogger().debug("Lex: LINK","#"+x.yytext+"#"),15;case 94:case 95:case 96:return g.getLogger().debug("Lex: LINK",x.yytext),15;case 97:case 98:case 99:return g.getLogger().debug("Lex: START_LINK",x.yytext),this.pushState("LLABEL"),16;case 101:return g.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 102:return this.popState(),g.getLogger().debug("Lex: LINK","#"+x.yytext+"#"),15;case 103:case 104:return this.popState(),g.getLogger().debug("Lex: LINK",x.yytext),15;case 105:return g.getLogger().debug("Lex: COLON",x.yytext),x.yytext=x.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block\s+)/,/^(?:block\n+)/,/^(?:block:)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[29],inclusive:!1},STYLE_STMNT:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[23],inclusive:!1},CLASSDEF:{rules:[21,22],inclusive:!1},CLASS_STYLE:{rules:[26],inclusive:!1},CLASS:{rules:[25],inclusive:!1},LLABEL:{rules:[100,101,102,103,104],inclusive:!1},ARROW_DIR:{rules:[86,87,88,89,90,91,92],inclusive:!1},BLOCK_ARROW:{rules:[77,82,85],inclusive:!1},NODE:{rules:[38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,78,81],inclusive:!1},md_string:{rules:[10,11,79,80],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[13,14,83,84],inclusive:!1},acc_descr_multiline:{rules:[35,36],inclusive:!1},acc_descr:{rules:[33],inclusive:!1},acc_title:{rules:[31],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,12,15,16,17,18,19,20,24,27,30,32,34,37,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,93,94,95,96,97,98,99,105],inclusive:!0}}}}();function R(){this.yy={}}return D.lexer=B,(0,c.eW)(R,"Parser"),R.prototype=D,D.Parser=R,new R}();tt.parser=tt;var ot=tt,V=new Map,yt=[],mt=new Map,Dt=(0,c.nV)(),st=new Map,At=(0,c.eW)(r=>c.SY.sanitizeText(r,Dt),"sanitizeText"),wt=(0,c.eW)(function(r,e=""){let t=st.get(r);t||(t={id:r,styles:[],textStyles:[]},st.set(r,t)),null!=e&&e.split(",").forEach(l=>{const n=l.replace(/([^;]*);/,"$1").trim();if(RegExp("color").exec(l)){const s=n.replace("fill","bgFill").replace("color","fill");t.textStyles.push(s)}t.styles.push(n)})},"addStyleClass"),K=(0,c.eW)(function(r,e=""){const t=V.get(r);null!=e&&(t.styles=e.split(","))},"addStyle2Node"),d=(0,c.eW)(function(r,e){r.split(",").forEach(function(t){let l=V.get(t);if(void 0===l){const n=t.trim();l={id:n,type:"na",children:[]},V.set(n,l)}l.classes||(l.classes=[]),l.classes.push(e)})},"setCssClass"),y=(0,c.eW)((r,e)=>{const t=r.flat(),l=[];for(const n of t)if(n.label&&(n.label=At(n.label)),"classDef"!==n.type)if("applyClass"!==n.type)if("applyStyles"!==n.type)if("column-setting"===n.type)e.columns=n.columns??-1;else if("edge"===n.type){const a=(mt.get(n.id)??0)+1;mt.set(n.id,a),n.id=a+"-"+n.id,yt.push(n)}else{n.label||("composite"===n.type?n.label="":n.label=n.id);const a=V.get(n.id);if(void 0===a?V.set(n.id,n):("na"!==n.type&&(a.type=n.type),n.label!==n.id&&(a.label=n.label)),n.children&&y(n.children,n),"space"===n.type){const s=n.width??1;for(let i=0;i<s;i++){const o=(0,ft.Z)(n);o.id=o.id+"-"+i,V.set(o.id,o),l.push(o)}}else void 0===a&&l.push(n)}else n?.stylesStr&&K(n.id,n?.stylesStr);else d(n.id,n?.styleClass??"");else wt(n.id,n.css);e.children=l},"populateBlockDatabase"),S=[],E={id:"root",type:"composite",children:[],columns:-1},O=(0,c.eW)(()=>{c.cM.debug("Clear called"),(0,c.ZH)(),E={id:"root",type:"composite",children:[],columns:-1},V=new Map([["root",E]]),S=[],st=new Map,yt=[],mt=new Map},"clear");function M(r){switch(c.cM.debug("typeStr2Type",r),r){case"[]":return"square";case"()":return c.cM.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"}}function z(r){return"=="===(c.cM.debug("typeStr2Type",r),r)?"thick":"normal"}function it(r){switch(r.trim()){case"--x":return"arrow_cross";case"--o":return"arrow_circle";default:return"arrow_point"}}(0,c.eW)(M,"typeStr2Type"),(0,c.eW)(z,"edgeTypeStr2Type"),(0,c.eW)(it,"edgeStrToEdgeData");var ee=0,Ee=(0,c.eW)(()=>(ee++,"id-"+Math.random().toString(36).substr(2,12)+"-"+ee),"generateId"),De=(0,c.eW)(r=>{E.children=r,y(r,E),S=E.children},"setHierarchy"),Ce=(0,c.eW)(r=>{const e=V.get(r);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),Ne=(0,c.eW)(()=>[...V.values()],"getBlocksFlat"),We=(0,c.eW)(()=>S||[],"getBlocks"),Oe=(0,c.eW)(()=>yt,"getEdges"),Te=(0,c.eW)(r=>V.get(r),"getBlock"),Me=(0,c.eW)(r=>{V.set(r.id,r)},"setBlock"),Be=(0,c.eW)(()=>console,"getLogger"),Ie=(0,c.eW)(function(){return st},"getClasses"),Ae={getConfig:(0,c.eW)(()=>(0,c.iE)().block,"getConfig"),typeStr2Type:M,edgeTypeStr2Type:z,edgeStrToEdgeData:it,getLogger:Be,getBlocksFlat:Ne,getBlocks:We,getEdges:Oe,setHierarchy:De,getBlock:Te,setBlock:Me,getColumns:Ce,getClasses:Ie,clear:O,generateId:Ee},Ct=(0,c.eW)((r,e)=>{const t=vt.Z,l=t(r,"r"),n=t(r,"g"),a=t(r,"b");return ct.Z(l,n,a,e)},"fade"),Pe=(0,c.eW)(r=>`.label {\n font-family: ${r.fontFamily};\n color: ${r.nodeTextColor||r.textColor};\n }\n .cluster-label text {\n fill: ${r.titleColor};\n }\n .cluster-label span,p {\n color: ${r.titleColor};\n }\n\n\n\n .label text,span,p {\n fill: ${r.nodeTextColor||r.textColor};\n color: ${r.nodeTextColor||r.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${r.mainBkg};\n stroke: ${r.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${r.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${r.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${r.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${r.edgeLabelBackground};\n rect {\n opacity: 0.5;\n background-color: ${r.edgeLabelBackground};\n fill: ${r.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${Ct(r.edgeLabelBackground,.5)};\n // background-color:\n }\n\n .node .cluster {\n // fill: ${Ct(r.mainBkg,.5)};\n fill: ${Ct(r.clusterBkg,.5)};\n stroke: ${Ct(r.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${r.titleColor};\n }\n\n .cluster span,p {\n color: ${r.titleColor};\n }\n /* .cluster div {\n color: ${r.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${r.fontFamily};\n font-size: 12px;\n background: ${r.tertiaryColor};\n border: 1px solid ${r.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${r.textColor};\n }\n`,"getStyles"),Ze=(0,c.eW)((r,e,t,l)=>{e.forEach(n=>{Je[n](r,t,l)})},"insertMarkers"),Je={extension:(0,c.eW)((r,e,t)=>{c.cM.trace("Making markers for ",t),r.append("defs").append("marker").attr("id",t+"_"+e+"-extensionStart").attr("class","marker extension "+e).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"),r.append("defs").append("marker").attr("id",t+"_"+e+"-extensionEnd").attr("class","marker extension "+e).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"),composition:(0,c.eW)((r,e,t)=>{r.append("defs").append("marker").attr("id",t+"_"+e+"-compositionStart").attr("class","marker composition "+e).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"),r.append("defs").append("marker").attr("id",t+"_"+e+"-compositionEnd").attr("class","marker composition "+e).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"),aggregation:(0,c.eW)((r,e,t)=>{r.append("defs").append("marker").attr("id",t+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).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"),r.append("defs").append("marker").attr("id",t+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).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"),dependency:(0,c.eW)((r,e,t)=>{r.append("defs").append("marker").attr("id",t+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).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"),r.append("defs").append("marker").attr("id",t+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).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"),lollipop:(0,c.eW)((r,e,t)=>{r.append("defs").append("marker").attr("id",t+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).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),r.append("defs").append("marker").attr("id",t+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).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"),point:(0,c.eW)((r,e,t)=>{r.append("marker").attr("id",t+"_"+e+"-pointEnd").attr("class","marker "+e).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"),r.append("marker").attr("id",t+"_"+e+"-pointStart").attr("class","marker "+e).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"),circle:(0,c.eW)((r,e,t)=>{r.append("marker").attr("id",t+"_"+e+"-circleEnd").attr("class","marker "+e).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"),r.append("marker").attr("id",t+"_"+e+"-circleStart").attr("class","marker "+e).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"),cross:(0,c.eW)((r,e,t)=>{r.append("marker").attr("id",t+"_"+e+"-crossEnd").attr("class","marker cross "+e).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"),r.append("marker").attr("id",t+"_"+e+"-crossStart").attr("class","marker cross "+e).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"),barb:(0,c.eW)((r,e,t)=>{r.append("defs").append("marker").attr("id",t+"_"+e+"-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")},Qe=Ze,Z=(0,c.nV)()?.block?.padding??8;function re(r,e){if(0===r||!Number.isInteger(r))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(r<0)return{px:e,py:0};if(1===r)return{px:0,py:e};return{px:e%r,py:Math.floor(e/r)}}(0,c.eW)(re,"calculateBlockPosition");var $e=(0,c.eW)(r=>{let e=0,t=0;for(const l of r.children){const{width:n,height:a,x:s,y:i}=l.size??{width:0,height:0,x:0,y:0};c.cM.debug("getMaxChildSize abc95 child:",l.id,"width:",n,"height:",a,"x:",s,"y:",i,l.type),"space"!==l.type&&(n>e&&(e=n/(r.widthInColumns??1)),a>t&&(t=a))}return{width:e,height:t}},"getMaxChildSize");function Nt(r,e,t=0,l=0){c.cM.debug("setBlockSizes abc95 (start)",r.id,r?.size?.x,"block width =",r?.size,"sieblingWidth",t),r?.size?.width||(r.size={width:t,height:l,x:0,y:0});let n=0,a=0;if(r.children?.length>0){for(const m of r.children)Nt(m,e);const s=$e(r);n=s.width,a=s.height,c.cM.debug("setBlockSizes abc95 maxWidth of",r.id,":s children is ",n,a);for(const m of r.children)m.size&&(c.cM.debug(`abc95 Setting size of children of ${r.id} id=${m.id} ${n} ${a} ${JSON.stringify(m.size)}`),m.size.width=n*(m.widthInColumns??1)+Z*((m.widthInColumns??1)-1),m.size.height=a,m.size.x=0,m.size.y=0,c.cM.debug(`abc95 updating size of ${r.id} children child:${m.id} maxWidth:${n} maxHeight:${a}`));for(const m of r.children)Nt(m,e,n,a);const i=r.columns??-1;let o=0;for(const m of r.children)o+=m.widthInColumns??1;let p=r.children.length;i>0&&i<o&&(p=i);const h=Math.ceil(o/p);let b=p*(n+Z)+Z,L=h*(a+Z)+Z;if(b<t){c.cM.debug(`Detected to small siebling: abc95 ${r.id} sieblingWidth ${t} sieblingHeight ${l} width ${b}`),b=t,L=l;const m=(t-p*Z-Z)/p,w=(l-h*Z-Z)/h;c.cM.debug("Size indata abc88",r.id,"childWidth",m,"maxWidth",n),c.cM.debug("Size indata abc88",r.id,"childHeight",w,"maxHeight",a),c.cM.debug("Size indata abc88 xSize",p,"padding",Z);for(const C of r.children)C.size&&(C.size.width=m,C.size.height=w,C.size.x=0,C.size.y=0)}if(c.cM.debug(`abc95 (finale calc) ${r.id} xSize ${p} ySize ${h} columns ${i}${r.children.length} width=${Math.max(b,r.size?.width||0)}`),b<(r?.size?.width||0)){b=r?.size?.width||0;const m=i>0?Math.min(r.children.length,i):r.children.length;if(m>0){const w=(b-m*Z-Z)/m;c.cM.debug("abc95 (growing to fit) width",r.id,b,r.size?.width,w);for(const C of r.children)C.size&&(C.size.width=w)}}r.size={width:b,height:L,x:0,y:0}}c.cM.debug("setBlockSizes abc94 (done)",r.id,r?.size?.x,r?.size?.width,r?.size?.y,r?.size?.height)}function zt(r,e){c.cM.debug(`abc85 layout blocks (=>layoutBlocks) ${r.id} x: ${r?.size?.x} y: ${r?.size?.y} width: ${r?.size?.width}`);const t=r.columns??-1;if(c.cM.debug("layoutBlocks columns abc95",r.id,"=>",t,r),r.children&&r.children.length>0){const l=r?.children[0]?.size?.width??0,n=r.children.length*l+(r.children.length-1)*Z;c.cM.debug("widthOfChildren 88",n,"posX");let a=0;c.cM.debug("abc91 block?.size?.x",r.id,r?.size?.x);let s=r?.size?.x?r?.size?.x+(-r?.size?.width/2||0):-Z,i=0;for(const o of r.children){const p=r;if(!o.size)continue;const{width:h,height:b}=o.size,{px:L,py:m}=re(t,a);if(m!=i&&(i=m,s=r?.size?.x?r?.size?.x+(-r?.size?.width/2||0):-Z,c.cM.debug("New row in layout for block",r.id," and child ",o.id,i)),c.cM.debug(`abc89 layout blocks (child) id: ${o.id} Pos: ${a} (px, py) ${L},${m} (${p?.size?.x},${p?.size?.y}) parent: ${p.id} width: ${h}${Z}`),p.size){const w=h/2;o.size.x=s+Z+w,c.cM.debug(`abc91 layout blocks (calc) px, pyid:${o.id} startingPos=X${s} new startingPosX${o.size.x} ${w} padding=${Z} width=${h} halfWidth=${w} => x:${o.size.x} y:${o.size.y} ${o.widthInColumns} (width * (child?.w || 1)) / 2 ${h*(o?.widthInColumns??1)/2}`),s=o.size.x+w,o.size.y=p.size.y-p.size.height/2+m*(b+Z)+b/2+Z,c.cM.debug(`abc88 layout blocks (calc) px, pyid:${o.id}startingPosX${s}${Z}${w}=>x:${o.size.x}y:${o.size.y}${o.widthInColumns}(width * (child?.w || 1)) / 2${h*(o?.widthInColumns??1)/2}`)}o.children&&zt(o,e),a+=o?.widthInColumns??1,c.cM.debug("abc88 columnsPos",o,a)}}c.cM.debug(`layout blocks (<==layoutBlocks) ${r.id} x: ${r?.size?.x} y: ${r?.size?.y} width: ${r?.size?.width}`)}function Pt(r,{minX:e,minY:t,maxX:l,maxY:n}={minX:0,minY:0,maxX:0,maxY:0}){if(r.size&&"root"!==r.id){const{x:a,y:s,width:i,height:o}=r.size;a-i/2<e&&(e=a-i/2),s-o/2<t&&(t=s-o/2),a+i/2>l&&(l=a+i/2),s+o/2>n&&(n=s+o/2)}if(r.children)for(const a of r.children)({minX:e,minY:t,maxX:l,maxY:n}=Pt(a,{minX:e,minY:t,maxX:l,maxY:n}));return{minX:e,minY:t,maxX:l,maxY:n}}function se(r){const e=r.getBlock("root");if(!e)return;Nt(e,r,0,0),zt(e,r),c.cM.debug("getBlocks",JSON.stringify(e,null,2));const{minX:t,minY:l,maxX:n,maxY:a}=Pt(e);return{x:t,y:l,width:n-t,height:a-l}}function Zt(r,e){e&&r.attr("style",e)}function ae(r){const e=(0,I.Ys)(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),t=e.append("xhtml:div"),l=r.label,n=r.isNode?"nodeLabel":"edgeLabel",a=t.append("span");return a.html(l),Zt(a,r.labelStyle),a.attr("class",n),Zt(t,r.labelStyle),t.style("display","inline-block"),t.style("white-space","nowrap"),t.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}(0,c.eW)(Nt,"setBlockSizes"),(0,c.eW)(zt,"layoutBlocks"),(0,c.eW)(Pt,"findBounds"),(0,c.eW)(se,"layout"),(0,c.eW)(Zt,"applyStyle"),(0,c.eW)(ae,"addHtmlLabel");var $=(0,c.eW)((r,e,t,l)=>{let n=r||"";if("object"==typeof n&&(n=n[0]),(0,c.ku)((0,c.nV)().flowchart.htmlLabels)){n=n.replace(/\\n|\n/g,"<br />"),c.cM.debug("vertexText"+n);return ae({isNode:l,label:(0,ut.EY)((0,X.SH)(n)),labelStyle:e.replace("fill:","color:")})}{const a=document.createElementNS("http://www.w3.org/2000/svg","text");a.setAttribute("style",e.replace("color:","fill:"));let s=[];s="string"==typeof n?n.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(n)?n:[];for(const i of s){const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),t?o.setAttribute("class","title-row"):o.setAttribute("class","row"),o.textContent=i.trim(),a.appendChild(o)}return a}},"createLabel"),tr=(0,c.eW)((r,e,t,l,n)=>{e.arrowTypeStart&&ie(r,"start",e.arrowTypeStart,t,l,n),e.arrowTypeEnd&&ie(r,"end",e.arrowTypeEnd,t,l,n)},"addEdgeMarkers"),er={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},ie=(0,c.eW)((r,e,t,l,n,a)=>{const s=er[t];if(!s)return void c.cM.warn(`Unknown arrow type: ${t}`);const i="start"===e?"Start":"End";r.attr(`marker-${e}`,`url(${l}#${n}_${a}-${s}${i})`)},"addEdgeMarker"),Yt={},U={},rr=(0,c.eW)((r,e)=>{const t=(0,c.nV)(),l=(0,c.ku)(t.flowchart.htmlLabels),n="markdown"===e.labelType?(0,ut.rw)(r,e.label,{style:e.labelStyle,useHtmlLabels:l,addSvgBackground:!0},t):$(e.label,e.labelStyle),a=r.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label");s.node().appendChild(n);let o,i=n.getBBox();if(l){const p=n.children[0],h=(0,I.Ys)(n);i=p.getBoundingClientRect(),h.attr("width",i.width),h.attr("height",i.height)}if(s.attr("transform","translate("+-i.width/2+", "+-i.height/2+")"),Yt[e.id]=a,e.width=i.width,e.height=i.height,e.startLabelLeft){const p=$(e.startLabelLeft,e.labelStyle),h=r.insert("g").attr("class","edgeTerminals"),b=h.insert("g").attr("class","inner");o=b.node().appendChild(p);const L=p.getBBox();b.attr("transform","translate("+-L.width/2+", "+-L.height/2+")"),U[e.id]||(U[e.id]={}),U[e.id].startLeft=h,St(o,e.startLabelLeft)}if(e.startLabelRight){const p=$(e.startLabelRight,e.labelStyle),h=r.insert("g").attr("class","edgeTerminals"),b=h.insert("g").attr("class","inner");o=h.node().appendChild(p),b.node().appendChild(p);const L=p.getBBox();b.attr("transform","translate("+-L.width/2+", "+-L.height/2+")"),U[e.id]||(U[e.id]={}),U[e.id].startRight=h,St(o,e.startLabelRight)}if(e.endLabelLeft){const p=$(e.endLabelLeft,e.labelStyle),h=r.insert("g").attr("class","edgeTerminals"),b=h.insert("g").attr("class","inner");o=b.node().appendChild(p);const L=p.getBBox();b.attr("transform","translate("+-L.width/2+", "+-L.height/2+")"),h.node().appendChild(p),U[e.id]||(U[e.id]={}),U[e.id].endLeft=h,St(o,e.endLabelLeft)}if(e.endLabelRight){const p=$(e.endLabelRight,e.labelStyle),h=r.insert("g").attr("class","edgeTerminals"),b=h.insert("g").attr("class","inner");o=b.node().appendChild(p);const L=p.getBBox();b.attr("transform","translate("+-L.width/2+", "+-L.height/2+")"),h.node().appendChild(p),U[e.id]||(U[e.id]={}),U[e.id].endRight=h,St(o,e.endLabelRight)}return n},"insertEdgeLabel");function St(r,e){(0,c.nV)().flowchart.htmlLabels&&r&&(r.style.width=9*e.length+"px",r.style.height="12px")}(0,c.eW)(St,"setTerminalWidth");var sr=(0,c.eW)((r,e)=>{c.cM.debug("Moving label abc88 ",r.id,r.label,Yt[r.id],e);let t=e.updatedPath?e.updatedPath:e.originalPath;const l=(0,c.nV)(),{subGraphTitleTotalMargin:n}=(0,bt.L)(l);if(r.label){const a=Yt[r.id];let s=r.x,i=r.y;if(t){const o=X.w8.calcLabelPosition(t);c.cM.debug("Moving label "+r.label+" from (",s,",",i,") to (",o.x,",",o.y,") abc88"),e.updatedPath&&(s=o.x,i=o.y)}a.attr("transform",`translate(${s}, ${i+n/2})`)}if(r.startLabelLeft){const a=U[r.id].startLeft;let s=r.x,i=r.y;if(t){const o=X.w8.calcTerminalLabelPosition(r.arrowTypeStart?10:0,"start_left",t);s=o.x,i=o.y}a.attr("transform",`translate(${s}, ${i})`)}if(r.startLabelRight){const a=U[r.id].startRight;let s=r.x,i=r.y;if(t){const o=X.w8.calcTerminalLabelPosition(r.arrowTypeStart?10:0,"start_right",t);s=o.x,i=o.y}a.attr("transform",`translate(${s}, ${i})`)}if(r.endLabelLeft){const a=U[r.id].endLeft;let s=r.x,i=r.y;if(t){const o=X.w8.calcTerminalLabelPosition(r.arrowTypeEnd?10:0,"end_left",t);s=o.x,i=o.y}a.attr("transform",`translate(${s}, ${i})`)}if(r.endLabelRight){const a=U[r.id].endRight;let s=r.x,i=r.y;if(t){const o=X.w8.calcTerminalLabelPosition(r.arrowTypeEnd?10:0,"end_right",t);s=o.x,i=o.y}a.attr("transform",`translate(${s}, ${i})`)}},"positionEdgeLabel"),ar=(0,c.eW)((r,e)=>{const t=r.x,l=r.y,n=Math.abs(e.x-t),a=Math.abs(e.y-l),s=r.width/2,i=r.height/2;return n>=s||a>=i},"outsideNode"),ir=(0,c.eW)((r,e,t)=>{c.cM.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(t)}\n node : x:${r.x} y:${r.y} w:${r.width} h:${r.height}`);const l=r.x,n=r.y,a=Math.abs(l-t.x),s=r.width/2;let i=t.x<e.x?s-a:s+a;const o=r.height/2,p=Math.abs(e.y-t.y),h=Math.abs(e.x-t.x);if(Math.abs(n-e.y)*s>Math.abs(l-e.x)*o){let b=t.y<e.y?e.y-o-n:n-o-e.y;i=h*b/p;const L={x:t.x<e.x?t.x+i:t.x-h+i,y:t.y<e.y?t.y+p-b:t.y-p+b};return 0===i&&(L.x=e.x,L.y=e.y),0===h&&(L.x=e.x),0===p&&(L.y=e.y),c.cM.debug(`abc89 topp/bott calc, Q ${p}, q ${b}, R ${h}, r ${i}`,L),L}{i=t.x<e.x?e.x-s-l:l-s-e.x;let b=p*i/h,L=t.x<e.x?t.x+h-i:t.x-h+i,m=t.y<e.y?t.y+b:t.y-b;return c.cM.debug(`sides calc abc89, Q ${p}, q ${b}, R ${h}, r ${i}`,{_x:L,_y:m}),0===i&&(L=e.x,m=e.y),0===h&&(L=e.x),0===p&&(m=e.y),{x:L,y:m}}},"intersection"),ne=(0,c.eW)((r,e)=>{c.cM.debug("abc88 cutPathAtIntersect",r,e);let t=[],l=r[0],n=!1;return r.forEach(a=>{if(ar(e,a)||n)l=a,n||t.push(a);else{const s=ir(e,l,a);let i=!1;t.forEach(o=>{i=i||o.x===s.x&&o.y===s.y}),t.some(o=>o.x===s.x&&o.y===s.y)||t.push(s),n=!0}}),t},"cutPathAtIntersect"),nr=(0,c.eW)(function(r,e,t,l,n,a,s){let i=t.points;c.cM.debug("abc88 InsertEdge: edge=",t,"e=",e);let o=!1;const p=a.node(e.v);var h=a.node(e.w);h?.intersect&&p?.intersect&&(i=i.slice(1,t.points.length-1),i.unshift(p.intersect(i[0])),i.push(h.intersect(i[i.length-1]))),t.toCluster&&(c.cM.debug("to cluster abc88",l[t.toCluster]),i=ne(t.points,l[t.toCluster].node),o=!0),t.fromCluster&&(c.cM.debug("from cluster abc88",l[t.fromCluster]),i=ne(i.reverse(),l[t.fromCluster].node).reverse(),o=!0);const b=i.filter(_=>!Number.isNaN(_.y));let L=I.$0Z;t.curve&&("graph"===n||"flowchart"===n)&&(L=t.curve);const{x:m,y:w}=(0,pt.o)(t),C=(0,I.jvg)().x(m).y(w).curve(L);let D;switch(t.thickness){case"normal":D="edge-thickness-normal";break;case"thick":case"invisible":D="edge-thickness-thick";break;default:D=""}switch(t.pattern){case"solid":D+=" edge-pattern-solid";break;case"dotted":D+=" edge-pattern-dotted";break;case"dashed":D+=" edge-pattern-dashed"}const B=r.append("path").attr("d",C(b)).attr("id",t.id).attr("class"," "+D+(t.classes?" "+t.classes:"")).attr("style",t.style);let R="";((0,c.nV)().flowchart.arrowMarkerAbsolute||(0,c.nV)().state.arrowMarkerAbsolute)&&(R=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,R=R.replace(/\(/g,"\\("),R=R.replace(/\)/g,"\\)")),tr(B,t,R,s,n);let T={};return o&&(T.updatedPath=i),T.originalPath=t.points,T},"insertEdge"),lr=(0,c.eW)(r=>{const e=new Set;for(const t of r)switch(t){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(t)}return e},"expandAndDeduplicateDirections"),cr=(0,c.eW)((r,e,t)=>{const l=lr(r),a=e.height+2*t.padding,s=a/2,i=e.width+2*s+t.padding,o=t.padding/2;return l.has("right")&&l.has("left")&&l.has("up")&&l.has("down")?[{x:0,y:0},{x:s,y:0},{x:i/2,y:2*o},{x:i-s,y:0},{x:i,y:0},{x:i,y:-a/3},{x:i+2*o,y:-a/2},{x:i,y:-2*a/3},{x:i,y:-a},{x:i-s,y:-a},{x:i/2,y:-a-2*o},{x:s,y:-a},{x:0,y:-a},{x:0,y:-2*a/3},{x:-2*o,y:-a/2},{x:0,y:-a/3}]:l.has("right")&&l.has("left")&&l.has("up")?[{x:s,y:0},{x:i-s,y:0},{x:i,y:-a/2},{x:i-s,y:-a},{x:s,y:-a},{x:0,y:-a/2}]:l.has("right")&&l.has("left")&&l.has("down")?[{x:0,y:0},{x:s,y:-a},{x:i-s,y:-a},{x:i,y:0}]:l.has("right")&&l.has("up")&&l.has("down")?[{x:0,y:0},{x:i,y:-s},{x:i,y:-a+s},{x:0,y:-a}]:l.has("left")&&l.has("up")&&l.has("down")?[{x:i,y:0},{x:0,y:-s},{x:0,y:-a+s},{x:i,y:-a}]:l.has("right")&&l.has("left")?[{x:s,y:0},{x:s,y:-o},{x:i-s,y:-o},{x:i-s,y:0},{x:i,y:-a/2},{x:i-s,y:-a},{x:i-s,y:-a+o},{x:s,y:-a+o},{x:s,y:-a},{x:0,y:-a/2}]:l.has("up")&&l.has("down")?[{x:i/2,y:0},{x:0,y:-o},{x:s,y:-o},{x:s,y:-a+o},{x:0,y:-a+o},{x:i/2,y:-a},{x:i,y:-a+o},{x:i-s,y:-a+o},{x:i-s,y:-o},{x:i,y:-o}]:l.has("right")&&l.has("up")?[{x:0,y:0},{x:i,y:-s},{x:0,y:-a}]:l.has("right")&&l.has("down")?[{x:0,y:0},{x:i,y:0},{x:0,y:-a}]:l.has("left")&&l.has("up")?[{x:i,y:0},{x:0,y:-s},{x:i,y:-a}]:l.has("left")&&l.has("down")?[{x:i,y:0},{x:0,y:0},{x:i,y:-a}]:l.has("right")?[{x:s,y:-o},{x:s,y:-o},{x:i-s,y:-o},{x:i-s,y:0},{x:i,y:-a/2},{x:i-s,y:-a},{x:i-s,y:-a+o},{x:s,y:-a+o},{x:s,y:-a+o}]:l.has("left")?[{x:s,y:0},{x:s,y:-o},{x:i-s,y:-o},{x:i-s,y:-a+o},{x:s,y:-a+o},{x:s,y:-a},{x:0,y:-a/2}]:l.has("up")?[{x:s,y:-o},{x:s,y:-a+o},{x:0,y:-a+o},{x:i/2,y:-a},{x:i,y:-a+o},{x:i-s,y:-a+o},{x:i-s,y:-o}]:l.has("down")?[{x:i/2,y:0},{x:0,y:-o},{x:s,y:-o},{x:s,y:-a+o},{x:i-s,y:-a+o},{x:i-s,y:-o},{x:i,y:-o}]:[{x:0,y:0}]},"getArrowPoints");function le(r,e){return r.intersect(e)}(0,c.eW)(le,"intersectNode");var or=le;function ce(r,e,t,l){var n=r.x,a=r.y,s=n-l.x,i=a-l.y,o=Math.sqrt(e*e*i*i+t*t*s*s),p=Math.abs(e*t*s/o);l.x<n&&(p=-p);var h=Math.abs(e*t*i/o);return l.y<a&&(h=-h),{x:n+p,y:a+h}}(0,c.eW)(ce,"intersectEllipse");var oe=ce;function he(r,e,t){return oe(r,e,e,t)}(0,c.eW)(he,"intersectCircle");var hr=he;function ue(r,e,t,l){var n,a,s,i,o,p,h,b,L,m,w,C,D;if(n=e.y-r.y,s=r.x-e.x,o=e.x*r.y-r.x*e.y,L=n*t.x+s*t.y+o,m=n*l.x+s*l.y+o,!(0!==L&&0!==m&&Ft(L,m)||(a=l.y-t.y,i=t.x-l.x,p=l.x*t.y-t.x*l.y,h=a*r.x+i*r.y+p,b=a*e.x+i*e.y+p,0!==h&&0!==b&&Ft(h,b)||(w=n*i-a*s,0===w))))return C=Math.abs(w/2),{x:(D=s*p-i*o)<0?(D-C)/w:(D+C)/w,y:(D=a*o-n*p)<0?(D-C)/w:(D+C)/w}}function Ft(r,e){return r*e>0}(0,c.eW)(ue,"intersectLine"),(0,c.eW)(Ft,"sameSign");var ur=ue,dr=de;function de(r,e,t){var l=r.x,n=r.y,a=[],s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach(function(w){s=Math.min(s,w.x),i=Math.min(i,w.y)}):(s=Math.min(s,e.x),i=Math.min(i,e.y));for(var o=l-r.width/2-s,p=n-r.height/2-i,h=0;h<e.length;h++){var b=e[h],L=e[h<e.length-1?h+1:0],m=ur(r,t,{x:o+b.x,y:p+b.y},{x:o+L.x,y:p+L.y});m&&a.push(m)}return a.length?(a.length>1&&a.sort(function(w,C){var D=w.x-t.x,B=w.y-t.y,R=Math.sqrt(D*D+B*B),T=C.x-t.x,_=C.y-t.y,g=Math.sqrt(T*T+_*_);return R<g?-1:R===g?0:1}),a[0]):r}(0,c.eW)(de,"intersectPolygon");var A={node:or,circle:hr,ellipse:oe,polygon:dr,rect:(0,c.eW)((r,e)=>{var o,p,t=r.x,l=r.y,n=e.x-t,a=e.y-l,s=r.width/2,i=r.height/2;return Math.abs(a)*s>Math.abs(n)*i?(a<0&&(i=-i),o=0===a?0:i*n/a,p=i):(n<0&&(s=-s),o=s,p=0===n?0:s*a/n),{x:t+o,y:l+p}},"intersectRect")},F=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t,l,n){const a=(0,c.nV)();let s;const i=t.useHtmlLabels||(0,c.ku)(a.flowchart.htmlLabels);s=l||"node default";const o=e.insert("g").attr("class",s).attr("id",t.domId||t.id),p=o.insert("g").attr("class","label").attr("style",t.labelStyle);let h;h=void 0===t.labelText?"":"string"==typeof t.labelText?t.labelText:t.labelText[0];const b=p.node();let L;L="markdown"===t.labelType?(0,ut.rw)(p,(0,c.oO)((0,X.SH)(h),a),{useHtmlLabels:i,width:t.width||a.flowchart.wrappingWidth,classes:"markdown-node-label"},a):b.appendChild($((0,c.oO)((0,X.SH)(h),a),t.labelStyle,!1,n));let m=L.getBBox();const w=t.padding/2;if((0,c.ku)(a.flowchart.htmlLabels)){const C=L.children[0],D=(0,I.Ys)(L),B=C.getElementsByTagName("img");if(B){const R=""===h.replace(/<img[^>]*>/g,"").trim();yield Promise.all([...B].map(T=>new Promise(_=>{function g(){if(T.style.display="flex",T.style.flexDirection="column",R){const x=a.fontSize?a.fontSize:window.getComputedStyle(document.body).fontSize,k=5,v=parseInt(x,10)*k+"px";T.style.minWidth=v,T.style.maxWidth=v}else T.style.width="100%";_(T)}(0,c.eW)(g,"setupImage"),setTimeout(()=>{T.complete&&g()}),T.addEventListener("error",g),T.addEventListener("load",g)})))}m=C.getBoundingClientRect(),D.attr("width",m.width),D.attr("height",m.height)}return i?p.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"):p.attr("transform","translate(0, "+-m.height/2+")"),t.centerLabel&&p.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),p.insert("rect",":first-child"),{shapeSvg:o,bbox:m,halfPadding:w,label:p}});return function(e,t,l,n){return r.apply(this,arguments)}}(),"labelHelper"),P=(0,c.eW)((r,e)=>{const t=e.node().getBBox();r.width=t.width,r.height=t.height},"updateNodeBounds");function et(r,e,t,l){return r.insert("polygon",":first-child").attr("points",l.map(function(n){return n.x+","+n.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+t/2+")")}(0,c.eW)(et,"insertPolygonShape");var xr=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){t.useHtmlLabels||(0,c.nV)().flowchart.htmlLabels||(t.centerLabel=!0);const{shapeSvg:n,bbox:a,halfPadding:s}=yield F(e,t,"node "+t.classes,!0);c.cM.info("Classes = ",t.classes);const i=n.insert("rect",":first-child");return i.attr("rx",t.rx).attr("ry",t.ry).attr("x",-a.width/2-s).attr("y",-a.height/2-s).attr("width",a.width+t.padding).attr("height",a.height+t.padding),P(t,i),t.intersect=function(o){return A.rect(t,o)},n});return function(e,t){return r.apply(this,arguments)}}(),"note"),ge=(0,c.eW)(r=>r?" "+r:"","formatClass"),G=(0,c.eW)((r,e)=>`${e||"node default"}${ge(r.classes)} ${ge(r.class)}`,"getClassesFromNode"),pe=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){const{shapeSvg:l,bbox:n}=yield F(e,t,G(t,void 0),!0),i=n.width+t.padding+(n.height+t.padding),o=[{x:i/2,y:0},{x:i,y:-i/2},{x:i/2,y:-i},{x:0,y:-i/2}];c.cM.info("Question main (Circle)");const p=et(l,i,i,o);return p.attr("style",t.style),P(t,p),t.intersect=function(h){return c.cM.warn("Intersect called"),A.polygon(t,o,h)},l});return function(e,t){return r.apply(this,arguments)}}(),"question"),br=(0,c.eW)((r,e)=>{const t=r.insert("g").attr("class","node default").attr("id",e.domId||e.id),n=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}];return t.insert("polygon",":first-child").attr("points",n.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(s){return A.circle(e,14,s)},t},"choice"),yr=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){const{shapeSvg:l,bbox:n}=yield F(e,t,G(t,void 0),!0),s=n.height+t.padding,i=s/4,o=n.width+2*i+t.padding,p=[{x:i,y:0},{x:o-i,y:0},{x:o,y:-s/2},{x:o-i,y:-s},{x:i,y:-s},{x:0,y:-s/2}],h=et(l,o,s,p);return h.attr("style",t.style),P(t,h),t.intersect=function(b){return A.polygon(t,p,b)},l});return function(e,t){return r.apply(this,arguments)}}(),"hexagon"),mr=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){const{shapeSvg:l,bbox:n}=yield F(e,t,void 0,!0),s=n.height+2*t.padding,i=s/2,o=n.width+2*i+t.padding,p=cr(t.directions,n,t),h=et(l,o,s,p);return h.attr("style",t.style),P(t,h),t.intersect=function(b){return A.polygon(t,p,b)},l});return function(e,t){return r.apply(this,arguments)}}(),"block_arrow"),_r=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){const{shapeSvg:l,bbox:n}=yield F(e,t,G(t,void 0),!0),a=n.width+t.padding,s=n.height+t.padding,i=[{x:-s/2,y:0},{x:a,y:0},{x:a,y:-s},{x:-s/2,y:-s},{x:0,y:-s/2}];return et(l,a,s,i).attr("style",t.style),t.width=a+s,t.height=s,t.intersect=function(p){return A.polygon(t,i,p)},l});return function(e,t){return r.apply(this,arguments)}}(),"rect_left_inv_arrow"),Lr=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){const{shapeSvg:l,bbox:n}=yield F(e,t,G(t),!0),a=n.width+t.padding,s=n.height+t.padding,i=[{x:-2*s/6,y:0},{x:a-s/6,y:0},{x:a+2*s/6,y:-s},{x:s/6,y:-s}],o=et(l,a,s,i);return o.attr("style",t.style),P(t,o),t.intersect=function(p){return A.polygon(t,i,p)},l});return function(e,t){return r.apply(this,arguments)}}(),"lean_right"),kr=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){const{shapeSvg:l,bbox:n}=yield F(e,t,G(t,void 0),!0),a=n.width+t.padding,s=n.height+t.padding,i=[{x:2*s/6,y:0},{x:a+s/6,y:0},{x:a-2*s/6,y:-s},{x:-s/6,y:-s}],o=et(l,a,s,i);return o.attr("style",t.style),P(t,o),t.intersect=function(p){return A.polygon(t,i,p)},l});return function(e,t){return r.apply(this,arguments)}}(),"lean_left"),wr=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){const{shapeSvg:l,bbox:n}=yield F(e,t,G(t,void 0),!0),a=n.width+t.padding,s=n.height+t.padding,i=[{x:-2*s/6,y:0},{x:a+2*s/6,y:0},{x:a-s/6,y:-s},{x:s/6,y:-s}],o=et(l,a,s,i);return o.attr("style",t.style),P(t,o),t.intersect=function(p){return A.polygon(t,i,p)},l});return function(e,t){return r.apply(this,arguments)}}(),"trapezoid"),Sr=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){const{shapeSvg:l,bbox:n}=yield F(e,t,G(t,void 0),!0),a=n.width+t.padding,s=n.height+t.padding,i=[{x:s/6,y:0},{x:a-s/6,y:0},{x:a+2*s/6,y:-s},{x:-2*s/6,y:-s}],o=et(l,a,s,i);return o.attr("style",t.style),P(t,o),t.intersect=function(p){return A.polygon(t,i,p)},l});return function(e,t){return r.apply(this,arguments)}}(),"inv_trapezoid"),vr=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){const{shapeSvg:l,bbox:n}=yield F(e,t,G(t,void 0),!0),a=n.width+t.padding,s=n.height+t.padding,i=[{x:0,y:0},{x:a+s/2,y:0},{x:a,y:-s/2},{x:a+s/2,y:-s},{x:0,y:-s}],o=et(l,a,s,i);return o.attr("style",t.style),P(t,o),t.intersect=function(p){return A.polygon(t,i,p)},l});return function(e,t){return r.apply(this,arguments)}}(),"rect_right_inv_arrow"),Er=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){const{shapeSvg:l,bbox:n}=yield F(e,t,G(t,void 0),!0),a=n.width+t.padding,s=a/2,i=s/(2.5+a/50),o=n.height+i+t.padding,p="M 0,"+i+" a "+s+","+i+" 0,0,0 "+a+" 0 a "+s+","+i+" 0,0,0 "+-a+" 0 l 0,"+o+" a "+s+","+i+" 0,0,0 "+a+" 0 l 0,"+-o,h=l.attr("label-offset-y",i).insert("path",":first-child").attr("style",t.style).attr("d",p).attr("transform","translate("+-a/2+","+-(o/2+i)+")");return P(t,h),t.intersect=function(b){const L=A.rect(t,b),m=L.x-t.x;if(0!=s&&(Math.abs(m)<t.width/2||Math.abs(m)==t.width/2&&Math.abs(L.y-t.y)>t.height/2-i)){let w=i*i*(1-m*m/(s*s));0!=w&&(w=Math.sqrt(w)),w=i-w,b.y-t.y>0&&(w=-w),L.y+=w}return L},l});return function(e,t){return r.apply(this,arguments)}}(),"cylinder"),Dr=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){const{shapeSvg:l,bbox:n,halfPadding:a}=yield F(e,t,"node "+t.classes+" "+t.class,!0),s=l.insert("rect",":first-child"),i=t.positioned?t.width:n.width+t.padding,o=t.positioned?t.height:n.height+t.padding,p=t.positioned?-i/2:-n.width/2-a,h=t.positioned?-o/2:-n.height/2-a;if(s.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",p).attr("y",h).attr("width",i).attr("height",o),t.props){const b=new Set(Object.keys(t.props));t.props.borders&&(Wt(s,t.props.borders,i,o),b.delete("borders")),b.forEach(L=>{c.cM.warn(`Unknown node property ${L}`)})}return P(t,s),t.intersect=function(b){return A.rect(t,b)},l});return function(e,t){return r.apply(this,arguments)}}(),"rect"),Cr=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){const{shapeSvg:l,bbox:n,halfPadding:a}=yield F(e,t,"node "+t.classes,!0),s=l.insert("rect",":first-child"),i=t.positioned?t.width:n.width+t.padding,o=t.positioned?t.height:n.height+t.padding,p=t.positioned?-i/2:-n.width/2-a,h=t.positioned?-o/2:-n.height/2-a;if(s.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",p).attr("y",h).attr("width",i).attr("height",o),t.props){const b=new Set(Object.keys(t.props));t.props.borders&&(Wt(s,t.props.borders,i,o),b.delete("borders")),b.forEach(L=>{c.cM.warn(`Unknown node property ${L}`)})}return P(t,s),t.intersect=function(b){return A.rect(t,b)},l});return function(e,t){return r.apply(this,arguments)}}(),"composite"),Nr=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){const{shapeSvg:l}=yield F(e,t,"label",!0);c.cM.trace("Classes = ",t.class);const n=l.insert("rect",":first-child");if(n.attr("width",0).attr("height",0),l.attr("class","label edgeLabel"),t.props){const i=new Set(Object.keys(t.props));t.props.borders&&(Wt(n,t.props.borders,0,0),i.delete("borders")),i.forEach(o=>{c.cM.warn(`Unknown node property ${o}`)})}return P(t,n),t.intersect=function(i){return A.rect(t,i)},l});return function(e,t){return r.apply(this,arguments)}}(),"labelRect");function Wt(r,e,t,l){const n=[],a=(0,c.eW)(i=>{n.push(i,0)},"addBorder"),s=(0,c.eW)(i=>{n.push(0,i)},"skipBorder");e.includes("t")?(c.cM.debug("add top border"),a(t)):s(t),e.includes("r")?(c.cM.debug("add right border"),a(l)):s(l),e.includes("b")?(c.cM.debug("add bottom border"),a(t)):s(t),e.includes("l")?(c.cM.debug("add left border"),a(l)):s(l),r.attr("stroke-dasharray",n.join(" "))}(0,c.eW)(Wt,"applyNodePropertyBorders");var Wr=(0,c.eW)((r,e)=>{let t;t=e.classes?"node "+e.classes:"node default";const l=r.insert("g").attr("class",t).attr("id",e.domId||e.id),n=l.insert("rect",":first-child"),a=l.insert("line"),s=l.insert("g").attr("class","label"),i=e.labelText.flat?e.labelText.flat():e.labelText;let o="";o="object"==typeof i?i[0]:i,c.cM.info("Label text abc79",o,i,"object"==typeof i);const p=s.node().appendChild($(o,e.labelStyle,!0,!0));let h={width:0,height:0};if((0,c.ku)((0,c.nV)().flowchart.htmlLabels)){const C=p.children[0],D=(0,I.Ys)(p);h=C.getBoundingClientRect(),D.attr("width",h.width),D.attr("height",h.height)}c.cM.info("Text 2",i);const b=i.slice(1,i.length);let L=p.getBBox();const m=s.node().appendChild($(b.join?b.join("<br/>"):b,e.labelStyle,!0,!0));if((0,c.ku)((0,c.nV)().flowchart.htmlLabels)){const C=m.children[0],D=(0,I.Ys)(m);h=C.getBoundingClientRect(),D.attr("width",h.width),D.attr("height",h.height)}const w=e.padding/2;return(0,I.Ys)(m).attr("transform","translate( "+(h.width>L.width?0:(L.width-h.width)/2)+", "+(L.height+w+5)+")"),(0,I.Ys)(p).attr("transform","translate( "+(h.width<L.width?0:-(L.width-h.width)/2)+", 0)"),h=s.node().getBBox(),s.attr("transform","translate("+-h.width/2+", "+(-h.height/2-w+3)+")"),n.attr("class","outer title-state").attr("x",-h.width/2-w).attr("y",-h.height/2-w).attr("width",h.width+e.padding).attr("height",h.height+e.padding),a.attr("class","divider").attr("x1",-h.width/2-w).attr("x2",h.width/2+w).attr("y1",-h.height/2-w+L.height+w).attr("y2",-h.height/2-w+L.height+w),P(e,n),e.intersect=function(C){return A.rect(e,C)},l},"rectWithTitle"),Or=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){const{shapeSvg:l,bbox:n}=yield F(e,t,G(t,void 0),!0),a=n.height+t.padding,s=n.width+a/4+t.padding,i=l.insert("rect",":first-child").attr("style",t.style).attr("rx",a/2).attr("ry",a/2).attr("x",-s/2).attr("y",-a/2).attr("width",s).attr("height",a);return P(t,i),t.intersect=function(o){return A.rect(t,o)},l});return function(e,t){return r.apply(this,arguments)}}(),"stadium"),Tr=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){const{shapeSvg:l,bbox:n,halfPadding:a}=yield F(e,t,G(t,void 0),!0),s=l.insert("circle",":first-child");return s.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",n.width/2+a).attr("width",n.width+t.padding).attr("height",n.height+t.padding),c.cM.info("Circle main"),P(t,s),t.intersect=function(i){return c.cM.info("Circle intersect",t,n.width/2+a,i),A.circle(t,n.width/2+a,i)},l});return function(e,t){return r.apply(this,arguments)}}(),"circle"),Mr=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){const{shapeSvg:l,bbox:n,halfPadding:a}=yield F(e,t,G(t,void 0),!0),i=l.insert("g",":first-child"),o=i.insert("circle"),p=i.insert("circle");return i.attr("class",t.class),o.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",n.width/2+a+5).attr("width",n.width+t.padding+10).attr("height",n.height+t.padding+10),p.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",n.width/2+a).attr("width",n.width+t.padding).attr("height",n.height+t.padding),c.cM.info("DoubleCircle main"),P(t,o),t.intersect=function(h){return c.cM.info("DoubleCircle intersect",t,n.width/2+a+5,h),A.circle(t,n.width/2+a+5,h)},l});return function(e,t){return r.apply(this,arguments)}}(),"doublecircle"),Br=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t){const{shapeSvg:l,bbox:n}=yield F(e,t,G(t,void 0),!0),a=n.width+t.padding,s=n.height+t.padding,i=[{x:0,y:0},{x:a,y:0},{x:a,y:-s},{x:0,y:-s},{x:0,y:0},{x:-8,y:0},{x:a+8,y:0},{x:a+8,y:-s},{x:-8,y:-s},{x:-8,y:0}],o=et(l,a,s,i);return o.attr("style",t.style),P(t,o),t.intersect=function(p){return A.polygon(t,i,p)},l});return function(e,t){return r.apply(this,arguments)}}(),"subroutine"),Ir=(0,c.eW)((r,e)=>{const t=r.insert("g").attr("class","node default").attr("id",e.domId||e.id),l=t.insert("circle",":first-child");return l.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),P(e,l),e.intersect=function(n){return A.circle(e,7,n)},t},"start"),fe=(0,c.eW)((r,e,t)=>{const l=r.insert("g").attr("class","node default").attr("id",e.domId||e.id);let n=70,a=10;"LR"===t&&(n=10,a=70);const s=l.append("rect").attr("x",-1*n/2).attr("y",-1*a/2).attr("width",n).attr("height",a).attr("class","fork-join");return P(e,s),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(i){return A.rect(e,i)},l},"forkJoin"),xe={rhombus:pe,composite:Cr,question:pe,rect:Dr,labelRect:Nr,rectWithTitle:Wr,choice:br,circle:Tr,doublecircle:Mr,stadium:Or,hexagon:yr,block_arrow:mr,rect_left_inv_arrow:_r,lean_right:Lr,lean_left:kr,trapezoid:wr,inv_trapezoid:Sr,rect_right_inv_arrow:vr,cylinder:Er,start:Ir,end:(0,c.eW)((r,e)=>{const t=r.insert("g").attr("class","node default").attr("id",e.domId||e.id),l=t.insert("circle",":first-child"),n=t.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),l.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),P(e,n),e.intersect=function(a){return A.circle(e,7,a)},t},"end"),note:xr,subroutine:Br,fork:fe,join:fe,class_box:(0,c.eW)((r,e)=>{const t=e.padding/2;let a;a=e.classes?"node "+e.classes:"node default";const s=r.insert("g").attr("class",a).attr("id",e.domId||e.id),i=s.insert("rect",":first-child"),o=s.insert("line"),p=s.insert("line");let h=0,b=4;const L=s.insert("g").attr("class","label");let m=0;const w=e.classData.annotations?.[0],C=e.classData.annotations[0]?"\xab"+e.classData.annotations[0]+"\xbb":"",D=L.node().appendChild($(C,e.labelStyle,!0,!0));let B=D.getBBox();if((0,c.ku)((0,c.nV)().flowchart.htmlLabels)){const v=D.children[0],u=(0,I.Ys)(D);B=v.getBoundingClientRect(),u.attr("width",B.width),u.attr("height",B.height)}e.classData.annotations[0]&&(b+=B.height+4,h+=B.width);let R=e.classData.label;void 0!==e.classData.type&&""!==e.classData.type&&((0,c.nV)().flowchart.htmlLabels?R+="&lt;"+e.classData.type+"&gt;":R+="<"+e.classData.type+">");const T=L.node().appendChild($(R,e.labelStyle,!0,!0));(0,I.Ys)(T).attr("class","classTitle");let _=T.getBBox();if((0,c.ku)((0,c.nV)().flowchart.htmlLabels)){const v=T.children[0],u=(0,I.Ys)(T);_=v.getBoundingClientRect(),u.attr("width",_.width),u.attr("height",_.height)}b+=_.height+4,_.width>h&&(h=_.width);const g=[];e.classData.members.forEach(v=>{const u=v.getDisplayDetails();let J=u.displayText;(0,c.nV)().flowchart.htmlLabels&&(J=J.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const f=L.node().appendChild($(J,u.cssStyle?u.cssStyle:e.labelStyle,!0,!0));let Y=f.getBBox();if((0,c.ku)((0,c.nV)().flowchart.htmlLabels)){const ht=f.children[0],at=(0,I.Ys)(f);Y=ht.getBoundingClientRect(),at.attr("width",Y.width),at.attr("height",Y.height)}Y.width>h&&(h=Y.width),b+=Y.height+4,g.push(f)}),b+=8;const x=[];if(e.classData.methods.forEach(v=>{const u=v.getDisplayDetails();let J=u.displayText;(0,c.nV)().flowchart.htmlLabels&&(J=J.replace(/</g,"&lt;").replace(/>/g,"&gt;"));const f=L.node().appendChild($(J,u.cssStyle?u.cssStyle:e.labelStyle,!0,!0));let Y=f.getBBox();if((0,c.ku)((0,c.nV)().flowchart.htmlLabels)){const ht=f.children[0],at=(0,I.Ys)(f);Y=ht.getBoundingClientRect(),at.attr("width",Y.width),at.attr("height",Y.height)}Y.width>h&&(h=Y.width),b+=Y.height+4,x.push(f)}),b+=8,w){let v=(h-B.width)/2;(0,I.Ys)(D).attr("transform","translate( "+(-1*h/2+v)+", "+-1*b/2+")"),m=B.height+4}let k=(h-_.width)/2;return(0,I.Ys)(T).attr("transform","translate( "+(-1*h/2+k)+", "+(-1*b/2+m)+")"),m+=_.height+4,o.attr("class","divider").attr("x1",-h/2-t).attr("x2",h/2+t).attr("y1",-b/2-t+8+m).attr("y2",-b/2-t+8+m),m+=8,g.forEach(v=>{(0,I.Ys)(v).attr("transform","translate( "+-h/2+", "+(-1*b/2+m+4)+")"),m+=(v?.getBBox()?.height??0)+4}),m+=8,p.attr("class","divider").attr("x1",-h/2-t).attr("x2",h/2+t).attr("y1",-b/2-t+8+m).attr("y2",-b/2-t+8+m),m+=8,x.forEach(v=>{(0,I.Ys)(v).attr("transform","translate( "+-h/2+", "+(-1*b/2+m)+")"),m+=(v?.getBBox()?.height??0)+4}),i.attr("style",e.style).attr("class","outer title-state").attr("x",-h/2-t).attr("y",-b/2-t).attr("width",h+e.padding).attr("height",b+e.padding),P(e,i),e.intersect=function(v){return A.rect(e,v)},s},"class_box")},Ot={},be=(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t,l){let n,a;if(t.link){let s;"sandbox"===(0,c.nV)().securityLevel?s="_top":t.linkTarget&&(s=t.linkTarget||"_blank"),n=e.insert("svg:a").attr("xlink:href",t.link).attr("target",s),a=yield xe[t.shape](n,t,l)}else a=yield xe[t.shape](e,t,l),n=a;return t.tooltip&&a.attr("title",t.tooltip),t.class&&a.attr("class","node default "+t.class),Ot[t.id]=n,t.haveCallback&&Ot[t.id].attr("class",Ot[t.id].attr("class")+" clickable"),n});return function(e,t,l){return r.apply(this,arguments)}}(),"insertNode"),zr=(0,c.eW)(r=>{const e=Ot[r.id];c.cM.trace("Transforming node",r.diff,r,"translate("+(r.x-r.width/2-5)+", "+r.width/2+")");const l=r.diff||0;return r.clusterNode?e.attr("transform","translate("+(r.x+l-r.width/2)+", "+(r.y-r.height/2-8)+")"):e.attr("transform","translate("+r.x+", "+r.y+")"),l},"positionNode");function jt(r,e,t=!1){const l=r;let n="default";(l?.classes?.length||0)>0&&(n=(l?.classes??[]).join(" ")),n+=" flowchart-label";let i,a=0,s="";switch(l.type){case"round":a=5,s="rect";break;case"composite":a=0,s="composite",i=0;break;case"square":case"group":default:s="rect";break;case"diamond":s="question";break;case"hexagon":s="hexagon";break;case"block_arrow":s="block_arrow";break;case"odd":case"rect_left_inv_arrow":s="rect_left_inv_arrow";break;case"lean_right":s="lean_right";break;case"lean_left":s="lean_left";break;case"trapezoid":s="trapezoid";break;case"inv_trapezoid":s="inv_trapezoid";break;case"circle":s="circle";break;case"ellipse":s="ellipse";break;case"stadium":s="stadium";break;case"subroutine":s="subroutine";break;case"cylinder":s="cylinder";break;case"doublecircle":s="doublecircle"}const o=(0,X.be)(l?.styles??[]),p=l.label,h=l.size??{width:0,height:0,x:0,y:0};return{labelStyle:o.labelStyle,shape:s,labelText:p,rx:a,ry:a,class:n,style:o.style,id:l.id,directions:l.directions,width:h.width,height:h.height,x:h.x,y:h.y,positioned:t,intersect:void 0,type:l.type,padding:i??(0,c.iE)()?.block?.padding??0}}function ye(r,e,t){return Kt.apply(this,arguments)}function Kt(){return(Kt=(0,W.Z)(function*(r,e,t){const l=jt(e,0,!1);if("group"===l.type)return;const n=(0,c.iE)(),a=yield be(r,l,{config:n}),s=a.node().getBBox(),i=t.getBlock(l.id);i.size={width:s.width,height:s.height,x:0,y:0,node:a},t.setBlock(i),a.remove()})).apply(this,arguments)}function me(r,e,t){return Ut.apply(this,arguments)}function Ut(){return(Ut=(0,W.Z)(function*(r,e,t){const l=jt(e,0,!0);if("space"!==t.getBlock(l.id).type){const a=(0,c.iE)();yield be(r,l,{config:a}),e.intersect=l?.intersect,zr(l)}})).apply(this,arguments)}function Tt(r,e,t,l){return Vt.apply(this,arguments)}function Vt(){return(Vt=(0,W.Z)(function*(r,e,t,l){for(const n of e)yield l(r,n,t),n.children&&(yield Tt(r,n.children,t,l))})).apply(this,arguments)}function _e(r,e,t){return Ht.apply(this,arguments)}function Ht(){return(Ht=(0,W.Z)(function*(r,e,t){yield Tt(r,e,t,ye)})).apply(this,arguments)}function Le(r,e,t){return Xt.apply(this,arguments)}function Xt(){return(Xt=(0,W.Z)(function*(r,e,t){yield Tt(r,e,t,me)})).apply(this,arguments)}function ke(r,e,t,l,n){return Gt.apply(this,arguments)}function Gt(){return(Gt=(0,W.Z)(function*(r,e,t,l,n){const a=new Et.k({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const s of t)s.size&&a.setNode(s.id,{width:s.size.width,height:s.size.height,intersect:s.intersect});for(const s of e)if(s.start&&s.end){const i=l.getBlock(s.start),o=l.getBlock(s.end);if(i?.size&&o?.size){const p=i.size,h=o.size,b=[{x:p.x,y:p.y},{x:p.x+(h.x-p.x)/2,y:p.y+(h.y-p.y)/2},{x:h.x,y:h.y}];nr(r,{v:s.start,w:s.end,name:s.id},{...s,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:b,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",a,n),s.label&&(yield rr(r,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:b,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),sr({...s,x:b[1].x,y:b[1].y},{originalPath:b}))}}})).apply(this,arguments)}(0,c.eW)(jt,"getNodeFromBlock"),(0,c.eW)(ye,"calculateBlockSize"),(0,c.eW)(me,"insertBlockPositioned"),(0,c.eW)(Tt,"performOperations"),(0,c.eW)(_e,"calculateBlockSizes"),(0,c.eW)(Le,"insertBlocks"),(0,c.eW)(ke,"insertEdges");var Pr=(0,c.eW)(function(r,e){return e.db.getClasses()},"getClasses"),Fr={parser:ot,db:Ae,renderer:{draw:(0,c.eW)(function(){var r=(0,W.Z)(function*(e,t,l,n){const{securityLevel:a,block:s}=(0,c.iE)(),i=n.db;let o;"sandbox"===a&&(o=(0,I.Ys)("#i"+t));const p="sandbox"===a?(0,I.Ys)(o.nodes()[0].contentDocument.body):(0,I.Ys)("body"),h="sandbox"===a?p.select(`[id="${t}"]`):(0,I.Ys)(`[id="${t}"]`);Qe(h,["point","circle","cross"],n.type,t);const L=i.getBlocks(),m=i.getBlocksFlat(),w=i.getEdges(),C=h.insert("g").attr("class","block");yield _e(C,L,i);const D=se(i);if(yield Le(C,L,i),yield ke(C,w,m,i,t),D){const B=D,R=Math.max(1,Math.round(B.width/B.height*.125)),T=B.height+R+10,_=B.width+10,{useMaxWidth:g}=s;(0,c.v2)(h,T,_,!!g),c.cM.debug("Here Bounds",D,B),h.attr("viewBox",`${B.x-5} ${B.y-5} ${B.width+10} ${B.height+10}`)}});return function(e,t,l,n){return r.apply(this,arguments)}}(),"draw"),getClasses:Pr},styles:Pe}},91650:(Rt,lt,N)=>{N.d(lt,{k:()=>Lt});var W=N(31066),pt=N(55663),bt=N(8888),ut=N(20995);const c=(0,pt.Z)(function(K){return(0,bt.Z)((0,W.Z)(K,1,ut.Z,!0))});var ft=N(55677),vt=N(20801),ct=N(41270),I=N(76038),Et=N(80256),tt=N(4509),ot=N(94518),V=N(88118),yt=N(43408);class Lt{constructor(d={}){this._isDirected=!Object.prototype.hasOwnProperty.call(d,"directed")||d.directed,this._isMultigraph=!!Object.prototype.hasOwnProperty.call(d,"multigraph")&&d.multigraph,this._isCompound=!!Object.prototype.hasOwnProperty.call(d,"compound")&&d.compound,this._label=void 0,this._defaultNodeLabelFn=ft.Z(void 0),this._defaultEdgeLabelFn=ft.Z(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(d){return this._label=d,this}graph(){return this._label}setDefaultNodeLabel(d){return vt.Z(d)||(d=ft.Z(d)),this._defaultNodeLabelFn=d,this}nodeCount(){return this._nodeCount}nodes(){return ct.Z(this._nodes)}sources(){var d=this;return I.Z(this.nodes(),function(y){return Et.Z(d._in[y])})}sinks(){var d=this;return I.Z(this.nodes(),function(y){return Et.Z(d._out[y])})}setNodes(d,y){var S=arguments,E=this;return tt.Z(d,function(O){S.length>1?E.setNode(O,y):E.setNode(O)}),this}setNode(d,y){return Object.prototype.hasOwnProperty.call(this._nodes,d)?(arguments.length>1&&(this._nodes[d]=y),this):(this._nodes[d]=arguments.length>1?y:this._defaultNodeLabelFn(d),this._isCompound&&(this._parent[d]="\0",this._children[d]={},this._children["\0"][d]=!0),this._in[d]={},this._preds[d]={},this._out[d]={},this._sucs[d]={},++this._nodeCount,this)}node(d){return this._nodes[d]}hasNode(d){return Object.prototype.hasOwnProperty.call(this._nodes,d)}removeNode(d){if(Object.prototype.hasOwnProperty.call(this._nodes,d)){var y=S=>this.removeEdge(this._edgeObjs[S]);delete this._nodes[d],this._isCompound&&(this._removeFromParentsChildList(d),delete this._parent[d],tt.Z(this.children(d),S=>{this.setParent(S)}),delete this._children[d]),tt.Z(ct.Z(this._in[d]),y),delete this._in[d],delete this._preds[d],tt.Z(ct.Z(this._out[d]),y),delete this._out[d],delete this._sucs[d],--this._nodeCount}return this}setParent(d,y){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(ot.Z(y))y="\0";else{for(var S=y+="";!ot.Z(S);S=this.parent(S))if(S===d)throw new Error("Setting "+y+" as parent of "+d+" would create a cycle");this.setNode(y)}return this.setNode(d),this._removeFromParentsChildList(d),this._parent[d]=y,this._children[y][d]=!0,this}_removeFromParentsChildList(d){delete this._children[this._parent[d]][d]}parent(d){if(this._isCompound){var y=this._parent[d];if("\0"!==y)return y}}children(d){if(ot.Z(d)&&(d="\0"),this._isCompound){var y=this._children[d];if(y)return ct.Z(y)}else{if("\0"===d)return this.nodes();if(this.hasNode(d))return[]}}predecessors(d){var y=this._preds[d];if(y)return ct.Z(y)}successors(d){var y=this._sucs[d];if(y)return ct.Z(y)}neighbors(d){var y=this.predecessors(d);if(y)return c(y,this.successors(d))}isLeaf(d){return 0===(this.isDirected()?this.successors(d):this.neighbors(d)).length}filterNodes(d){var y=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});y.setGraph(this.graph());var S=this;tt.Z(this._nodes,function(M,z){d(z)&&y.setNode(z,M)}),tt.Z(this._edgeObjs,function(M){y.hasNode(M.v)&&y.hasNode(M.w)&&y.setEdge(M,S.edge(M))});var E={};function O(M){var z=S.parent(M);return void 0===z||y.hasNode(z)?(E[M]=z,z):z in E?E[z]:O(z)}return this._isCompound&&tt.Z(y.nodes(),function(M){y.setParent(M,O(M))}),y}setDefaultEdgeLabel(d){return vt.Z(d)||(d=ft.Z(d)),this._defaultEdgeLabelFn=d,this}edgeCount(){return this._edgeCount}edges(){return V.Z(this._edgeObjs)}setPath(d,y){var S=this,E=arguments;return yt.Z(d,function(O,M){return E.length>1?S.setEdge(O,M,y):S.setEdge(O,M),M}),this}setEdge(){var d,y,S,E,O=!1,M=arguments[0];"object"==typeof M&&null!==M&&"v"in M?(d=M.v,y=M.w,S=M.name,2===arguments.length&&(E=arguments[1],O=!0)):(d=M,y=arguments[1],S=arguments[3],arguments.length>2&&(E=arguments[2],O=!0)),d=""+d,y=""+y,ot.Z(S)||(S=""+S);var z=st(this._isDirected,d,y,S);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,z))return O&&(this._edgeLabels[z]=E),this;if(!ot.Z(S)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(d),this.setNode(y),this._edgeLabels[z]=O?E:this._defaultEdgeLabelFn(d,y,S);var it=function At(K,d,y,S){var E=""+d,O=""+y;if(!K&&E>O){var M=E;E=O,O=M}var z={v:E,w:O};return S&&(z.name=S),z}(this._isDirected,d,y,S);return d=it.v,y=it.w,Object.freeze(it),this._edgeObjs[z]=it,kt(this._preds[y],d),kt(this._sucs[d],y),this._in[y][z]=it,this._out[d][z]=it,this._edgeCount++,this}edge(d,y,S){var E=1===arguments.length?wt(this._isDirected,arguments[0]):st(this._isDirected,d,y,S);return this._edgeLabels[E]}hasEdge(d,y,S){var E=1===arguments.length?wt(this._isDirected,arguments[0]):st(this._isDirected,d,y,S);return Object.prototype.hasOwnProperty.call(this._edgeLabels,E)}removeEdge(d,y,S){var E=1===arguments.length?wt(this._isDirected,arguments[0]):st(this._isDirected,d,y,S),O=this._edgeObjs[E];return O&&(d=O.v,y=O.w,delete this._edgeLabels[E],delete this._edgeObjs[E],Dt(this._preds[y],d),Dt(this._sucs[d],y),delete this._in[y][E],delete this._out[d][E],this._edgeCount--),this}inEdges(d,y){var S=this._in[d];if(S){var E=V.Z(S);return y?I.Z(E,function(O){return O.v===y}):E}}outEdges(d,y){var S=this._out[d];if(S){var E=V.Z(S);return y?I.Z(E,function(O){return O.w===y}):E}}nodeEdges(d,y){var S=this.inEdges(d,y);if(S)return S.concat(this.outEdges(d,y))}}function kt(K,d){K[d]?K[d]++:K[d]=1}function Dt(K,d){--K[d]||delete K[d]}function st(K,d,y,S){var E=""+d,O=""+y;if(!K&&E>O){var M=E;E=O,O=M}return E+"\x01"+O+"\x01"+(ot.Z(S)?"\0":S)}function wt(K,d){return st(K,d.v,d.w,d.name)}Lt.prototype._nodeCount=0,Lt.prototype._edgeCount=0},75788:(Rt,lt,N)=>{N.d(lt,{k:()=>W.k});var W=N(91650)},38884:(Rt,lt,N)=>{N.d(lt,{Z:()=>ut});var W=N(69052);const ut=function bt(X){return(0,W.Z)(X,4)}}}]);