| 6 | `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:s(function(){var a=this.next();return a||this.lex()},"lex"),begin:s(function(a){this.conditionStack.push(a)},"begin"),popState:s(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:s(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:s(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:s(function(a){this.begin(a)},"pushState"),stateStackSize:s(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:s(function(a,c,u,y){var o=y;switch(u){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;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.begin("acc_descr"),14;break;case 10:return this.popState(),"acc_descr_value";break;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 m})();p.lexer=k;function v(){this.yy={}}return s(v,"Parser"),v.prototype=p,p.Parser=v,new v})();X.parser=X;var Nt=X,gt={};it(gt,{addEvent:()=>wt,addSection:()=>kt,addTask:()=>_t,addTaskOrg:()=>St,clear:()=>xt,default:()=>Lt,getCommonDb:()=>mt,getSections:()=>bt,getTasks:()=>vt});var W="",ft=0,Y=[],G=[],B=[],mt=s(()=>ct,"getCommonDb"),xt=s(function(){Y.length=0,G.length=0,W="",B.length=0,ht()},"clear"),kt=s(function(n){W=n,Y.push(n)},"addSection"),bt=s(function(){return Y},"getSections"),vt=s(function(){let n=ut(),t=100,e=0;for(;!n&&e<t;)n=ut(),e++;return G.push(...B),G},"getTasks"),_t=s(function(n,t,e){let l={id:ft++,section:W,type:W,task:n,score:t||0,events:e?[e]:[]};B.push(l)},"addTask"),wt=s(function(n){B.find(e=>e.id===ft-1).events.push(n)},"addEvent"),St=s(function(n){let t={section:W,type:W,description:n,task:n,classes:[]};G.push(t)},"addTaskOrg"),ut=s(function(){let n=s(function(e){return B[e].processed},"compileTask"),t=!0;for(let[e,l]of B.entries())n(e),t=t&&l.processed;return t},"compileTasks"),Lt={clear:xt,getCommonDb:mt,addSection:kt,getSections:bt,getTasks:vt,addTask:_t,addTaskOrg:St,addEvent:wt},Mt=12,q=s(function(n,t){let e=n.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"),$t=s(function(n,t){let l=n.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),r=n.append("g");r.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"),r.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 d(f){let p=Q().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",p).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}s(d,"smile");function h(f){let p=Q().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",p).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}s(h,"sad");function g(f){f.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 s(g,"ambivalent"),t.score>3?d(r):t.score<3?h(r):g(r),l},"drawFace"),Ht=s(function(n,t){let e=n.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"),Et=s(function(n,t){let e=t.text.replace(/<br\s*\/?>/gi," "),l=n.append("text");l.attr("x",t.x),l.attr("y",t.y),l.attr("class","legend"),l.style("text-anchor",t.anchor),t.class!==void 0&&l.attr("class",t.class);let r=l.append("tspan");return r.attr("x",t.x+t.textMargin*2),r.text(e),l},"drawText"),Pt=s(function(n,t){function e(r,d,h,g,f){return r+","+d+" "+(r+h)+","+d+" "+(r+h)+","+(d+g-f)+" "+(r+h-f*1.2)+","+(d+g)+" "+r+","+(d+g)}s(e,"genPoints");let l=n.append("polygon");l.attr("points",e(t.x,t.y,50,20,7)),l.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,Et(n,t)},"drawLabel"),At=s(function(n,t,e){let l=n.append("g"),r=D();r.x=t.x,r.y=t.y,r.fill=t.fill,r.width=e.width,r.height=e.height,r.class="journey-section section-type-"+t.num,r.rx=3,r.ry=3,q(l,r),Tt(e)(t.text,l,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+t.num},e,t.colour)},"drawSection"),pt=-1,Ct=s(function(n,t,e){let l=t.x+e.width/2,r=n.append("g");pt++,r.append("line").attr("id","task"+pt).attr("x1",l).attr("y1",t.y).attr("x2",l).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),$t(r,{cx:l,cy:300+(5-t.score)*30,score:t.score});let h=D();h.x=t.x,h.y=t.y,h.fill=t.fill,h.width=e.width,h.height=e.height,h.class="task task-type-"+t.num,h.rx=3,h.ry=3,q(r,h),Tt(e)(t.task,r,h.x,h.y,h.width,h.height,{class:"task"},e,t.colour)},"drawTask"),Rt=s(function(n,t){q(n,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),Ft=s(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),D=s(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Tt=(function(){function n(r,d,h,g,f,p,k,v){let m=d.append("text").attr("x",h+f/2).attr("y",g+p/2+5).style("font-color",v).style("text-anchor","middle").text(r);l(m,k)}s(n,"byText");function t(r,d,h,g,f,p,k,v,m){let{taskFontSize:i,taskFontFamily:a}=v,c=r.split(/<br\s*\/?>/gi);for(let u=0;u<c.length;u++){let y=u*i-i*(c.length-1)/2,o=d.append("text").attr("x",h+f/2).attr("y",g).attr("fill",m).style("text-anchor","middle").style("font-size",i).style("font-family",a);o.append("tspan").attr("x",h+f/2).attr("dy",y).text(c[u]),o.attr("y",g+p/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),l(o,k)}}s(t,"byTspan");function e(r,d,h,g,f,p,k,v){let m=d.append("switch"),a=m.append("foreignObject").attr("x",h).attr("y",g).attr("width",f).attr("height",p).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(r),t(r,m,h,g,f,p,k,v),l(a,k)}s(e,"byFo");function l(r,d){for(let h in d)h in d&&r.attr(h,d[h])}return s(l,"_setTextAttrs"),function(r){return r.textPlacement==="fo"?e:r.textPlacement==="old"?n:t}})(),zt=s(function(n){n.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 tt(n,t){n.each(function(){var e=V(this),l=e.text().split(/(\s+|<br>)/).reverse(),r,d=[],h=1.1,g=e.attr("y"),f=parseFloat(e.attr("dy")),p=e.text(null).append("tspan").attr("x",0).attr("y",g).attr("dy",f+"em");for(let k=0;k<l.length;k++)r=l[l.length-1-k],d.push(r),p.text(d.join(" ").trim()),(p.node().getComputedTextLength()>t||r==="<br>")&&(d.pop(),p.text(d.join(" ").trim()),r==="<br>"?d=[""]:d=[r],p=e.append("tspan").attr("x",0).attr("y",g).attr("dy",h+"em").text(r))})}s(tt,"wrap");var Vt=s(function(n,t,e,l){let r=e%Mt-1,d=n.append("g");t.section=r,d.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+r));let h=d.append("g"),g=d.append("g"),p=g.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(tt,t.width).node().getBBox(),k=l.fontSize?.replace?l.fontSize.replace("px",""):l.fontSize;return t.height=p.height+k*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,g.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),Bt(h,t,r,l),t},"drawNode"),Wt=s(function(n,t,e){let l=n.append("g"),d=l.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(tt,t.width).node().getBBox(),h=e.fontSize?.replace?e.fontSize.replace("px",""):e.fontSize;return l.remove(),d.height+h*1.1*.5+t.padding},"getVirtualNodeHeight"),Bt=s(function(n,t,e){n.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`),n.append("line").attr("class","node-line-"+e).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),R={drawRect:q,drawCircle:Ht,drawSection:At,drawText:Et,drawLabel:Pt,drawTask:Ct,drawBackgroundRect:Rt,getTextObj:Ft,getNoteRect:D,initGraphics:zt,drawNode:Vt,getVirtualNodeHeight:Wt},Ot=s(function(n,t,e,l){let r=dt(),d=r.timeline?.leftMargin??50;S.debug("timeline",l.db);let h=r.securityLevel,g;h==="sandbox"&&(g=V("#i"+t));let p=(h==="sandbox"?V(g.nodes()[0].contentDocument.body):V("body")).select("#"+t);p.append("g");let k=l.db.getTasks(),v=l.db.getCommonDb().getDiagramTitle();S.debug("task",k),R.initGraphics(p);let m=l.db.getSections();S.debug("sections",m);let i=0,a=0,c=0,u=0,y=50+d,o=50;u=50;let E=0,b=!0;m.forEach(function(M){let _={number:E,descr:M,section:E,width:150,padding:20,maxHeight:i},x=R.getVirtualNodeHeight(p,_,r);S.debug("sectionHeight before draw",x),i=Math.max(i,x+20)});let L=0,P=0;S.debug("tasks.length",k.length);for(let[M,_]of k.entries()){let x={number:M,descr:_,section:_.section,width:150,padding:20,maxHeight:a},T=R.getVirtualNodeHeight(p,x,r);S.debug("taskHeight before draw",T),a=Math.max(a,T+20),L=Math.max(L,_.events.length);let $=0;for(let A of _.events){let U={descr:A,section:_.section,number:_.section,width:150,padding:20,maxHeight:50};$+=R.getVirtualNodeHeight(p,U,r)}_.events.length>0&&($+=(_.events.length-1)*10),P=Math.max(P,$)}S.debug("maxSectionHeight before draw",i),S.debug("maxTaskHeight before draw",a),m&&m.length>0?m.forEach(M=>{let _=k.filter(A=>A.section===M),x={number:E,descr:M,section:E,width:200*Math.max(_.length,1)-50,padding:20,maxHeight:i};S.debug("sectionNode",x);let T=p.append("g"),$=R.drawNode(T,x,E,r);S.debug("sectionNode output",$),T.attr("transform",`translate(${y}, ${u})`),o+=i+50,_.length>0&&yt(p,_,E,y,o,a,r,L,P,i,!1),y+=200*Math.max(_.length,1),o=u,E++}):(b=!1,yt(p,k,E,y,o,a,r,L,P,i,!0));let F=p.node().getBBox();S.debug("bounds",F),v&&p.append("text").text(v).attr("x",F.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),c=b?i+a+150:a+100,p.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",c).attr("x2",F.width+3*d).attr("y2",c).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),ot(void 0,p,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),yt=s(function(n,t,e,l,r,d,h,g,f,p,k){for(let v of t){let m={descr:v.task,section:e,number:e,width:150,padding:20,maxHeight:d};S.debug("taskNode",m);let i=n.append("g").attr("class","taskWrapper"),c=R.drawNode(i,m,e,h).height;if(S.debug("taskHeight after draw",c),i.attr("transform",`translate(${l}, ${r})`),d=Math.max(d,c),v.events){let u=n.append("g").attr("class","lineWrapper"),y=d;r+=100,y=y+jt(n,v.events,e,l,r,h),r-=100,u.append("line").attr("x1",l+190/2).attr("y1",r+d).attr("x2",l+190/2).attr("y2",r+d+100+f+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}l=l+200,k&&!h.timeline?.disableMulticolor&&e++}r=r-10},"drawTasks"),jt=s(function(n,t,e,l,r,d){let h=0,g=r;r=r+100;for(let f of t){let p={descr:f,section:e,number:e,width:150,padding:20,maxHeight:50};S.debug("eventNode",p);let k=n.append("g").attr("class","eventWrapper"),m=R.drawNode(k,p,e,d).height;h=h+m,k.attr("transform",`translate(${l}, ${r})`),r=r+10+m}return r=g,h},"drawEvents"),Gt={setConf:s(()=>{},"setConf"),draw:Ot},qt=s(n=>{let t="";for(let e=0;e<n.THEME_COLOR_LIMIT;e++)n["lineColor"+e]=n["lineColor"+e]||n["cScaleInv"+e],st(n["lineColor"+e])?n["lineColor"+e]=at(n["lineColor"+e],20):n["lineColor"+e]=lt(n["lineColor"+e],20);for(let e=0;e<n.THEME_COLOR_LIMIT;e++){let l=""+(17-3*e);t+=` |