62 lines
23 KiB
JavaScript
62 lines
23 KiB
JavaScript
import{m as r,a as bt,p as S,i as V,b7 as kt,b8 as _t,b9 as vt,ba as wt,aQ as et,n as St,bb as $t,N as Et}from"./mermaid.esm.min-RL45CjrO.js";import"./app-BwvsBlHw.js";var X=(function(){var i=r(function(g,a,c,h){for(c=c||{},h=g.length;h--;c[g[h]]=a);return c},"o"),t=[6,8,10,11,12,14,16,17,20,21],e=[1,9],s=[1,10],n=[1,11],l=[1,12],p=[1,13],y=[1,16],u=[1,17],f={trace:r(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",20:"period",21:"event"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[18,1],[19,1]],performAction:r(function(g,a,c,h,d,o,m){var k=o.length-1;switch(d){case 1:return o[k-1];case 2:this.$=[];break;case 3:o[k-1].push(o[k]),this.$=o[k-1];break;case 4:case 5:this.$=o[k];break;case 6:case 7:this.$=[];break;case 8:h.getCommonDb().setDiagramTitle(o[k].substr(6)),this.$=o[k].substr(6);break;case 9:this.$=o[k].trim(),h.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=o[k].trim(),h.getCommonDb().setAccDescription(this.$);break;case 12:h.addSection(o[k].substr(8)),this.$=o[k].substr(8);break;case 15:h.addTask(o[k],0,""),this.$=o[k];break;case 16:h.addEvent(o[k].substr(2)),this.$=o[k];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},i(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:e,12:s,14:n,16:l,17:p,18:14,19:15,20:y,21:u},i(t,[2,7],{1:[2,1]}),i(t,[2,3]),{9:18,11:e,12:s,14:n,16:l,17:p,18:14,19:15,20:y,21:u},i(t,[2,5]),i(t,[2,6]),i(t,[2,8]),{13:[1,19]},{15:[1,20]},i(t,[2,11]),i(t,[2,12]),i(t,[2,13]),i(t,[2,14]),i(t,[2,15]),i(t,[2,16]),i(t,[2,4]),i(t,[2,9]),i(t,[2,10])],defaultActions:{},parseError:r(function(g,a){if(a.recoverable)this.trace(g);else{var c=new Error(g);throw c.hash=a,c}},"parseError"),parse:r(function(g){var a=this,c=[0],h=[],d=[null],o=[],m=this.table,k="",I=0,P=0,H=0,C=2,v=1,N=o.slice.call(arguments,1),x=Object.create(this.lexer),$={yy:{}};for(var L in this.yy)Object.prototype.hasOwnProperty.call(this.yy,L)&&($.yy[L]=this.yy[L]);x.setInput(g,$.yy),$.yy.lexer=x,$.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var F=x.yylloc;o.push(F);var mt=x.options&&x.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function xt(E){c.length=c.length-2*E,d.length=d.length-E,o.length=o.length-E}r(xt,"popStack");function K(){var E;return E=h.pop()||x.lex()||v,typeof E!="number"&&(E instanceof Array&&(h=E,E=h.pop()),E=a.symbols_[E]||E),E}r(K,"lex");for(var w,G,O,T,qt,q,j={},R,A,tt,W;;){if(O=c[c.length-1],this.defaultActions[O]?T=this.defaultActions[O]:((w===null||typeof w>"u")&&(w=K()),T=m[O]&&m[O][w]),typeof T>"u"||!T.length||!T[0]){var Y="";W=[];for(R in m[O])this.terminals_[R]&&R>C&&W.push("'"+this.terminals_[R]+"'");x.showPosition?Y="Parse error on line "+(I+1)+`:
|
|
`+x.showPosition()+`
|
|
Expecting `+W.join(", ")+", got '"+(this.terminals_[w]||w)+"'":Y="Parse error on line "+(I+1)+": Unexpected "+(w==v?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(Y,{text:x.match,token:this.terminals_[w]||w,line:x.yylineno,loc:F,expected:W})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+w);switch(T[0]){case 1:c.push(w),d.push(x.yytext),o.push(x.yylloc),c.push(T[1]),w=null,G?(w=G,G=null):(P=x.yyleng,k=x.yytext,I=x.yylineno,F=x.yylloc,H>0);break;case 2:if(A=this.productions_[T[1]][1],j.$=d[d.length-A],j._$={first_line:o[o.length-(A||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(A||1)].first_column,last_column:o[o.length-1].last_column},mt&&(j._$.range=[o[o.length-(A||1)].range[0],o[o.length-1].range[1]]),q=this.performAction.apply(j,[k,P,I,$.yy,T[1],d,o].concat(N)),typeof q<"u")return q;A&&(c=c.slice(0,-1*A*2),d=d.slice(0,-1*A),o=o.slice(0,-1*A)),c.push(this.productions_[T[1]][0]),d.push(j.$),o.push(j._$),tt=m[c[c.length-2]][c[c.length-1]],c.push(tt);break;case 3:return!0}}return!0},"parse")},_=(function(){var g={EOF:1,parseError:r(function(a,c){if(this.yy.parser)this.yy.parser.parseError(a,c);else throw new Error(a)},"parseError"),setInput:r(function(a,c){return this.yy=c||this.yy||{},this._input=a,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(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var c=a.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),a},"input"),unput:r(function(a){var c=a.length,h=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;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),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===d.length?this.yylloc.first_column:0)+d[d.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},"unput"),more:r(function(){return this._more=!0,this},"more"),reject:r(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(function(a){this.unput(this.match.slice(a))},"less"),pastInput:r(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:r(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:r(function(){var a=this.pastInput(),c=new Array(a.length+1).join("-");return a+this.upcomingInput()+`
|
|
`+c+"^"},"showPosition"),test_match:r(function(a,c){var h,d,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))),d=a[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+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,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(a[0].length),this.matched+=a[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 m in o)this[m]=o[m];return!1}return!1},"test_match"),next:r(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,c,h,d;this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),m=0;m<o.length;m++)if(h=this._input.match(this.rules[o[m]]),h&&(!c||h[0].length>c[0].length)){if(c=h,d=m,this.options.backtrack_lexer){if(a=this.test_match(h,o[m]),a!==!1)return a;if(this._backtrack){c=!1;continue}else return!1}else if(!this.options.flex)break}return c?(a=this.test_match(c,o[d]),a!==!1?a:!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(function(){var a=this.next();return a||this.lex()},"lex"),begin:r(function(a){this.conditionStack.push(a)},"begin"),popState:r(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:r(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(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:r(function(a){this.begin(a)},"pushState"),stateStackSize:r(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:r(function(a,c,h,d){switch(h){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18],inclusive:!0}}};return g})();f.lexer=_;function b(){this.yy={}}return r(b,"Parser"),b.prototype=f,f.Parser=b,new b})();X.parser=X;var Tt=X,rt={};St(rt,{addEvent:()=>pt,addSection:()=>ct,addTask:()=>ut,addTaskOrg:()=>yt,clear:()=>ot,default:()=>It,getCommonDb:()=>lt,getSections:()=>ht,getTasks:()=>dt});var z="",st=0,Q=[],B=[],D=[],lt=r(()=>$t,"getCommonDb"),ot=r(function(){Q.length=0,B.length=0,z="",D.length=0,Et()},"clear"),ct=r(function(i){z=i,Q.push(i)},"addSection"),ht=r(function(){return Q},"getSections"),dt=r(function(){let i=it(),t=100,e=0;for(;!i&&e<t;)i=it(),e++;return B.push(...D),B},"getTasks"),ut=r(function(i,t,e){let s={id:st++,section:z,type:z,task:i,score:t||0,events:e?[e]:[]};D.push(s)},"addTask"),pt=r(function(i){D.find(t=>t.id===st-1).events.push(i)},"addEvent"),yt=r(function(i){let t={section:z,type:z,description:i,task:i,classes:[]};B.push(t)},"addTaskOrg"),it=r(function(){let i=r(function(e){return D[e].processed},"compileTask"),t=!0;for(let[e,s]of D.entries())i(e),t=t&&s.processed;return t},"compileTasks"),It={clear:ot,getCommonDb:lt,addSection:ct,getSections:ht,getTasks:dt,addTask:ut,addTaskOrg:yt,addEvent:pt},Nt=12,U=r(function(i,t){let e=i.append("rect");return e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),e.attr("rx",t.rx),e.attr("ry",t.ry),t.class!==void 0&&e.attr("class",t.class),e},"drawRect"),At=r(function(i,t){let e=i.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),s=i.append("g");s.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function n(y){let u=et().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);y.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}r(n,"smile");function l(y){let u=et().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);y.append("path").attr("class","mouth").attr("d",u).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}r(l,"sad");function p(y){y.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return r(p,"ambivalent"),t.score>3?n(s):t.score<3?l(s):p(s),e},"drawFace"),Ct=r(function(i,t){let e=i.append("circle");return e.attr("cx",t.cx),e.attr("cy",t.cy),e.attr("class","actor-"+t.pos),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("r",t.r),e.class!==void 0&&e.attr("class",e.class),t.title!==void 0&&e.append("title").text(t.title),e},"drawCircle"),gt=r(function(i,t){let e=t.text.replace(/<br\s*\/?>/gi," "),s=i.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class!==void 0&&s.attr("class",t.class);let n=s.append("tspan");return n.attr("x",t.x+t.textMargin*2),n.text(e),s},"drawText"),Pt=r(function(i,t){function e(n,l,p,y,u){return n+","+l+" "+(n+p)+","+l+" "+(n+p)+","+(l+y-u)+" "+(n+p-u*1.2)+","+(l+y)+" "+n+","+(l+y)}r(e,"genPoints");let s=i.append("polygon");s.attr("points",e(t.x,t.y,50,20,7)),s.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,gt(i,t)},"drawLabel"),Lt=r(function(i,t,e){let s=i.append("g"),n=Z();n.x=t.x,n.y=t.y,n.fill=t.fill,n.width=e.width,n.height=e.height,n.class="journey-section section-type-"+t.num,n.rx=3,n.ry=3,U(s,n),ft(e)(t.text,s,n.x,n.y,n.width,n.height,{class:"journey-section section-type-"+t.num},e,t.colour)},"drawSection"),nt=-1,Ot=r(function(i,t,e){let s=t.x+e.width/2,n=i.append("g");nt++,n.append("line").attr("id","task"+nt).attr("x1",s).attr("y1",t.y).attr("x2",s).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),At(n,{cx:s,cy:300+(5-t.score)*30,score:t.score});let l=Z();l.x=t.x,l.y=t.y,l.fill=t.fill,l.width=e.width,l.height=e.height,l.class="task task-type-"+t.num,l.rx=3,l.ry=3,U(n,l),ft(e)(t.task,n,l.x,l.y,l.width,l.height,{class:"task"},e,t.colour)},"drawTask"),Mt=r(function(i,t){U(i,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),jt=r(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),Z=r(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),ft=(function(){function i(n,l,p,y,u,f,_,b){let g=l.append("text").attr("x",p+u/2).attr("y",y+f/2+5).style("font-color",b).style("text-anchor","middle").text(n);s(g,_)}r(i,"byText");function t(n,l,p,y,u,f,_,b,g){let{taskFontSize:a,taskFontFamily:c}=b,h=n.split(/<br\s*\/?>/gi);for(let d=0;d<h.length;d++){let o=d*a-a*(h.length-1)/2,m=l.append("text").attr("x",p+u/2).attr("y",y).attr("fill",g).style("text-anchor","middle").style("font-size",a).style("font-family",c);m.append("tspan").attr("x",p+u/2).attr("dy",o).text(h[d]),m.attr("y",y+f/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(m,_)}}r(t,"byTspan");function e(n,l,p,y,u,f,_,b){let g=l.append("switch"),a=g.append("foreignObject").attr("x",p).attr("y",y).attr("width",u).attr("height",f).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");a.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(n),t(n,g,p,y,u,f,_,b),s(a,_)}r(e,"byFo");function s(n,l){for(let p in l)p in l&&n.attr(p,l[p])}return r(s,"_setTextAttrs"),function(n){return n.textPlacement==="fo"?e:n.textPlacement==="old"?i:t}})(),zt=r(function(i){i.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function J(i,t){i.each(function(){var e=V(this),s=e.text().split(/(\s+|<br>)/).reverse(),n,l=[],p=1.1,y=e.attr("y"),u=parseFloat(e.attr("dy")),f=e.text(null).append("tspan").attr("x",0).attr("y",y).attr("dy",u+"em");for(let _=0;_<s.length;_++)n=s[s.length-1-_],l.push(n),f.text(l.join(" ").trim()),(f.node().getComputedTextLength()>t||n==="<br>")&&(l.pop(),f.text(l.join(" ").trim()),n==="<br>"?l=[""]:l=[n],f=e.append("tspan").attr("x",0).attr("y",y).attr("dy",p+"em").text(n))})}r(J,"wrap");var Dt=r(function(i,t,e,s){let n=e%Nt-1,l=i.append("g");t.section=n,l.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+n));let p=l.append("g"),y=l.append("g"),u=y.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(J,t.width).node().getBBox(),f=s.fontSize?.replace?s.fontSize.replace("px",""):s.fontSize;return t.height=u.height+f*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,y.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),Ft(p,t,n,s),t},"drawNode"),Ht=r(function(i,t,e){let s=i.append("g"),n=s.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(J,t.width).node().getBBox(),l=e.fontSize?.replace?e.fontSize.replace("px",""):e.fontSize;return s.remove(),n.height+l*1.1*.5+t.padding},"getVirtualNodeHeight"),Ft=r(function(i,t,e){i.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("d",`M0 ${t.height-5} v${-t.height+10} q0,-5 5,-5 h${t.width-10} q5,0 5,5 v${t.height-5} H0 Z`),i.append("line").attr("class","node-line-"+e).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),M={drawRect:U,drawCircle:Ct,drawSection:Lt,drawText:gt,drawLabel:Pt,drawTask:Ot,drawBackgroundRect:Mt,getTextObj:jt,getNoteRect:Z,initGraphics:zt,drawNode:Dt,getVirtualNodeHeight:Ht},Rt=r(function(i,t,e,s){let n=bt(),l=n.timeline?.leftMargin??50;S.debug("timeline",s.db);let p=n.securityLevel,y;p==="sandbox"&&(y=V("#i"+t));let u=(p==="sandbox"?V(y.nodes()[0].contentDocument.body):V("body")).select("#"+t);u.append("g");let f=s.db.getTasks(),_=s.db.getCommonDb().getDiagramTitle();S.debug("task",f),M.initGraphics(u);let b=s.db.getSections();S.debug("sections",b);let g=0,a=0,c=0,h=0,d=50+l,o=50;h=50;let m=0,k=!0;b.forEach(function(C){let v={number:m,descr:C,section:m,width:150,padding:20,maxHeight:g},N=M.getVirtualNodeHeight(u,v,n);S.debug("sectionHeight before draw",N),g=Math.max(g,N+20)});let I=0,P=0;S.debug("tasks.length",f.length);for(let[C,v]of f.entries()){let N={number:C,descr:v,section:v.section,width:150,padding:20,maxHeight:a},x=M.getVirtualNodeHeight(u,N,n);S.debug("taskHeight before draw",x),a=Math.max(a,x+20),I=Math.max(I,v.events.length);let $=0;for(let L of v.events){let F={descr:L,section:v.section,number:v.section,width:150,padding:20,maxHeight:50};$+=M.getVirtualNodeHeight(u,F,n)}v.events.length>0&&($+=(v.events.length-1)*10),P=Math.max(P,$)}S.debug("maxSectionHeight before draw",g),S.debug("maxTaskHeight before draw",a),b&&b.length>0?b.forEach(C=>{let v=f.filter(L=>L.section===C),N={number:m,descr:C,section:m,width:200*Math.max(v.length,1)-50,padding:20,maxHeight:g};S.debug("sectionNode",N);let x=u.append("g"),$=M.drawNode(x,N,m,n);S.debug("sectionNode output",$),x.attr("transform",`translate(${d}, ${h})`),o+=g+50,v.length>0&&at(u,v,m,d,o,a,n,I,P,g,!1),d+=200*Math.max(v.length,1),o=h,m++}):(k=!1,at(u,f,m,d,o,a,n,I,P,g,!0));let H=u.node().getBBox();S.debug("bounds",H),_&&u.append("text").text(_).attr("x",H.width/2-l).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),c=k?g+a+150:a+100,u.append("g").attr("class","lineWrapper").append("line").attr("x1",l).attr("y1",c).attr("x2",H.width+3*l).attr("y2",c).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),kt(void 0,u,n.timeline?.padding??50,n.timeline?.useMaxWidth??!1)},"draw"),at=r(function(i,t,e,s,n,l,p,y,u,f,_){for(let b of t){let g={descr:b.task,section:e,number:e,width:150,padding:20,maxHeight:l};S.debug("taskNode",g);let a=i.append("g").attr("class","taskWrapper"),c=M.drawNode(a,g,e,p).height;if(S.debug("taskHeight after draw",c),a.attr("transform",`translate(${s}, ${n})`),l=Math.max(l,c),b.events){let h=i.append("g").attr("class","lineWrapper"),d=l;n+=100,d=d+Wt(i,b.events,e,s,n,p),n-=100,h.append("line").attr("x1",s+190/2).attr("y1",n+l).attr("x2",s+190/2).attr("y2",n+l+100+u+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}s=s+200,_&&!p.timeline?.disableMulticolor&&e++}n=n-10},"drawTasks"),Wt=r(function(i,t,e,s,n,l){let p=0,y=n;n=n+100;for(let u of t){let f={descr:u,section:e,number:e,width:150,padding:20,maxHeight:50};S.debug("eventNode",f);let _=i.append("g").attr("class","eventWrapper"),b=M.drawNode(_,f,e,l).height;p=p+b,_.attr("transform",`translate(${s}, ${n})`),n=n+10+b}return n=y,p},"drawEvents"),Vt={setConf:r(()=>{},"setConf"),draw:Rt},Bt=r(i=>{let t="";for(let e=0;e<i.THEME_COLOR_LIMIT;e++)i["lineColor"+e]=i["lineColor"+e]||i["cScaleInv"+e],_t(i["lineColor"+e])?i["lineColor"+e]=vt(i["lineColor"+e],20):i["lineColor"+e]=wt(i["lineColor"+e],20);for(let e=0;e<i.THEME_COLOR_LIMIT;e++){let s=""+(17-3*e);t+=`
|
|
.section-${e-1} rect, .section-${e-1} path, .section-${e-1} circle, .section-${e-1} path {
|
|
fill: ${i["cScale"+e]};
|
|
}
|
|
.section-${e-1} text {
|
|
fill: ${i["cScaleLabel"+e]};
|
|
}
|
|
.node-icon-${e-1} {
|
|
font-size: 40px;
|
|
color: ${i["cScaleLabel"+e]};
|
|
}
|
|
.section-edge-${e-1}{
|
|
stroke: ${i["cScale"+e]};
|
|
}
|
|
.edge-depth-${e-1}{
|
|
stroke-width: ${s};
|
|
}
|
|
.section-${e-1} line {
|
|
stroke: ${i["cScaleInv"+e]} ;
|
|
stroke-width: 3;
|
|
}
|
|
|
|
.lineWrapper line{
|
|
stroke: ${i["cScaleLabel"+e]} ;
|
|
}
|
|
|
|
.disabled, .disabled circle, .disabled text {
|
|
fill: lightgray;
|
|
}
|
|
.disabled text {
|
|
fill: #efefef;
|
|
}
|
|
`}return t},"genSections"),Ut=r(i=>`
|
|
.edge {
|
|
stroke-width: 3;
|
|
}
|
|
${Bt(i)}
|
|
.section-root rect, .section-root path, .section-root circle {
|
|
fill: ${i.git0};
|
|
}
|
|
.section-root text {
|
|
fill: ${i.gitBranchLabel0};
|
|
}
|
|
.icon-container {
|
|
height:100%;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
.edge {
|
|
fill: none;
|
|
}
|
|
.eventWrapper {
|
|
filter: brightness(120%);
|
|
}
|
|
`,"getStyles"),Gt=Ut,Qt={db:rt,renderer:Vt,parser:Tt,styles:Gt};export{Qt as diagram};
|