ranui
Version:
A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.
90 lines (85 loc) • 21.2 kB
JavaScript
const r=require("./chunk-Y2CYZVJY-DPaYLFFP.cjs"),Q=require("./src-C9EhKhbk.cjs"),p=require("./chunk-WYO6CB5R-u4mJNOcO.cjs");require("./chunk-ICXQ74PX-BbT9JaEW.cjs");const pe=require("./chunk-VAUOI2AC-DfQf5L2_.cjs");require("./chunk-HOUHSVGY-BGB3dOvI.cjs");require("./chunk-Q4XR5HBZ-aBnPq509.cjs");const fe=require("./chunk-5VM5RSS4-DudUFQ_Z.cjs");require("./chunk-OGEWGWER-DX8sW1dT.cjs");require("./chunk-C7G6YPKG-CKEeW9TM.cjs");const J=require("./chunk-ZGVPDNZ5-Cw5_HJba.cjs"),ce=require("./chunk-ZIRB5QZD-aLu-4ITN.cjs");var $=(function(){var e=r.__name(function(i,t,o,c){for(o=o||{},c=i.length;c--;o[i[c]]=t);return o},"o"),g=[1,4],f=[1,13],s=[1,12],d=[1,15],b=[1,16],S=[1,20],h=[1,19],v=[6,7,8],C=[1,26],u=[1,24],R=[1,25],N=[6,7,11],V=[1,31],O=[6,7,11,24],_=[1,6,13,16,17,20,23],w=[1,35],T=[1,36],A=[1,6,7,11,13,16,17,20,23],q=[1,38],F={trace:r.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},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,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:r.__name(function(t,o,c,l,m,n,M){var a=n.length-1;switch(m){case 6:case 7:return l;case 8:l.getLogger().trace("Stop NL ");break;case 9:l.getLogger().trace("Stop EOF ");break;case 11:l.getLogger().trace("Stop NL2 ");break;case 12:l.getLogger().trace("Stop EOF2 ");break;case 15:l.getLogger().info("Node: ",n[a-1].id),l.addNode(n[a-2].length,n[a-1].id,n[a-1].descr,n[a-1].type,n[a]);break;case 16:l.getLogger().info("Node: ",n[a].id),l.addNode(n[a-1].length,n[a].id,n[a].descr,n[a].type);break;case 17:l.getLogger().trace("Icon: ",n[a]),l.decorateNode({icon:n[a]});break;case 18:case 23:l.decorateNode({class:n[a]});break;case 19:l.getLogger().trace("SPACELIST");break;case 20:l.getLogger().trace("Node: ",n[a-1].id),l.addNode(0,n[a-1].id,n[a-1].descr,n[a-1].type,n[a]);break;case 21:l.getLogger().trace("Node: ",n[a].id),l.addNode(0,n[a].id,n[a].descr,n[a].type);break;case 22:l.decorateNode({icon:n[a]});break;case 27:l.getLogger().trace("node found ..",n[a-2]),this.$={id:n[a-1],descr:n[a-1],type:l.getType(n[a-2],n[a])};break;case 28:this.$={id:n[a],descr:n[a],type:0};break;case 29:l.getLogger().trace("node found ..",n[a-3]),this.$={id:n[a-3],descr:n[a-1],type:l.getType(n[a-2],n[a])};break;case 30:this.$=n[a-1]+n[a];break;case 31:this.$=n[a];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:f,7:[1,10],9:9,12:11,13:s,14:14,16:d,17:b,18:17,19:18,20:S,23:h},e(v,[2,3]),{1:[2,2]},e(v,[2,4]),e(v,[2,5]),{1:[2,6],6:f,12:21,13:s,14:14,16:d,17:b,18:17,19:18,20:S,23:h},{6:f,9:22,12:11,13:s,14:14,16:d,17:b,18:17,19:18,20:S,23:h},{6:C,7:u,10:23,11:R},e(N,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:S,23:h}),e(N,[2,19]),e(N,[2,21],{15:30,24:V}),e(N,[2,22]),e(N,[2,23]),e(O,[2,25]),e(O,[2,26]),e(O,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:u,10:34,11:R},{1:[2,7],6:f,12:21,13:s,14:14,16:d,17:b,18:17,19:18,20:S,23:h},e(_,[2,14],{7:w,11:T}),e(A,[2,8]),e(A,[2,9]),e(A,[2,10]),e(N,[2,16],{15:37,24:V}),e(N,[2,17]),e(N,[2,18]),e(N,[2,20],{24:q}),e(O,[2,31]),{21:[1,39]},{22:[1,40]},e(_,[2,13],{7:w,11:T}),e(A,[2,11]),e(A,[2,12]),e(N,[2,15],{24:q}),e(O,[2,30]),{22:[1,41]},e(O,[2,27]),e(O,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:r.__name(function(t,o){if(o.recoverable)this.trace(t);else{var c=new Error(t);throw c.hash=o,c}},"parseError"),parse:r.__name(function(t){var o=this,c=[0],l=[],m=[null],n=[],M=this.table,a="",U=0,ie=0,se=0,he=2,re=1,ue=n.slice.call(arguments,1),k=Object.create(this.lexer),P={yy:{}};for(var W in this.yy)Object.prototype.hasOwnProperty.call(this.yy,W)&&(P.yy[W]=this.yy[W]);k.setInput(t,P.yy),P.yy.lexer=k,P.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var Y=k.yylloc;n.push(Y);var ge=k.options&&k.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function de(D){c.length=c.length-2*D,m.length=m.length-D,n.length=n.length-D}r.__name(de,"popStack");function ae(){var D=l.pop()||k.lex()||re;return typeof D!="number"&&(D instanceof Array&&(l=D,D=l.pop()),D=o.symbols_[D]||D),D}r.__name(ae,"lex");for(var E,Z,B,x,X,j={},H,I,oe,z;;){if(B=c[c.length-1],this.defaultActions[B]?x=this.defaultActions[B]:((E===null||typeof E>"u")&&(E=ae()),x=M[B]&&M[B][E]),typeof x>"u"||!x.length||!x[0]){var K="";z=[];for(H in M[B])this.terminals_[H]&&H>he&&z.push("'"+this.terminals_[H]+"'");k.showPosition?K="Parse error on line "+(U+1)+`:
`+k.showPosition()+`
Expecting `+z.join(", ")+", got '"+(this.terminals_[E]||E)+"'":K="Parse error on line "+(U+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(K,{text:k.match,token:this.terminals_[E]||E,line:k.yylineno,loc:Y,expected:z})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+B+", token: "+E);switch(x[0]){case 1:c.push(E),m.push(k.yytext),n.push(k.yylloc),c.push(x[1]),E=null,Z?(E=Z,Z=null):(ie=k.yyleng,a=k.yytext,U=k.yylineno,Y=k.yylloc,se>0&&se--);break;case 2:if(I=this.productions_[x[1]][1],j.$=m[m.length-I],j._$={first_line:n[n.length-(I||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(I||1)].first_column,last_column:n[n.length-1].last_column},ge&&(j._$.range=[n[n.length-(I||1)].range[0],n[n.length-1].range[1]]),X=this.performAction.apply(j,[a,ie,U,P.yy,x[1],m,n].concat(ue)),typeof X<"u")return X;I&&(c=c.slice(0,-1*I*2),m=m.slice(0,-1*I),n=n.slice(0,-1*I)),c.push(this.productions_[x[1]][0]),m.push(j.$),n.push(j._$),oe=M[c[c.length-2]][c[c.length-1]],c.push(oe);break;case 3:return!0}}return!0},"parse")};F.lexer=(function(){return{EOF:1,parseError:r.__name(function(t,o){if(this.yy.parser)this.yy.parser.parseError(t,o);else throw new Error(t)},"parseError"),setInput:r.__name(function(i,t){return this.yy=t||this.yy||{},this._input=i,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:r.__name(function(){var i=this._input[0];return this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i,i.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),i},"input"),unput:r.__name(function(i){var t=i.length,o=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;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 l=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-t},this.options.ranges&&(this.yylloc.range=[l[0],l[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:r.__name(function(){return this._more=!0,this},"more"),reject:r.__name(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:r.__name(function(i){this.unput(this.match.slice(i))},"less"),pastInput:r.__name(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:r.__name(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:r.__name(function(){var i=this.pastInput(),t=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
`+t+"^"},"showPosition"),test_match:r.__name(function(i,t){var o,c,l;if(this.options.backtrack_lexer&&(l={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&&(l.yylloc.range=this.yylloc.range.slice(0))),c=i[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+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,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(i[0].length),this.matched+=i[0],o=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var m in l)this[m]=l[m];return!1}return!1},"test_match"),next:r.__name(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,t,o,c;this._more||(this.yytext="",this.match="");for(var l=this._currentRules(),m=0;m<l.length;m++)if(o=this._input.match(this.rules[l[m]]),o&&(!t||o[0].length>t[0].length)){if(t=o,c=m,this.options.backtrack_lexer){if(i=this.test_match(o,l[m]),i!==!1)return i;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(i=this.test_match(t,l[c]),i!==!1?i:!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:r.__name(function(){var t=this.next();return t||this.lex()},"lex"),begin:r.__name(function(t){this.conditionStack.push(t)},"begin"),popState:r.__name(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:r.__name(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:r.__name(function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:r.__name(function(t){this.begin(t)},"pushState"),stateStackSize:r.__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:r.__name(function(t,o,c,l){switch(c){case 0:return this.pushState("shapeData"),o.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:return o.yytext=o.yytext.replace(/\n\s*/g,"<br/>"),24;case 4:return 24;case 5:this.popState();break;case 6:return t.getLogger().trace("Found comment",o.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return t.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:t.getLogger().trace("end icon"),this.popState();break;case 16:return t.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return t.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return t.getLogger().trace("description:",o.yytext),"NODE_DESCR";case 32:this.popState();break;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 this.popState(),t.getLogger().trace("node end ...",o.yytext),"NODE_DEND";case 36:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 41:return t.getLogger().trace("Long description:",o.yytext),21;case 42:return t.getLogger().trace("Long description:",o.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\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:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}}})();function G(){this.yy={}}return r.__name(G,"Parser"),G.prototype=F,F.Parser=G,new G})();$.parser=$;var _e=$,L=[],ne=[],ee=0,te={},me=r.__name(()=>{L=[],ne=[],ee=0,te={}},"clear"),ye=r.__name(e=>{if(L.length===0)return null;const g=L[0].level;let f=null;for(let s=L.length-1;s>=0;s--)if(L[s].level===g&&!f&&(f=L[s]),L[s].level<g)throw new Error('Items without section detected, found section ("'+L[s].label+'")');return e===f?.level?null:f},"getSection"),le=r.__name(function(){return ne},"getSections"),be=r.__name(function(){const e=[],g=[],f=le(),s=p.getConfig2();for(const d of f){const b={id:d.id,label:p.sanitizeText(d.label??"",s),labelType:"markdown",isGroup:!0,ticket:d.ticket,shape:"kanbanSection",level:d.level,look:s.look};g.push(b);const S=L.filter(h=>h.parentId===d.id);for(const h of S){const v={id:h.id,parentId:d.id,label:p.sanitizeText(h.label??"",s),labelType:"markdown",isGroup:!1,ticket:h?.ticket,priority:h?.priority,assigned:h?.assigned,icon:h?.icon,shape:"kanbanItem",level:h.level,rx:5,ry:5,cssStyles:["text-align: left"]};g.push(v)}}return{nodes:g,edges:e,other:{},config:p.getConfig2()}},"getData"),ke=r.__name((e,g,f,s,d)=>{const b=p.getConfig2();let S=b.mindmap?.padding??p.defaultConfig_default.mindmap.padding;switch(s){case y.ROUNDED_RECT:case y.RECT:case y.HEXAGON:S*=2}const h={id:p.sanitizeText(g,b)||"kbn"+ee++,level:e,label:p.sanitizeText(f,b),width:b.mindmap?.maxNodeWidth??p.defaultConfig_default.mindmap.maxNodeWidth,padding:S,isGroup:!1};if(d!==void 0){let C;d.includes(`
`)?C=d+`
`:C=`{
`+d+`
}`;const u=ce.load(C,{schema:ce.JSON_SCHEMA});if(u.shape&&(u.shape!==u.shape.toLowerCase()||u.shape.includes("_")))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);u?.shape&&u.shape==="kanbanItem"&&(h.shape=u?.shape),u?.label&&(h.label=u?.label),u?.icon&&(h.icon=u?.icon.toString()),u?.assigned&&(h.assigned=u?.assigned.toString()),u?.ticket&&(h.ticket=u?.ticket.toString()),u?.priority&&(h.priority=u?.priority)}const v=ye(e);v?h.parentId=v.id||"kbn"+ee++:ne.push(h),L.push(h)},"addNode"),y={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Ee={clear:me,addNode:ke,getSections:le,getData:be,nodeType:y,getType:r.__name((e,g)=>{switch(Q.log.debug("In get type",e,g),e){case"[":return y.RECT;case"(":return g===")"?y.ROUNDED_RECT:y.CLOUD;case"((":return y.CIRCLE;case")":return y.CLOUD;case"))":return y.BANG;case"{{":return y.HEXAGON;default:return y.DEFAULT}},"getType"),setElementForId:r.__name((e,g)=>{te[e]=g},"setElementForId"),decorateNode:r.__name(e=>{if(!e)return;const g=p.getConfig2(),f=L[L.length-1];e.icon&&(f.icon=p.sanitizeText(e.icon,g)),e.class&&(f.cssClasses=p.sanitizeText(e.class,g))},"decorateNode"),type2Str:r.__name(e=>{switch(e){case y.DEFAULT:return"no-border";case y.RECT:return"rect";case y.ROUNDED_RECT:return"rounded-rect";case y.CIRCLE:return"circle";case y.CLOUD:return"cloud";case y.BANG:return"bang";case y.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),getLogger:r.__name(()=>Q.log,"getLogger"),getElementById:r.__name(e=>te[e],"getElementById")},Se={draw:r.__name(async(e,g,f,s)=>{Q.log.debug(`Rendering kanban diagram
`+e);const d=s.db.getData(),b=p.getConfig2();b.htmlLabels=!1;const S=pe.selectSvgElement(g);for(const _ of d.nodes)_.domId=`${g}-${_.id}`;const h=S.append("g");h.attr("class","sections");const v=S.append("g");v.attr("class","items");const C=d.nodes.filter(_=>_.isGroup);let u=0;const R=10,N=[];let V=25;for(const _ of C){const w=b?.kanban?.sectionWidth||200;u=u+1,_.x=w*u+(u-1)*R/2,_.width=w,_.y=0,_.height=w*3,_.rx=5,_.ry=5,_.cssClasses=_.cssClasses+" section-"+u;const T=await J.insertCluster(h,_);V=Math.max(V,T?.labelBBox?.height),N.push(T)}let O=0;for(const _ of C){const w=N[O];O=O+1;const T=b?.kanban?.sectionWidth||200,A=-T*3/2+V;let q=A;const F=d.nodes.filter(t=>t.parentId===_.id);for(const t of F){if(t.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");t.x=_.x,t.width=T-1.5*R;const o=(await J.insertNode(v,t,{config:b})).node().getBBox();t.y=q+o.height/2,await J.positionNode(t),q=t.y+o.height/2+R/2}const G=w.cluster.select("rect"),i=Math.max(q-A+3*R,50)+(V-25);G.attr("height",i)}p.setupGraphViewbox(void 0,S,b.mindmap?.padding??p.defaultConfig_default.kanban.padding,b.mindmap?.useMaxWidth??p.defaultConfig_default.kanban.useMaxWidth)},"draw")},Ne=r.__name(e=>{let g="";for(let s=0;s<e.THEME_COLOR_LIMIT;s++)e["lineColor"+s]=e["lineColor"+s]||e["cScaleInv"+s],p.isDark(e["lineColor"+s])?e["lineColor"+s]=p.lighten(e["lineColor"+s],20):e["lineColor"+s]=p.darken(e["lineColor"+s],20);const f=r.__name((s,d)=>e.darkMode?p.darken(s,d):p.lighten(s,d),"adjuster");for(let s=0;s<e.THEME_COLOR_LIMIT;s++){const d=""+(17-3*s);g+=`
.section-${s-1} rect, .section-${s-1} path, .section-${s-1} circle, .section-${s-1} polygon, .section-${s-1} path {
fill: ${f(e["cScale"+s],10)};
stroke: ${f(e["cScale"+s],10)};
}
.section-${s-1} text {
fill: ${e["cScaleLabel"+s]};
}
.node-icon-${s-1} {
font-size: 40px;
color: ${e["cScaleLabel"+s]};
}
.section-edge-${s-1}{
stroke: ${e["cScale"+s]};
}
.edge-depth-${s-1}{
stroke-width: ${d};
}
.section-${s-1} line {
stroke: ${e["cScaleInv"+s]} ;
stroke-width: 3;
}
.disabled, .disabled circle, .disabled text {
fill: lightgray;
}
.disabled text {
fill: #efefef;
}
.node rect,
.node circle,
.node ellipse,
.node polygon,
.node path {
fill: ${e.background};
stroke: ${e.nodeBorder};
stroke-width: 1px;
}
.kanban-ticket-link {
fill: ${e.background};
stroke: ${e.nodeBorder};
text-decoration: underline;
}
`}return g},"genSections"),xe={db:Ee,renderer:Se,parser:_e,styles:r.__name(e=>`
.edge {
stroke-width: 3;
}
${Ne(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;
}
.cluster-label, .label {
color: ${e.textColor};
fill: ${e.textColor};
}
.kanban-label {
dy: 1em;
alignment-baseline: middle;
text-anchor: middle;
dominant-baseline: middle;
text-align: center;
}
${fe.getIconStyles()}
`,"getStyles")};exports.diagram=xe;