ruru
Version:
Grafast-flavoured GraphiQL distribution
2 lines • 26.4 kB
JavaScript
export const __webpack_esm_id__=4513;export const __webpack_esm_ids__=[4513];export const __webpack_esm_modules__={22186(t,e,n){n.r(e),n.d(e,{getIconStyles:()=>i});var i=(0,n(60162).__name)(()=>"\n /* Font Awesome icon styling - consolidated */\n .label-icon {\n display: inline-block;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n }\n \n .node .label-icon path {\n fill: currentColor;\n stroke: revert;\n stroke-width: revert;\n }\n","getIconStyles")},73140(t,e,n){n.r(e),n.d(e,{drawBackgroundRect:()=>o,drawEmbeddedImage:()=>h,drawImage:()=>c,drawRect:()=>s,drawText:()=>l,getNoteRect:()=>u,getTextObj:()=>y});var i=n(54141),a=n(60162),r=n(8041),s=(0,a.__name)((t,e)=>{const n=t.append("rect");if(n.attr("x",e.x),n.attr("y",e.y),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("width",e.width),n.attr("height",e.height),e.name&&n.attr("name",e.name),e.rx&&n.attr("rx",e.rx),e.ry&&n.attr("ry",e.ry),void 0!==e.attrs)for(const t in e.attrs)n.attr(t,e.attrs[t]);return e.class&&n.attr("class",e.class),n},"drawRect"),o=(0,a.__name)((t,e)=>{const n={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};s(t,n).lower()},"drawBackgroundRect"),l=(0,a.__name)((t,e)=>{const n=e.text.replace(i.lineBreakRegex," "),a=t.append("text");a.attr("x",e.x),a.attr("y",e.y),a.attr("class","legend"),a.style("text-anchor",e.anchor),e.class&&a.attr("class",e.class);const r=a.append("tspan");return r.attr("x",e.x+2*e.textMargin),r.text(n),a},"drawText"),c=(0,a.__name)((t,e,n,i)=>{const a=t.append("image");a.attr("x",e),a.attr("y",n);const s=(0,r.sanitizeUrl)(i);a.attr("xlink:href",s)},"drawImage"),h=(0,a.__name)((t,e,n,i)=>{const a=t.append("use");a.attr("x",e),a.attr("y",n);const s=(0,r.sanitizeUrl)(i);a.attr("xlink:href",`#${s}`)},"drawEmbeddedImage"),u=(0,a.__name)(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),y=(0,a.__name)(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj")},74513(t,e,n){n.r(e),n.d(e,{diagram:()=>G});var i=n(73140),a=n(22186),r=n(54141),s=n(60162),o=n(79806),l=function(){var t=(0,s.__name)(function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},"o"),e=[6,8,10,11,12,14,16,17,18],n=[1,9],i=[1,10],a=[1,11],r=[1,12],o=[1,13],l=[1,14],c={trace:(0,s.__name)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey: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,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",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",18:"taskName",19:"taskData"},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,2]],performAction:(0,s.__name)(function(t,e,n,i,a,r,s){var o=r.length-1;switch(a){case 1:return r[o-1];case 2:case 6:case 7:this.$=[];break;case 3:r[o-1].push(r[o]),this.$=r[o-1];break;case 4:case 5:this.$=r[o];break;case 8:i.setDiagramTitle(r[o].substr(6)),this.$=r[o].substr(6);break;case 9:this.$=r[o].trim(),i.setAccTitle(this.$);break;case 10:case 11:this.$=r[o].trim(),i.setAccDescription(this.$);break;case 12:i.addSection(r[o].substr(8)),this.$=r[o].substr(8);break;case 13:i.addTask(r[o-1],r[o]),this.$="task"}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:n,12:i,14:a,16:r,17:o,18:l},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:n,12:i,14:a,16:r,17:o,18:l},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:(0,s.__name)(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:(0,s.__name)(function(t){var e=this,n=[0],i=[],a=[null],r=[],o=this.table,l="",c=0,h=0,u=0,y=r.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(p.yy[_]=this.yy[_]);d.setInput(t,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;r.push(g);var m=d.options&&d.options.ranges;function f(){var t;return"number"!=typeof(t=i.pop()||d.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,s.__name)(function(t){n.length=n.length-2*t,a.length=a.length-t,r.length=r.length-t},"popStack"),(0,s.__name)(f,"lex");for(var x,k,b,w,v,$,T,M,S,C={};;){if(b=n[n.length-1],this.defaultActions[b]?w=this.defaultActions[b]:(null==x&&(x=f()),w=o[b]&&o[b][x]),void 0===w||!w.length||!w[0]){var E;for($ in S=[],o[b])this.terminals_[$]&&$>2&&S.push("'"+this.terminals_[$]+"'");E=d.showPosition?"Parse error on line "+(c+1)+":\n"+d.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(E,{text:d.match,token:this.terminals_[x]||x,line:d.yylineno,loc:g,expected:S})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+x);switch(w[0]){case 1:n.push(x),a.push(d.yytext),r.push(d.yylloc),n.push(w[1]),x=null,k?(x=k,k=null):(h=d.yyleng,l=d.yytext,c=d.yylineno,g=d.yylloc,u>0&&u--);break;case 2:if(T=this.productions_[w[1]][1],C.$=a[a.length-T],C._$={first_line:r[r.length-(T||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(T||1)].first_column,last_column:r[r.length-1].last_column},m&&(C._$.range=[r[r.length-(T||1)].range[0],r[r.length-1].range[1]]),void 0!==(v=this.performAction.apply(C,[l,h,c,p.yy,w[1],a,r].concat(y))))return v;T&&(n=n.slice(0,-1*T*2),a=a.slice(0,-1*T),r=r.slice(0,-1*T)),n.push(this.productions_[w[1]][0]),a.push(C.$),r.push(C._$),M=o[n[n.length-2]][n[n.length-1]],n.push(M);break;case 3:return!0}}return!0},"parse")},h=function(){return{EOF:1,parseError:(0,s.__name)(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:(0,s.__name)(function(t,e){return this.yy=e||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:(0,s.__name)(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.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),t},"input"),unput:(0,s.__name)(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),n.length-1&&(this.yylineno-=n.length-1);var a=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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:(0,s.__name)(function(){return this._more=!0,this},"more"),reject:(0,s.__name)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,s.__name)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,s.__name)(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:(0,s.__name)(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:(0,s.__name)(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,s.__name)(function(t,e){var n,i,a;if(this.options.backtrack_lexer&&(a={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&&(a.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in a)this[r]=a[r];return!1}return!1},"test_match"),next:(0,s.__name)(function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var a=this._currentRules(),r=0;r<a.length;r++)if((n=this._input.match(this.rules[a[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,a[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,s.__name)(function(){return this.next()||this.lex()},"lex"),begin:(0,s.__name)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,s.__name)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,s.__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:(0,s.__name)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,s.__name)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,s.__name)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,s.__name)(function(t,e,n,i){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;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 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\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,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/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,19],inclusive:!0}}}}();function u(){this.yy={}}return c.lexer=h,(0,s.__name)(u,"Parser"),u.prototype=c,c.Parser=u,new u}();l.parser=l;var c=l,h="",u=[],y=[],d=[],p=(0,s.__name)(function(){u.length=0,y.length=0,h="",d.length=0,(0,r.clear)()},"clear"),_=(0,s.__name)(function(t){h=t,u.push(t)},"addSection"),g=(0,s.__name)(function(){return u},"getSections"),m=(0,s.__name)(function(){let t=b(),e=0;for(;!t&&e<100;)t=b(),e++;return y.push(...d),y},"getTasks"),f=(0,s.__name)(function(){const t=[];return y.forEach(e=>{e.people&&t.push(...e.people)}),[...new Set(t)].sort()},"updateActors"),x=(0,s.__name)(function(t,e){const n=e.substr(1).split(":");let i=0,a=[];1===n.length?(i=Number(n[0]),a=[]):(i=Number(n[0]),a=n[1].split(","));const r=a.map(t=>t.trim()),s={section:h,type:h,people:r,task:t,score:i};d.push(s)},"addTask"),k=(0,s.__name)(function(t){const e={section:h,type:h,description:t,task:t,classes:[]};y.push(e)},"addTaskOrg"),b=(0,s.__name)(function(){const t=(0,s.__name)(function(t){return d[t].processed},"compileTask");let e=!0;for(const[n,i]of d.entries())t(n),e=e&&i.processed;return e},"compileTasks"),w=(0,s.__name)(function(){return f()},"getActors"),v={getConfig:(0,s.__name)(()=>(0,r.getConfig2)().journey,"getConfig"),clear:p,setDiagramTitle:r.setDiagramTitle,getDiagramTitle:r.getDiagramTitle,setAccTitle:r.setAccTitle,getAccTitle:r.getAccTitle,setAccDescription:r.setAccDescription,getAccDescription:r.getAccDescription,addSection:_,getSections:g,getTasks:m,addTask:x,addTaskOrg:k,getActors:w},$=(0,s.__name)(t=>`.label {\n font-family: ${t.fontFamily};\n color: ${t.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${t.textColor}\n }\n\n .legend {\n fill: ${t.textColor};\n font-family: ${t.fontFamily};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${t.textColor}\n }\n\n .face {\n ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${t.fontFamily};\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${t.fillType0?`fill: ${t.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${t.fillType0?`fill: ${t.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${t.fillType0?`fill: ${t.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${t.fillType0?`fill: ${t.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${t.fillType0?`fill: ${t.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${t.fillType0?`fill: ${t.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${t.fillType0?`fill: ${t.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${t.fillType0?`fill: ${t.fillType7}`:""};\n }\n\n .actor-0 {\n ${t.actor0?`fill: ${t.actor0}`:""};\n }\n .actor-1 {\n ${t.actor1?`fill: ${t.actor1}`:""};\n }\n .actor-2 {\n ${t.actor2?`fill: ${t.actor2}`:""};\n }\n .actor-3 {\n ${t.actor3?`fill: ${t.actor3}`:""};\n }\n .actor-4 {\n ${t.actor4?`fill: ${t.actor4}`:""};\n }\n .actor-5 {\n ${t.actor5?`fill: ${t.actor5}`:""};\n }\n ${(0,a.getIconStyles)()}\n`,"getStyles"),T=(0,s.__name)(function(t,e){return(0,i.drawRect)(t,e)},"drawRect"),M=(0,s.__name)(function(t,e){const n=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");function a(t){const n=(0,o.arc)().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",n).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function r(t){const n=(0,o.arc)().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",n).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function l(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return i.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),(0,s.__name)(a,"smile"),(0,s.__name)(r,"sad"),(0,s.__name)(l,"ambivalent"),e.score>3?a(i):e.score<3?r(i):l(i),n},"drawFace"),S=(0,s.__name)(function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n},"drawCircle"),C=(0,s.__name)(function(t,e){return(0,i.drawText)(t,e)},"drawText"),E=(0,s.__name)(function(t,e){function n(t,e,n,i,a){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+i-a)+" "+(t+n-1.2*a)+","+(e+i)+" "+t+","+(e+i)}(0,s.__name)(n,"genPoints");const i=t.append("polygon");i.attr("points",n(e.x,e.y,50,20,7)),i.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,C(t,e)},"drawLabel"),I=(0,s.__name)(function(t,e,n){const a=t.append("g"),r=(0,i.getNoteRect)();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=n.width*e.taskCount+n.diagramMarginX*(e.taskCount-1),r.height=n.height,r.class="journey-section section-type-"+e.num,r.rx=3,r.ry=3,T(a,r),R(n)(e.text,a,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+e.num},n,e.colour)},"drawSection"),A=-1,P=(0,s.__name)(function(t,e,n){const a=e.x+n.width/2,r=t.append("g");A++,r.append("line").attr("id","task"+A).attr("x1",a).attr("y1",e.y).attr("x2",a).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),M(r,{cx:a,cy:300+30*(5-e.score),score:e.score});const s=(0,i.getNoteRect)();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=n.width,s.height=n.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,T(r,s);let o=e.x+14;e.people.forEach(t=>{const n=e.actors[t].color,i={cx:o,cy:e.y,r:7,fill:n,stroke:"#000",title:t,pos:e.actors[t].position};S(r,i),o+=10}),R(n)(e.task,r,s.x,s.y,s.width,s.height,{class:"task"},n,e.colour)},"drawTask"),j=(0,s.__name)(function(t,e){(0,i.drawBackgroundRect)(t,e)},"drawBackgroundRect"),R=function(){function t(t,e,n,a,r,s,o,l){i(e.append("text").attr("x",n+r/2).attr("y",a+s/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,n,a,r,s,o,l,c){const{taskFontSize:h,taskFontFamily:u}=l,y=t.split(/<br\s*\/?>/gi);for(let t=0;t<y.length;t++){const l=t*h-h*(y.length-1)/2,d=e.append("text").attr("x",n+r/2).attr("y",a).attr("fill",c).style("text-anchor","middle").style("font-size",h).style("font-family",u);d.append("tspan").attr("x",n+r/2).attr("dy",l).text(y[t]),d.attr("y",a+s/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(d,o)}}function n(t,n,a,r,s,o,l,c){const h=n.append("switch"),u=h.append("foreignObject").attr("x",a).attr("y",r).attr("width",s).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,a,r,s,o,l,c),i(u,l)}function i(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return(0,s.__name)(t,"byText"),(0,s.__name)(e,"byTspan"),(0,s.__name)(n,"byFo"),(0,s.__name)(i,"_setTextAttrs"),function(i){return"fo"===i.textPlacement?n:"old"===i.textPlacement?t:e}}(),B={drawRect:T,drawCircle:S,drawSection:I,drawText:C,drawLabel:E,drawTask:P,drawBackgroundRect:j,initGraphics:(0,s.__name)(function(t){t.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")},F=(0,s.__name)(function(t){Object.keys(t).forEach(function(e){L[e]=t[e]})},"setConf"),V={},D=0;function O(t){const e=(0,r.getConfig2)().journey,n=e.maxLabelWidth;D=0;let i=60;Object.keys(V).forEach(a=>{const r=V[a].color,s={cx:20,cy:i,r:7,fill:r,stroke:"#000",pos:V[a].position};B.drawCircle(t,s);let o=t.append("text").attr("visibility","hidden").text(a);const l=o.node().getBoundingClientRect().width;o.remove();let c=[];if(l<=n)c=[a];else{const e=a.split(" ");let i="";o=t.append("text").attr("visibility","hidden"),e.forEach(t=>{const e=i?`${i} ${t}`:t;if(o.text(e),o.node().getBoundingClientRect().width>n){if(i&&c.push(i),i=t,o.text(t),o.node().getBoundingClientRect().width>n){let e="";for(const i of t)e+=i,o.text(e+"-"),o.node().getBoundingClientRect().width>n&&(c.push(e.slice(0,-1)+"-"),e=i);i=e}}else i=e}),i&&c.push(i),o.remove()}c.forEach((n,a)=>{const r={x:40,y:i+7+20*a,fill:"#666",text:n,textMargin:e.boxTextMargin??5},s=B.drawText(t,r).node().getBoundingClientRect().width;s>D&&s>e.leftMargin-s&&(D=s)}),i+=Math.max(20,20*c.length)})}(0,s.__name)(O,"drawActorLegend");var L=(0,r.getConfig2)().journey,N=0,z=(0,s.__name)(function(t,e,n,i){const a=(0,r.getConfig2)(),s=a.journey.titleColor,l=a.journey.titleFontSize,c=a.journey.titleFontFamily,h=a.securityLevel;let u;"sandbox"===h&&(u=(0,o.select)("#i"+e));const y="sandbox"===h?(0,o.select)(u.nodes()[0].contentDocument.body):(0,o.select)("body");Y.init();const d=y.select("#"+e);B.initGraphics(d);const p=i.db.getTasks(),_=i.db.getDiagramTitle(),g=i.db.getActors();for(const t in V)delete V[t];let m=0;g.forEach(t=>{V[t]={color:L.actorColours[m%L.actorColours.length],position:m},m++}),O(d),N=L.leftMargin+D,Y.insert(0,0,N,50*Object.keys(V).length),U(d,p,0);const f=Y.getBounds();_&&d.append("text").text(_).attr("x",N).attr("font-size",l).attr("font-weight","bold").attr("y",25).attr("fill",s).attr("font-family",c);const x=f.stopy-f.starty+2*L.diagramMarginY,k=N+f.stopx+2*L.diagramMarginX;(0,r.configureSvgSize)(d,x,k,L.useMaxWidth),d.append("line").attr("x1",N).attr("y1",4*L.height).attr("x2",k-N-4).attr("y2",4*L.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const b=_?70:0;d.attr("viewBox",`${f.startx} -25 ${k} ${x+b}`),d.attr("preserveAspectRatio","xMinYMin meet"),d.attr("height",x+b+25)},"draw"),Y={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:(0,s.__name)(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:(0,s.__name)(function(t,e,n,i){void 0===t[e]?t[e]=n:t[e]=i(n,t[e])},"updateVal"),updateBounds:(0,s.__name)(function(t,e,n,i){const a=(0,r.getConfig2)().journey,o=this;let l=0;function c(r){return(0,s.__name)(function(s){l++;const c=o.sequenceItems.length-l+1;o.updateVal(s,"starty",e-c*a.boxMargin,Math.min),o.updateVal(s,"stopy",i+c*a.boxMargin,Math.max),o.updateVal(Y.data,"startx",t-c*a.boxMargin,Math.min),o.updateVal(Y.data,"stopx",n+c*a.boxMargin,Math.max),"activation"!==r&&(o.updateVal(s,"startx",t-c*a.boxMargin,Math.min),o.updateVal(s,"stopx",n+c*a.boxMargin,Math.max),o.updateVal(Y.data,"starty",e-c*a.boxMargin,Math.min),o.updateVal(Y.data,"stopy",i+c*a.boxMargin,Math.max))},"updateItemBounds")}(0,s.__name)(c,"updateFn"),this.sequenceItems.forEach(c())},"updateBounds"),insert:(0,s.__name)(function(t,e,n,i){const a=Math.min(t,n),r=Math.max(t,n),s=Math.min(e,i),o=Math.max(e,i);this.updateVal(Y.data,"startx",a,Math.min),this.updateVal(Y.data,"starty",s,Math.min),this.updateVal(Y.data,"stopx",r,Math.max),this.updateVal(Y.data,"stopy",o,Math.max),this.updateBounds(a,s,r,o)},"insert"),bumpVerticalPos:(0,s.__name)(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:(0,s.__name)(function(){return this.verticalPos},"getVerticalPos"),getBounds:(0,s.__name)(function(){return this.data},"getBounds")},W=L.sectionFills,q=L.sectionColours,U=(0,s.__name)(function(t,e,n){const i=(0,r.getConfig2)().journey;let a="";const s=n+(2*i.height+i.diagramMarginY);let o=0,l="#CCC",c="black",h=0;for(const[n,r]of e.entries()){if(a!==r.section){l=W[o%W.length],h=o%W.length,c=q[o%q.length];let s=0;const u=r.section;for(let t=n;t<e.length&&e[t].section==u;t++)s+=1;const y={x:n*i.taskMargin+n*i.width+N,y:50,text:r.section,fill:l,num:h,colour:c,taskCount:s};B.drawSection(t,y,i),a=r.section,o++}const u=r.people.reduce((t,e)=>(V[e]&&(t[e]=V[e]),t),{});r.x=n*i.taskMargin+n*i.width+N,r.y=s,r.width=i.diagramMarginX,r.height=i.diagramMarginY,r.colour=c,r.fill=l,r.num=h,r.actors=u,B.drawTask(t,r,i),Y.insert(r.x,r.y,r.x+r.width+i.taskMargin,450)}},"drawTasks"),X={setConf:F,draw:z},G={parser:c,db:v,renderer:X,styles:$,init:(0,s.__name)(t=>{X.setConf(t.journey),v.clear()},"init")}}};
//# sourceMappingURL=4513.js.map