98 lines
22 KiB
JavaScript
98 lines
22 KiB
JavaScript
/*! third party licenses: js/vendor.LICENSE.txt */
|
|
import{l as I,g as W,y as ct,I as ht,B as M,h as F,A as lt}from"./index-CyCAgei9.chunk.mjs";import{c as Q}from"./cytoscape.esm-3961YR65.chunk.mjs";import{c as dt}from"./cytoscape-cose-bilkent-BWab1rkW.chunk.mjs";import{w as gt,x as pt,y as ut,s as yt}from"./isEmpty-nTVdZyYD.chunk.mjs";import{c as ft}from"./createText-2e5e7dd3-DGO2Nq3C.chunk.mjs";import"./percentages-BXMCSKIN-Cw9SI0WV.chunk.mjs";import"./whiteboard-main.mjs";import"./index-Anv74-sp.chunk.mjs";import"./vendor-BeFBwUwf.chunk.mjs";import"./index-vg7q3Iku.chunk.mjs";import"./index-Bn0s6V7w.chunk.mjs";var q=function(){var e=function(S,n,c,h){for(c=c||{},h=S.length;h--;c[S[h]]=n);return c},a=[1,4],t=[1,13],r=[1,12],s=[1,15],i=[1,16],l=[1,20],p=[1,19],u=[6,7,8],m=[1,26],b=[1,24],w=[1,25],y=[6,7,11],A=[1,6,13,15,16,19,22],D=[1,33],x=[1,34],R=[1,6,7,11,13,15,16,19,22],j={trace:function(){},yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:function(S,n,c,h,g,o,E){var d=o.length-1;switch(g){case 6:case 7:return h;case 8:h.getLogger().trace("Stop NL ");break;case 9:h.getLogger().trace("Stop EOF ");break;case 11:h.getLogger().trace("Stop NL2 ");break;case 12:h.getLogger().trace("Stop EOF2 ");break;case 15:h.getLogger().info("Node: ",o[d].id),h.addNode(o[d-1].length,o[d].id,o[d].descr,o[d].type);break;case 16:h.getLogger().trace("Icon: ",o[d]),h.decorateNode({icon:o[d]});break;case 17:case 21:h.decorateNode({class:o[d]});break;case 18:h.getLogger().trace("SPACELIST");break;case 19:h.getLogger().trace("Node: ",o[d].id),h.addNode(0,o[d].id,o[d].descr,o[d].type);break;case 20:h.decorateNode({icon:o[d]});break;case 25:h.getLogger().trace("node found ..",o[d-2]),this.$={id:o[d-1],descr:o[d-1],type:h.getType(o[d-2],o[d])};break;case 26:this.$={id:o[d],descr:o[d],type:h.nodeType.DEFAULT};break;case 27:h.getLogger().trace("node found ..",o[d-3]),this.$={id:o[d-3],descr:o[d-1],type:h.getType(o[d-2],o[d])};break}},table:[{3:1,4:2,5:3,6:[1,5],8:a},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:a},{6:t,7:[1,10],9:9,12:11,13:r,14:14,15:s,16:i,17:17,18:18,19:l,22:p},e(u,[2,3]),{1:[2,2]},e(u,[2,4]),e(u,[2,5]),{1:[2,6],6:t,12:21,13:r,14:14,15:s,16:i,17:17,18:18,19:l,22:p},{6:t,9:22,12:11,13:r,14:14,15:s,16:i,17:17,18:18,19:l,22:p},{6:m,7:b,10:23,11:w},e(y,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:l,22:p}),e(y,[2,18]),e(y,[2,19]),e(y,[2,20]),e(y,[2,21]),e(y,[2,23]),e(y,[2,24]),e(y,[2,26],{19:[1,30]}),{20:[1,31]},{6:m,7:b,10:32,11:w},{1:[2,7],6:t,12:21,13:r,14:14,15:s,16:i,17:17,18:18,19:l,22:p},e(A,[2,14],{7:D,11:x}),e(R,[2,8]),e(R,[2,9]),e(R,[2,10]),e(y,[2,15]),e(y,[2,16]),e(y,[2,17]),{20:[1,35]},{21:[1,36]},e(A,[2,13],{7:D,11:x}),e(R,[2,11]),e(R,[2,12]),{21:[1,37]},e(y,[2,25]),e(y,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:function(S,n){if(n.recoverable)this.trace(S);else{var c=new Error(S);throw c.hash=n,c}},parse:function(S){var n=this,c=[0],h=[],g=[null],o=[],E=this.table,d="",P=0,J=0,rt=2,K=1,st=o.slice.call(arguments,1),$=Object.create(this.lexer),v={yy:{}};for(var G in this.yy)Object.prototype.hasOwnProperty.call(this.yy,G)&&(v.yy[G]=this.yy[G]);$.setInput(S,v.yy),v.yy.lexer=$,v.yy.parser=this,typeof $.yylloc>"u"&&($.yylloc={});var z=$.yylloc;o.push(z);var at=$.options&&$.options.ranges;typeof v.yy.parseError=="function"?this.parseError=v.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ot(){var O;return O=h.pop()||$.lex()||K,typeof O!="number"&&(O instanceof Array&&(h=O,O=h.pop()),O=n.symbols_[O]||O),O}for(var _,C,N,X,T={},B,L,V,U;;){if(C=c[c.length-1],this.defaultActions[C]?N=this.defaultActions[C]:((_===null||typeof _>"u")&&(_=ot()),N=E[C]&&E[C][_]),typeof N>"u"||!N.length||!N[0]){var Y="";U=[];for(B in E[C])this.terminals_[B]&&B>rt&&U.push("'"+this.terminals_[B]+"'");$.showPosition?Y="Parse error on line "+(P+1)+`:
|
|
`+$.showPosition()+`
|
|
Expecting `+U.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Y="Parse error on line "+(P+1)+": Unexpected "+(_==K?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Y,{text:$.match,token:this.terminals_[_]||_,line:$.yylineno,loc:z,expected:U})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+C+", token: "+_);switch(N[0]){case 1:c.push(_),g.push($.yytext),o.push($.yylloc),c.push(N[1]),_=null,J=$.yyleng,d=$.yytext,P=$.yylineno,z=$.yylloc;break;case 2:if(L=this.productions_[N[1]][1],T.$=g[g.length-L],T._$={first_line:o[o.length-(L||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(L||1)].first_column,last_column:o[o.length-1].last_column},at&&(T._$.range=[o[o.length-(L||1)].range[0],o[o.length-1].range[1]]),X=this.performAction.apply(T,[d,J,P,v.yy,N[1],g,o].concat(st)),typeof X<"u")return X;L&&(c=c.slice(0,-1*L*2),g=g.slice(0,-1*L),o=o.slice(0,-1*L)),c.push(this.productions_[N[1]][0]),g.push(T.$),o.push(T._$),V=E[c[c.length-2]][c[c.length-1]],c.push(V);break;case 3:return!0}}return!0}},it=function(){var S={EOF:1,parseError:function(n,c){if(this.yy.parser)this.yy.parser.parseError(n,c);else throw new Error(n)},setInput:function(n,c){return this.yy=c||this.yy||{},this._input=n,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},input:function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var c=n.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},unput:function(n){var c=n.length,h=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var g=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),h.length-1&&(this.yylineno-=h.length-1);var o=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:h?(h.length===g.length?this.yylloc.first_column:0)+g[g.length-h.length].length-h[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[o[0],o[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject: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},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var n=this.pastInput(),c=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
|
|
`+c+"^"},test_match:function(n,c){var h,g,o;if(this.options.backtrack_lexer&&(o={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&&(o.yylloc.range=this.yylloc.range.slice(0))),g=n[0].match(/(?:\r\n?|\n).*/g),g&&(this.yylineno+=g.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,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(n[0].length),this.matched+=n[0],h=this.performAction.call(this,this.yy,this,c,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var E in o)this[E]=o[E];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,c,h,g;this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),E=0;E<o.length;E++)if(h=this._input.match(this.rules[o[E]]),h&&(!c||h[0].length>c[0].length)){if(c=h,g=E,this.options.backtrack_lexer){if(n=this.test_match(h,o[E]),n!==!1)return n;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(n=this.test_match(c,o[g]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var n=this.next();return n||this.lex()},begin:function(n){this.conditionStack.push(n)},popState:function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},pushState:function(n){this.begin(n)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(n,c,h,g){switch(h){case 0:return n.getLogger().trace("Found comment",c.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:n.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return n.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:n.getLogger().trace("end icon"),this.popState();break;case 10:return n.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return n.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return n.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return n.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:n.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return n.getLogger().trace("description:",c.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),n.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),n.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),n.getLogger().trace("node end ...",c.yytext),"NODE_DEND";case 30:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),n.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),n.getLogger().trace("node end (("),"NODE_DEND";case 35:return n.getLogger().trace("Long description:",c.yytext),20;case 36:return n.getLogger().trace("Long description:",c.yytext),20}},rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return S}();j.lexer=it;function H(){this.yy={}}return H.prototype=j,j.Parser=H,new H}();q.parser=q;const mt=q;let k=[],tt=0,Z={};const $t=()=>{k=[],tt=0,Z={}},Et=function(e){for(let a=k.length-1;a>=0;a--)if(k[a].level<e)return k[a];return null},_t=()=>k.length>0?k[0]:null,bt=(e,a,t,r)=>{var s,i;I.info("addNode",e,a,t,r);const l=W();let p=((s=l.mindmap)==null?void 0:s.padding)??M.mindmap.padding;switch(r){case f.ROUNDED_RECT:case f.RECT:case f.HEXAGON:p*=2}const u={id:tt++,nodeId:F(a,l),level:e,descr:F(t,l),type:r,children:[],width:((i=l.mindmap)==null?void 0:i.maxNodeWidth)??M.mindmap.maxNodeWidth,padding:p},m=Et(e);if(m)m.children.push(u),k.push(u);else if(k.length===0)k.push(u);else throw new Error('There can be only one root. No parent could be found for ("'+u.descr+'")')},f={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Nt=(e,a)=>{switch(I.debug("In get type",e,a),e){case"[":return f.RECT;case"(":return a===")"?f.ROUNDED_RECT:f.CLOUD;case"((":return f.CIRCLE;case")":return f.CLOUD;case"))":return f.BANG;case"{{":return f.HEXAGON;default:return f.DEFAULT}},kt=(e,a)=>{Z[e]=a},St=e=>{if(!e)return;const a=W(),t=k[k.length-1];e.icon&&(t.icon=F(e.icon,a)),e.class&&(t.class=F(e.class,a))},Dt=e=>{switch(e){case f.DEFAULT:return"no-border";case f.RECT:return"rect";case f.ROUNDED_RECT:return"rounded-rect";case f.CIRCLE:return"circle";case f.CLOUD:return"cloud";case f.BANG:return"bang";case f.HEXAGON:return"hexgon";default:return"no-border"}},xt=()=>I,Lt=e=>Z[e],Ot={clear:$t,addNode:bt,getMindmap:_t,nodeType:f,getType:Nt,setElementForId:kt,decorateNode:St,type2Str:Dt,getLogger:xt,getElementById:Lt},wt=Ot,vt=12,Ct=function(e,a,t,r){a.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+e.type2Str(t.type)).attr("d",`M0 ${t.height-5} v${-t.height+2*5} q0,-5 5,-5 h${t.width-2*5} q5,0 5,5 v${t.height-5} H0 Z`),a.append("line").attr("class","node-line-"+r).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},It=function(e,a,t){a.append("rect").attr("id","node-"+t.id).attr("class","node-bkg node-"+e.type2Str(t.type)).attr("height",t.height).attr("width",t.width)},Tt=function(e,a,t){const r=t.width,s=t.height,i=.15*r,l=.25*r,p=.35*r,u=.2*r;a.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+e.type2Str(t.type)).attr("d",`M0 0 a${i},${i} 0 0,1 ${r*.25},${-1*r*.1}
|
|
a${p},${p} 1 0,1 ${r*.4},${-1*r*.1}
|
|
a${l},${l} 1 0,1 ${r*.35},${1*r*.2}
|
|
|
|
a${i},${i} 1 0,1 ${r*.15},${1*s*.35}
|
|
a${u},${u} 1 0,1 ${-1*r*.15},${1*s*.65}
|
|
|
|
a${l},${i} 1 0,1 ${-1*r*.25},${r*.15}
|
|
a${p},${p} 1 0,1 ${-1*r*.5},0
|
|
a${i},${i} 1 0,1 ${-1*r*.25},${-1*r*.15}
|
|
|
|
a${i},${i} 1 0,1 ${-1*r*.1},${-1*s*.35}
|
|
a${u},${u} 1 0,1 ${r*.1},${-1*s*.65}
|
|
|
|
H0 V0 Z`)},Rt=function(e,a,t){const r=t.width,s=t.height,i=.15*r;a.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+e.type2Str(t.type)).attr("d",`M0 0 a${i},${i} 1 0,0 ${r*.25},${-1*s*.1}
|
|
a${i},${i} 1 0,0 ${r*.25},0
|
|
a${i},${i} 1 0,0 ${r*.25},0
|
|
a${i},${i} 1 0,0 ${r*.25},${1*s*.1}
|
|
|
|
a${i},${i} 1 0,0 ${r*.15},${1*s*.33}
|
|
a${i*.8},${i*.8} 1 0,0 0,${1*s*.34}
|
|
a${i},${i} 1 0,0 ${-1*r*.15},${1*s*.33}
|
|
|
|
a${i},${i} 1 0,0 ${-1*r*.25},${s*.15}
|
|
a${i},${i} 1 0,0 ${-1*r*.25},0
|
|
a${i},${i} 1 0,0 ${-1*r*.25},0
|
|
a${i},${i} 1 0,0 ${-1*r*.25},${-1*s*.15}
|
|
|
|
a${i},${i} 1 0,0 ${-1*r*.1},${-1*s*.33}
|
|
a${i*.8},${i*.8} 1 0,0 0,${-1*s*.34}
|
|
a${i},${i} 1 0,0 ${r*.1},${-1*s*.33}
|
|
|
|
H0 V0 Z`)},At=function(e,a,t){a.append("circle").attr("id","node-"+t.id).attr("class","node-bkg node-"+e.type2Str(t.type)).attr("r",t.width/2)};function Pt(e,a,t,r,s){return e.insert("polygon",":first-child").attr("points",r.map(function(i){return i.x+","+i.y}).join(" ")).attr("transform","translate("+(s.width-a)/2+", "+t+")")}const Bt=function(e,a,t){const r=t.height,s=r/4,i=t.width-t.padding+2*s,l=[{x:s,y:0},{x:i-s,y:0},{x:i,y:-r/2},{x:i-s,y:-r},{x:s,y:-r},{x:0,y:-r/2}];Pt(a,i,r,l,t)},Ut=function(e,a,t){a.append("rect").attr("id","node-"+t.id).attr("class","node-bkg node-"+e.type2Str(t.type)).attr("height",t.height).attr("rx",t.padding).attr("ry",t.padding).attr("width",t.width)},Mt=function(e,a,t,r,s){const i=s.htmlLabels,l=r%(vt-1),p=a.append("g");t.section=l;let u="section-"+l;l<0&&(u+=" section-root"),p.attr("class",(t.class?t.class+" ":"")+"mindmap-node "+u);const m=p.append("g"),b=p.append("g"),w=t.descr.replace(/(<br\/*>)/g,`
|
|
`);ft(b,w,{useHtmlLabels:i,width:t.width,classes:"mindmap-node-label"}),i||b.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");const y=b.node().getBBox(),[A]=lt(s.fontSize);if(t.height=y.height+A*1.1*.5+t.padding,t.width=y.width+2*t.padding,t.icon)if(t.type===e.nodeType.CIRCLE)t.height+=50,t.width+=50,p.append("foreignObject").attr("height","50px").attr("width",t.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+l+" "+t.icon),b.attr("transform","translate("+t.width/2+", "+(t.height/2-1.5*t.padding)+")");else{t.width+=50;const D=t.height;t.height=Math.max(D,60);const x=Math.abs(t.height-D);p.append("foreignObject").attr("width","60px").attr("height",t.height).attr("style","text-align: center;margin-top:"+x/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+l+" "+t.icon),b.attr("transform","translate("+(25+t.width/2)+", "+(x/2+t.padding/2)+")")}else if(i){const D=(t.width-y.width)/2,x=(t.height-y.height)/2;b.attr("transform","translate("+D+", "+x+")")}else{const D=t.width/2,x=t.padding/2;b.attr("transform","translate("+D+", "+x+")")}switch(t.type){case e.nodeType.DEFAULT:Ct(e,m,t,l);break;case e.nodeType.ROUNDED_RECT:Ut(e,m,t);break;case e.nodeType.RECT:It(e,m,t);break;case e.nodeType.CIRCLE:m.attr("transform","translate("+t.width/2+", "+ +t.height/2+")"),At(e,m,t);break;case e.nodeType.CLOUD:Tt(e,m,t);break;case e.nodeType.BANG:Rt(e,m,t);break;case e.nodeType.HEXAGON:Bt(e,m,t);break}return e.setElementForId(t.id,p),t.height},Ft=function(e,a){const t=e.getElementById(a.id),r=a.x||0,s=a.y||0;t.attr("transform","translate("+r+","+s+")")};Q.use(dt);function et(e,a,t,r,s){Mt(e,a,t,r,s),t.children&&t.children.forEach((i,l)=>{et(e,a,i,r<0?l:r,s)})}function jt(e,a){a.edges().map((t,r)=>{const s=t.data();if(t[0]._private.bodyBounds){const i=t[0]._private.rscratch;I.trace("Edge: ",r,s),e.insert("path").attr("d",`M ${i.startX},${i.startY} L ${i.midX},${i.midY} L${i.endX},${i.endY} `).attr("class","edge section-edge-"+s.section+" edge-depth-"+s.depth)}})}function nt(e,a,t,r){a.add({group:"nodes",data:{id:e.id.toString(),labelText:e.descr,height:e.height,width:e.width,level:r,nodeId:e.id,padding:e.padding,type:e.type},position:{x:e.x,y:e.y}}),e.children&&e.children.forEach(s=>{nt(s,a,t,r+1),a.add({group:"edges",data:{id:`${e.id}_${s.id}`,source:e.id,target:s.id,depth:r,section:s.section}})})}function Ht(e,a){return new Promise(t=>{const r=yt("body").append("div").attr("id","cy").attr("style","display:none"),s=Q({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),nt(e,s,a,0),s.nodes().forEach(function(i){i.layoutDimensions=()=>{const l=i.data();return{w:l.width,h:l.height}}}),s.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),s.ready(i=>{I.info("Ready",i),t(s)})})}function Gt(e,a){a.nodes().map((t,r)=>{const s=t.data();s.x=t.position().x,s.y=t.position().y,Ft(e,s);const i=e.getElementById(s.nodeId);I.info("Id:",r,"Position: (",t.position().x,", ",t.position().y,")",s),i.attr("transform",`translate(${t.position().x-s.width/2}, ${t.position().y-s.height/2})`),i.attr("attr",`apa-${r})`)})}const zt=async(e,a,t,r)=>{var s,i;I.debug(`Rendering mindmap diagram
|
|
`+e);const l=r.db,p=l.getMindmap();if(!p)return;const u=W();u.htmlLabels=!1;const m=ct(a),b=m.append("g");b.attr("class","mindmap-edges");const w=m.append("g");w.attr("class","mindmap-nodes"),et(l,w,p,-1,u);const y=await Ht(p,u);jt(b,y),Gt(l,y),ht(void 0,m,((s=u.mindmap)==null?void 0:s.padding)??M.mindmap.padding,((i=u.mindmap)==null?void 0:i.useMaxWidth)??M.mindmap.useMaxWidth)},Xt={draw:zt},Yt=e=>{let a="";for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e["lineColor"+t]=e["lineColor"+t]||e["cScaleInv"+t],gt(e["lineColor"+t])?e["lineColor"+t]=pt(e["lineColor"+t],20):e["lineColor"+t]=ut(e["lineColor"+t],20);for(let t=0;t<e.THEME_COLOR_LIMIT;t++){const r=""+(17-3*t);a+=`
|
|
.section-${t-1} rect, .section-${t-1} path, .section-${t-1} circle, .section-${t-1} polygon, .section-${t-1} path {
|
|
fill: ${e["cScale"+t]};
|
|
}
|
|
.section-${t-1} text {
|
|
fill: ${e["cScaleLabel"+t]};
|
|
}
|
|
.node-icon-${t-1} {
|
|
font-size: 40px;
|
|
color: ${e["cScaleLabel"+t]};
|
|
}
|
|
.section-edge-${t-1}{
|
|
stroke: ${e["cScale"+t]};
|
|
}
|
|
.edge-depth-${t-1}{
|
|
stroke-width: ${r};
|
|
}
|
|
.section-${t-1} line {
|
|
stroke: ${e["cScaleInv"+t]} ;
|
|
stroke-width: 3;
|
|
}
|
|
|
|
.disabled, .disabled circle, .disabled text {
|
|
fill: lightgray;
|
|
}
|
|
.disabled text {
|
|
fill: #efefef;
|
|
}
|
|
`}return a},qt=e=>`
|
|
.edge {
|
|
stroke-width: 3;
|
|
}
|
|
${Yt(e)}
|
|
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
|
|
fill: ${e.git0};
|
|
}
|
|
.section-root text {
|
|
fill: ${e.gitBranchLabel0};
|
|
}
|
|
.icon-container {
|
|
height:100%;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
.edge {
|
|
fill: none;
|
|
}
|
|
.mindmap-node-label {
|
|
dy: 1em;
|
|
alignment-baseline: middle;
|
|
text-anchor: middle;
|
|
dominant-baseline: middle;
|
|
text-align: center;
|
|
}
|
|
`,Wt=qt,ae={db:wt,renderer:Xt,parser:mt,styles:Wt};export{ae as diagram};
|
|
//# sourceMappingURL=mindmap-definition-fc14e90a-D7uqoyZo.chunk.mjs.map
|