LightRAG/lightrag/api/webui/assets/mindmap-definition-6CBA2TL7-CaNUoVfO.js

96 lines
99 KiB
JavaScript
Raw Normal View History

import{_,l as Q,c as st,K as Et,a3 as Lt,H as it,i as J,a4 as Tt,a5 as Nt,a6 as mt,d as Dt,ad as Ot,M as At}from"./mermaid-vendor-CAxUo7Zk.js";import{c as ft}from"./cytoscape.esm-CfBqOv7Q.js";import{g as It}from"./react-vendor-DEwriMA6.js";import"./feature-graph-C6IuADHZ.js";import"./graph-vendor-B-X5JegA.js";import"./ui-vendor-CeCm8EER.js";import"./utils-vendor-BysuhMZA.js";var tt={exports:{}},et={exports:{}},rt={exports:{}},Ct=rt.exports,ct;function Rt(){return ct||(ct=1,function(C,M){(function(D,y){C.exports=y()})(Ct,function(){return function(u){var D={};function y(r){if(D[r])return D[r].exports;var t=D[r]={i:r,l:!1,exports:{}};return u[r].call(t.exports,t,t.exports,y),t.l=!0,t.exports}return y.m=u,y.c=D,y.i=function(r){return r},y.d=function(r,t,e){y.o(r,t)||Object.defineProperty(r,t,{configurable:!1,enumerable:!0,get:e})},y.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return y.d(t,"a",t),t},y.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},y.p="",y(y.s=26)}([function(u,D,y){function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,u.exports=r},function(u,D,y){var r=y(2),t=y(8),e=y(9);function i(g,a,v){r.call(this,v),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=v,this.bendpoints=[],this.source=g,this.target=a}i.prototype=Object.create(r.prototype);for(var o in r)i[o]=r[o];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,a){for(var v=this.getOtherEnd(g),n=a.getGraphManager().getRoot();;){if(v.getOwner()==a)return v;if(v.getOwner()==n)break;v=v.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=t.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=e.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=e.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=e.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=e.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},u.exports=i},function(u,D,y){function r(t){this.vGraphObject=t}u.exports=r},function(u,D,y){var r=y(2),t=y(10),e=y(13),i=y(0),o=y(16),g=y(4);function a(n,c,l,E){l==null&&E==null&&(E=c),r.call(this,E),n.graphManager!=null&&(n=n.graphManager),this.estimatedSize=t.MIN_VALUE,this.inclusionTreeDepth=t.MAX_VALUE,this.vGraphObject=E,this.edges=[],this.graphManager=n,l!=null&&c!=null?this.rect=new e(c.x,c.y,l.width,l.height):this.rect=new e}a.prototype=Object.create(r.prototype);for(var v in r)a[v]=r[v];a.prototype.getEdges=function(){return this.edges},a.prototype.g
2025-08-14 05:03:43 +08:00
`+w.showPosition()+`
Expecting `+q.join(", ")+", got '"+(this.terminals_[P]||P)+"'":nt="Parse error on line "+(R+1)+": Unexpected "+(P==U?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(nt,{text:w.match,token:this.terminals_[P]||P,line:w.yylineno,loc:b,expected:q})}if($[0]instanceof Array&&$.length>1)throw new Error("Parse Error: multiple actions possible at state: "+B+", token: "+P);switch($[0]){case 1:s.push(P),f.push(w.yytext),p.push(w.yylloc),s.push($[1]),P=null,x=w.yyleng,I=w.yytext,R=w.yylineno,b=w.yylloc;break;case 2:if(Z=this.productions_[$[1]][1],V.$=f[f.length-Z],V._$={first_line:p[p.length-(Z||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(Z||1)].first_column,last_column:p[p.length-1].last_column},Y&&(V._$.range=[p[p.length-(Z||1)].range[0],p[p.length-1].range[1]]),j=this.performAction.apply(V,[I,x,R,S.yy,$[1],f,p].concat(X)),typeof j<"u")return j;Z&&(s=s.slice(0,-1*Z*2),f=f.slice(0,-1*Z),p=p.slice(0,-1*Z)),s.push(this.productions_[$[1]][0]),f.push(V.$),p.push(V._$),lt=A[s[s.length-2]][s[s.length-1]],s.push(lt);break;case 3:return!0}}return!0},"parse")},m=function(){var O={EOF:1,parseError:_(function(N,s){if(this.yy.parser)this.yy.parser.parseError(N,s);else throw new Error(N)},"parseError"),setInput:_(function(d,N){return this.yy=N||this.yy||{},this._input=d,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:_(function(){var d=this._input[0];this.yytext+=d,this.yyleng++,this.offset++,this.match+=d,this.matched+=d;var N=d.match(/(?:\r\n?|\n).*/g);return N?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),d},"input"),unput:_(function(d){var N=d.length,s=d.split(/(?:\r\n?|\n)/g);this._input=d+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-N),this.offset-=N;var h=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),s.length-1&&(this.yylineno-=s.length-1);var f=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:s?(s.length===h.length?this.yylloc.first_column:0)+h[h.length-s.length].length-s[0].length:this.yylloc.first_column-N},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-N]),this.yyleng=this.yytext.length,this},"unput"),more:_(function(){return this._more=!0,this},"more"),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},"reject"),less:_(function(d){this.unput(this.match.slice(d))},"less"),pastInput:_(function(){var d=this.matched.substr(0,this.matched.length-this.match.length);return(d.length>20?"...":"")+d.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:_(function(){var d=this.match;return d.length<20&&(d+=this._input.substr(0,20-d.length)),(d.substr(0,20)+(d.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:_(function(){var d=this.pastInput(),N=new Array(d.length+1).join("-");return d+this.upcomingInput()+`
`+N+"^"},"showPosition"),test_match:_(function(d,N){var s,h,f;if(this.options.backtrack_lexer&&(f={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&&(f.yylloc.range=this.yylloc.range.slice(0))),h=d[0].match(/(?:\r\n?|\n).*/g),h&&(this.yylineno+=h.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:h?h[h.length-1].length-h[h.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+d[0].length},this.yytext+=d[0],this.match+=d[0],this.matches=d,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(d[0].length),this.matched+=d[0],s=this.performAction.call(this,this.yy,this,N,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var p in f)this[p]=f[p];return!1}return!1},"test_match"),next:_(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var d,N,s,h;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),p=0;p<f.length;p++)if(s=this._input.match(this.rules[f[p]]),s&&(!N||s[0].length>N[0].length)){if(N=s,h=p,this.options.backtrack_lexer){if(d=this.test_match(s,f[p]),d!==!1)return d;if(this._backtrack){N=!1;continue}else return!1}else if(!this.options.flex)break}return N?(d=this.test_match(N,f[h]),d!==!1?d:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:_(function(){var N=this.next();return N||this.lex()},"lex"),begin:_(function(N){this.conditionStack.push(N)},"begin"),popState:_(function(){var N=this.conditionStack.length-1;return N>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_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},"_currentRules"),topState:_(function(N){return N=this.conditionStack.length-1-Math.abs(N||0),N>=0?this.conditionStack[N]:"INITIAL"},"topState"),pushState:_(function(N){this.begin(N)},"pushState"),stateStackSize:_(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:_(function(N,s,h,f){switch(h){case 0:return N.getLogger().trace("Found comment",s.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:",s.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 ...",s.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:",s.yytext),20;case 36:return N.getLogger().trace("Long description:",s.yytext),20}},"anonymous"),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 O}();T.lexer=m;function L(){this.yy={}}return _(L,"Parser"),L.prototype=T,T.Parser=L,new L}();at.parser=at;var Ft=at,bt={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},K,Ut=(K=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=bt,this.clear(),this.getType=this.getType.bind(this),this.getMindmap=this.getMindmap.bind(this),this.getElementById=this.getElementById.bind
a${e},${e} 1 0,1 ${D*.4},${-1*D*.1}
a${t},${t} 1 0,1 ${D*.35},${1*D*.2}
a${r},${r} 1 0,1 ${D*.15},${1*y*.35}
a${i},${i} 1 0,1 ${-1*D*.15},${1*y*.65}
a${t},${r} 1 0,1 ${-1*D*.25},${D*.15}
a${e},${e} 1 0,1 ${-1*D*.5},0
a${r},${r} 1 0,1 ${-1*D*.25},${-1*D*.15}
a${r},${r} 1 0,1 ${-1*D*.1},${-1*y*.35}
a${i},${i} 1 0,1 ${D*.1},${-1*y*.65}
H0 V0 Z`)},"cloudBkg"),Ht=_(function(C,M,u){const D=u.width,y=u.height,r=.15*D;M.append("path").attr("id","node-"+u.id).attr("class","node-bkg node-"+C.type2Str(u.type)).attr("d",`M0 0 a${r},${r} 1 0,0 ${D*.25},${-1*y*.1}
a${r},${r} 1 0,0 ${D*.25},0
a${r},${r} 1 0,0 ${D*.25},0
a${r},${r} 1 0,0 ${D*.25},${1*y*.1}
a${r},${r} 1 0,0 ${D*.15},${1*y*.33}
a${r*.8},${r*.8} 1 0,0 0,${1*y*.34}
a${r},${r} 1 0,0 ${-1*D*.15},${1*y*.33}
a${r},${r} 1 0,0 ${-1*D*.25},${y*.15}
a${r},${r} 1 0,0 ${-1*D*.25},0
a${r},${r} 1 0,0 ${-1*D*.25},0
a${r},${r} 1 0,0 ${-1*D*.25},${-1*y*.15}
a${r},${r} 1 0,0 ${-1*D*.1},${-1*y*.33}
a${r*.8},${r*.8} 1 0,0 0,${-1*y*.34}
a${r},${r} 1 0,0 ${D*.1},${-1*y*.33}
H0 V0 Z`)},"bangBkg"),$t=_(function(C,M,u){M.append("circle").attr("id","node-"+u.id).attr("class","node-bkg node-"+C.type2Str(u.type)).attr("r",u.width/2)},"circleBkg");function pt(C,M,u,D,y){return C.insert("polygon",":first-child").attr("points",D.map(function(r){return r.x+","+r.y}).join(" ")).attr("transform","translate("+(y.width-M)/2+", "+u+")")}_(pt,"insertPolygonShape");var Bt=_(function(C,M,u){const D=u.height,r=D/4,t=u.width-u.padding+2*r,e=[{x:r,y:0},{x:t-r,y:0},{x:t,y:-D/2},{x:t-r,y:-D},{x:r,y:-D},{x:0,y:-D/2}];pt(M,t,D,e,u)},"hexagonBkg"),Wt=_(function(C,M,u){M.append("rect").attr("id","node-"+u.id).attr("class","node-bkg node-"+C.type2Str(u.type)).attr("height",u.height).attr("rx",u.padding).attr("ry",u.padding).attr("width",u.width)},"roundedRectBkg"),Vt=_(async function(C,M,u,D,y){const r=y.htmlLabels,t=D%(Pt-1),e=M.append("g");u.section=t;let i="section-"+t;t<0&&(i+=" section-root"),e.attr("class",(u.class?u.class+" ":"")+"mindmap-node "+i);const o=e.append("g"),g=e.append("g"),a=u.descr.replace(/(<br\/*>)/g,`
`);await Ot(g,a,{useHtmlLabels:r,width:u.width,classes:"mindmap-node-label"},y),r||g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");const v=g.node().getBBox(),[n]=At(y.fontSize);if(u.height=v.height+n*1.1*.5+u.padding,u.width=v.width+2*u.padding,u.icon)if(u.type===C.nodeType.CIRCLE)u.height+=50,u.width+=50,e.append("foreignObject").attr("height","50px").attr("width",u.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+t+" "+u.icon),g.attr("transform","translate("+u.width/2+", "+(u.height/2-1.5*u.padding)+")");else{u.width+=50;const c=u.height;u.height=Math.max(c,60);const l=Math.abs(u.height-c);e.append("foreignObject").attr("width","60px").attr("height",u.height).attr("style","text-align: center;margin-top:"+l/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+t+" "+u.icon),g.attr("transform","translate("+(25+u.width/2)+", "+(l/2+u.padding/2)+")")}else if(r){const c=(u.width-v.width)/2,l=(u.height-v.height)/2;g.attr("transform","translate("+c+", "+l+")")}else{const c=u.width/2,l=u.padding/2;g.attr("transform","translate("+c+", "+l+")")}switch(u.type){case C.nodeType.DEFAULT:Yt(C,o,u,t);break;case C.nodeType.ROUNDED_RECT:Wt(C,o,u,t);break;case C.nodeType.RECT:Xt(C,o,u,t);break;case C.nodeType.CIRCLE:o.attr("transform","translate("+u.width/2+", "+ +u.height/2+")"),$t(C,o,u,t);break;case C.nodeType.CLOUD:kt(C,o,u,t);break;case C.nodeType.BANG:Ht(C,o,u,t);break;case C.nodeType.HEXAGON:Bt(C,o,u,t);break}return C.setElementForId(u.id,e),u.height},"drawNode"),Zt=_(function(C,M){const u=C.getElementById(M.id),D=M.x||0,y=M.y||0;u.attr("transform","translate("+D+","+y+")")},"positionNode");ft.use(_t);async function ot(C,M,u,D,y){await Vt(C,M,u,D,y),u.children&&await Promise.all(u.children.map((r,t)=>ot(C,M,r,D<0?t:D,y)))}_(ot,"drawNodes");function dt(C,M){M.edges().map((u,D)=>{const y=u.data();if(u[0]._private.bodyBounds){const r=u[0]._private.rscratch;Q.trace("Edge: ",D,y),C.insert("path").attr("d",`M ${r.startX},${r.startY} L ${r.midX},${r.midY} L${r.endX},${r.endY} `).attr("class","edge section-edge-"+y.section+" edge-depth-"+y.depth)}})}_(dt,"drawEdges");function ht(C,M,u,D){M.add({group:"nodes",data:{id:C.id.toString(),labelText:C.descr,height:C.height,width:C.width,level:D,nodeId:C.id,padding:C.padding,type:C.type},position:{x:C.x,y:C.y}}),C.children&&C.children.forEach(y=>{ht(y,M,u,D+1),M.add({group:"edges",data:{id:`${C.id}_${y.id}`,source:C.id,target:y.id,depth:D,section:y.section}})})}_(ht,"addNodes");function vt(C,M){return new Promise(u=>{const D=Dt("body").append("div").attr("id","cy").attr("style","display:none"),y=ft({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});D.remove(),ht(C,y,M,0),y.nodes().forEach(function(r){r.layoutDimensions=()=>{const t=r.data();return{w:t.width,h:t.height}}}),y.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),y.ready(r=>{Q.info("Ready",r),u(y)})})}_(vt,"layoutMindmap");function yt(C,M){M.nodes().map((u,D)=>{const y=u.data();y.x=u.position().x,y.y=u.position().y,Zt(C,y);const r=C.getElementById(y.nodeId);Q.info("id:",D,"Position: (",u.position().x,", ",u.position().y,")",y),r.attr("transform",`translate(${u.position().x-y.width/2}, ${u.position().y-y.height/2})`),r.attr("attr",`apa-${D})`)})}_(yt,"positionNodes");var Qt=_(async(C,M,u,D)=>{var a,v;Q.debug(`Rendering mindmap diagram
`+C);const y=D.db,r=y.getMindmap();if(!r)return;const t=st();t.htmlLabels=!1;const e=Et(M),i=e.append("g");i.attr("class","mindmap-edges");const o=e.append("g");o.attr("class","mindmap-nodes"),await ot(y,o,r,-1,t);const g=await vt(r,t);dt(i,g),yt(y,g),Lt(void 0,e,((a=t.mindmap)==null?void 0:a.padding)??it.mindmap.padding,((v=t.mindmap)==null?void 0:v.useMaxWidth)??it.mindmap.useMaxWidth)},"draw"),jt={draw:Qt},zt=_(C=>{let M="";for(let u=0;u<C.THEME_COLOR_LIMIT;u++)C["lineColor"+u]=C["lineColor"+u]||C["cScaleInv"+u],Tt(C["lineColor"+u])?C["lineColor"+u]=Nt(C["lineColor"+u],20):C["lineColor"+u]=mt(C["lineColor"+u],20);for(let u=0;u<C.THEME_COLOR_LIMIT;u++){const D=""+(17-3*u);M+=`
.section-${u-1} rect, .section-${u-1} path, .section-${u-1} circle, .section-${u-1} polygon, .section-${u-1} path {
fill: ${C["cScale"+u]};
}
.section-${u-1} text {
fill: ${C["cScaleLabel"+u]};
}
.node-icon-${u-1} {
font-size: 40px;
color: ${C["cScaleLabel"+u]};
}
.section-edge-${u-1}{
stroke: ${C["cScale"+u]};
}
.edge-depth-${u-1}{
stroke-width: ${D};
}
.section-${u-1} line {
stroke: ${C["cScaleInv"+u]} ;
stroke-width: 3;
}
.disabled, .disabled circle, .disabled text {
fill: lightgray;
}
.disabled text {
fill: #efefef;
}
`}return M},"genSections"),Kt=_(C=>`
.edge {
stroke-width: 3;
}
${zt(C)}
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
fill: ${C.git0};
}
.section-root text {
fill: ${C.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;
}
`,"getStyles"),qt=Kt,ae={get db(){return new Ut},renderer:jt,parser:Ft,styles:qt};export{ae as diagram};