code-server
Version:
Run VS Code on a remote server.
97 lines (95 loc) • 24.1 kB
JavaScript
import{a as pe}from"./chunk-NK24NO5N.js";import{a as fe}from"./chunk-OFCNYUR6.js";import{b as ue,c as ge}from"./chunk-QFGQTGVT.js";import"./chunk-MZ3V5LZE.js";import"./chunk-DJCKKX6W.js";import"./chunk-WPKM2ZGX.js";import"./chunk-YUYBSA4E.js";import"./chunk-KANRR4GQ.js";import"./chunk-KI4BUBHJ.js";import"./chunk-GXXPGOGS.js";import"./chunk-LB6FF7YJ.js";import"./chunk-N5VMO4QT.js";import"./chunk-5TVAF4SJ.js";import{H as M,_ as C,c as ae,d as ce,e as le,k as B,u as he,x as de}from"./chunk-5Z3D3SW5.js";import{b as T}from"./chunk-SNB7PWCV.js";import"./chunk-CU3WNRKO.js";import{a as h}from"./chunk-5ZAMBDF5.js";import"./chunk-3RNHDNP5.js";var b=[];for(let e=0;e<256;++e)b.push((e+256).toString(16).slice(1));function me(e,n=0){return(b[e[n+0]]+b[e[n+1]]+b[e[n+2]]+b[e[n+3]]+"-"+b[e[n+4]]+b[e[n+5]]+"-"+b[e[n+6]]+b[e[n+7]]+"-"+b[e[n+8]]+b[e[n+9]]+"-"+b[e[n+10]]+b[e[n+11]]+b[e[n+12]]+b[e[n+13]]+b[e[n+14]]+b[e[n+15]]).toLowerCase()}var q,Se=new Uint8Array(16);function J(){if(!q){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");q=crypto.getRandomValues.bind(crypto)}return q(Se)}var xe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),K={randomUUID:xe};function De(e,n,l){if(K.randomUUID&&!n&&!e)return K.randomUUID();e=e||{};let a=e.random??e.rng?.()??J();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,n){if(l=l||0,l<0||l+16>n.length)throw new RangeError(`UUID byte range ${l}:${l+15} is out of buffer bounds`);for(let t=0;t<16;++t)n[l+t]=a[t];return n}return me(a)}var Q=De;var Z=(function(){var e=h(function(N,s,i,o){for(i=i||{},o=N.length;o--;i[N[o]]=s);return i},"o"),n=[1,4],l=[1,13],a=[1,12],t=[1,15],d=[1,16],f=[1,20],m=[1,19],k=[6,7,8],I=[1,26],w=[1,24],R=[1,25],u=[6,7,11],A=[1,6,13,15,16,19,22],ee=[1,33],te=[1,34],U=[1,6,7,11,13,15,16,19,22],j={trace:h(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:h(function(s,i,o,c,p,r,$){var g=r.length-1;switch(p){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[g].id),c.addNode(r[g-1].length,r[g].id,r[g].descr,r[g].type);break;case 16:c.getLogger().trace("Icon: ",r[g]),c.decorateNode({icon:r[g]});break;case 17:case 21:c.decorateNode({class:r[g]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[g].id),c.addNode(0,r[g].id,r[g].descr,r[g].type);break;case 20:c.decorateNode({icon:r[g]});break;case 25:c.getLogger().trace("node found ..",r[g-2]),this.$={id:r[g-1],descr:r[g-1],type:c.getType(r[g-2],r[g])};break;case 26:this.$={id:r[g],descr:r[g],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[g-3]),this.$={id:r[g-3],descr:r[g-1],type:c.getType(r[g-2],r[g])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:l,7:[1,10],9:9,12:11,13:a,14:14,15:t,16:d,17:17,18:18,19:f,22:m},e(k,[2,3]),{1:[2,2]},e(k,[2,4]),e(k,[2,5]),{1:[2,6],6:l,12:21,13:a,14:14,15:t,16:d,17:17,18:18,19:f,22:m},{6:l,9:22,12:11,13:a,14:14,15:t,16:d,17:17,18:18,19:f,22:m},{6:I,7:w,10:23,11:R},e(u,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:f,22:m}),e(u,[2,18]),e(u,[2,19]),e(u,[2,20]),e(u,[2,21]),e(u,[2,23]),e(u,[2,24]),e(u,[2,26],{19:[1,30]}),{20:[1,31]},{6:I,7:w,10:32,11:R},{1:[2,7],6:l,12:21,13:a,14:14,15:t,16:d,17:17,18:18,19:f,22:m},e(A,[2,14],{7:ee,11:te}),e(U,[2,8]),e(U,[2,9]),e(U,[2,10]),e(u,[2,15]),e(u,[2,16]),e(u,[2,17]),{20:[1,35]},{21:[1,36]},e(A,[2,13],{7:ee,11:te}),e(U,[2,11]),e(U,[2,12]),{21:[1,37]},e(u,[2,25]),e(u,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:h(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:h(function(s){var i=this,o=[0],c=[],p=[null],r=[],$=this.table,g="",V=0,ne=0,ie=0,be=2,re=1,ke=r.slice.call(arguments,1),y=Object.create(this.lexer),L={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(L.yy[H]=this.yy[H]);y.setInput(s,L.yy),L.yy.lexer=y,L.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var W=y.yylloc;r.push(W);var Ee=y.options&&y.options.ranges;typeof L.yy.parseError=="function"?this.parseError=L.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(_){o.length=o.length-2*_,p.length=p.length-_,r.length=r.length-_}h(_e,"popStack");function se(){var _;return _=c.pop()||y.lex()||re,typeof _!="number"&&(_ instanceof Array&&(c=_,_=c.pop()),_=i.symbols_[_]||_),_}h(se,"lex");for(var E,X,v,S,Ae,z,O={},F,x,oe,G;;){if(v=o[o.length-1],this.defaultActions[v]?S=this.defaultActions[v]:((E===null||typeof E>"u")&&(E=se()),S=$[v]&&$[v][E]),typeof S>"u"||!S.length||!S[0]){var Y="";G=[];for(F in $[v])this.terminals_[F]&&F>be&&G.push("'"+this.terminals_[F]+"'");y.showPosition?Y="Parse error on line "+(V+1)+`:
`+y.showPosition()+`
Expecting `+G.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Y="Parse error on line "+(V+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Y,{text:y.match,token:this.terminals_[E]||E,line:y.yylineno,loc:W,expected:G})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+E);switch(S[0]){case 1:o.push(E),p.push(y.yytext),r.push(y.yylloc),o.push(S[1]),E=null,X?(E=X,X=null):(ne=y.yyleng,g=y.yytext,V=y.yylineno,W=y.yylloc,ie>0&&ie--);break;case 2:if(x=this.productions_[S[1]][1],O.$=p[p.length-x],O._$={first_line:r[r.length-(x||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(x||1)].first_column,last_column:r[r.length-1].last_column},Ee&&(O._$.range=[r[r.length-(x||1)].range[0],r[r.length-1].range[1]]),z=this.performAction.apply(O,[g,ne,V,L.yy,S[1],p,r].concat(ke)),typeof z<"u")return z;x&&(o=o.slice(0,-1*x*2),p=p.slice(0,-1*x),r=r.slice(0,-1*x)),o.push(this.productions_[S[1]][0]),p.push(O.$),r.push(O._$),oe=$[o[o.length-2]][o[o.length-1]],o.push(oe);break;case 3:return!0}}return!0},"parse")},ye=(function(){var N={EOF:1,parseError:h(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:h(function(s,i){return this.yy=i||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:h(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:h(function(s){var i=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=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 p=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===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:h(function(s){this.unput(this.match.slice(s))},"less"),pastInput:h(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
`+i+"^"},"showPosition"),test_match:h(function(s,i){var o,c,p;if(this.options.backtrack_lexer&&(p={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&&(p.yylloc.range=this.yylloc.range.slice(0))),c=s[0].match(/(?:\r\n?|\n).*/g),c&&(this.yylineno+=c.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,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(s[0].length),this.matched+=s[0],o=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var r in p)this[r]=p[r];return!1}return!1},"test_match"),next:h(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,i,o,c;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),r=0;r<p.length;r++)if(o=this._input.match(this.rules[p[r]]),o&&(!i||o[0].length>i[0].length)){if(i=o,c=r,this.options.backtrack_lexer){if(s=this.test_match(o,p[r]),s!==!1)return s;if(this._backtrack){i=!1;continue}else return!1}else if(!this.options.flex)break}return i?(s=this.test_match(i,p[c]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:h(function(){var i=this.next();return i||this.lex()},"lex"),begin:h(function(i){this.conditionStack.push(i)},"begin"),popState:h(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:h(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:h(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:h(function(i){this.begin(i)},"pushState"),stateStackSize:h(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:h(function(i,o,c,p){var r=p;switch(c){case 0:return i.getLogger().trace("Found comment",o.yytext),6;break;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;break;case 4:this.popState();break;case 5:i.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return i.getLogger().trace("SPACELINE"),6;break;case 7:return 7;case 8:return 15;case 9:i.getLogger().trace("end icon"),this.popState();break;case 10:return i.getLogger().trace("Exploding node"),this.begin("NODE"),19;break;case 11:return i.getLogger().trace("Cloud"),this.begin("NODE"),19;break;case 12:return i.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;break;case 13:return i.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;break;case 14:return this.begin("NODE"),19;break;case 15:return this.begin("NODE"),19;break;case 16:return this.begin("NODE"),19;break;case 17:return this.begin("NODE"),19;break;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:i.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return i.getLogger().trace("description:",o.yytext),"NODE_DESCR";break;case 26:this.popState();break;case 27:return this.popState(),i.getLogger().trace("node end ))"),"NODE_DEND";break;case 28:return this.popState(),i.getLogger().trace("node end )"),"NODE_DEND";break;case 29:return this.popState(),i.getLogger().trace("node end ...",o.yytext),"NODE_DEND";break;case 30:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";break;case 31:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";break;case 32:return this.popState(),i.getLogger().trace("node end (-"),"NODE_DEND";break;case 33:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";break;case 34:return this.popState(),i.getLogger().trace("node end (("),"NODE_DEND";break;case 35:return i.getLogger().trace("Long description:",o.yytext),20;break;case 36:return i.getLogger().trace("Long description:",o.yytext),20;break}},"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})();j.lexer=ye;function P(){this.yy={}}return h(P,"Parser"),P.prototype=j,j.Parser=P,new P})();Z.parser=Z;var Ne=Z,Le=12,D={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},ve=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=D,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)}static{h(this,"MindmapDB")}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,l,a){T.info("addNode",e,n,l,a);let t=!1;this.nodes.length===0?(this.baseLevel=e,e=0,t=!0):this.baseLevel!==void 0&&(e=e-this.baseLevel,t=!1);let d=C(),f=d.mindmap?.padding??B.mindmap.padding;switch(a){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:f*=2;break}let m={id:this.count++,nodeId:M(n,d),level:e,descr:M(l,d),type:a,children:[],width:d.mindmap?.maxNodeWidth??B.mindmap.maxNodeWidth,padding:f,isRoot:t},k=this.getParent(e);if(k)k.children.push(m),this.nodes.push(m);else if(t)this.nodes.push(m);else throw new Error(`There can be only one root. No parent could be found for ("${m.descr}")`)}getType(e,n){switch(T.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=C(),l=this.nodes[this.nodes.length-1];e.icon&&(l.icon=M(e.icon,n)),e.class&&(l.class=M(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[l,a]of e.children.entries()){let t=e.level===0?l%(Le-1):n;this.assignSections(a,t)}}flattenNodes(e,n){let l=C(),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 t=a.join(" "),d=h(m=>{let I=(l.theme?.toLowerCase()??"").includes("redux");switch(m){case D.CIRCLE:return"mindmapCircle";case D.RECT:return"rect";case D.ROUNDED_RECT:return"rounded";case D.CLOUD:return"cloud";case D.BANG:return"bang";case D.HEXAGON:return"hexagon";case D.DEFAULT:return I?"rounded":"defaultMindmapNode";case D.NO_BORDER:default:return"rect"}},"getShapeFromType"),f={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:d(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:t,cssStyles:[],look:l.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(n.push(f),e.children)for(let m of e.children)this.flattenNodes(m,n)}generateEdges(e,n){if(!e.children)return;let l=C();for(let a of e.children){let t="edge";a.section!==void 0&&(t+=` section-edge-${a.section}`);let d=e.level+1;t+=` edge-depth-${d}`;let f={id:`edge_${e.id}_${a.id}`,start:e.id.toString(),end:a.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:l.look,classes:t,depth:e.level,section:a.section};n.push(f),this.generateEdges(a,n)}}getData(){let e=this.getMindmap(),n=C(),a=de().layout!==void 0,t=n;if(a||(t.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:t};T.debug("getData: mindmapRoot",e,n),this.assignSections(e);let d=[],f=[];this.flattenNodes(e,d),this.generateEdges(e,f),T.debug(`getData: processed ${d.length} nodes and ${f.length} edges`);let m=new Map;for(let k of d)m.set(k.id,{shape:k.shape,width:k.width,height:k.height,padding:k.padding});return{nodes:d,edges:f,config:t,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(m),type:"mindmap",diagramId:"mindmap-"+Q()}}getLogger(){return T}},Te=h(async(e,n,l,a)=>{T.debug(`Rendering mindmap diagram
`+e);let t=a.db,d=t.getData(),f=pe(n,d.config.securityLevel);if(d.type=a.type,d.layoutAlgorithm=ge(d.config.layout,{fallback:"cose-bilkent"}),d.diagramId=n,!t.getMindmap())return;d.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):u.shape==="hexagon"&&(u.width=0,u.height=0)}),await ue(d,f);let{themeVariables:k}=he(),{useGradient:I,gradientStart:w,gradientStop:R}=k;if(I&&w&&R){let u=f.attr("id"),A=f.append("defs").append("linearGradient").attr("id",`${u}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");A.append("stop").attr("offset","0%").attr("stop-color",w).attr("stop-opacity",1),A.append("stop").attr("offset","100%").attr("stop-color",R).attr("stop-opacity",1)}fe(f,d.config.mindmap?.padding??B.mindmap.padding,"mindmapDiagram",d.config.mindmap?.useMaxWidth??B.mindmap.useMaxWidth)},"draw"),Ie={draw:Te},Oe=h(e=>{let{theme:n,look:l}=e,a="";for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e["lineColor"+t]=e["lineColor"+t]||e["cScaleInv"+t],ae(e["lineColor"+t])?e["lineColor"+t]=ce(e["lineColor"+t],20):e["lineColor"+t]=le(e["lineColor"+t],20);for(let t=0;t<e.THEME_COLOR_LIMIT;t++){let d=""+(l==="neo"?Math.max(10-(t-1)*2,2):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]};
}
.section-${t-1} span {
color: ${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: ${d};
}
.section-${t-1} line {
stroke: ${e["cScaleInv"+t]} ;
stroke-width: 3;
}
.disabled, .disabled circle, .disabled text {
fill: lightgray;
}
.disabled text {
fill: #efefef;
}
[data-look="neo"].mindmap-node.section-${t-1} rect, [data-look="neo"].mindmap-node.section-${t-1} path, [data-look="neo"].mindmap-node.section-${t-1} circle, [data-look="neo"].mindmap-node.section-${t-1} polygon {
fill: ${n==="redux"||n==="redux-dark"||n==="neutral"?e.mainBkg:e["cScale"+t]};
stroke: ${n==="redux"||n==="redux-dark"?e.nodeBorder:e["cScale"+t]};
stroke-width: ${e.strokeWidth??2}px;
}
[data-look="neo"].section-edge-${t-1}{
stroke: ${n?.includes("redux")||n==="neo-dark"?e.nodeBorder:e["cScale"+t]};
}
[data-look="neo"].mindmap-node.section-${t-1} text {
fill: ${n==="redux"||n==="redux-dark"?e.nodeBorder:e["cScaleLabel"+(n==="neutral"?1:t)]};
}
`}return a},"genSections"),Ce=h((e,n,l)=>{let a="";for(let t=0;t<e;t++)a+=`
[data-look="neo"].mindmap-node.section-${t-1} rect, [data-look="neo"].mindmap-node.section-${t-1} path, [data-look="neo"].mindmap-node.section-${t-1} circle, [data-look="neo"].mindmap-node.section-${t-1} polygon {
stroke: url(${n}-gradient);
fill: ${l};
}
.section-${t-1} line {
stroke-width: 0;
}`;return a},"genGradient"),we=h(e=>{let{theme:n}=e,l=e.svgId,a=e.dropShadow?e.dropShadow.replace("url(#drop-shadow)",`url(${l}-drop-shadow)`):"none";return`
.edge {
stroke-width: 3;
}
${Oe(e)}
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
fill: ${e.git0};
}
.section-root text {
fill: ${e.gitBranchLabel0};
}
.section-root span {
color: ${n?.includes("redux")?e.nodeBorder: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;
}
[data-look="neo"].mindmap-node {
filter: ${a};
}
[data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon {
fill: ${n?.includes("redux")?e.mainBkg:e.git0};
}
[data-look="neo"].mindmap-node.section-root .text-inner-tspan {
fill: ${n?.includes("redux")?e.nodeBorder:e["cScaleLabel"+(n==="neutral"?1:0)]};
}
${e.useGradient&&l&&e.mainBkg?Ce(e.THEME_COLOR_LIMIT,l,e.mainBkg):""}
`},"getStyles"),Re=we,ot={get db(){return new ve},renderer:Ie,parser:Ne,styles:Re};export{ot as diagram};