Files
build_notes_simengweb/assets/mindmap-definition-ZYHNXUZP-CXmuntRV.js
2025-11-02 20:41:34 +08:00

69 lines
21 KiB
JavaScript

import{m as ue}from"./chunk-6EQESGSB-BwqU_0-N.js";import{y as pe}from"./chunk-T244DUNM-DxPf_Hxg.js";import{m as l,p as I,V as ye,c as fe,r as M,a as V,o as P,bc as me,b8 as be,b9 as _e,ba as Ee}from"./mermaid.esm.min-DdZd6KOl.js";import"./app-DxarFyj7.js";var X=(function(){var i=l(function(N,t,r,o){for(r=r||{},o=N.length;o--;r[N[o]]=t);return r},"o"),e=[1,4],n=[1,13],a=[1,12],h=[1,15],c=[1,16],p=[1,20],u=[1,19],b=[6,7,8],C=[1,26],Y=[1,24],q=[1,25],E=[6,7,11],J=[1,6,13,15,16,19,22],K=[1,33],Q=[1,34],R=[1,6,7,11,13,15,16,19,22],B={trace:l(function(){},"trace"),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:l(function(N,t,r,o,d,s,_){var g=s.length-1;switch(d){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",s[g].id),o.addNode(s[g-1].length,s[g].id,s[g].descr,s[g].type);break;case 16:o.getLogger().trace("Icon: ",s[g]),o.decorateNode({icon:s[g]});break;case 17:case 21:o.decorateNode({class:s[g]});break;case 18:o.getLogger().trace("SPACELIST");break;case 19:o.getLogger().trace("Node: ",s[g].id),o.addNode(0,s[g].id,s[g].descr,s[g].type);break;case 20:o.decorateNode({icon:s[g]});break;case 25:o.getLogger().trace("node found ..",s[g-2]),this.$={id:s[g-1],descr:s[g-1],type:o.getType(s[g-2],s[g])};break;case 26:this.$={id:s[g],descr:s[g],type:o.nodeType.DEFAULT};break;case 27:o.getLogger().trace("node found ..",s[g-3]),this.$={id:s[g-3],descr:s[g-1],type:o.getType(s[g-2],s[g])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:n,7:[1,10],9:9,12:11,13:a,14:14,15:h,16:c,17:17,18:18,19:p,22:u},i(b,[2,3]),{1:[2,2]},i(b,[2,4]),i(b,[2,5]),{1:[2,6],6:n,12:21,13:a,14:14,15:h,16:c,17:17,18:18,19:p,22:u},{6:n,9:22,12:11,13:a,14:14,15:h,16:c,17:17,18:18,19:p,22:u},{6:C,7:Y,10:23,11:q},i(E,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:p,22:u}),i(E,[2,18]),i(E,[2,19]),i(E,[2,20]),i(E,[2,21]),i(E,[2,23]),i(E,[2,24]),i(E,[2,26],{19:[1,30]}),{20:[1,31]},{6:C,7:Y,10:32,11:q},{1:[2,7],6:n,12:21,13:a,14:14,15:h,16:c,17:17,18:18,19:p,22:u},i(J,[2,14],{7:K,11:Q}),i(R,[2,8]),i(R,[2,9]),i(R,[2,10]),i(E,[2,15]),i(E,[2,16]),i(E,[2,17]),{20:[1,35]},{21:[1,36]},i(J,[2,13],{7:K,11:Q}),i(R,[2,11]),i(R,[2,12]),{21:[1,37]},i(E,[2,25]),i(E,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(N,t){if(t.recoverable)this.trace(N);else{var r=new Error(N);throw r.hash=t,r}},"parseError"),parse:l(function(N){var t=this,r=[0],o=[],d=[null],s=[],_=this.table,g="",$=0,Z=0,le=0,ce=2,ee=1,he=s.slice.call(arguments,1),y=Object.create(this.lexer),v={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(v.yy[F]=this.yy[F]);y.setInput(N,v.yy),v.yy.lexer=y,v.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var j=y.yylloc;s.push(j);var de=y.options&&y.options.ranges;typeof v.yy.parseError=="function"?this.parseError=v.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ge(S){r.length=r.length-2*S,d.length=d.length-S,s.length=s.length-S}l(ge,"popStack");function te(){var S;return S=o.pop()||y.lex()||ee,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=t.symbols_[S]||S),S}l(te,"lex");for(var m,G,T,D,Ce,z,O={},A,k,ie,U;;){if(T=r[r.length-1],this.defaultActions[T]?D=this.defaultActions[T]:((m===null||typeof m>"u")&&(m=te()),D=_[T]&&_[T][m]),typeof D>"u"||!D.length||!D[0]){var H="";U=[];for(A in _[T])this.terminals_[A]&&A>ce&&U.push("'"+this.terminals_[A]+"'");y.showPosition?H="Parse error on line "+($+1)+`:
`+y.showPosition()+`
Expecting `+U.join(", ")+", got '"+(this.terminals_[m]||m)+"'":H="Parse error on line "+($+1)+": Unexpected "+(m==ee?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(H,{text:y.match,token:this.terminals_[m]||m,line:y.yylineno,loc:j,expected:U})}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+T+", token: "+m);switch(D[0]){case 1:r.push(m),d.push(y.yytext),s.push(y.yylloc),r.push(D[1]),m=null,G?(m=G,G=null):(Z=y.yyleng,g=y.yytext,$=y.yylineno,j=y.yylloc,le>0);break;case 2:if(k=this.productions_[D[1]][1],O.$=d[d.length-k],O._$={first_line:s[s.length-(k||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(k||1)].first_column,last_column:s[s.length-1].last_column},de&&(O._$.range=[s[s.length-(k||1)].range[0],s[s.length-1].range[1]]),z=this.performAction.apply(O,[g,Z,$,v.yy,D[1],d,s].concat(he)),typeof z<"u")return z;k&&(r=r.slice(0,-1*k*2),d=d.slice(0,-1*k),s=s.slice(0,-1*k)),r.push(this.productions_[D[1]][0]),d.push(O.$),s.push(O._$),ie=_[r[r.length-2]][r[r.length-1]],r.push(ie);break;case 3:return!0}}return!0},"parse")},ae=(function(){var N={EOF:1,parseError:l(function(t,r){if(this.yy.parser)this.yy.parser.parseError(t,r);else throw new Error(t)},"parseError"),setInput:l(function(t,r){return this.yy=r||this.yy||{},this._input=t,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:l(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var r=t.match(/(?:\r\n?|\n).*/g);return r?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:l(function(t){var r=t.length,o=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var d=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),o.length-1&&(this.yylineno-=o.length-1);var s=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:o?(o.length===d.length?this.yylloc.first_column:0)+d[d.length-o.length].length-o[0].length:this.yylloc.first_column-r},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-r]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(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:l(function(t){this.unput(this.match.slice(t))},"less"),pastInput:l(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var t=this.pastInput(),r=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
`+r+"^"},"showPosition"),test_match:l(function(t,r){var o,d,s;if(this.options.backtrack_lexer&&(s={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&&(s.yylloc.range=this.yylloc.range.slice(0))),d=t[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],o=this.performAction.call(this,this.yy,this,r,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var _ in s)this[_]=s[_];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,r,o,d;this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),_=0;_<s.length;_++)if(o=this._input.match(this.rules[s[_]]),o&&(!r||o[0].length>r[0].length)){if(r=o,d=_,this.options.backtrack_lexer){if(t=this.test_match(o,s[_]),t!==!1)return t;if(this._backtrack){r=!1;continue}else return!1}else if(!this.options.flex)break}return r?(t=this.test_match(r,s[d]),t!==!1?t:!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:l(function(){var t=this.next();return t||this.lex()},"lex"),begin:l(function(t){this.conditionStack.push(t)},"begin"),popState:l(function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(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:l(function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:l(function(t){this.begin(t)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(t,r,o,d){switch(o){case 0:return t.getLogger().trace("Found comment",r.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:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return t.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:t.getLogger().trace("end icon"),this.popState();break;case 10:return t.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return t.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return t.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:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return t.getLogger().trace("description:",r.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),t.getLogger().trace("node end ...",r.yytext),"NODE_DEND";case 30:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 35:return t.getLogger().trace("Long description:",r.yytext),20;case 36:return t.getLogger().trace("Long description:",r.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 N})();B.lexer=ae;function w(){this.yy={}}return l(w,"Parser"),w.prototype=B,B.Parser=w,new w})();X.parser=X;var Se=X,f=[];for(let i=0;i<256;++i)f.push((i+256).toString(16).slice(1));function se(i,e=0){return(f[i[e+0]]+f[i[e+1]]+f[i[e+2]]+f[i[e+3]]+"-"+f[i[e+4]]+f[i[e+5]]+"-"+f[i[e+6]]+f[i[e+7]]+"-"+f[i[e+8]]+f[i[e+9]]+"-"+f[i[e+10]]+f[i[e+11]]+f[i[e+12]]+f[i[e+13]]+f[i[e+14]]+f[i[e+15]]).toLowerCase()}l(se,"unsafeStringify");var W,De=new Uint8Array(16);function re(){if(!W){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");W=crypto.getRandomValues.bind(crypto)}return W(De)}l(re,"rng");var Ne=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ne={randomUUID:Ne};function oe(i,e,n){if(ne.randomUUID&&!e&&!i)return ne.randomUUID();i=i||{};let a=i.random??i.rng?.()??re();if(a.length<16)throw new Error("Random bytes length must be >= 16");if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,e){if(n=n||0,n<0||n+16>e.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let h=0;h<16;++h)e[n+h]=a[h];return e}return se(a)}l(oe,"v4");var ke=oe,L={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},x,Le=(x=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=L,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let n=this.nodes.length-1;n>=0;n--)if(this.nodes[n].level<e)return this.nodes[n];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(e,n,a,h){I.info("addNode",e,n,a,h);let c=!1;this.nodes.length===0?(this.baseLevel=e,e=0,c=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,c=!1);let p=V(),u=p.mindmap?.padding??M.mindmap.padding;switch(h){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:u*=2;break}let b={id:this.count++,nodeId:P(n,p),level:e,descr:P(a,p),type:h,children:[],width:p.mindmap?.maxNodeWidth??M.mindmap.maxNodeWidth,padding:u,isRoot:c},C=this.getParent(e);if(C)C.children.push(b),this.nodes.push(b);else if(c)this.nodes.push(b);else throw new Error(`There can be only one root. No parent could be found for ("${b.descr}")`)}getType(e,n){switch(I.debug("In get type",e,n),e){case"[":return this.nodeType.RECT;case"(":return n===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,n){this.elements[e]=n}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;let n=V(),a=this.nodes[this.nodes.length-1];e.icon&&(a.icon=P(e.icon,n)),e.class&&(a.class=P(e.class,n))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,n){if(e.level===0?e.section=void 0:e.section=n,e.children)for(let[a,h]of e.children.entries()){let c=e.level===0?a:n;this.assignSections(h,c)}}flattenNodes(e,n){let a=["mindmap-node"];e.isRoot===!0?a.push("section-root","section--1"):e.section!==void 0&&a.push(`section-${e.section}`),e.class&&a.push(e.class);let h=a.join(" "),c=l(u=>{switch(u){case L.CIRCLE:return"mindmapCircle";case L.RECT:return"rect";case L.ROUNDED_RECT:return"rounded";case L.CLOUD:return"cloud";case L.BANG:return"bang";case L.HEXAGON:return"hexagon";case L.DEFAULT:return"defaultMindmapNode";case L.NO_BORDER:default:return"rect"}},"getShapeFromType"),p={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,isGroup:!1,shape:c(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:h,cssStyles:[],look:"default",icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(n.push(p),e.children)for(let u of e.children)this.flattenNodes(u,n)}generateEdges(e,n){if(e.children)for(let a of e.children){let h="edge";a.section!==void 0&&(h+=` section-edge-${a.section}`);let c=e.level+1;h+=` edge-depth-${c}`;let p={id:`edge_${e.id}_${a.id}`,start:e.id.toString(),end:a.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:"default",classes:h,depth:e.level,section:a.section};n.push(p),this.generateEdges(a,n)}}getData(){let e=this.getMindmap(),n=V(),a=me().layout!==void 0,h=n;if(a||(h.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:h};I.debug("getData: mindmapRoot",e,n),this.assignSections(e);let c=[],p=[];this.flattenNodes(e,c),this.generateEdges(e,p),I.debug(`getData: processed ${c.length} nodes and ${p.length} edges`);let u=new Map;for(let b of c)u.set(b.id,{shape:b.shape,width:b.width,height:b.height,padding:b.padding});return{nodes:c,edges:p,config:h,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(u),type:"mindmap",diagramId:"mindmap-"+ke()}}getLogger(){return I}},l(x,"MindmapDB"),x),ve=l(async(i,e,n,a)=>{I.debug(`Rendering mindmap diagram
`+i);let h=a.db,c=h.getData(),p=ue(e,c.config.securityLevel);c.type=a.type,c.layoutAlgorithm=ye(c.config.layout,{fallback:"cose-bilkent"}),c.diagramId=e,h.getMindmap()&&(c.nodes.forEach(u=>{u.shape==="rounded"?(u.radius=15,u.taper=15,u.stroke="none",u.width=0,u.padding=15):u.shape==="circle"?u.padding=10:u.shape==="rect"&&(u.width=0,u.padding=10)}),await fe(c,p),pe(p,c.config.mindmap?.padding??M.mindmap.padding,"mindmapDiagram",c.config.mindmap?.useMaxWidth??M.mindmap.useMaxWidth))},"draw"),Te={draw:ve},Oe=l(i=>{let e="";for(let n=0;n<i.THEME_COLOR_LIMIT;n++)i["lineColor"+n]=i["lineColor"+n]||i["cScaleInv"+n],be(i["lineColor"+n])?i["lineColor"+n]=_e(i["lineColor"+n],20):i["lineColor"+n]=Ee(i["lineColor"+n],20);for(let n=0;n<i.THEME_COLOR_LIMIT;n++){let a=""+(17-3*n);e+=`
.section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} polygon, .section-${n-1} path {
fill: ${i["cScale"+n]};
}
.section-${n-1} text {
fill: ${i["cScaleLabel"+n]};
}
.node-icon-${n-1} {
font-size: 40px;
color: ${i["cScaleLabel"+n]};
}
.section-edge-${n-1}{
stroke: ${i["cScale"+n]};
}
.edge-depth-${n-1}{
stroke-width: ${a};
}
.section-${n-1} line {
stroke: ${i["cScaleInv"+n]} ;
stroke-width: 3;
}
.disabled, .disabled circle, .disabled text {
fill: lightgray;
}
.disabled text {
fill: #efefef;
}
`}return e},"genSections"),Ie=l(i=>`
.edge {
stroke-width: 3;
}
${Oe(i)}
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
fill: ${i.git0};
}
.section-root text {
fill: ${i.gitBranchLabel0};
}
.section-root span {
color: ${i.gitBranchLabel0};
}
.section-2 span {
color: ${i.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"),xe=Ie,Ue={get db(){return new Le},renderer:Te,parser:Se,styles:xe};export{Ue as diagram};