From d9c498b3a522890f96f46978a834134fba6dd0de Mon Sep 17 00:00:00 2001 From: welpo Date: Mon, 16 Sep 2024 20:46:26 +0200 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20chore(deps):=20upgrade=20m?= =?UTF-8?q?ermaid=20to=20v11.2.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changelog: https://github.com/mermaid-js/mermaid/releases/tag/mermaid%4011.2.1 Source: https://cdn.jsdelivr.net/npm/mermaid@11.2.1/dist/mermaid.min.js --- static/js/mermaid.min.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/js/mermaid.min.js b/static/js/mermaid.min.js index d64c2c5..cd4d959 100644 --- a/static/js/mermaid.min.js +++ b/static/js/mermaid.min.js @@ -391,8 +391,8 @@ Please report this to https://github.com/markedjs/marked.`,r)return e="

An err `).replace(/\n{2,}/g,` `)),!1===e?t.replace(/ /g," "):t}function MC(t,e={}){let r=IC(t,e),n=Y_.lexer(r),i=[[]],a=0;function o(e,r="normal"){"text"===e.type?e.text.split(` `).forEach((t,e)=>{0!==e&&(a++,i.push([])),t.split(" ").forEach(t=>{t&&i[a].push({content:t,type:r})})}):"strong"===e.type||"em"===e.type?e.tokens.forEach(t=>{o(t,e.type)}):"html"===e.type&&i[a].push({content:e.text,type:"normal"})}return Ae(o,"processNode"),n.forEach(t=>{"paragraph"===t.type?t.tokens?.forEach(t=>{o(t)}):"html"===t.type&&i[a].push({content:t.text,type:"normal"})}),i}function RC(t,{markdownAutoWrap:e}={}){function r(t){return"text"===t.type?!1===e?t.text.replace(/\n */g,"
").replace(/ /g," "):t.text.replace(/\n */g,"
"):"strong"===t.type?`${t.tokens?.map(r).join("")}`:"em"===t.type?`${t.tokens?.map(r).join("")}`:"paragraph"===t.type?`

${t.tokens?.map(r).join("")}

`:"space"===t.type?"":"html"===t.type?""+t.text:"Unsupported markdown: "+t.type}return t=Y_.lexer(t),Ae(r,"output"),t.map(r).join("")}var DC=t(()=>{NC(),Gr(),Ae(IC,"preprocessMarkdown"),Ae(MC,"markdownToLines"),Ae(RC,"markdownToHTML")});function OC(t){return Intl.Segmenter?[...(new Intl.Segmenter).segment(t)].map(t=>t.segment):[...t]}function PC(t,e){return BC(t,[],OC(e.content),e.type)}function BC(t,e,r,n){var i,a,o;return 0===r.length?[{content:e.join(""),type:n},{content:"",type:n}]:([i,...a]=r,t([{content:(o=[...e,i]).join(""),type:n}])?BC(t,o,a,n):(0===e.length&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}]))}function FC(t,e){if(t.some(({content:t})=>t.includes(` -`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return $C(t,e)}function $C(t,e,r=[],n=[]){if(0===t.length)return 0{Ae(OC,"splitTextToChars"),Ae(PC,"splitWordToFitWidth"),Ae(BC,"splitWordToFitWidthRecursion"),Ae(FC,"splitLineToFitWidth"),Ae($C,"splitLineToFitWidthRecursion")});function GC(t,e){e&&t.attr("style",e)}async function UC(t,e,r,n,i=!1){let a=t.append("foreignObject"),o=a.append("xhtml:div"),s=e.label;e.label&&ql(e.label)&&(s=await jl(e.label.replace(L.lineBreakRegex,` -`),D()));var t=e.isNode?"nodeLabel":"edgeLabel",l=o.append("span");return l.html(s),GC(l,e.labelStyle),l.attr("class",t+" "+n),GC(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),o.style("max-width",r+"px"),o.style("text-align","center"),o.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&o.attr("class","labelBkg"),(l=o.node().getBoundingClientRect()).width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),l=o.node().getBoundingClientRect()),a.node()}function qC(t,e,r){return t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em")}function YC(t,e,r){return WC(e=qC(t=t.append("text"),1,e),r),r=e.node().getComputedTextLength(),t.remove(),r}function jC(t,e,r){return WC(e=qC(t=t.append("text"),1,e),[{content:r,type:"normal"}]),(r=e.node()?.getBoundingClientRect())&&t.remove(),r}function HC(e,t,r,n=!1){let i=t.append("g"),a=i.insert("rect").attr("class","background").attr("style","stroke: none"),o=i.append("text").attr("y","-10.1"),s=0;for(var l of r){var c,h=Ae(t=>YC(i,1.1,t)<=e,"checkWidth");for(c of h(l)?[l]:FC(l,h))WC(qC(o,s,1.1),c),s++}return(n?(t=o.node().getBBox(),a.attr("x",-2).attr("y",-2).attr("width",t.width+4).attr("height",t.height+4),i):o).node()}function WC(n,t){n.text(""),t.forEach((t,e)=>{var r=n.append("tspan").attr("font-style","em"===t.type?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight","strong"===t.type?"bold":"normal");0===e?r.text(t.content):r.text(" "+t.content)})}function VC(t){return t.replace(/fa[bklrs]?:fa-[\w-]+/g,t=>``)}var XC,KC=t(()=>{i(),tc(),Q3(),e(),DC(),K8(),zC(),Ae(GC,"applyStyle"),Ae(UC,"addHtmlSpan"),Ae(qC,"createTspan"),Ae(YC,"computeWidthOfText"),Ae(jC,"computeDimensionOfText"),Ae(HC,"createFormattedText"),Ae(WC,"updateTextContentAndStyles"),Ae(VC,"replaceIconSubstring"),XC=Ae(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,isNode:o=!0,width:s=200,addSvgBackground:l=!1}={},c)=>(R.info("XYZ createText",e,r,n,i,a,o,"addSvgBackground: ",l),a?(n=RC(e,c),a=VC(V8(n)),n=e.replace(/\\\\/g,"\\"),UC(t,{isNode:o,label:ql(e)?n:a,labelStyle:r.replace("fill:","color:")},s,i,l)):(n=HC(s,t,MC(e.replace(//g,"
").replace("
","
"),c),!!e&&l),o?(a=(r=/stroke:/.exec(r)?r.replace("stroke:","lineColor:"):r).replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:"),O(n).attr("style",a)):(i=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:"),O(n).select("rect").attr("style",i.replace(/background:/g,"fill:")),s=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:"),O(n).select("text").attr("style",s)),n)),"createText")});function ZC(t,e){e&&t.attr("style",e)}function QC(t){var e=O(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=e.append("xhtml:div"),n=t.label,i=t.isNode?"nodeLabel":"edgeLabel",a=r.append("span");return a.html(n),ZC(a,t.labelStyle),a.attr("class",i),ZC(r,t.labelStyle),r.style("display","inline-block"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}var JC,tS,eS=t(()=>{Q3(),e(),i(),tc(),K8(),KC(),Ae(ZC,"applyStyle"),Ae(QC,"addHtmlLabel"),JC=Ae((t,e,r,n)=>{let i=t||"";if("object"==typeof i&&(i=i[0]),Dl(D().flowchart.htmlLabels))return i=i.replace(/\\n|\n/g,"
"),R.debug("vertexText"+i),QC({isNode:n,label:VC(V8(i)),labelStyle:e.replace("fill:","color:")});var a,o=document.createElementNS("http://www.w3.org/2000/svg","text");o.setAttribute("style",e.replace("color:","fill:"));for(a of"string"==typeof i?i.split(/\\n|\n|/gi):Array.isArray(i)?i:[]){var s=document.createElementNS("http://www.w3.org/2000/svg","tspan");s.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),s.setAttribute("dy","1em"),s.setAttribute("x","0"),r?s.setAttribute("class","title-row"):s.setAttribute("class","row"),s.textContent=a.trim(),o.appendChild(s)}return o},"createLabel"),tS=JC});function rS(t,e){return t.intersect(e)}var nS,iS=t(()=>{Ae(rS,"intersectNode"),nS=rS});function aS(t,e,r,n){var i=t.x,t=t.y,a=i-n.x,o=t-n.y,s=Math.sqrt(e*e*o*o+r*r*a*a),a=Math.abs(e*r*a/s),e=(n.x{Ae(aS,"intersectEllipse"),oS=aS});function lS(t,e,r){return oS(t,e,e,r)}var cS,hS=t(()=>{sS(),Ae(lS,"intersectCircle"),cS=lS});function uS(t,e,r,n){var i,a,o,s,l=e.y-t.y,c=t.x-e.x,h=e.x*t.y-t.x*e.y,u=l*r.x+c*r.y+h,d=l*n.x+c*n.y+h;if(!(0!=u&&0!=d&&0{Ae(uS,"intersectLine"),Ae(dS,"sameSign"),pS=uS});function fS(t,e,n){var r=t.x,i=t.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach(function(t){o=Math.min(o,t.x),s=Math.min(s,t.y)}):(o=Math.min(o,e.x),s=Math.min(s,e.y));for(var l=r-t.width/2-o,c=i-t.height/2-s,h=0;h{gS(),Ae(mS=fS,"intersectPolygon")}),wS=t(()=>{yS=Ae((t,e)=>{var r,n=t.x,i=t.y,a=e.x-n,e=e.y-i,o=t.width/2,t=t.height/2,t=Math.abs(e)*o>Math.abs(a)*t?(e<0&&(t=-t),r=0==e?0:t*a/e,t):(r=o=a<0?-o:o,0==a?0:o*e/a);return{x:n+r,y:i+t}},"intersectRect"),vS=yS}),kS=t(()=>{iS(),hS(),sS(),bS(),wS(),xS={node:nS,circle:cS,ellipse:oS,polygon:mS,rect:vS}});function TS(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}var ES,_S,CS,SS,AS=t(()=>{eS(),KC(),i(),Q3(),tc(),K8(),ES=Ae(async(t,e,r,i)=>{let a=D(),n,o=e.useHtmlLabels||Dl(a.flowchart.htmlLabels),s=(n=r||"node default",t.insert("g").attr("class",n).attr("id",e.domId||e.id)),l=s.insert("g").attr("class","label").attr("style",e.labelStyle),c,h=(c=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0],l.node()),u,d=(u="markdown"===e.labelType?XC(l,Sl(V8(c),a),{useHtmlLabels:o,width:e.width||a.flowchart.wrappingWidth,classes:"markdown-node-label"},a):h.appendChild(tS(Sl(V8(c),a),e.labelStyle,!1,i))).getBBox(),p=e.padding/2;if(Dl(a.flowchart.htmlLabels)){if(r=u.children[0],t=O(u),i=r.getElementsByTagName("img")){let n=""===c.replace(/]*>/g,"").trim();await Promise.all([...i].map(r=>new Promise(e=>{function t(){var t;r.style.display="flex",r.style.flexDirection="column",n?(t=a.fontSize||window.getComputedStyle(document.body).fontSize,t=5*parseInt(t,10)+"px",r.style.minWidth=t,r.style.maxWidth=t):r.style.width="100%",e(r)}Ae(t,"setupImage"),setTimeout(()=>{r.complete&&t()}),r.addEventListener("error",t),r.addEventListener("load",t)})))}d=r.getBoundingClientRect(),t.attr("width",d.width),t.attr("height",d.height)}return o?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:p,label:l}},"labelHelper"),_S=Ae((t,e)=>{e=e.node().getBBox(),t.width=e.width,t.height=e.height},"updateNodeBounds"),Ae(TS,"insertPolygonShape")}),LS=t(()=>{AS(),e(),i(),kS(),CS=Ae(async(t,e)=>{e.useHtmlLabels||D().flowchart.htmlLabels||(e.centerLabel=!0);var{shapeSvg:t,bbox:r,halfPadding:n}=await ES(t,e,"node "+e.classes,!0),i=(R.info("Classes = ",e.classes),t.insert("rect",":first-child"));return i.attr("rx",e.rx).attr("ry",e.ry).attr("x",-r.width/2-n).attr("y",-r.height/2-n).attr("width",r.width+e.padding).attr("height",r.height+e.padding),_S(e,i),e.intersect=function(t){return xS.rect(e,t)},t},"note"),SS=CS});function NS(t,e,r,n){let i=[],a=Ae(t=>{i.push(t,0)},"addBorder"),o=Ae(t=>{i.push(0,t)},"skipBorder");(e.includes("t")?(R.debug("add top border"),a):o)(r),(e.includes("r")?(R.debug("add right border"),a):o)(n),(e.includes("b")?(R.debug("add bottom border"),a):o)(r),(e.includes("l")?(R.debug("add left border"),a):o)(n),t.attr("stroke-dasharray",i.join(" "))}var IS,MS,RS,DS,OS,PS,BS,FS,$S,zS,GS,US,qS,YS,jS,HS,WS,VS,XS,KS,ZS,QS,JS,tA,eA,rA,nA,iA,aA,oA,sA,lA,cA,hA=t(()=>{Q3(),i(),tc(),e(),M_(),eS(),kS(),LS(),AS(),IS=Ae(t=>t?" "+t:"","formatClass"),MS=Ae((t,e)=>`${e||"node default"}${IS(t.classes)} `+IS(t.class),"getClassesFromNode"),RS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=i+a,s=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}];return R.info("Question main (Circle)"),(t=TS(r,o,o,s)).attr("style",e.style),_S(e,t),e.intersect=function(t){return R.warn("Intersect called"),xS.polygon(e,s,t)},r},"question"),DS=Ae((t,e)=>((t=t.insert("g").attr("class","node default").attr("id",e.domId||e.id)).insert("polygon",":first-child").attr("points",[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}].map(function(t){return t.x+","+t.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(t){return xS.circle(e,14,t)},t),"choice"),OS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e,void 0),!0),i=n.height+e.padding,a=i/4,o=n.width+2*a+e.padding,s=[{x:a,y:0},{x:o-a,y:0},{x:o,y:-i/2},{x:o-a,y:-i},{x:a,y:-i},{x:0,y:-i/2}],l=TS(r,o,i,s);return l.attr("style",e.style),_S(e,l),e.intersect=function(t){return xS.polygon(e,s,t)},r},"hexagon"),PS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,void 0,!0),i=n.height+2*e.padding,a=i/2,o=n.width+2*a+e.padding,s=N_(e.directions,n,e),l=TS(r,o,i,s);return l.attr("style",e.style),_S(e,l),e.intersect=function(t){return xS.polygon(e,s,t)},r},"block_arrow"),BS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return TS(r,i,a,o).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(t){return xS.polygon(e,o,t)},r},"rect_left_inv_arrow"),FS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],s=TS(r,i,a,o);return s.attr("style",e.style),_S(e,s),e.intersect=function(t){return xS.polygon(e,o,t)},r},"lean_right"),$S=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],s=TS(r,i,a,o);return s.attr("style",e.style),_S(e,s),e.intersect=function(t){return xS.polygon(e,o,t)},r},"lean_left"),zS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],s=TS(r,i,a,o);return s.attr("style",e.style),_S(e,s),e.intersect=function(t){return xS.polygon(e,o,t)},r},"trapezoid"),GS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],s=TS(r,i,a,o);return s.attr("style",e.style),_S(e,s),e.intersect=function(t){return xS.polygon(e,o,t)},r},"inv_trapezoid"),US=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],s=TS(r,i,a,o);return s.attr("style",e.style),_S(e,s),e.intersect=function(t){return xS.polygon(e,o,t)},r},"rect_right_inv_arrow"),qS=Ae(async(t,i)=>{let{shapeSvg:e,bbox:r}=await ES(t,i,MS(i,void 0),!0),n=r.width+i.padding,a=n/2,o=a/(2.5+n/50),s=r.height+o+i.padding,l="M 0,"+o+" a "+a+","+o+" 0,0,0 "+n+" 0 a "+a+","+o+" 0,0,0 "+-n+" 0 l 0,"+s+" a "+a+","+o+" 0,0,0 "+n+" 0 l 0,"+-s,c=e.attr("label-offset-y",o).insert("path",":first-child").attr("style",i.style).attr("d",l).attr("transform","translate("+-n/2+","+-(s/2+o)+")");return _S(i,c),i.intersect=function(e){var r=xS.rect(i,e),n=r.x-i.x;if(0!=a&&(Math.abs(n)i.height/2-o)){let t=o*o*(1-n*n/(a*a));0!=t&&(t=Math.sqrt(t)),t=o-t,0{var{shapeSvg:t,bbox:r,halfPadding:n}=await ES(t,e,"node "+e.classes+" "+e.class,!0),i=t.insert("rect",":first-child"),a=e.positioned?e.width:r.width+e.padding,o=e.positioned?e.height:r.height+e.padding,s=e.positioned?-a/2:-r.width/2-n,r=e.positioned?-o/2:-r.height/2-n;return i.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",s).attr("y",r).attr("width",a).attr("height",o),e.props&&(n=new Set(Object.keys(e.props)),e.props.borders&&(NS(i,e.props.borders,a,o),n.delete("borders")),n.forEach(t=>{R.warn("Unknown node property "+t)})),_S(e,i),e.intersect=function(t){return xS.rect(e,t)},t},"rect"),jS=Ae(async(t,e)=>{var{shapeSvg:t,bbox:r,halfPadding:n}=await ES(t,e,"node "+e.classes,!0),i=t.insert("rect",":first-child"),a=e.positioned?e.width:r.width+e.padding,o=e.positioned?e.height:r.height+e.padding,s=e.positioned?-a/2:-r.width/2-n,r=e.positioned?-o/2:-r.height/2-n;return i.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",s).attr("y",r).attr("width",a).attr("height",o),e.props&&(n=new Set(Object.keys(e.props)),e.props.borders&&(NS(i,e.props.borders,a,o),n.delete("borders")),n.forEach(t=>{R.warn("Unknown node property "+t)})),_S(e,i),e.intersect=function(t){return xS.rect(e,t)},t},"composite"),HS=Ae(async(t,e)=>{var r,t=(await ES(t,e,"label",!0)).shapeSvg,n=(R.trace("Classes = ",e.class),t.insert("rect",":first-child"));return n.attr("width",0).attr("height",0),t.attr("class","label edgeLabel"),e.props&&(r=new Set(Object.keys(e.props)),e.props.borders&&(NS(n,e.props.borders,0,0),r.delete("borders")),r.forEach(t=>{R.warn("Unknown node property "+t)})),_S(e,n),e.intersect=function(t){return xS.rect(e,t)},t},"labelRect"),Ae(NS,"applyNodePropertyBorders"),WS=Ae((t,e)=>{let r,n=(r=e.classes?"node "+e.classes:"node default",t.insert("g").attr("class",r).attr("id",e.domId||e.id)),i=n.insert("rect",":first-child"),a=n.insert("line"),o=n.insert("g").attr("class","label"),s=e.labelText.flat?e.labelText.flat():e.labelText,l,c=(l="object"==typeof s?s[0]:s,R.info("Label text abc79",l,s,"object"==typeof s),o.node().appendChild(tS(l,e.labelStyle,!0,!0))),h={width:0,height:0};Dl(D().flowchart.htmlLabels)&&(t=c.children[0],d=O(c),h=t.getBoundingClientRect(),d.attr("width",h.width),d.attr("height",h.height)),R.info("Text 2",s);var u,t=s.slice(1,s.length),d=c.getBBox(),t=o.node().appendChild(tS(t.join?t.join("
"):t,e.labelStyle,!0,!0)),p=(Dl(D().flowchart.htmlLabels)&&(p=t.children[0],u=O(t),h=p.getBoundingClientRect(),u.attr("width",h.width),u.attr("height",h.height)),e.padding/2);return O(t).attr("transform","translate( "+(h.width>d.width?0:(d.width-h.width)/2)+", "+(d.height+p+5)+")"),O(c).attr("transform","translate( "+(h.width{var{shapeSvg:t,bbox:r}=await ES(t,e,MS(e,void 0),!0),n=r.height+e.padding,r=r.width+n/4+e.padding,r=t.insert("rect",":first-child").attr("style",e.style).attr("rx",n/2).attr("ry",n/2).attr("x",-r/2).attr("y",-n/2).attr("width",r).attr("height",n);return _S(e,r),e.intersect=function(t){return xS.rect(e,t)},t},"stadium"),XS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n,halfPadding:i}=await ES(t,e,MS(e,void 0),!0),a=r.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),R.info("Circle main"),_S(e,a),e.intersect=function(t){return R.info("Circle intersect",e,n.width/2+i,t),xS.circle(e,n.width/2+i,t)},r},"circle"),KS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n,halfPadding:i}=await ES(t,e,MS(e,void 0),!0),a=r.insert("g",":first-child"),o=a.insert("circle"),s=a.insert("circle");return a.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+5).attr("width",n.width+e.padding+10).attr("height",n.height+e.padding+10),s.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),R.info("DoubleCircle main"),_S(e,o),e.intersect=function(t){return R.info("DoubleCircle intersect",e,n.width/2+i+5,t),xS.circle(e,n.width/2+i+5,t)},r},"doublecircle"),ZS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],s=TS(r,i,a,o);return s.attr("style",e.style),_S(e,s),e.intersect=function(t){return xS.polygon(e,o,t)},r},"subroutine"),QS=Ae((t,e)=>{var r=(t=t.insert("g").attr("class","node default").attr("id",e.domId||e.id)).insert("circle",":first-child");return r.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),_S(e,r),e.intersect=function(t){return xS.circle(e,7,t)},t},"start"),JS=Ae((t,e,r)=>{let n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),i=70,a=10;return"LR"===r&&(i=10,a=70),t=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join"),_S(e,t),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return xS.rect(e,t)},n},"forkJoin"),tA=Ae((t,e)=>{var r=(t=t.insert("g").attr("class","node default").attr("id",e.domId||e.id)).insert("circle",":first-child"),n=t.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),r.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),_S(e,n),e.intersect=function(t){return xS.circle(e,7,t)},t},"end"),eA=Ae((t,o)=>{let e=o.padding/2,r,n=(r=o.classes?"node "+o.classes:"node default",t.insert("g").attr("class",r).attr("id",o.domId||o.id)),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("line"),l=0,c=4,h=n.insert("g").attr("class","label"),u=0,d=o.classData.annotations?.[0],p=o.classData.annotations[0]?"«"+o.classData.annotations[0]+"»":"",g=h.node().appendChild(tS(p,o.labelStyle,!0,!0)),f=g.getBBox(),m=(Dl(D().flowchart.htmlLabels)&&(t=g.children[0],y=O(g),f=t.getBoundingClientRect(),y.attr("width",f.width),y.attr("height",f.height)),o.classData.annotations[0]&&(c+=f.height+4,l+=f.width),o.classData.label);var y;void 0!==o.classData.type&&""!==o.classData.type&&(D().flowchart.htmlLabels?m+="<"+o.classData.type+">":m+="<"+o.classData.type+">"),O(t=h.node().appendChild(tS(m,o.labelStyle,!0,!0))).attr("class","classTitle");let v=t.getBBox(),x=(Dl(D().flowchart.htmlLabels)&&(y=t.children[0],w=O(t),v=y.getBoundingClientRect(),w.attr("width",v.width),w.attr("height",v.height)),c+=v.height+4,v.width>l&&(l=v.width),[]),b=(o.classData.members.forEach(t=>{let e=t.getDisplayDetails(),r=e.displayText,n=(D().flowchart.htmlLabels&&(r=r.replace(//g,">")),h.node().appendChild(tS(r,e.cssStyle||o.labelStyle,!0,!0))),i=n.getBBox();var a;Dl(D().flowchart.htmlLabels)&&(t=n.children[0],a=O(n),i=t.getBoundingClientRect(),a.attr("width",i.width),a.attr("height",i.height)),i.width>l&&(l=i.width),c+=i.height+4,x.push(n)}),c+=8,[]);o.classData.methods.forEach(t=>{let e=t.getDisplayDetails(),r=e.displayText,n=(D().flowchart.htmlLabels&&(r=r.replace(//g,">")),h.node().appendChild(tS(r,e.cssStyle||o.labelStyle,!0,!0))),i=n.getBBox();var a;Dl(D().flowchart.htmlLabels)&&(t=n.children[0],a=O(n),i=t.getBoundingClientRect(),a.attr("width",i.width),a.attr("height",i.height)),i.width>l&&(l=i.width),c+=i.height+4,b.push(n)}),c+=8,d&&(y=(l-f.width)/2,O(g).attr("transform","translate( "+(-1*l/2+y)+", "+-1*c/2+")"),u=f.height+4);var w=(l-v.width)/2;return O(t).attr("transform","translate( "+(-1*l/2+w)+", "+(-1*c/2+u)+")"),u+=v.height+4,a.attr("class","divider").attr("x1",-l/2-e).attr("x2",l/2+e).attr("y1",-c/2-e+8+u).attr("y2",-c/2-e+8+u),u+=8,x.forEach(t=>{O(t).attr("transform","translate( "+-l/2+", "+(-1*c/2+u+4)+")"),t=t?.getBBox(),u+=(t?.height??0)+4}),u+=8,s.attr("class","divider").attr("x1",-l/2-e).attr("x2",l/2+e).attr("y1",-c/2-e+8+u).attr("y2",-c/2-e+8+u),u+=8,b.forEach(t=>{O(t).attr("transform","translate( "+-l/2+", "+(-1*c/2+u)+")"),t=t?.getBBox(),u+=(t?.height??0)+4}),i.attr("style",o.style).attr("class","outer title-state").attr("x",-l/2-e).attr("y",-c/2-e).attr("width",l+o.padding).attr("height",c+o.padding),_S(o,i),o.intersect=function(t){return xS.rect(o,t)},n},"class_box"),rA={rhombus:RS,composite:jS,question:RS,rect:YS,labelRect:HS,rectWithTitle:WS,choice:DS,circle:XS,doublecircle:KS,stadium:VS,hexagon:OS,block_arrow:PS,rect_left_inv_arrow:BS,lean_right:FS,lean_left:$S,trapezoid:zS,inv_trapezoid:GS,rect_right_inv_arrow:US,cylinder:qS,start:QS,end:tA,note:SS,subroutine:ZS,fork:JS,join:JS,class_box:eA},nA={},iA=Ae(async(e,r,n)=>{let i,a;if(r.link){let t;"sandbox"===D().securityLevel?t="_top":r.linkTarget&&(t=r.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",r.link).attr("target",t),a=await rA[r.shape](i,r,n)}else a=await rA[r.shape](e,r,n),i=a;return r.tooltip&&a.attr("title",r.tooltip),r.class&&a.attr("class","node default "+r.class),nA[r.id]=i,r.haveCallback&&nA[r.id].attr("class",nA[r.id].attr("class")+" clickable"),i},"insertNode"),aA=Ae((t,e)=>{nA[e.id]=t},"setNodeElem"),oA=Ae(()=>{nA={}},"clear"),sA=Ae(t=>{var e=nA[t.id],r=(R.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")"),t.diff||0);return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r},"positionNode")}),uA=t(()=>{Q3(),hA(),lA=Ae((t,e)=>{let r;return"sandbox"===e&&(r=O("#i"+t)),O("sandbox"===e?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement")}),dA=t(()=>{cA=Ae(({flowchart:t})=>{var e=t?.subGraphTitleMargin?.top??0;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:t=t?.subGraphTitleMargin?.bottom??0,subGraphTitleTotalMargin:e+t}},"getSubGraphTitleMargins")});function pA(t,e,r){if(t&&t.length){var n,[i,a]=e,e=Math.PI/180*r,o=Math.cos(e),s=Math.sin(e);for(n of t){var[l,c]=n;n[0]=(l-i)*o-(c-a)*s+i,n[1]=(l-i)*s+(c-a)*o+a}}}function gA(t,e){return t[0]===e[0]&&t[1]===e[1]}function fA(t,r,n,e=1){var i=n,n=Math.max(r,.1),p=t[0]&&t[0][0]&&"number"==typeof t[0][0]?[t]:t,a=[0,0];if(i)for(var o of p)pA(o,a,i);if(r=function(e,i){var t,r=[];for(t of p){var n=[...t];gA(n[0],n[n.length-1])||n.push([n[0][0],n[0][1]]),2t.ymine.ymin?1:t.xe.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax)),s.length){let r=[],n=s[0].ymin,t=0;for(;r.length||s.length;){if(s.length){let e=-1;for(let t=0;tn);t++)e=t;s.splice(0,e+1).forEach(t=>{r.push({s:n,edge:t})})}if((r=r.filter(t=>!(t.edge.ymax<=n))).sort((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x)),(1!==i||t%e==0)&&1=r.length);t+=2){var u=r[t].edge,d=r[d].edge;o.push([[Math.round(u.x),n],[Math.round(d.x),n]])}n+=i,r.forEach(t=>{t.edge.x=t.edge.x+i*t.edge.islope}),t++}}return o}(n,e),i){for(var s of p)pA(s,a,-i);{t=a,n=-i;let e=[];r.forEach(t=>e.push(...t)),pA(e,t,n)}}return r}function mA(t,e){let r=e.hachureAngle+90,n=e.hachureGap,i=(n<0&&(n=4*e.strokeWidth),n=Math.round(Math.max(n,.1)),1);return 1<=e.roughness&&.7<((null==(e=e.randomizer)?void 0:e.next())||Math.random())&&(i=n),fA(t,n,r,i||1)}function yA(t){var e=t[0],t=t[1];return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))}function vA(t,e){return t.type===e}function xA(t){let n=[],i=function(t){for(var e=new Array;""!==t;){if(!t.match(/^([ \t\r\n,]+)/))if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:l9,text:RegExp.$1};else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:c9,text:""+parseFloat(RegExp.$1)}}t=t.substr(RegExp.$1.length)}return e[e.length]={type:h9,text:""},e}(t),a="BOD",o=0,s=i[o];for(;!vA(s,h9);){let e=0,r=[];if("BOD"===a){if("M"!==s.text&&"m"!==s.text)return xA("M0,0"+t);o++,e=u9[s.text],a=s.text}else vA(s,c9)?e=u9[a]:(o++,e=u9[s.text],a=s.text);if(!(o+ee%2?t+n:t+r);a.push({key:"C",data:l}),r=l[4],n=l[5];break;case"Q":a.push({key:"Q",data:[...s]}),r=s[2],n=s[3];break;case"q":l=s.map((t,e)=>e%2?t+n:t+r),a.push({key:"Q",data:l}),r=l[2],n=l[3];break;case"A":a.push({key:"A",data:[...s]}),r=s[5],n=s[6];break;case"a":r+=s[5],n+=s[6],a.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],r,n]});break;case"H":a.push({key:"H",data:[...s]}),r=s[0];break;case"h":r+=s[0],a.push({key:"H",data:[r]});break;case"V":a.push({key:"V",data:[...s]}),n=s[0];break;case"v":n+=s[0],a.push({key:"V",data:[n]});break;case"S":a.push({key:"S",data:[...s]}),r=s[2],n=s[3];break;case"s":var c=s.map((t,e)=>e%2?t+n:t+r);a.push({key:"S",data:c}),r=c[2],n=c[3];break;case"T":a.push({key:"T",data:[...s]}),r=s[0],n=s[1];break;case"t":r+=s[0],n+=s[1],a.push({key:"T",data:[r,n]});break;case"Z":case"z":a.push({key:"Z",data:[]}),r=e,n=i}return a}function wA(t){let i=[],a="",o=0,s=0,e=0,r=0,l=0,c=0;for(var{key:n,data:h}of t){switch(n){case"M":i.push({key:"M",data:[...h]}),[o,s]=h,[e,r]=h;break;case"C":i.push({key:"C",data:[...h]}),o=h[4],s=h[5],l=h[2],c=h[3];break;case"L":i.push({key:"L",data:[...h]}),[o,s]=h;break;case"H":o=h[0],i.push({key:"L",data:[o,s]});break;case"V":s=h[0],i.push({key:"L",data:[o,s]});break;case"S":{let t=0,e;e="C"===a||"S"===a?(t=o+(o-l),s+(s-c)):(t=o,s),i.push({key:"C",data:[t,e,...h]}),l=h[0],c=h[1],o=h[2],s=h[3];break}case"T":{let[t,e]=h,r=0,n;n="Q"===a||"T"===a?(r=o+(o-l),s+(s-c)):(r=o,s);var u=o+2*(r-o)/3,d=s+2*(n-s)/3,p=t+2*(r-t)/3,g=e+2*(n-e)/3;i.push({key:"C",data:[u,d,p,g,t,e]}),l=r,c=n,o=t,s=e;break}case"Q":var[u,d,p,g]=h,f=o+2*(u-o)/3,m=s+2*(d-s)/3;i.push({key:"C",data:[f,m,p+2*(u-p)/3,g+2*(d-g)/3,p,g]}),l=u,c=d,o=p,s=g;break;case"A":var f=Math.abs(h[0]),m=Math.abs(h[1]),y=h[2],v=h[3],x=h[4],b=h[5],w=h[6];0===f||0===m?(i.push({key:"C",data:[o,s,b,w,b,w]}),o=b,s=w):o===b&&s===w||(TA(o,s,b,w,f,m,y,v,x).forEach(function(t){i.push({key:"C",data:t})}),o=b,s=w);break;case"Z":i.push({key:"Z",data:[]}),o=e,s=r}a=n}return i}function kA(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function TA(t,e,r,n,i,a,o,s,l,c){var h=Math.PI*o/180;let u=[],d=0,p=0,g=0,f=0;c?[d,p,g,f]=c:([t,e]=kA(t,e,-h),[r,n]=kA(r,n,-h),1<(m=(y=(t-r)/2)*y/(i*i)+(v=(e-n)/2)*v/(a*a))&&(i*=m=Math.sqrt(m),a*=m),m=i*i,x=a*a,s=(s===l?-1:1)*Math.sqrt(Math.abs((m*x-m*v*v-x*y*y)/(m*v*v+x*y*y))),g=s*i*v/a+(t+r)/2,f=s*-a*y/i+(e+n)/2,d=Math.asin(parseFloat(((e-f)/a).toFixed(9))),p=Math.asin(parseFloat(((n-f)/a).toFixed(9))),tp&&(d-=2*Math.PI),!l&&p>d&&(p-=2*Math.PI));var m=p-d,y=(Math.abs(m)>120*Math.PI/180&&(x=p,v=r,s=n,p=l&&p>d?d+120*Math.PI/180*1:d+120*Math.PI/180*-1,u=TA(r=g+i*Math.cos(p),n=f+a*Math.sin(p),v,s,i,a,o,0,l,[p,x,g,f])),m=p-d,Math.cos(d)),v=Math.sin(d),s=Math.cos(p),o=Math.sin(p),x=4/3*i*(l=Math.tan(m/4)),i=[t,e],a=[t+x*v,e-(m=4/3*a*l)*y],l=[r+x*o,n-m*s],t=[r,n];if(a[0]=2*i[0]-a[0],a[1]=2*i[1]-a[1],c)return[a,l,t].concat(u);u=[a,l,t].concat(u);var b=[];for(let t=0;t2*Math.PI&&(c=0,h=2*Math.PI),i=2*Math.PI/l.curveStepCount,i=qA(a=Math.min(i/2,(h-c)/2),t,e,r,n,c,h,1,l),l.disableMultiStroke||(a=qA(a,t,e,r,n,c,h,1.5,l),i.push(...a)),o&&(s?i.push(...FA(t,e,t+r*Math.cos(c),e+n*Math.sin(c),l),...FA(t,e,t+r*Math.cos(h),e+n*Math.sin(h),l)):i.push({op:"lineTo",data:[t,e]},{op:"lineTo",data:[t+r*Math.cos(c),e+n*Math.sin(c)]})),{type:"path",ops:i}}function IA(t,e){let r=wA(bA(xA(t))),n=[],i=[0,0],a=[0,0];for(var{key:o,data:s}of r)switch(o){case"M":a=[s[0],s[1]],i=[s[0],s[1]];break;case"L":n.push(...FA(a[0],a[1],s[0],s[1],e)),a=[s[0],s[1]];break;case"C":var[l,c,h,u,d,p]=s;n.push(...YA(l,c,h,u,d,p,a,e)),a=[d,p];break;case"Z":n.push(...FA(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function MA(t,e){var r,n=[];for(r of t)if(r.length){var i=e.maxRandomnessOffset||0,a=r.length;if(2s?l/10:h)/2,d=.2+.2*OA(i),p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=BA(p,i,c),g=BA(g,i,c);var f=[],m=Ae(()=>BA(u,i,c),"M"),y=Ae(()=>BA(h,i,c),"k"),v=i.preserveVertices;return a&&f.push(o?{op:"move",data:[t+(v?0:m()),e+(v?0:m())]}:{op:"move",data:[t+(v?0:BA(h,i,c)),e+(v?0:BA(h,i,c))]}),f.push(o?{op:"bcurveTo",data:[p+t+(r-t)*d+m(),g+e+(n-e)*d+m(),p+t+2*(r-t)*d+m(),g+e+2*(n-e)*d+m(),r+(v?0:m()),n+(v?0:m())]}:{op:"bcurveTo",data:[p+t+(r-t)*d+y(),g+e+(n-e)*d+y(),p+t+2*(r-t)*d+y(),g+e+2*(n-e)*d+y(),r+(v?0:y()),n+(v?0:y())]}),f}function zA(e,r,n){if(!e.length)return[];var i=[];i.push([e[0][0]+BA(r,n),e[0][1]+BA(r,n)]),i.push([e[0][0]+BA(r,n),e[0][1]+BA(r,n)]);for(let t=1;tl&&(l=h,c=t)}return Math.sqrt(l)>t?(QA(e,r,c+1,t,a),QA(e,c,n,t,a)):(a.length||a.push(o),a.push(s)),a}function JA(e,r=.15,t){var n=[],i=(e.length-1)/3;for(let t=0;t{Ae(pA,"t"),Ae(gA,"e"),Ae(fA,"s"),Ae(mA,"n"),t9=class{static{Ae(this,"o")}constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){return t=mA(t,e),{type:"fillSketch",ops:this.renderLines(t,e)}}renderLines(t,e){var r,n=[];for(r of t)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],e));return n}},Ae(yA,"a"),e9=class extends t9{static{Ae(this,"h")}fillPolygons(t,e){let r=e.hachureGap;r<0&&(r=4*e.strokeWidth),r=Math.max(r,.1);var n,i,t=mA(t,Object.assign({},e,{hachureGap:r})),a=Math.PI/180*e.hachureAngle,o=[],s=.5*r*Math.cos(a),l=.5*r*Math.sin(a);for([n,i]of t)yA([n,i])&&o.push([[n[0]-s,n[1]+l],[...i]],[[n[0]+s,n[1]-l],[...i]]);return{type:"fillSketch",ops:this.renderLines(o,e)}}},r9=class extends t9{static{Ae(this,"r")}fillPolygons(t,e){var r=this._fillPolygons(t,e),e=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),t=this._fillPolygons(t,e);return r.ops=r.ops.concat(t.ops),r}},n9=class{static{Ae(this,"i")}constructor(t){this.helper=t}fillPolygons(t,e){return t=mA(t,e=Object.assign({},e,{hachureAngle:0})),this.dotsOnLines(t,e)}dotsOnLines(t,e){let r=[],n=e.hachureGap,i=(n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1),e.fillWeight);i<0&&(i=e.strokeWidth/2);var a,o=n/4;for(a of t){var s=yA(a),l=s/n,c=Math.ceil(l)-1,h=s-c*n,u=(a[0][0]+a[1][0])/2-n/4,d=Math.min(a[0][1],a[1][1]);for(let t=0;t{let e=yA(t),r=Math.floor(e/(h+u)),n=(e+u-r*(h+u))/2,i=t[0],a=t[1];i[0]>a[0]&&(i=t[1],a=t[0]);var o=Math.atan((a[1]-i[1])/(a[0]-i[0]));for(let t=0;t{let e=yA(t),r=Math.round(e/(2*c)),n=t[0],i=t[1];n[0]>i[0]&&(n=t[1],i=t[0]);var a=Math.atan((i[1]-n[1])/(i[0]-n[0]));for(let t=0;t2*Math.PI&&(l=0,c=2*Math.PI);var h=(c-l)/n.curveStepCount,u=[];for(let t=l;t<=c;t+=h)u.push([i+o*Math.cos(t),a+s*Math.sin(t)]);return u.push([i+o*Math.cos(c),a+s*Math.sin(c)]),u.push([i,a]),RA([u],n)}(t,e,r,i))),i.stroke!==p9&&a.push(o),this._d("arc",a,i)}curve(t,e){var r=this._o(e),e=[],n=SA(t,r);if(r.fill&&r.fill!==p9)if("solid"===r.fillStyle){var i=SA(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));e.push({type:"fillPath",ops:this._mergedShape(i.ops)})}else{var a,o=[];if((i=t).length)for(a of"number"==typeof i[0][0]?[i]:i)a.length<3?o.push(...a):3===a.length?o.push(...JA(HA([a[0],a[0],a[1],a[2]]),10,(1+r.roughness)/2)):o.push(...JA(HA(a),10,(1+r.roughness)/2));o.length&&e.push(RA([o],r))}return r.stroke!==p9&&e.push(n),this._d("curve",e,r)}polygon(t,e){var r=[],n=_A(t,!0,e=this._o(e));return e.fill&&("solid"===e.fillStyle?r.push(MA([t],e)):r.push(RA([t],e))),e.stroke!==p9&&r.push(n),this._d("polygon",r,e)}path(t,e){let r=this._o(e),n=[];var i,a,o,s;return t&&(t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," "),e=r.fill&&"transparent"!==r.fill&&r.fill!==p9,i=r.stroke!==p9,o=function(t,e){let r=wA(bA(xA(t))),n=[],i=[],a=[0,0],o=[],s=Ae(()=>{4<=o.length&&i.push(...JA(o,1)),o=[]},"i"),l=Ae(()=>{s(),i.length&&(n.push(i),i=[])},"c");for(var{key:c,data:h}of r)switch(c){case"M":l(),a=[h[0],h[1]],i.push(a);break;case"L":s(),i.push([h[0],h[1]]);break;case"C":var u;o.length||(u=i.length?i[i.length-1]:a,o.push([u[0],u[1]])),o.push([h[0],h[1]]),o.push([h[2],h[3]]),o.push([h[4],h[5]]);break;case"Z":s(),i.push([a[0],a[1]])}if(l(),!e)return n;var d,p=[];for(d of n){var g=ZA(d,e);g.length&&p.push(g)}return p}(t,(a=!!(r.simplification&&r.simplification<1))?4-4*(r.simplification||1):(1+r.roughness)/2),s=IA(t,r),e&&("solid"===r.fillStyle?1===o.length?(e=IA(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0})),n.push({type:"fillPath",ops:this._mergedShape(e.ops)})):n.push(MA(o,r)):n.push(RA(o,r))),i)&&(a?o.forEach(t=>{n.push(_A(t,!1,r))}):n.push(s)),this._d("path",n,r)}opsToPath(t,e){let r="";for(var n of t.ops){var i="number"==typeof e&&0<=e?n.data.map(t=>+t.toFixed(e)):n.data;switch(n.op){case"move":r+=`M${i[0]} ${i[1]} `;break;case"bcurveTo":r+=`C${i[0]} ${i[1]}, ${i[2]} ${i[3]}, ${i[4]} ${i[5]} `;break;case"lineTo":r+=`L${i[0]} ${i[1]} `}}return r.trim()}toPaths(t){var e,r=t.sets||[],n=t.options||this.defaultOptions,i=[];for(e of r){let t=null;switch(e.type){case"path":t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:p9};break;case"fillPath":t={d:this.opsToPath(e),stroke:p9,strokeWidth:0,fill:n.fill||p9};break;case"fillSketch":t=this.fillSketch(e,n)}t&&i.push(t)}return i}fillSketch(t,e){let r=e.fillWeight;return r<0&&(r=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||p9,strokeWidth:r,fill:p9}}_mergedShape(t){return t.filter((t,e)=>0===e||"move"!==t.op)}},f9=class{static{Ae(this,"st")}constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new g9(e)}draw(t){var e,r=t.sets||[],n=t.options||this.getDefaultOptions(),i=this.ctx,a=t.options.fixedDecimalPlaceDigits;for(e of r)switch(e.type){case"path":i.save(),i.strokeStyle="none"===n.stroke?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,e,a),i.restore();break;case"fillPath":i.save(),i.fillStyle=n.fill||"";var o="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(i,e,a,o),i.restore();break;case"fillSketch":this.fillSketch(i,e,n)}}fillSketch(t,e,r){let n=r.fillWeight;n<0&&(n=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=n,this._drawToContext(t,e,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,r,n="nonzero"){t.beginPath();for(var i of e.ops){var a="number"==typeof r&&0<=r?i.data.map(t=>+t.toFixed(r)):i.data;switch(i.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}"fillPath"===e.type?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,r,n,i){return t=this.gen.line(t,e,r,n,i),this.draw(t),t}rectangle(t,e,r,n,i){return t=this.gen.rectangle(t,e,r,n,i),this.draw(t),t}ellipse(t,e,r,n,i){return t=this.gen.ellipse(t,e,r,n,i),this.draw(t),t}circle(t,e,r,n){return t=this.gen.circle(t,e,r,n),this.draw(t),t}linearPath(t,e){return t=this.gen.linearPath(t,e),this.draw(t),t}polygon(t,e){return t=this.gen.polygon(t,e),this.draw(t),t}arc(t,e,r,n,i,a,o=!1,s){return t=this.gen.arc(t,e,r,n,i,a,o,s),this.draw(t),t}curve(t,e){return t=this.gen.curve(t,e),this.draw(t),t}path(t,e){return t=this.gen.path(t,e),this.draw(t),t}},m9="http://www.w3.org/2000/svg",y9=class{static{Ae(this,"ot")}constructor(t,e){this.svg=t,this.gen=new g9(e)}draw(e){var r,t=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(m9,"g"),o=e.options.fixedDecimalPlaceDigits;for(r of t){let t=null;switch(r.type){case"path":(t=i.createElementNS(m9,"path")).setAttribute("d",this.opsToPath(r,o)),t.setAttribute("stroke",n.stroke),t.setAttribute("stroke-width",n.strokeWidth+""),t.setAttribute("fill","none"),n.strokeLineDash&&t.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&t.setAttribute("stroke-dashoffset",""+n.strokeLineDashOffset);break;case"fillPath":(t=i.createElementNS(m9,"path")).setAttribute("d",this.opsToPath(r,o)),t.setAttribute("stroke","none"),t.setAttribute("stroke-width","0"),t.setAttribute("fill",n.fill||""),"curve"!==e.shape&&"polygon"!==e.shape||t.setAttribute("fill-rule","evenodd");break;case"fillSketch":t=this.fillSketch(i,r,n)}t&&a.appendChild(t)}return a}fillSketch(t,e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),(t=t.createElementNS(m9,"path")).setAttribute("d",this.opsToPath(e,r.fixedDecimalPlaceDigits)),t.setAttribute("stroke",r.fill||""),t.setAttribute("stroke-width",n+""),t.setAttribute("fill","none"),r.fillLineDash&&t.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&t.setAttribute("stroke-dashoffset",""+r.fillLineDashOffset),t}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,r,n,i){return t=this.gen.line(t,e,r,n,i),this.draw(t)}rectangle(t,e,r,n,i){return t=this.gen.rectangle(t,e,r,n,i),this.draw(t)}ellipse(t,e,r,n,i){return t=this.gen.ellipse(t,e,r,n,i),this.draw(t)}circle(t,e,r,n){return t=this.gen.circle(t,e,r,n),this.draw(t)}linearPath(t,e){return t=this.gen.linearPath(t,e),this.draw(t)}polygon(t,e){return t=this.gen.polygon(t,e),this.draw(t)}arc(t,e,r,n,i,a,o=!1,s){return t=this.gen.arc(t,e,r,n,i,a,o,s),this.draw(t)}curve(t,e){return t=this.gen.curve(t,e),this.draw(t)}path(t,e){return t=this.gen.path(t,e),this.draw(t)}},v9={canvas:Ae((t,e)=>new f9(t,e),"canvas"),svg:Ae((t,e)=>new y9(t,e),"svg"),generator:Ae(t=>new g9(t),"generator"),newSeed:Ae(()=>g9.newSeed(),"newSeed")}}),k9=t(()=>{x9=Ae((t,e)=>{var r,n=t.x,i=t.y,a=e.x-n,e=e.y-i,o=t.width/2,t=t.height/2,t=Math.abs(e)*o>Math.abs(a)*t?(e<0&&(t=-t),r=0==e?0:t*a/e,t):(r=o=a<0?-o:o,0==a?0:o*e/a);return{x:n+r,y:i+t}},"intersectRect"),b9=x9});function T9(t,e){e&&t.attr("style",e)}async function E9(t){let e=O(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=e.append("xhtml:div"),n=t.label;t.label&&ql(t.label)&&(n=await jl(t.label.replace(L.lineBreakRegex,` +`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return $C(t,e)}function $C(t,e,r=[],n=[]){if(0===t.length)return 0{Ae(OC,"splitTextToChars"),Ae(PC,"splitWordToFitWidth"),Ae(BC,"splitWordToFitWidthRecursion"),Ae(FC,"splitLineToFitWidth"),Ae($C,"splitLineToFitWidthRecursion")});function GC(t,e){e&&t.attr("style",e)}async function UC(t,e,r,n,i=!1){(t=t.append("foreignObject")).attr("width",10*r+"px"),t.attr("height",10*r+"px");let a=t.append("xhtml:div"),o=e.label;e.label&&ql(e.label)&&(o=await jl(e.label.replace(L.lineBreakRegex,` +`),D()));var s=e.isNode?"nodeLabel":"edgeLabel",l=a.append("span");return l.html(o),GC(l,e.labelStyle),l.attr("class",s+" "+n),GC(a,e.labelStyle),a.style("display","table-cell"),a.style("white-space","nowrap"),a.style("line-height","1.5"),a.style("max-width",r+"px"),a.style("text-align","center"),a.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&a.attr("class","labelBkg"),(l=a.node().getBoundingClientRect()).width===r&&(a.style("display","table"),a.style("white-space","break-spaces"),a.style("width",r+"px"),l=a.node().getBoundingClientRect()),t.node()}function qC(t,e,r){return t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em")}function YC(t,e,r){return WC(e=qC(t=t.append("text"),1,e),r),r=e.node().getComputedTextLength(),t.remove(),r}function jC(t,e,r){return WC(e=qC(t=t.append("text"),1,e),[{content:r,type:"normal"}]),(r=e.node()?.getBoundingClientRect())&&t.remove(),r}function HC(e,t,r,n=!1){let i=t.append("g"),a=i.insert("rect").attr("class","background").attr("style","stroke: none"),o=i.append("text").attr("y","-10.1"),s=0;for(var l of r){var c,h=Ae(t=>YC(i,1.1,t)<=e,"checkWidth");for(c of h(l)?[l]:FC(l,h))WC(qC(o,s,1.1),c),s++}return(n?(t=o.node().getBBox(),a.attr("x",-2).attr("y",-2).attr("width",t.width+4).attr("height",t.height+4),i):o).node()}function WC(n,t){n.text(""),t.forEach((t,e)=>{var r=n.append("tspan").attr("font-style","em"===t.type?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight","strong"===t.type?"bold":"normal");0===e?r.text(t.content):r.text(" "+t.content)})}function VC(t){return t.replace(/fa[bklrs]?:fa-[\w-]+/g,t=>``)}var XC,KC=t(()=>{i(),tc(),Q3(),e(),DC(),K8(),zC(),Ae(GC,"applyStyle"),Ae(UC,"addHtmlSpan"),Ae(qC,"createTspan"),Ae(YC,"computeWidthOfText"),Ae(jC,"computeDimensionOfText"),Ae(HC,"createFormattedText"),Ae(WC,"updateTextContentAndStyles"),Ae(VC,"replaceIconSubstring"),XC=Ae(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,isNode:o=!0,width:s=200,addSvgBackground:l=!1}={},c)=>(R.debug("XYZ createText",e,r,n,i,a,o,"addSvgBackground: ",l),a?(n=RC(e,c),a=VC(V8(n)),n=e.replace(/\\\\/g,"\\"),UC(t,{isNode:o,label:ql(e)?n:a,labelStyle:r.replace("fill:","color:")},s,i,l)):(n=HC(s,t,MC(e.replace(//g,"
").replace("
","
"),c),!!e&&l),o?(a=(r=/stroke:/.exec(r)?r.replace("stroke:","lineColor:"):r).replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:"),O(n).attr("style",a)):(i=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:"),O(n).select("rect").attr("style",i.replace(/background:/g,"fill:")),s=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:"),O(n).select("text").attr("style",s)),n)),"createText")});function ZC(t,e){e&&t.attr("style",e)}function QC(t){var e=O(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=e.append("xhtml:div"),n=t.label,i=t.isNode?"nodeLabel":"edgeLabel",a=r.append("span");return a.html(n),ZC(a,t.labelStyle),a.attr("class",i),ZC(r,t.labelStyle),r.style("display","inline-block"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}var JC,tS,eS=t(()=>{Q3(),e(),i(),tc(),K8(),KC(),Ae(ZC,"applyStyle"),Ae(QC,"addHtmlLabel"),JC=Ae((t,e,r,n)=>{let i=t||"";if("object"==typeof i&&(i=i[0]),Dl(D().flowchart.htmlLabels))return i=i.replace(/\\n|\n/g,"
"),R.debug("vertexText"+i),QC({isNode:n,label:VC(V8(i)),labelStyle:e.replace("fill:","color:")});var a,o=document.createElementNS("http://www.w3.org/2000/svg","text");o.setAttribute("style",e.replace("color:","fill:"));for(a of"string"==typeof i?i.split(/\\n|\n|/gi):Array.isArray(i)?i:[]){var s=document.createElementNS("http://www.w3.org/2000/svg","tspan");s.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),s.setAttribute("dy","1em"),s.setAttribute("x","0"),r?s.setAttribute("class","title-row"):s.setAttribute("class","row"),s.textContent=a.trim(),o.appendChild(s)}return o},"createLabel"),tS=JC});function rS(t,e){return t.intersect(e)}var nS,iS=t(()=>{Ae(rS,"intersectNode"),nS=rS});function aS(t,e,r,n){var i=t.x,t=t.y,a=i-n.x,o=t-n.y,s=Math.sqrt(e*e*o*o+r*r*a*a),a=Math.abs(e*r*a/s),e=(n.x{Ae(aS,"intersectEllipse"),oS=aS});function lS(t,e,r){return oS(t,e,e,r)}var cS,hS=t(()=>{sS(),Ae(lS,"intersectCircle"),cS=lS});function uS(t,e,r,n){var i,a,o,s,l=e.y-t.y,c=t.x-e.x,h=e.x*t.y-t.x*e.y,u=l*r.x+c*r.y+h,d=l*n.x+c*n.y+h;if(!(0!=u&&0!=d&&0{Ae(uS,"intersectLine"),Ae(dS,"sameSign"),pS=uS});function fS(t,e,n){var r=t.x,i=t.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach(function(t){o=Math.min(o,t.x),s=Math.min(s,t.y)}):(o=Math.min(o,e.x),s=Math.min(s,e.y));for(var l=r-t.width/2-o,c=i-t.height/2-s,h=0;h{gS(),Ae(mS=fS,"intersectPolygon")}),wS=t(()=>{yS=Ae((t,e)=>{var r,n=t.x,i=t.y,a=e.x-n,e=e.y-i,o=t.width/2,t=t.height/2,t=Math.abs(e)*o>Math.abs(a)*t?(e<0&&(t=-t),r=0==e?0:t*a/e,t):(r=o=a<0?-o:o,0==a?0:o*e/a);return{x:n+r,y:i+t}},"intersectRect"),vS=yS}),kS=t(()=>{iS(),hS(),sS(),bS(),wS(),xS={node:nS,circle:cS,ellipse:oS,polygon:mS,rect:vS}});function TS(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}var ES,_S,CS,SS,AS=t(()=>{eS(),KC(),i(),Q3(),tc(),K8(),ES=Ae(async(t,e,r,i)=>{let a=D(),n,o=e.useHtmlLabels||Dl(a.flowchart.htmlLabels),s=(n=r||"node default",t.insert("g").attr("class",n).attr("id",e.domId||e.id)),l=s.insert("g").attr("class","label").attr("style",e.labelStyle),c,h=(c=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0],l.node()),u,d=(u="markdown"===e.labelType?XC(l,Sl(V8(c),a),{useHtmlLabels:o,width:e.width||a.flowchart.wrappingWidth,classes:"markdown-node-label"},a):h.appendChild(tS(Sl(V8(c),a),e.labelStyle,!1,i))).getBBox(),p=e.padding/2;if(Dl(a.flowchart.htmlLabels)){if(r=u.children[0],t=O(u),i=r.getElementsByTagName("img")){let n=""===c.replace(/]*>/g,"").trim();await Promise.all([...i].map(r=>new Promise(e=>{function t(){var t;r.style.display="flex",r.style.flexDirection="column",n?(t=a.fontSize||window.getComputedStyle(document.body).fontSize,t=5*parseInt(t,10)+"px",r.style.minWidth=t,r.style.maxWidth=t):r.style.width="100%",e(r)}Ae(t,"setupImage"),setTimeout(()=>{r.complete&&t()}),r.addEventListener("error",t),r.addEventListener("load",t)})))}d=r.getBoundingClientRect(),t.attr("width",d.width),t.attr("height",d.height)}return o?l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):l.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&l.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),l.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:p,label:l}},"labelHelper"),_S=Ae((t,e)=>{e=e.node().getBBox(),t.width=e.width,t.height=e.height},"updateNodeBounds"),Ae(TS,"insertPolygonShape")}),LS=t(()=>{AS(),e(),i(),kS(),CS=Ae(async(t,e)=>{e.useHtmlLabels||D().flowchart.htmlLabels||(e.centerLabel=!0);var{shapeSvg:t,bbox:r,halfPadding:n}=await ES(t,e,"node "+e.classes,!0),i=(R.info("Classes = ",e.classes),t.insert("rect",":first-child"));return i.attr("rx",e.rx).attr("ry",e.ry).attr("x",-r.width/2-n).attr("y",-r.height/2-n).attr("width",r.width+e.padding).attr("height",r.height+e.padding),_S(e,i),e.intersect=function(t){return xS.rect(e,t)},t},"note"),SS=CS});function NS(t,e,r,n){let i=[],a=Ae(t=>{i.push(t,0)},"addBorder"),o=Ae(t=>{i.push(0,t)},"skipBorder");(e.includes("t")?(R.debug("add top border"),a):o)(r),(e.includes("r")?(R.debug("add right border"),a):o)(n),(e.includes("b")?(R.debug("add bottom border"),a):o)(r),(e.includes("l")?(R.debug("add left border"),a):o)(n),t.attr("stroke-dasharray",i.join(" "))}var IS,MS,RS,DS,OS,PS,BS,FS,$S,zS,GS,US,qS,YS,jS,HS,WS,VS,XS,KS,ZS,QS,JS,tA,eA,rA,nA,iA,aA,oA,sA,lA,cA,hA=t(()=>{Q3(),i(),tc(),e(),M_(),eS(),kS(),LS(),AS(),IS=Ae(t=>t?" "+t:"","formatClass"),MS=Ae((t,e)=>`${e||"node default"}${IS(t.classes)} `+IS(t.class),"getClassesFromNode"),RS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=i+a,s=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}];return R.info("Question main (Circle)"),(t=TS(r,o,o,s)).attr("style",e.style),_S(e,t),e.intersect=function(t){return R.warn("Intersect called"),xS.polygon(e,s,t)},r},"question"),DS=Ae((t,e)=>((t=t.insert("g").attr("class","node default").attr("id",e.domId||e.id)).insert("polygon",":first-child").attr("points",[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}].map(function(t){return t.x+","+t.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(t){return xS.circle(e,14,t)},t),"choice"),OS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e,void 0),!0),i=n.height+e.padding,a=i/4,o=n.width+2*a+e.padding,s=[{x:a,y:0},{x:o-a,y:0},{x:o,y:-i/2},{x:o-a,y:-i},{x:a,y:-i},{x:0,y:-i/2}],l=TS(r,o,i,s);return l.attr("style",e.style),_S(e,l),e.intersect=function(t){return xS.polygon(e,s,t)},r},"hexagon"),PS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,void 0,!0),i=n.height+2*e.padding,a=i/2,o=n.width+2*a+e.padding,s=N_(e.directions,n,e),l=TS(r,o,i,s);return l.attr("style",e.style),_S(e,l),e.intersect=function(t){return xS.polygon(e,s,t)},r},"block_arrow"),BS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return TS(r,i,a,o).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(t){return xS.polygon(e,o,t)},r},"rect_left_inv_arrow"),FS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],s=TS(r,i,a,o);return s.attr("style",e.style),_S(e,s),e.intersect=function(t){return xS.polygon(e,o,t)},r},"lean_right"),$S=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],s=TS(r,i,a,o);return s.attr("style",e.style),_S(e,s),e.intersect=function(t){return xS.polygon(e,o,t)},r},"lean_left"),zS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],s=TS(r,i,a,o);return s.attr("style",e.style),_S(e,s),e.intersect=function(t){return xS.polygon(e,o,t)},r},"trapezoid"),GS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],s=TS(r,i,a,o);return s.attr("style",e.style),_S(e,s),e.intersect=function(t){return xS.polygon(e,o,t)},r},"inv_trapezoid"),US=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:0,y:0},{x:i+a/2,y:0},{x:i,y:-a/2},{x:i+a/2,y:-a},{x:0,y:-a}],s=TS(r,i,a,o);return s.attr("style",e.style),_S(e,s),e.intersect=function(t){return xS.polygon(e,o,t)},r},"rect_right_inv_arrow"),qS=Ae(async(t,i)=>{let{shapeSvg:e,bbox:r}=await ES(t,i,MS(i,void 0),!0),n=r.width+i.padding,a=n/2,o=a/(2.5+n/50),s=r.height+o+i.padding,l="M 0,"+o+" a "+a+","+o+" 0,0,0 "+n+" 0 a "+a+","+o+" 0,0,0 "+-n+" 0 l 0,"+s+" a "+a+","+o+" 0,0,0 "+n+" 0 l 0,"+-s,c=e.attr("label-offset-y",o).insert("path",":first-child").attr("style",i.style).attr("d",l).attr("transform","translate("+-n/2+","+-(s/2+o)+")");return _S(i,c),i.intersect=function(e){var r=xS.rect(i,e),n=r.x-i.x;if(0!=a&&(Math.abs(n)i.height/2-o)){let t=o*o*(1-n*n/(a*a));0!=t&&(t=Math.sqrt(t)),t=o-t,0{var{shapeSvg:t,bbox:r,halfPadding:n}=await ES(t,e,"node "+e.classes+" "+e.class,!0),i=t.insert("rect",":first-child"),a=e.positioned?e.width:r.width+e.padding,o=e.positioned?e.height:r.height+e.padding,s=e.positioned?-a/2:-r.width/2-n,r=e.positioned?-o/2:-r.height/2-n;return i.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",s).attr("y",r).attr("width",a).attr("height",o),e.props&&(n=new Set(Object.keys(e.props)),e.props.borders&&(NS(i,e.props.borders,a,o),n.delete("borders")),n.forEach(t=>{R.warn("Unknown node property "+t)})),_S(e,i),e.intersect=function(t){return xS.rect(e,t)},t},"rect"),jS=Ae(async(t,e)=>{var{shapeSvg:t,bbox:r,halfPadding:n}=await ES(t,e,"node "+e.classes,!0),i=t.insert("rect",":first-child"),a=e.positioned?e.width:r.width+e.padding,o=e.positioned?e.height:r.height+e.padding,s=e.positioned?-a/2:-r.width/2-n,r=e.positioned?-o/2:-r.height/2-n;return i.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",s).attr("y",r).attr("width",a).attr("height",o),e.props&&(n=new Set(Object.keys(e.props)),e.props.borders&&(NS(i,e.props.borders,a,o),n.delete("borders")),n.forEach(t=>{R.warn("Unknown node property "+t)})),_S(e,i),e.intersect=function(t){return xS.rect(e,t)},t},"composite"),HS=Ae(async(t,e)=>{var r,t=(await ES(t,e,"label",!0)).shapeSvg,n=(R.trace("Classes = ",e.class),t.insert("rect",":first-child"));return n.attr("width",0).attr("height",0),t.attr("class","label edgeLabel"),e.props&&(r=new Set(Object.keys(e.props)),e.props.borders&&(NS(n,e.props.borders,0,0),r.delete("borders")),r.forEach(t=>{R.warn("Unknown node property "+t)})),_S(e,n),e.intersect=function(t){return xS.rect(e,t)},t},"labelRect"),Ae(NS,"applyNodePropertyBorders"),WS=Ae((t,e)=>{let r,n=(r=e.classes?"node "+e.classes:"node default",t.insert("g").attr("class",r).attr("id",e.domId||e.id)),i=n.insert("rect",":first-child"),a=n.insert("line"),o=n.insert("g").attr("class","label"),s=e.labelText.flat?e.labelText.flat():e.labelText,l,c=(l="object"==typeof s?s[0]:s,R.info("Label text abc79",l,s,"object"==typeof s),o.node().appendChild(tS(l,e.labelStyle,!0,!0))),h={width:0,height:0};Dl(D().flowchart.htmlLabels)&&(t=c.children[0],d=O(c),h=t.getBoundingClientRect(),d.attr("width",h.width),d.attr("height",h.height)),R.info("Text 2",s);var u,t=s.slice(1,s.length),d=c.getBBox(),t=o.node().appendChild(tS(t.join?t.join("
"):t,e.labelStyle,!0,!0)),p=(Dl(D().flowchart.htmlLabels)&&(p=t.children[0],u=O(t),h=p.getBoundingClientRect(),u.attr("width",h.width),u.attr("height",h.height)),e.padding/2);return O(t).attr("transform","translate( "+(h.width>d.width?0:(d.width-h.width)/2)+", "+(d.height+p+5)+")"),O(c).attr("transform","translate( "+(h.width{var{shapeSvg:t,bbox:r}=await ES(t,e,MS(e,void 0),!0),n=r.height+e.padding,r=r.width+n/4+e.padding,r=t.insert("rect",":first-child").attr("style",e.style).attr("rx",n/2).attr("ry",n/2).attr("x",-r/2).attr("y",-n/2).attr("width",r).attr("height",n);return _S(e,r),e.intersect=function(t){return xS.rect(e,t)},t},"stadium"),XS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n,halfPadding:i}=await ES(t,e,MS(e,void 0),!0),a=r.insert("circle",":first-child");return a.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),R.info("Circle main"),_S(e,a),e.intersect=function(t){return R.info("Circle intersect",e,n.width/2+i,t),xS.circle(e,n.width/2+i,t)},r},"circle"),KS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n,halfPadding:i}=await ES(t,e,MS(e,void 0),!0),a=r.insert("g",":first-child"),o=a.insert("circle"),s=a.insert("circle");return a.attr("class",e.class),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i+5).attr("width",n.width+e.padding+10).attr("height",n.height+e.padding+10),s.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",n.width/2+i).attr("width",n.width+e.padding).attr("height",n.height+e.padding),R.info("DoubleCircle main"),_S(e,o),e.intersect=function(t){return R.info("DoubleCircle intersect",e,n.width/2+i+5,t),xS.circle(e,n.width/2+i+5,t)},r},"doublecircle"),ZS=Ae(async(t,e)=>{let{shapeSvg:r,bbox:n}=await ES(t,e,MS(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:0,y:0},{x:i,y:0},{x:i,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:i+8,y:0},{x:i+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],s=TS(r,i,a,o);return s.attr("style",e.style),_S(e,s),e.intersect=function(t){return xS.polygon(e,o,t)},r},"subroutine"),QS=Ae((t,e)=>{var r=(t=t.insert("g").attr("class","node default").attr("id",e.domId||e.id)).insert("circle",":first-child");return r.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),_S(e,r),e.intersect=function(t){return xS.circle(e,7,t)},t},"start"),JS=Ae((t,e,r)=>{let n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),i=70,a=10;return"LR"===r&&(i=10,a=70),t=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join"),_S(e,t),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return xS.rect(e,t)},n},"forkJoin"),tA=Ae((t,e)=>{var r=(t=t.insert("g").attr("class","node default").attr("id",e.domId||e.id)).insert("circle",":first-child"),n=t.insert("circle",":first-child");return n.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),r.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),_S(e,n),e.intersect=function(t){return xS.circle(e,7,t)},t},"end"),eA=Ae((t,o)=>{let e=o.padding/2,r,n=(r=o.classes?"node "+o.classes:"node default",t.insert("g").attr("class",r).attr("id",o.domId||o.id)),i=n.insert("rect",":first-child"),a=n.insert("line"),s=n.insert("line"),l=0,c=4,h=n.insert("g").attr("class","label"),u=0,d=o.classData.annotations?.[0],p=o.classData.annotations[0]?"«"+o.classData.annotations[0]+"»":"",g=h.node().appendChild(tS(p,o.labelStyle,!0,!0)),f=g.getBBox(),m=(Dl(D().flowchart.htmlLabels)&&(t=g.children[0],y=O(g),f=t.getBoundingClientRect(),y.attr("width",f.width),y.attr("height",f.height)),o.classData.annotations[0]&&(c+=f.height+4,l+=f.width),o.classData.label);var y;void 0!==o.classData.type&&""!==o.classData.type&&(D().flowchart.htmlLabels?m+="<"+o.classData.type+">":m+="<"+o.classData.type+">"),O(t=h.node().appendChild(tS(m,o.labelStyle,!0,!0))).attr("class","classTitle");let v=t.getBBox(),x=(Dl(D().flowchart.htmlLabels)&&(y=t.children[0],w=O(t),v=y.getBoundingClientRect(),w.attr("width",v.width),w.attr("height",v.height)),c+=v.height+4,v.width>l&&(l=v.width),[]),b=(o.classData.members.forEach(t=>{let e=t.getDisplayDetails(),r=e.displayText,n=(D().flowchart.htmlLabels&&(r=r.replace(//g,">")),h.node().appendChild(tS(r,e.cssStyle||o.labelStyle,!0,!0))),i=n.getBBox();var a;Dl(D().flowchart.htmlLabels)&&(t=n.children[0],a=O(n),i=t.getBoundingClientRect(),a.attr("width",i.width),a.attr("height",i.height)),i.width>l&&(l=i.width),c+=i.height+4,x.push(n)}),c+=8,[]);o.classData.methods.forEach(t=>{let e=t.getDisplayDetails(),r=e.displayText,n=(D().flowchart.htmlLabels&&(r=r.replace(//g,">")),h.node().appendChild(tS(r,e.cssStyle||o.labelStyle,!0,!0))),i=n.getBBox();var a;Dl(D().flowchart.htmlLabels)&&(t=n.children[0],a=O(n),i=t.getBoundingClientRect(),a.attr("width",i.width),a.attr("height",i.height)),i.width>l&&(l=i.width),c+=i.height+4,b.push(n)}),c+=8,d&&(y=(l-f.width)/2,O(g).attr("transform","translate( "+(-1*l/2+y)+", "+-1*c/2+")"),u=f.height+4);var w=(l-v.width)/2;return O(t).attr("transform","translate( "+(-1*l/2+w)+", "+(-1*c/2+u)+")"),u+=v.height+4,a.attr("class","divider").attr("x1",-l/2-e).attr("x2",l/2+e).attr("y1",-c/2-e+8+u).attr("y2",-c/2-e+8+u),u+=8,x.forEach(t=>{O(t).attr("transform","translate( "+-l/2+", "+(-1*c/2+u+4)+")"),t=t?.getBBox(),u+=(t?.height??0)+4}),u+=8,s.attr("class","divider").attr("x1",-l/2-e).attr("x2",l/2+e).attr("y1",-c/2-e+8+u).attr("y2",-c/2-e+8+u),u+=8,b.forEach(t=>{O(t).attr("transform","translate( "+-l/2+", "+(-1*c/2+u)+")"),t=t?.getBBox(),u+=(t?.height??0)+4}),i.attr("style",o.style).attr("class","outer title-state").attr("x",-l/2-e).attr("y",-c/2-e).attr("width",l+o.padding).attr("height",c+o.padding),_S(o,i),o.intersect=function(t){return xS.rect(o,t)},n},"class_box"),rA={rhombus:RS,composite:jS,question:RS,rect:YS,labelRect:HS,rectWithTitle:WS,choice:DS,circle:XS,doublecircle:KS,stadium:VS,hexagon:OS,block_arrow:PS,rect_left_inv_arrow:BS,lean_right:FS,lean_left:$S,trapezoid:zS,inv_trapezoid:GS,rect_right_inv_arrow:US,cylinder:qS,start:QS,end:tA,note:SS,subroutine:ZS,fork:JS,join:JS,class_box:eA},nA={},iA=Ae(async(e,r,n)=>{let i,a;if(r.link){let t;"sandbox"===D().securityLevel?t="_top":r.linkTarget&&(t=r.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",r.link).attr("target",t),a=await rA[r.shape](i,r,n)}else a=await rA[r.shape](e,r,n),i=a;return r.tooltip&&a.attr("title",r.tooltip),r.class&&a.attr("class","node default "+r.class),nA[r.id]=i,r.haveCallback&&nA[r.id].attr("class",nA[r.id].attr("class")+" clickable"),i},"insertNode"),aA=Ae((t,e)=>{nA[e.id]=t},"setNodeElem"),oA=Ae(()=>{nA={}},"clear"),sA=Ae(t=>{var e=nA[t.id],r=(R.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")"),t.diff||0);return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r},"positionNode")}),uA=t(()=>{Q3(),hA(),lA=Ae((t,e)=>{let r;return"sandbox"===e&&(r=O("#i"+t)),O("sandbox"===e?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement")}),dA=t(()=>{cA=Ae(({flowchart:t})=>{var e=t?.subGraphTitleMargin?.top??0;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:t=t?.subGraphTitleMargin?.bottom??0,subGraphTitleTotalMargin:e+t}},"getSubGraphTitleMargins")});function pA(t,e,r){if(t&&t.length){var n,[i,a]=e,e=Math.PI/180*r,o=Math.cos(e),s=Math.sin(e);for(n of t){var[l,c]=n;n[0]=(l-i)*o-(c-a)*s+i,n[1]=(l-i)*s+(c-a)*o+a}}}function gA(t,e){return t[0]===e[0]&&t[1]===e[1]}function fA(t,r,n,e=1){var i=n,n=Math.max(r,.1),p=t[0]&&t[0][0]&&"number"==typeof t[0][0]?[t]:t,a=[0,0];if(i)for(var o of p)pA(o,a,i);if(r=function(e,i){var t,r=[];for(t of p){var n=[...t];gA(n[0],n[n.length-1])||n.push([n[0][0],n[0][1]]),2t.ymine.ymin?1:t.xe.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax)),s.length){let r=[],n=s[0].ymin,t=0;for(;r.length||s.length;){if(s.length){let e=-1;for(let t=0;tn);t++)e=t;s.splice(0,e+1).forEach(t=>{r.push({s:n,edge:t})})}if((r=r.filter(t=>!(t.edge.ymax<=n))).sort((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x)),(1!==i||t%e==0)&&1=r.length);t+=2){var u=r[t].edge,d=r[d].edge;o.push([[Math.round(u.x),n],[Math.round(d.x),n]])}n+=i,r.forEach(t=>{t.edge.x=t.edge.x+i*t.edge.islope}),t++}}return o}(n,e),i){for(var s of p)pA(s,a,-i);{t=a,n=-i;let e=[];r.forEach(t=>e.push(...t)),pA(e,t,n)}}return r}function mA(t,e){let r=e.hachureAngle+90,n=e.hachureGap,i=(n<0&&(n=4*e.strokeWidth),n=Math.round(Math.max(n,.1)),1);return 1<=e.roughness&&.7<((null==(e=e.randomizer)?void 0:e.next())||Math.random())&&(i=n),fA(t,n,r,i||1)}function yA(t){var e=t[0],t=t[1];return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))}function vA(t,e){return t.type===e}function xA(t){let n=[],i=function(t){for(var e=new Array;""!==t;){if(!t.match(/^([ \t\r\n,]+)/))if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:l9,text:RegExp.$1};else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:c9,text:""+parseFloat(RegExp.$1)}}t=t.substr(RegExp.$1.length)}return e[e.length]={type:h9,text:""},e}(t),a="BOD",o=0,s=i[o];for(;!vA(s,h9);){let e=0,r=[];if("BOD"===a){if("M"!==s.text&&"m"!==s.text)return xA("M0,0"+t);o++,e=u9[s.text],a=s.text}else vA(s,c9)?e=u9[a]:(o++,e=u9[s.text],a=s.text);if(!(o+ee%2?t+n:t+r);a.push({key:"C",data:l}),r=l[4],n=l[5];break;case"Q":a.push({key:"Q",data:[...s]}),r=s[2],n=s[3];break;case"q":l=s.map((t,e)=>e%2?t+n:t+r),a.push({key:"Q",data:l}),r=l[2],n=l[3];break;case"A":a.push({key:"A",data:[...s]}),r=s[5],n=s[6];break;case"a":r+=s[5],n+=s[6],a.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],r,n]});break;case"H":a.push({key:"H",data:[...s]}),r=s[0];break;case"h":r+=s[0],a.push({key:"H",data:[r]});break;case"V":a.push({key:"V",data:[...s]}),n=s[0];break;case"v":n+=s[0],a.push({key:"V",data:[n]});break;case"S":a.push({key:"S",data:[...s]}),r=s[2],n=s[3];break;case"s":var c=s.map((t,e)=>e%2?t+n:t+r);a.push({key:"S",data:c}),r=c[2],n=c[3];break;case"T":a.push({key:"T",data:[...s]}),r=s[0],n=s[1];break;case"t":r+=s[0],n+=s[1],a.push({key:"T",data:[r,n]});break;case"Z":case"z":a.push({key:"Z",data:[]}),r=e,n=i}return a}function wA(t){let i=[],a="",o=0,s=0,e=0,r=0,l=0,c=0;for(var{key:n,data:h}of t){switch(n){case"M":i.push({key:"M",data:[...h]}),[o,s]=h,[e,r]=h;break;case"C":i.push({key:"C",data:[...h]}),o=h[4],s=h[5],l=h[2],c=h[3];break;case"L":i.push({key:"L",data:[...h]}),[o,s]=h;break;case"H":o=h[0],i.push({key:"L",data:[o,s]});break;case"V":s=h[0],i.push({key:"L",data:[o,s]});break;case"S":{let t=0,e;e="C"===a||"S"===a?(t=o+(o-l),s+(s-c)):(t=o,s),i.push({key:"C",data:[t,e,...h]}),l=h[0],c=h[1],o=h[2],s=h[3];break}case"T":{let[t,e]=h,r=0,n;n="Q"===a||"T"===a?(r=o+(o-l),s+(s-c)):(r=o,s);var u=o+2*(r-o)/3,d=s+2*(n-s)/3,p=t+2*(r-t)/3,g=e+2*(n-e)/3;i.push({key:"C",data:[u,d,p,g,t,e]}),l=r,c=n,o=t,s=e;break}case"Q":var[u,d,p,g]=h,f=o+2*(u-o)/3,m=s+2*(d-s)/3;i.push({key:"C",data:[f,m,p+2*(u-p)/3,g+2*(d-g)/3,p,g]}),l=u,c=d,o=p,s=g;break;case"A":var f=Math.abs(h[0]),m=Math.abs(h[1]),y=h[2],v=h[3],x=h[4],b=h[5],w=h[6];0===f||0===m?(i.push({key:"C",data:[o,s,b,w,b,w]}),o=b,s=w):o===b&&s===w||(TA(o,s,b,w,f,m,y,v,x).forEach(function(t){i.push({key:"C",data:t})}),o=b,s=w);break;case"Z":i.push({key:"Z",data:[]}),o=e,s=r}a=n}return i}function kA(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function TA(t,e,r,n,i,a,o,s,l,c){var h=Math.PI*o/180;let u=[],d=0,p=0,g=0,f=0;c?[d,p,g,f]=c:([t,e]=kA(t,e,-h),[r,n]=kA(r,n,-h),1<(m=(y=(t-r)/2)*y/(i*i)+(v=(e-n)/2)*v/(a*a))&&(i*=m=Math.sqrt(m),a*=m),m=i*i,x=a*a,s=(s===l?-1:1)*Math.sqrt(Math.abs((m*x-m*v*v-x*y*y)/(m*v*v+x*y*y))),g=s*i*v/a+(t+r)/2,f=s*-a*y/i+(e+n)/2,d=Math.asin(parseFloat(((e-f)/a).toFixed(9))),p=Math.asin(parseFloat(((n-f)/a).toFixed(9))),tp&&(d-=2*Math.PI),!l&&p>d&&(p-=2*Math.PI));var m=p-d,y=(Math.abs(m)>120*Math.PI/180&&(x=p,v=r,s=n,p=l&&p>d?d+120*Math.PI/180*1:d+120*Math.PI/180*-1,u=TA(r=g+i*Math.cos(p),n=f+a*Math.sin(p),v,s,i,a,o,0,l,[p,x,g,f])),m=p-d,Math.cos(d)),v=Math.sin(d),s=Math.cos(p),o=Math.sin(p),x=4/3*i*(l=Math.tan(m/4)),i=[t,e],a=[t+x*v,e-(m=4/3*a*l)*y],l=[r+x*o,n-m*s],t=[r,n];if(a[0]=2*i[0]-a[0],a[1]=2*i[1]-a[1],c)return[a,l,t].concat(u);u=[a,l,t].concat(u);var b=[];for(let t=0;t2*Math.PI&&(c=0,h=2*Math.PI),i=2*Math.PI/l.curveStepCount,i=qA(a=Math.min(i/2,(h-c)/2),t,e,r,n,c,h,1,l),l.disableMultiStroke||(a=qA(a,t,e,r,n,c,h,1.5,l),i.push(...a)),o&&(s?i.push(...FA(t,e,t+r*Math.cos(c),e+n*Math.sin(c),l),...FA(t,e,t+r*Math.cos(h),e+n*Math.sin(h),l)):i.push({op:"lineTo",data:[t,e]},{op:"lineTo",data:[t+r*Math.cos(c),e+n*Math.sin(c)]})),{type:"path",ops:i}}function IA(t,e){let r=wA(bA(xA(t))),n=[],i=[0,0],a=[0,0];for(var{key:o,data:s}of r)switch(o){case"M":a=[s[0],s[1]],i=[s[0],s[1]];break;case"L":n.push(...FA(a[0],a[1],s[0],s[1],e)),a=[s[0],s[1]];break;case"C":var[l,c,h,u,d,p]=s;n.push(...YA(l,c,h,u,d,p,a,e)),a=[d,p];break;case"Z":n.push(...FA(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function MA(t,e){var r,n=[];for(r of t)if(r.length){var i=e.maxRandomnessOffset||0,a=r.length;if(2s?l/10:h)/2,d=.2+.2*OA(i),p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=BA(p,i,c),g=BA(g,i,c);var f=[],m=Ae(()=>BA(u,i,c),"M"),y=Ae(()=>BA(h,i,c),"k"),v=i.preserveVertices;return a&&f.push(o?{op:"move",data:[t+(v?0:m()),e+(v?0:m())]}:{op:"move",data:[t+(v?0:BA(h,i,c)),e+(v?0:BA(h,i,c))]}),f.push(o?{op:"bcurveTo",data:[p+t+(r-t)*d+m(),g+e+(n-e)*d+m(),p+t+2*(r-t)*d+m(),g+e+2*(n-e)*d+m(),r+(v?0:m()),n+(v?0:m())]}:{op:"bcurveTo",data:[p+t+(r-t)*d+y(),g+e+(n-e)*d+y(),p+t+2*(r-t)*d+y(),g+e+2*(n-e)*d+y(),r+(v?0:y()),n+(v?0:y())]}),f}function zA(e,r,n){if(!e.length)return[];var i=[];i.push([e[0][0]+BA(r,n),e[0][1]+BA(r,n)]),i.push([e[0][0]+BA(r,n),e[0][1]+BA(r,n)]);for(let t=1;tl&&(l=h,c=t)}return Math.sqrt(l)>t?(QA(e,r,c+1,t,a),QA(e,c,n,t,a)):(a.length||a.push(o),a.push(s)),a}function JA(e,r=.15,t){var n=[],i=(e.length-1)/3;for(let t=0;t{Ae(pA,"t"),Ae(gA,"e"),Ae(fA,"s"),Ae(mA,"n"),t9=class{static{Ae(this,"o")}constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){return t=mA(t,e),{type:"fillSketch",ops:this.renderLines(t,e)}}renderLines(t,e){var r,n=[];for(r of t)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],e));return n}},Ae(yA,"a"),e9=class extends t9{static{Ae(this,"h")}fillPolygons(t,e){let r=e.hachureGap;r<0&&(r=4*e.strokeWidth),r=Math.max(r,.1);var n,i,t=mA(t,Object.assign({},e,{hachureGap:r})),a=Math.PI/180*e.hachureAngle,o=[],s=.5*r*Math.cos(a),l=.5*r*Math.sin(a);for([n,i]of t)yA([n,i])&&o.push([[n[0]-s,n[1]+l],[...i]],[[n[0]+s,n[1]-l],[...i]]);return{type:"fillSketch",ops:this.renderLines(o,e)}}},r9=class extends t9{static{Ae(this,"r")}fillPolygons(t,e){var r=this._fillPolygons(t,e),e=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),t=this._fillPolygons(t,e);return r.ops=r.ops.concat(t.ops),r}},n9=class{static{Ae(this,"i")}constructor(t){this.helper=t}fillPolygons(t,e){return t=mA(t,e=Object.assign({},e,{hachureAngle:0})),this.dotsOnLines(t,e)}dotsOnLines(t,e){let r=[],n=e.hachureGap,i=(n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1),e.fillWeight);i<0&&(i=e.strokeWidth/2);var a,o=n/4;for(a of t){var s=yA(a),l=s/n,c=Math.ceil(l)-1,h=s-c*n,u=(a[0][0]+a[1][0])/2-n/4,d=Math.min(a[0][1],a[1][1]);for(let t=0;t{let e=yA(t),r=Math.floor(e/(h+u)),n=(e+u-r*(h+u))/2,i=t[0],a=t[1];i[0]>a[0]&&(i=t[1],a=t[0]);var o=Math.atan((a[1]-i[1])/(a[0]-i[0]));for(let t=0;t{let e=yA(t),r=Math.round(e/(2*c)),n=t[0],i=t[1];n[0]>i[0]&&(n=t[1],i=t[0]);var a=Math.atan((i[1]-n[1])/(i[0]-n[0]));for(let t=0;t2*Math.PI&&(l=0,c=2*Math.PI);var h=(c-l)/n.curveStepCount,u=[];for(let t=l;t<=c;t+=h)u.push([i+o*Math.cos(t),a+s*Math.sin(t)]);return u.push([i+o*Math.cos(c),a+s*Math.sin(c)]),u.push([i,a]),RA([u],n)}(t,e,r,i))),i.stroke!==p9&&a.push(o),this._d("arc",a,i)}curve(t,e){var r=this._o(e),e=[],n=SA(t,r);if(r.fill&&r.fill!==p9)if("solid"===r.fillStyle){var i=SA(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));e.push({type:"fillPath",ops:this._mergedShape(i.ops)})}else{var a,o=[];if((i=t).length)for(a of"number"==typeof i[0][0]?[i]:i)a.length<3?o.push(...a):3===a.length?o.push(...JA(HA([a[0],a[0],a[1],a[2]]),10,(1+r.roughness)/2)):o.push(...JA(HA(a),10,(1+r.roughness)/2));o.length&&e.push(RA([o],r))}return r.stroke!==p9&&e.push(n),this._d("curve",e,r)}polygon(t,e){var r=[],n=_A(t,!0,e=this._o(e));return e.fill&&("solid"===e.fillStyle?r.push(MA([t],e)):r.push(RA([t],e))),e.stroke!==p9&&r.push(n),this._d("polygon",r,e)}path(t,e){let r=this._o(e),n=[];var i,a,o,s;return t&&(t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," "),e=r.fill&&"transparent"!==r.fill&&r.fill!==p9,i=r.stroke!==p9,o=function(t,e){let r=wA(bA(xA(t))),n=[],i=[],a=[0,0],o=[],s=Ae(()=>{4<=o.length&&i.push(...JA(o,1)),o=[]},"i"),l=Ae(()=>{s(),i.length&&(n.push(i),i=[])},"c");for(var{key:c,data:h}of r)switch(c){case"M":l(),a=[h[0],h[1]],i.push(a);break;case"L":s(),i.push([h[0],h[1]]);break;case"C":var u;o.length||(u=i.length?i[i.length-1]:a,o.push([u[0],u[1]])),o.push([h[0],h[1]]),o.push([h[2],h[3]]),o.push([h[4],h[5]]);break;case"Z":s(),i.push([a[0],a[1]])}if(l(),!e)return n;var d,p=[];for(d of n){var g=ZA(d,e);g.length&&p.push(g)}return p}(t,(a=!!(r.simplification&&r.simplification<1))?4-4*(r.simplification||1):(1+r.roughness)/2),s=IA(t,r),e&&("solid"===r.fillStyle?1===o.length?(e=IA(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0})),n.push({type:"fillPath",ops:this._mergedShape(e.ops)})):n.push(MA(o,r)):n.push(RA(o,r))),i)&&(a?o.forEach(t=>{n.push(_A(t,!1,r))}):n.push(s)),this._d("path",n,r)}opsToPath(t,e){let r="";for(var n of t.ops){var i="number"==typeof e&&0<=e?n.data.map(t=>+t.toFixed(e)):n.data;switch(n.op){case"move":r+=`M${i[0]} ${i[1]} `;break;case"bcurveTo":r+=`C${i[0]} ${i[1]}, ${i[2]} ${i[3]}, ${i[4]} ${i[5]} `;break;case"lineTo":r+=`L${i[0]} ${i[1]} `}}return r.trim()}toPaths(t){var e,r=t.sets||[],n=t.options||this.defaultOptions,i=[];for(e of r){let t=null;switch(e.type){case"path":t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:p9};break;case"fillPath":t={d:this.opsToPath(e),stroke:p9,strokeWidth:0,fill:n.fill||p9};break;case"fillSketch":t=this.fillSketch(e,n)}t&&i.push(t)}return i}fillSketch(t,e){let r=e.fillWeight;return r<0&&(r=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||p9,strokeWidth:r,fill:p9}}_mergedShape(t){return t.filter((t,e)=>0===e||"move"!==t.op)}},f9=class{static{Ae(this,"st")}constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new g9(e)}draw(t){var e,r=t.sets||[],n=t.options||this.getDefaultOptions(),i=this.ctx,a=t.options.fixedDecimalPlaceDigits;for(e of r)switch(e.type){case"path":i.save(),i.strokeStyle="none"===n.stroke?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,e,a),i.restore();break;case"fillPath":i.save(),i.fillStyle=n.fill||"";var o="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(i,e,a,o),i.restore();break;case"fillSketch":this.fillSketch(i,e,n)}}fillSketch(t,e,r){let n=r.fillWeight;n<0&&(n=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=n,this._drawToContext(t,e,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,r,n="nonzero"){t.beginPath();for(var i of e.ops){var a="number"==typeof r&&0<=r?i.data.map(t=>+t.toFixed(r)):i.data;switch(i.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}"fillPath"===e.type?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,r,n,i){return t=this.gen.line(t,e,r,n,i),this.draw(t),t}rectangle(t,e,r,n,i){return t=this.gen.rectangle(t,e,r,n,i),this.draw(t),t}ellipse(t,e,r,n,i){return t=this.gen.ellipse(t,e,r,n,i),this.draw(t),t}circle(t,e,r,n){return t=this.gen.circle(t,e,r,n),this.draw(t),t}linearPath(t,e){return t=this.gen.linearPath(t,e),this.draw(t),t}polygon(t,e){return t=this.gen.polygon(t,e),this.draw(t),t}arc(t,e,r,n,i,a,o=!1,s){return t=this.gen.arc(t,e,r,n,i,a,o,s),this.draw(t),t}curve(t,e){return t=this.gen.curve(t,e),this.draw(t),t}path(t,e){return t=this.gen.path(t,e),this.draw(t),t}},m9="http://www.w3.org/2000/svg",y9=class{static{Ae(this,"ot")}constructor(t,e){this.svg=t,this.gen=new g9(e)}draw(e){var r,t=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(m9,"g"),o=e.options.fixedDecimalPlaceDigits;for(r of t){let t=null;switch(r.type){case"path":(t=i.createElementNS(m9,"path")).setAttribute("d",this.opsToPath(r,o)),t.setAttribute("stroke",n.stroke),t.setAttribute("stroke-width",n.strokeWidth+""),t.setAttribute("fill","none"),n.strokeLineDash&&t.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&t.setAttribute("stroke-dashoffset",""+n.strokeLineDashOffset);break;case"fillPath":(t=i.createElementNS(m9,"path")).setAttribute("d",this.opsToPath(r,o)),t.setAttribute("stroke","none"),t.setAttribute("stroke-width","0"),t.setAttribute("fill",n.fill||""),"curve"!==e.shape&&"polygon"!==e.shape||t.setAttribute("fill-rule","evenodd");break;case"fillSketch":t=this.fillSketch(i,r,n)}t&&a.appendChild(t)}return a}fillSketch(t,e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),(t=t.createElementNS(m9,"path")).setAttribute("d",this.opsToPath(e,r.fixedDecimalPlaceDigits)),t.setAttribute("stroke",r.fill||""),t.setAttribute("stroke-width",n+""),t.setAttribute("fill","none"),r.fillLineDash&&t.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&t.setAttribute("stroke-dashoffset",""+r.fillLineDashOffset),t}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,r,n,i){return t=this.gen.line(t,e,r,n,i),this.draw(t)}rectangle(t,e,r,n,i){return t=this.gen.rectangle(t,e,r,n,i),this.draw(t)}ellipse(t,e,r,n,i){return t=this.gen.ellipse(t,e,r,n,i),this.draw(t)}circle(t,e,r,n){return t=this.gen.circle(t,e,r,n),this.draw(t)}linearPath(t,e){return t=this.gen.linearPath(t,e),this.draw(t)}polygon(t,e){return t=this.gen.polygon(t,e),this.draw(t)}arc(t,e,r,n,i,a,o=!1,s){return t=this.gen.arc(t,e,r,n,i,a,o,s),this.draw(t)}curve(t,e){return t=this.gen.curve(t,e),this.draw(t)}path(t,e){return t=this.gen.path(t,e),this.draw(t)}},v9={canvas:Ae((t,e)=>new f9(t,e),"canvas"),svg:Ae((t,e)=>new y9(t,e),"svg"),generator:Ae(t=>new g9(t),"generator"),newSeed:Ae(()=>g9.newSeed(),"newSeed")}}),k9=t(()=>{x9=Ae((t,e)=>{var r,n=t.x,i=t.y,a=e.x-n,e=e.y-i,o=t.width/2,t=t.height/2,t=Math.abs(e)*o>Math.abs(a)*t?(e<0&&(t=-t),r=0==e?0:t*a/e,t):(r=o=a<0?-o:o,0==a?0:o*e/a);return{x:n+r,y:i+t}},"intersectRect"),b9=x9});function T9(t,e){e&&t.attr("style",e)}async function E9(t){let e=O(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=e.append("xhtml:div"),n=t.label;t.label&&ql(t.label)&&(n=await jl(t.label.replace(L.lineBreakRegex,` `),D()));var i=t.isNode?"nodeLabel":"edgeLabel";return r.html('"+n+""),T9(r,t.labelStyle),r.style("display","inline-block"),r.style("padding-right","1px"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}var _9,C9,S9,A9,L9,N9,I9,M9,R9,D9,O9,P9,B9,F9,$9,z9,G9=t(()=>{Q3(),e(),i(),tc(),K8(),Ae(T9,"applyStyle"),Ae(E9,"addHtmlLabel"),_9=Ae(async(t,e,r,n)=>{let i=t||"";if("object"==typeof i&&(i=i[0]),Dl(D().flowchart.htmlLabels))return i=i.replace(/\\n|\n/g,"
"),R.info("vertexText"+i),E9({isNode:n,label:V8(i).replace(/fa[blrs]?:fa-[\w-]+/g,t=>``),labelStyle:e&&e.replace("fill:","color:")});var a,o=document.createElementNS("http://www.w3.org/2000/svg","text");o.setAttribute("style",e.replace("color:","fill:"));for(a of"string"==typeof i?i.split(/\\n|\n|/gi):Array.isArray(i)?i:[]){var s=document.createElementNS("http://www.w3.org/2000/svg","tspan");s.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),s.setAttribute("dy","1em"),s.setAttribute("x","0"),r?s.setAttribute("class","title-row"):s.setAttribute("class","row"),s.textContent=a.trim(),o.appendChild(s)}return o},"createLabel"),C9=_9}),U9=t(()=>{S9=Ae((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD")}),q9=t(()=>{i(),A9=Ae(t=>({fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:D().handDrawnSeed}),"solidStateFill"),L9=Ae(t=>({stylesMap:t=N9([...t.cssCompiledStyles||[],...t.cssStyles||[]]),stylesArray:[...t]}),"compileStyles"),N9=Ae(t=>{let r=new Map;return t.forEach(t=>{var[t,e]=t.split(":");r.set(t.trim(),e?.trim())}),r},"styles2Map"),I9=Ae(t=>{let e=L9(t).stylesArray,r=[],n=[],i=[],a=[];return e.forEach(t=>{var e=t[0];"color"===e||"font-size"===e||"font-family"===e||"font-weight"===e||"font-style"===e||"text-decoration"===e||"text-align"===e||"text-transform"===e||"line-height"===e||"letter-spacing"===e||"word-spacing"===e||"text-shadow"===e||"text-overflow"===e||"white-space"===e||"word-wrap"===e||"word-break"===e||"overflow-wrap"===e||"hyphens"===e?r.push(t.join(":")+" !important"):(n.push(t.join(":")+" !important"),e.includes("stroke")&&i.push(t.join(":")+" !important"),"fill"===e&&a.push(t.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),M9=Ae((t,e)=>{var{themeVariables:r,handDrawnSeed:n}=D(),{nodeBorder:r,mainBkg:i}=r,t=L9(t).stylesMap;return Object.assign({roughness:.7,fill:t.get("fill")||i,fillStyle:"hachure",fillWeight:4,stroke:t.get("stroke")||r,seed:n,strokeWidth:1.3},e)},"userNodeOverrides")}),Y9=t(()=>{i(),tc(),e(),dA(),Q3(),w9(),KC(),k9(),G9(),U9(),q9(),R9=Ae(async(n,i)=>{R.info("Creating subgraph rect for ",i.id,i);let t=D(),{themeVariables:e,handDrawnSeed:a}=t,{clusterBkg:o,clusterBorder:s}=e,{labelStyles:r,nodeStyles:l,borderStyles:c,backgroundStyles:h}=I9(i),u=n.insert("g").attr("class","cluster "+i.cssClasses).attr("id",i.id).attr("data-look",i.look),d=Dl(t.flowchart.htmlLabels),p=u.insert("g").attr("class","cluster-label "),g=await XC(p,i.label,{style:i.labelStyle,useHtmlLabels:d,isNode:!0}),f=g.getBBox();Dl(t.flowchart.htmlLabels)&&(n=g.children[0],m=O(g),f=n.getBoundingClientRect(),m.attr("width",f.width),m.attr("height",f.height));var n=i.width<=f.width+i.padding?f.width+i.padding:i.width,m=(i.width<=f.width+i.padding?i.diff=(n-i.width)/2-i.padding:i.diff=-i.padding,i.height),y=i.x-n/2,v=i.y-m/2;R.trace("Data ",i,JSON.stringify(i));let x;if("handDrawn"===i.look){let t=v9.svg(u),e=M9(i,{roughness:.7,fill:o,stroke:s,fillWeight:3,seed:a}),r=t.path(S9(y,v,n,m,0),e);(x=u.insert(()=>(R.debug("Rough node insert CXC",r),r),":first-child")).select("path:nth-child(2)").attr("style",c.join(";")),x.select("path").attr("style",h.join(";").replace("fill","stroke"))}else(x=u.insert("rect",":first-child")).attr("style",l).attr("rx",i.rx).attr("ry",i.ry).attr("x",y).attr("y",v).attr("width",n).attr("height",m);return y=cA(t).subGraphTitleTopMargin,p.attr("transform",`translate(${i.x-f.width/2}, ${i.y-i.height/2+y})`),r&&(v=p.select("span"))&&v.attr("style",r),n=x.node().getBBox(),i.offsetX=0,i.width=n.width,i.height=n.height,i.offsetY=f.height-i.padding/2,i.intersect=function(t){return b9(i,t)},{cluster:u,labelBBox:f}},"rect"),D9=Ae((t,e)=>{var r=(t=t.insert("g").attr("class","note-cluster").attr("id",e.id)).insert("rect",":first-child"),n=0*e.padding,i=n/2,i=(r.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-i).attr("y",e.y-e.height/2-i).attr("width",e.width+n).attr("height",e.height+n).attr("fill","none"),r.node().getBBox());return e.width=i.width,e.height=i.height,e.intersect=function(t){return b9(e,t)},{cluster:t,labelBBox:{width:0,height:0}}},"noteGroup"),O9=Ae(async(i,a)=>{let t=D(),{themeVariables:e,handDrawnSeed:o}=t,{altBackground:s,compositeBackground:l,compositeTitleBackground:c,nodeBorder:h}=e,u=i.insert("g").attr("class",a.cssClasses).attr("id",a.id).attr("data-id",a.id).attr("data-look",a.look),r=u.insert("g",":first-child"),n=u.insert("g").attr("class","cluster-label"),d=u.append("rect"),p=n.node().appendChild(await C9(a.label,a.labelStyle,void 0,!0)),g=p.getBBox();Dl(t.flowchart.htmlLabels)&&(i=p.children[0],f=O(p),g=i.getBoundingClientRect(),f.attr("width",g.width),f.attr("height",g.height));var f=(i=0*a.padding)/2,m=(a.width<=g.width+a.padding?g.width+a.padding:a.width)+i,y=(a.width<=g.width+a.padding?a.diff=(m-a.width)/2-a.padding:a.diff=-a.padding,a.height+i),i=a.height+i-g.height-6,v=a.x-m/2,x=a.y-y/2;a.width=m;let b=a.y-a.height/2-f+g.height+2,w;if("handDrawn"===a.look){let t=a.cssClasses.includes("statediagram-cluster-alt"),e=v9.svg(u),r=a.rx||a.ry?e.path(S9(v,x,m,y,10),{roughness:.7,fill:c,fillStyle:"solid",stroke:h,seed:o}):e.rectangle(v,x,m,y,{seed:o}),n=(w=u.insert(()=>r,":first-child"),e.rectangle(v,b,m,i,{fill:t?s:l,fillStyle:t?"hachure":"solid",stroke:h,seed:o}));w=u.insert(()=>r,":first-child"),d=u.insert(()=>n)}else(w=r.insert("rect",":first-child")).attr("class","outer").attr("x",v).attr("y",x).attr("width",m).attr("height",y).attr("data-look",a.look),d.attr("class","inner").attr("x",v).attr("y",b).attr("width",m).attr("height",i);return n.attr("transform",`translate(${a.x-g.width/2}, ${1+x-(Dl(t.flowchart.htmlLabels)?0:3)})`),f=w.node().getBBox(),a.height=f.height,a.offsetX=0,a.offsetY=g.height-a.padding/2,a.labelBBox=g,a.intersect=function(t){return b9(a,t)},{cluster:u,labelBBox:g}},"roundedWithTitle"),P9=Ae((e,r)=>{var{themeVariables:n,handDrawnSeed:i}=D(),n=n.nodeBorder,t=(e=e.insert("g").attr("class",r.cssClasses).attr("id",r.id).attr("data-look",r.look)).insert("g",":first-child"),a=0*r.padding,o=r.width+a,a=(r.diff=-r.padding,r.height+a),s=r.x-o/2,l=r.y-a/2;r.width=o;let c;if("handDrawn"===r.look){let t=v9.svg(e).rectangle(s,l,o,a,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:n,seed:i});c=e.insert(()=>t,":first-child")}else(c=t.insert("rect",":first-child")).attr("class","divider").attr("x",s).attr("y",l).attr("width",o).attr("height",a).attr("data-look",r.look);return n=c.node().getBBox(),r.height=n.height,r.offsetX=0,r.offsetY=0,r.intersect=function(t){return b9(r,t)},{cluster:e,labelBBox:{}}},"divider"),B9={rect:R9,squareRect:R9,roundedWithTitle:O9,noteGroup:D9,divider:P9},F9=new Map,$9=Ae(async(t,e)=>{var r=e.shape||"rect",r=await B9[r](t,e);return F9.set(e.id,r),r},"insertCluster"),z9=Ae(()=>{F9=new Map},"clear")});function j9(t,e){if(void 0===t||void 0===e)return{angle:0,deltaX:0,deltaY:0};t=W9(t),e=W9(e);var[t,r]=[t.x,t.y],[e,n]=[e.x,e.y],e=e-t,t=n-r;return{angle:Math.atan(t/e),deltaX:e,deltaY:t}}var H9,W9,V9,X9,K9,Z9,Q9=t(()=>{H9={aggregation:18,extension:18,composition:18,dependency:6,lollipop:13.5,arrow_point:4},Ae(j9,"calculateDeltaAndAngle"),W9=Ae(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),V9=Ae(o=>({x:Ae(function(t,e,r){let n=0;var i,a;return 0===e&&Object.hasOwn(H9,o.arrowTypeStart)?({angle:i,deltaX:a}=j9(r[0],r[1]),n=H9[o.arrowTypeStart]*Math.cos(i)*(0<=a?1:-1)):e===r.length-1&&Object.hasOwn(H9,o.arrowTypeEnd)&&({angle:i,deltaX:a}=j9(r[r.length-1],r[r.length-2]),n=H9[o.arrowTypeEnd]*Math.cos(i)*(0<=a?1:-1)),W9(t).x+n},"x"),y:Ae(function(t,e,r){let n=0;var i,a;return 0===e&&Object.hasOwn(H9,o.arrowTypeStart)?({angle:i,deltaY:a}=j9(r[0],r[1]),n=H9[o.arrowTypeStart]*Math.abs(Math.sin(i))*(0<=a?1:-1)):e===r.length-1&&Object.hasOwn(H9,o.arrowTypeEnd)&&({angle:i,deltaY:a}=j9(r[r.length-1],r[r.length-2]),n=H9[o.arrowTypeEnd]*Math.abs(Math.sin(i))*(0<=a?1:-1)),W9(t).y+n},"y")}),"getLineFunctionsWithOffset")}),J9=t(()=>{e(),X9=Ae((t,e,r,n,i)=>{e.arrowTypeStart&&Z9(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&Z9(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),K9={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Z9=Ae((t,e,r,n,i,a)=>{var o=K9[r];o?t.attr("marker-"+e,`url(${n}#${i}_${a}-${o}${"start"===e?"Start":"End"})`):R.warn("Unknown arrow type: "+r)},"addEdgeMarker")});function tL(t,e){D().flowchart.htmlLabels&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}function eL(e){var r=[],n=[];for(let t=1;t{i(),tc(),e(),KC(),K8(),Q9(),dA(),Q3(),w9(),G9(),J9(),rL=new Map,nL=new Map,iL=Ae(()=>{rL.clear(),nL.clear()},"clear"),aL=Ae(t=>t?t.reduce((t,e)=>t+";"+e,""):"","getLabelStyles"),oL=Ae(async(t,e)=>{var r,n=Dl(D().flowchart.htmlLabels),i=await XC(t,e.label,{style:aL(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1}),a=(R.info("abc82",e,e.labelType),t.insert("g").attr("class","edgeLabel")),o=a.insert("g").attr("class","label");o.node().appendChild(i);let s=i.getBBox();n&&(n=i.children[0],r=O(i),s=n.getBoundingClientRect(),r.attr("width",s.width),r.attr("height",s.height)),o.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),rL.set(e.id,a),e.width=s.width,e.height=s.height;let l;return e.startLabelLeft&&(n=await C9(e.startLabelLeft,aL(e.labelStyle)),o=(r=t.insert("g").attr("class","edgeTerminals")).insert("g").attr("class","inner"),l=o.node().appendChild(n),a=n.getBBox(),o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),nL.get(e.id)||nL.set(e.id,{}),nL.get(e.id).startLeft=r,tL(l,e.startLabelLeft)),e.startLabelRight&&(n=await C9(e.startLabelRight,aL(e.labelStyle)),a=(o=t.insert("g").attr("class","edgeTerminals")).insert("g").attr("class","inner"),l=o.node().appendChild(n),a.node().appendChild(n),r=n.getBBox(),a.attr("transform","translate("+-r.width/2+", "+-r.height/2+")"),nL.get(e.id)||nL.set(e.id,{}),nL.get(e.id).startRight=o,tL(l,e.startLabelRight)),e.endLabelLeft&&(n=await C9(e.endLabelLeft,aL(e.labelStyle)),r=(a=t.insert("g").attr("class","edgeTerminals")).insert("g").attr("class","inner"),l=r.node().appendChild(n),o=n.getBBox(),r.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),a.node().appendChild(n),nL.get(e.id)||nL.set(e.id,{}),nL.get(e.id).endLeft=a,tL(l,e.endLabelLeft)),e.endLabelRight&&(r=await C9(e.endLabelRight,aL(e.labelStyle)),n=(o=t.insert("g").attr("class","edgeTerminals")).insert("g").attr("class","inner"),l=n.node().appendChild(r),a=r.getBBox(),n.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),o.node().appendChild(r),nL.get(e.id)||nL.set(e.id,{}),nL.get(e.id).endRight=o,tL(l,e.endLabelRight)),i},"insertEdgeLabel"),Ae(tL,"setTerminalWidth"),sL=Ae((n,i)=>{R.debug("Moving label abc88 ",n.id,n.label,rL.get(n.id),i);var a,o=i.updatedPath||i.originalPath,s=D(),s=cA(s).subGraphTitleTotalMargin;if(n.label){let t=rL.get(n.id),e=n.x,r=n.y;o&&(a=H8.calcLabelPosition(o),R.debug("Moving label "+n.label+" from (",e,",",r,") to (",a.x,",",a.y,") abc88"),i.updatedPath)&&(e=a.x,r=a.y),t.attr("transform",`translate(${e}, ${r+s/2})`)}if(n.startLabelLeft){let t=nL.get(n.id).startLeft,e=n.x,r=n.y;o&&(i=H8.calcTerminalLabelPosition(n.arrowTypeStart?10:0,"start_left",o),e=i.x,r=i.y),t.attr("transform",`translate(${e}, ${r})`)}if(n.startLabelRight){let t=nL.get(n.id).startRight,e=n.x,r=n.y;o&&(a=H8.calcTerminalLabelPosition(n.arrowTypeStart?10:0,"start_right",o),e=a.x,r=a.y),t.attr("transform",`translate(${e}, ${r})`)}if(n.endLabelLeft){let t=nL.get(n.id).endLeft,e=n.x,r=n.y;o&&(s=H8.calcTerminalLabelPosition(n.arrowTypeEnd?10:0,"end_left",o),e=s.x,r=s.y),t.attr("transform",`translate(${e}, ${r})`)}if(n.endLabelRight){let t=nL.get(n.id).endRight,e=n.x,r=n.y;o&&(i=H8.calcTerminalLabelPosition(n.arrowTypeEnd?10:0,"end_right",o),e=i.x,r=i.y),t.attr("transform",`translate(${e}, ${r})`)}},"positionEdgeLabel"),lL=Ae((t,e)=>{var r=t.x,n=t.y,r=Math.abs(e.x-r),e=Math.abs(e.y-n),n=t.width/2,t=t.height/2;return n<=r||t<=e},"outsideNode"),cL=Ae((t,n,i)=>{R.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(n)} insidePoint : ${JSON.stringify(i)} @@ -1024,7 +1024,7 @@ Expecting `+A.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on l fill: ${t.titleColor||t.textColor}; font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif); } -`,"getStyles"),ppt=dpt}),ypt={};J(ypt,{diagram:()=>vpt});var vpt,xpt,bpt,wpt,kpt,Tpt,Ept,_pt,Cpt,Spt=t(()=>{Pdt(),gpt(),fpt(),mpt(),vpt={parser:Ddt,db:ipt,renderer:upt,styles:ppt}}),Apt=t(()=>{cut(),e(),xpt={parse:Ae(async t=>{t=await aut("info",t),R.debug(t)},"parse")}}),Lpt=t(()=>{bpt="11.2.0"}),Npt=t(()=>{Lpt(),wpt={version:bpt},kpt=Ae(()=>wpt.version,"getVersion"),Tpt={getVersion:kpt}}),Ipt=t(()=>{Q3(),i(),Ept=Ae(t=>{let e=D().securityLevel,r=O("body");var n;return"sandbox"===e&&(n=O("#i"+t).node()?.contentDocument??document,r=O(n.body)),r.select("#"+t)},"selectSvgElement")}),Mpt=t(()=>{e(),Ipt(),ec(),_pt=Ae((t,e,r)=>{R.debug(`rendering info diagram +`,"getStyles"),ppt=dpt}),ypt={};J(ypt,{diagram:()=>vpt});var vpt,xpt,bpt,wpt,kpt,Tpt,Ept,_pt,Cpt,Spt=t(()=>{Pdt(),gpt(),fpt(),mpt(),vpt={parser:Ddt,db:ipt,renderer:upt,styles:ppt}}),Apt=t(()=>{cut(),e(),xpt={parse:Ae(async t=>{t=await aut("info",t),R.debug(t)},"parse")}}),Lpt=t(()=>{bpt="11.2.1"}),Npt=t(()=>{Lpt(),wpt={version:bpt},kpt=Ae(()=>wpt.version,"getVersion"),Tpt={getVersion:kpt}}),Ipt=t(()=>{Q3(),i(),Ept=Ae(t=>{let e=D().securityLevel,r=O("body");var n;return"sandbox"===e&&(n=O("#i"+t).node()?.contentDocument??document,r=O(n.body)),r.select("#"+t)},"selectSvgElement")}),Mpt=t(()=>{e(),Ipt(),ec(),_pt=Ae((t,e,r)=>{R.debug(`rendering info diagram `+t),t=Ept(e),Vl(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text("v"+r)},"draw"),Cpt={draw:_pt}}),Rpt={};J(Rpt,{diagram:()=>Dpt});var Dpt,Opt,Ppt,Bpt,Fpt,$pt,zpt,Gpt,Upt,qpt,Ypt,jpt,Hpt,Wpt,Vpt,Xpt,Kpt,Zpt,Qpt,Jpt=t(()=>{Apt(),Npt(),Mpt(),Dpt={parser:xpt,db:Tpt,renderer:Cpt}}),t1t=t(()=>{e(),fh(),Nn(),$pt=xr.pie,Opt={sections:new Map,showData:!1,config:$pt},Ppt=Opt.sections,Bpt=Opt.showData,Fpt=structuredClone($pt),$pt=Ae(()=>structuredClone(Fpt),"getConfig"),zpt=Ae(()=>{Ppt=new Map,Bpt=Opt.showData,lc()},"clear"),Gpt=Ae(({label:t,value:e})=>{Ppt.has(t)||(Ppt.set(t,e),R.debug(`added new section: ${t}, with value: `+e))},"addSection"),Upt=Ae(()=>Ppt,"getSections"),qpt=Ae(t=>{Bpt=t},"setShowData"),Ypt=Ae(()=>Bpt,"getShowData"),jpt={getConfig:$pt,clear:zpt,setDiagramTitle:pc,getDiagramTitle:gc,setAccTitle:cc,getAccTitle:hc,setAccDescription:uc,getAccDescription:dc,addSection:Gpt,getSections:Upt,setShowData:qpt,getShowData:Ypt}}),e1t=t(()=>{cut(),e(),put(),t1t(),Hpt=Ae((t,e)=>{hut(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),Wpt={parse:Ae(async t=>{t=await aut("pie",t),R.debug(t),Hpt(t,jpt)},"parse")}}),r1t=t(()=>{Vpt=Ae(t=>` .pieCircle{ stroke: ${t.pieStrokeColor}; @@ -1238,7 +1238,7 @@ Expecting `+A.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on l fill: ${t.actorBkg}; stroke-width: 2px; } -`,"getStyles"),qmt=Umt}),Tyt=t(()=>{function e(t,e,r,n,i,a,o){g(e.append("text").attr("x",r).attr("y",n).style("text-anchor","start").text(t),o)}function l(t,e,r,n,i,a,o,s){var{actorFontSize:l,actorFontFamily:c,actorFontWeight:h}=s,u=t.split(L.lineBreakRegex);for(let t=0;tr?s.width:r);if((t=l.append("rect")).attr("class","actorPopupMenuPanel"+i),t.attr("x",s.x),t.attr("y",s.height),t.attr("fill",s.fill),t.attr("stroke",s.stroke),t.attr("width",c),t.attr("height",s.height),t.attr("rx",s.rx),t.attr("ry",s.ry),null!=a){var h,u=20;for(h in a){var d=l.append("a"),p=(0,Ymt.sanitizeUrl)(a[h]);d.attr("xlink:href",p),d.attr("target","_blank"),xyt(n)(h,d,s.x+10,s.height+u,c,20,{class:"actor"},n),u+=30}}return t.attr("height",u),{height:s.height+u,width:c}},"drawPopup"),Xmt=Ae(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Kmt=Ae(async function(n,i,a=null){var o=n.append("foreignObject"),s=await jl(i.text,Rr()),s=o.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(s).node().getBoundingClientRect();if(o.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),"noteText"===i.class)(n=n.node().firstChild).setAttribute("height",s.height+2*i.textMargin),n=n.getBBox(),o.attr("x",Math.round(n.x+n.width/2-s.width/2)).attr("y",Math.round(n.y+n.height/2-s.height/2));else if(a){let{startx:t,stopx:e,starty:r}=a;t>e&&(n=t,t=e,e=n),o.attr("x",Math.round(t+Math.abs(t-e)/2-s.width/2)),"loopText"===i.class?o.attr("y",Math.round(r)):o.attr("y",Math.round(r-s.height))}return[o]},"drawKatex"),Zmt=Ae(function(t,e){let r=0,n=0,i=e.text.split(L.lineBreakRegex),[a,o]=j8(e.fontSize),s=[],l=0,c=Ae(()=>e.y,"yfunc");if(void 0!==e.valign&&void 0!==e.textMargin&&0Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":c=Ae(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":c=Ae(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc")}if(void 0!==e.anchor&&void 0!==e.textMargin&&void 0!==e.width)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle"}for(var[h,u]of i.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==a&&(l=h*a),(h=t.append("text")).attr("x",e.x),h.attr("y",c()),void 0!==e.anchor&&h.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&h.style("font-family",e.fontFamily),void 0!==o&&h.style("font-size",o),void 0!==e.fontWeight&&h.style("font-weight",e.fontWeight),void 0!==e.fill&&h.attr("fill",e.fill),void 0!==e.class&&h.attr("class",e.class),void 0!==e.dy?h.attr("dy",e.dy):0!==l&&h.attr("dy",l);var d,u=u||k8;(e.tspan?((d=h.append("tspan")).attr("x",e.x),void 0!==e.fill&&d.attr("fill",e.fill),d):h).text(u),void 0!==e.valign&&void 0!==e.textMargin&&0{r.select&&t.forEach(t=>{var t=n.get(t),e=r.select("#actor"+t.actorCnt);!i.mirrorActors&&t.stopy?e.attr("y2",t.stopy+t.height/2):i.mirrorActors&&e.attr("y2",t.stopy)})},"fixLifeLineHeights"),eyt=Ae(function(t,e,r,n){var i=n?e.stopy:e.starty,a=e.x+e.width/2,o=i+5,s=t=t.append("g").lower(),o=(n||(Jmt++,Object.keys(e.links||{}).length&&!r.forceMenus&&s.attr("onclick",Xmt(`actor${Jmt}_popup`)).attr("cursor","pointer"),s.append("line").attr("id","actor"+Jmt).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),s=t.append("g"),e.actorCnt=Jmt,null!=e.links&&s.attr("id","root-"+Jmt)),T3()),a="actor",t=(e.properties?.class?a=e.properties.class:o.fill="#eaeaea",a+=n?" "+Hmt:" actor-top",o.x=e.x,o.y=i,o.width=e.width,o.height=e.height,o.class=a,o.rx=3,o.ry=3,o.name=e.name,Wmt(s,o));e.rectData=o,e.properties?.icon&&("@"===(n=e.properties.icon.trim()).charAt(0)?k3(s,o.x+o.width-20,o.y+10,n.substr(1)):w3(s,o.x+o.width-20,o.y+10,n)),vyt(r,ql(e.description))(e.description,s,o.x,o.y,o.width,o.height,{class:"actor actor-box"},r);let l=e.height;return t.node&&(i=t.node().getBBox(),e.height=i.height,l=i.height),l},"drawActorTypeParticipant"),ryt=Ae(function(t,e,r,n){var i=n?e.stopy:e.starty,a=e.x+e.width/2,o=i+80,s=t.append("g").lower(),l=(n||(Jmt++,s.append("line").attr("id","actor"+Jmt).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=Jmt),t.append("g")),c="actor-man";return l.attr("class",c+=n?" "+Hmt:" actor-top"),l.attr("name",e.name),(s=T3()).x=e.x,s.y=i,s.fill="#eaeaea",s.width=e.width,s.height=e.height,s.class="actor",s.rx=3,s.ry=3,l.append("line").attr("id","actor-man-torso"+Jmt).attr("x1",a).attr("y1",i+25).attr("x2",a).attr("y2",i+45),l.append("line").attr("id","actor-man-arms"+Jmt).attr("x1",a-jmt/2).attr("y1",i+33).attr("x2",a+jmt/2).attr("y2",i+33),l.append("line").attr("x1",a-jmt/2).attr("y1",i+60).attr("x2",a).attr("y2",i+45),l.append("line").attr("x1",a).attr("y1",i+45).attr("x2",a+jmt/2-2).attr("y2",i+60),(o=l.append("circle")).attr("cx",e.x+e.width/2),o.attr("cy",i+10),o.attr("r",15),o.attr("width",e.width),o.attr("height",e.height),t=l.node().getBBox(),e.height=t.height,vyt(r,ql(e.description))(e.description,l,s.x,s.y+35,s.width,s.height,{class:"actor actor-man"},r),e.height},"drawActorTypeActor"),nyt=Ae(async function(t,e,r,n){switch(e.type){case"actor":return ryt(t,e,r,n);case"participant":return eyt(t,e,r,n)}},"drawActor"),iyt=Ae(function(t,e,r){t=t.append("g"),lyt(t,e),e.name&&vyt(r)(e.name,t,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),t.lower()},"drawBox"),ayt=Ae(function(t){return t.append("g")},"anchorElement"),oyt=Ae(function(t,e,r,n,i){var a=T3(),o=e.anchored;a.x=e.startx,a.y=e.starty,a.class="activation"+i%3,a.width=e.stopx-e.startx,a.height=r-e.starty,Wmt(o,a)},"drawActivation"),syt=Ae(async function(t,e,r,n){let{boxMargin:i,boxTextMargin:a,labelBoxHeight:o,labelBoxWidth:s,messageFontFamily:l,messageFontSize:c,messageFontWeight:h}=n,u=t.append("g"),d=Ae(function(t,e,r,n){return u.append("line").attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",n).attr("class","loopLine")},"drawLoopLine"),p=(d(e.startx,e.starty,e.stopx,e.starty),d(e.stopx,e.starty,e.stopx,e.stopy),d(e.startx,e.stopy,e.stopx,e.stopy),d(e.startx,e.starty,e.startx,e.stopy),void 0!==e.sections&&e.sections.forEach(function(t){d(e.startx,t.y,e.stopx,t.y).style("stroke-dasharray","3, 3")}),E3());p.text=r,p.x=e.startx,p.y=e.starty,p.fontFamily=l,p.fontSize=c,p.fontWeight=h,p.anchor="middle",p.valign="middle",p.tspan=!1,p.width=s||50,p.height=o||20,p.textMargin=a,p.class="labelText",Qmt(u,p),(p=myt()).text=e.title,p.x=e.startx+s/2+(e.stopx-e.startx)/2,p.y=e.starty+i+a,p.anchor="middle",p.valign="middle",p.textMargin=a,p.class="loopText",p.fontFamily=l,p.fontSize=c,p.fontWeight=h,p.wrap=!0;var g=ql(p.text)?await Kmt(u,p,e):Zmt(u,p);if(void 0!==e.sectionTitles)for(var[f,m]of Object.entries(e.sectionTitles))m.message&&(p.text=m.message,p.x=e.startx+(e.stopx-e.startx)/2,p.y=e.sections[f].y+i+a,p.class="loopText",p.anchor="middle",p.valign="middle",p.tspan=!1,p.fontFamily=l,p.fontSize=c,p.fontWeight=h,p.wrap=e.wrap,ql(p.text)?(e.starty=e.sections[f].y,await Kmt(u,p,e)):Zmt(u,p),m=Math.round(g.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e)),e.sections[f].height+=m-(i+a));return e.height=Math.round(e.stopy-e.starty),u},"drawLoop"),lyt=Ae(function(t,e){x3(t,e)},"drawBackgroundRect"),cyt=Ae(function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),hyt=Ae(function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),uyt=Ae(function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),dyt=Ae(function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),pyt=Ae(function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),gyt=Ae(function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),fyt=Ae(function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),myt=Ae(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),yyt=Ae(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Ae(n,"byText"),Ae(c,"byTspan"),Ae(i,"byFo"),Ae(a,"byKatex"),Ae(f,"_setTextAttrs"),vyt=function(t,e=!1){return e?a:"fo"===t.textPlacement?i:"old"===t.textPlacement?n:c},Ae(e,"byText"),Ae(l,"byTspan"),Ae(r,"byFo"),Ae(g,"_setTextAttrs"),xyt=function(t){return"fo"===t.textPlacement?r:"old"===t.textPlacement?e:l},byt={drawRect:Wmt,drawText:Zmt,drawLabel:Qmt,drawActor:nyt,drawBox:iyt,drawPopup:Vmt,anchorElement:ayt,drawActivation:oyt,drawLoop:syt,drawBackgroundRect:lyt,insertArrowHead:dyt,insertArrowFilledHead:pyt,insertSequenceNumber:gyt,insertArrowCrossHead:fyt,insertDatabaseIcon:cyt,insertComputerIcon:hyt,insertClockIcon:uyt,getTextObj:myt,getNoteRect:yyt,fixLifeLineHeights:tyt,sanitizeUrl:Ymt.sanitizeUrl}});async function Eyt(t,e){B.bumpVerticalPos(10);var{startx:r,stopx:n,message:i}=e,a=L.splitBreaks(i).length,o=ql(i),i=o?await Yl(i,D()):H8.calculateTextDimensions(i,Nyt(P));o||(o=i.height/a,e.height+=o,B.bumpVerticalPos(o));let s,l=i.height-10,c=i.width;return r===n?(s=B.getVerticalPos()+l,P.rightAngles||(l+=P.boxMargin,s=B.getVerticalPos()+l),l+=30,a=L.getMax(c/2,P.width/2),B.insert(r-a,B.getVerticalPos()-10+l,n+a,B.getVerticalPos()+30+l)):(l+=P.boxMargin,s=B.getVerticalPos()+l,B.insert(r,s-10,n,s)),B.bumpVerticalPos(l),e.height+=l,e.stopy=e.starty+e.height,B.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),s}function _yt(t,e,r,n,i){B.bumpVerticalPos(r);let a=n;e.id&&e.message&&t[e.id]&&(r=t[e.id].width,t=Nyt(P),e.message=H8.wrapLabel(`[${e.message}]`,r-2*P.wrapPadding,t),e.width=r,e.wrap=!0,r=H8.calculateTextDimensions(e.message,t),t=L.getMax(r.height,P.labelBoxHeight),a=n+t,R.debug(t+" - "+e.message)),i(e),B.bumpVerticalPos(a)}function Cyt(r,n,t,e,i,a,o){function s(t,e){t.x{var e=Nyt(P),r=t.actorKeys.reduce((t,e)=>t+(n.get(e).width+(n.get(e).margin||0)),0),e=(r-=2*P.boxTextMargin,t.wrap&&(t.name=H8.wrapLabel(t.name,r-2*P.wrapPadding,e)),H8.calculateTextDimensions(t.name,e)),e=(c=L.getMax(e.height,c),L.getMax(r,e.width+2*P.wrapPadding));t.margin=P.boxTextMargin,rt.textMaxHeight=c),L.getMax(r,P.height)}var P,B,Lyt,Nyt,Iyt,Myt,Ryt,Dyt,Oyt,Pyt,Byt,Fyt,$yt,zyt,Gyt,Uyt,qyt,Yyt,jyt,Hyt=t(()=>{Q3(),Tyt(),e(),tc(),e5(),i(),Hr(),K8(),ec(),P={},B={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:Ae(function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map(t=>t.height||0))+(0===this.loops.length?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(0===this.messages.length?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(0===this.notes.length?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:Ae(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:Ae(function(t){this.boxes.push(t)},"addBox"),addActor:Ae(function(t){this.actors.push(t)},"addActor"),addLoop:Ae(function(t){this.loops.push(t)},"addLoop"),addMessage:Ae(function(t){this.messages.push(t)},"addMessage"),addNote:Ae(function(t){this.notes.push(t)},"addNote"),lastActor:Ae(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:Ae(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:Ae(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:Ae(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:Ae(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,Byt(D())},"init"),updateVal:Ae(function(t,e,r,n){void 0===t[e]?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:Ae(function(n,i,a,o){let s=this,l=0;function t(r){return Ae(function(t){l++;var e=s.sequenceItems.length-l+1;s.updateVal(t,"starty",i-e*P.boxMargin,Math.min),s.updateVal(t,"stopy",o+e*P.boxMargin,Math.max),s.updateVal(B.data,"startx",n-e*P.boxMargin,Math.min),s.updateVal(B.data,"stopx",a+e*P.boxMargin,Math.max),"activation"!==r&&(s.updateVal(t,"startx",n-e*P.boxMargin,Math.min),s.updateVal(t,"stopx",a+e*P.boxMargin,Math.max),s.updateVal(B.data,"starty",i-e*P.boxMargin,Math.min),s.updateVal(B.data,"stopy",o+e*P.boxMargin,Math.max))},"updateItemBounds")}Ae(t,"updateFn"),this.sequenceItems.forEach(t()),this.activations.forEach(t("activation"))},"updateBounds"),insert:Ae(function(t,e,r,n){var i=L.getMin(t,r),t=L.getMax(t,r),r=L.getMin(e,n),e=L.getMax(e,n);this.updateVal(B.data,"startx",i,Math.min),this.updateVal(B.data,"starty",r,Math.min),this.updateVal(B.data,"stopx",t,Math.max),this.updateVal(B.data,"stopy",e,Math.max),this.updateBounds(i,r,t,e)},"insert"),newActivation:Ae(function(t,e,r){var r=r.get(t.from),n=Fyt(t.from).length||0,r=r.x+r.width/2+(n-1)*P.activationWidth/2;this.activations.push({startx:r,starty:this.verticalPos+2,stopx:r+P.activationWidth,stopy:void 0,actor:t.from,anchored:byt.anchorElement(e)})},"newActivation"),endActivation:Ae(function(t){return t=this.activations.map(function(t){return t.actor}).lastIndexOf(t.from),this.activations.splice(t,1)[0]},"endActivation"),createLoop:Ae(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:Ae(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:Ae(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:Ae(function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap},"isLoopOverlap"),addSectionToLoop:Ae(function(t){var e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:B.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:Ae(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:Ae(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:Ae(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=L.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:Ae(function(){return this.verticalPos},"getVerticalPos"),getBounds:Ae(function(){return{bounds:this.data,models:this.models}},"getBounds")},Lyt=Ae(async function(t,e){B.bumpVerticalPos(P.boxMargin),e.height=P.boxMargin,e.starty=B.getVerticalPos();var r=T3(),t=(r.x=e.startx,r.y=e.starty,r.width=e.width||P.width,r.class="note",t.append("g")),n=byt.drawRect(t,r),t=((i=E3()).x=e.startx,i.y=e.starty,i.width=r.width,i.dy="1em",i.text=e.message,i.class="noteText",i.fontFamily=P.noteFontFamily,i.fontSize=P.noteFontSize,i.fontWeight=P.noteFontWeight,i.anchor=P.noteAlign,i.textMargin=P.noteMargin,i.valign="center",ql(i.text)?await Kmt(t,i):Zmt(t,i)),i=Math.round(t.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e));n.attr("height",i+2*P.noteMargin),e.height+=i+2*P.noteMargin,B.bumpVerticalPos(i+2*P.noteMargin),e.stopy=e.starty+i+2*P.noteMargin,e.stopx=e.startx+r.width,B.insert(e.startx,e.starty,e.stopx,e.stopy),B.models.addNote(e)},"drawNote"),Nyt=Ae(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),Iyt=Ae(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),Myt=Ae(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont"),Ae(Eyt,"boundMessage"),Ryt=Ae(async function(t,e,r,n){var{startx:e,stopx:i,starty:a,message:o,type:s,sequenceIndex:l,sequenceVisible:c}=e,h=H8.calculateTextDimensions(o,Nyt(P)),u=E3();u.x=e,u.y=a+10,u.width=i-e,u.class="messageText",u.dy="1em",u.text=o,u.fontFamily=P.messageFontFamily,u.fontSize=P.messageFontSize,u.fontWeight=P.messageFontWeight,u.anchor=P.messageAlign,u.valign="center",u.textMargin=P.wrapPadding,u.tspan=!1,ql(u.text)?await Kmt(t,u,{startx:e,stopx:i,starty:r}):Zmt(t,u);let d=h.width,p,g=(e===i?p=P.rightAngles?t.append("path").attr("d",`M ${e},${r} H ${e+L.getMax(P.width/2,d/2)} V ${r+25} H `+e):t.append("path").attr("d","M "+e+","+r+" C "+(e+60)+","+(r-10)+" "+(e+60)+","+(r+30)+" "+e+","+(r+20)):((p=t.append("line")).attr("x1",e),p.attr("y1",r),p.attr("x2",i),p.attr("y2",r)),s===n.db.LINETYPE.DOTTED||s===n.db.LINETYPE.DOTTED_CROSS||s===n.db.LINETYPE.DOTTED_POINT||s===n.db.LINETYPE.DOTTED_OPEN||s===n.db.LINETYPE.BIDIRECTIONAL_DOTTED?(p.style("stroke-dasharray","3, 3"),p.attr("class","messageLine1")):p.attr("class","messageLine0"),"");P.arrowMarkerAbsolute&&(g=(g=(g=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search).replace(/\(/g,"\\(")).replace(/\)/g,"\\)")),p.attr("stroke-width",2),p.attr("stroke","none"),p.style("fill","none"),s!==n.db.LINETYPE.SOLID&&s!==n.db.LINETYPE.DOTTED||p.attr("marker-end","url("+g+"#arrowhead)"),s!==n.db.LINETYPE.BIDIRECTIONAL_SOLID&&s!==n.db.LINETYPE.BIDIRECTIONAL_DOTTED||(p.attr("marker-start","url("+g+"#arrowhead)"),p.attr("marker-end","url("+g+"#arrowhead)")),s!==n.db.LINETYPE.SOLID_POINT&&s!==n.db.LINETYPE.DOTTED_POINT||p.attr("marker-end","url("+g+"#filled-head)"),s!==n.db.LINETYPE.SOLID_CROSS&&s!==n.db.LINETYPE.DOTTED_CROSS||p.attr("marker-end","url("+g+"#crosshead)"),(c||P.showSequenceNumbers)&&(p.attr("marker-start","url("+g+"#sequencenumber)"),t.append("text").attr("x",e).attr("y",r+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(l))},"drawMessage"),Dyt=Ae(function(t,e,r,n,i,a,o){let s=0,l=0,c,h=0;for(var u of n){var d=(u=e.get(u)).box;c&&c!=d&&(o||B.models.addBox(c),l+=P.boxMargin+c.margin),d&&d!=c&&(o||(d.x=s+l,d.y=i),l+=d.margin),u.width=u.width||P.width,u.height=L.getMax(u.height||P.height,P.height),u.margin=u.margin||P.actorMargin,h=L.getMax(h,u.height),r.get(u.name)&&(l+=u.width/2),u.x=s+l,u.starty=B.getVerticalPos(),B.insert(u.x,i,u.x+u.width,u.height),s+=u.width+l,u.box&&(u.box.width=s+d.margin-u.box.x),l=u.margin,c=u.box,B.models.addActor(u)}c&&!o&&B.models.addBox(c),B.bumpVerticalPos(h)},"addActorRenderingData"),Oyt=Ae(async function(e,r,n,t){if(t){let t=0;B.bumpVerticalPos(2*P.boxMargin);for(var i of n)(i=r.get(i)).stopy||(i.stopy=B.getVerticalPos()),i=await byt.drawActor(e,i,P,!0),t=L.getMax(t,i);B.bumpVerticalPos(t+P.boxMargin)}else for(var a of n)a=r.get(a),await byt.drawActor(e,a,P,!1)},"drawActors"),Pyt=Ae(function(t,e,r,n){let i=0,a=0;for(var o of r){var o=e.get(o),s=Gyt(o);(s=byt.drawPopup(t,o,s,P,P.forceMenus,n)).height>i&&(i=s.height),s.width+o.x>a&&(a=s.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),Byt=Ae(function(t){ae(P,t),t.fontFamily&&(P.actorFontFamily=P.noteFontFamily=P.messageFontFamily=t.fontFamily),t.fontSize&&(P.actorFontSize=P.noteFontSize=P.messageFontSize=t.fontSize),t.fontWeight&&(P.actorFontWeight=P.noteFontWeight=P.messageFontWeight=t.fontWeight)},"setConf"),Fyt=Ae(function(e){return B.activations.filter(function(t){return t.actor===e})},"actorActivations"),$yt=Ae(function(t,e){return e=e.get(t),[(t=Fyt(t)).reduce(function(t,e){return L.getMin(t,e.startx)},e.x+e.width/2-1),t.reduce(function(t,e){return L.getMax(t,e.stopx)},e.x+e.width/2+1)]},"activationBounds"),Ae(_yt,"adjustLoopHeightForWrap"),Ae(Cyt,"adjustCreatedDestroyedData"),zyt=Ae(async function(n,t,e,i){var{securityLevel:r,sequence:a}=D();P=a;let o;"sandbox"===r&&(o=O("#i"+t));var a=O("sandbox"===r?o.nodes()[0].contentDocument.body:"body"),s="sandbox"===r?o.nodes()[0].contentDocument:document;B.init(),R.debug(i.db);let l="sandbox"===r?a.select(`[id="${t}"]`):O(`[id="${t}"]`),c=i.db.getActors(),h=i.db.getCreatedActors(),u=i.db.getDestroyedActors(),d=i.db.getBoxes(),p=i.db.getActorKeys(),g=i.db.getMessages(),f=i.db.getDiagramTitle(),m=i.db.hasAtLeastOneBox(),y=i.db.hasAtLeastOneBoxWithTitle(),v=await Syt(c,g,i);if(P.height=await Ayt(c,v,d),byt.insertComputerIcon(l),byt.insertDatabaseIcon(l),byt.insertClockIcon(l),m&&(B.bumpVerticalPos(P.boxMargin),y)&&B.bumpVerticalPos(d[0].textMaxHeight),!0===P.hideUnusedParticipants){let e=new Set;g.forEach(t=>{e.add(t.from),e.add(t.to)}),p=p.filter(t=>e.has(t))}Dyt(l,c,h,p,0,g,!1);var x,b,w,k=await Yyt(g,c,v,i);function T(t,e){var r=B.endActivation(t);r.starty+18>e&&(r.starty=e-6,e+=12),byt.drawActivation(l,r,e,P,Fyt(t.from).length),B.insert(r.startx,e-10,r.stopx,e)}byt.insertArrowHead(l),byt.insertArrowCrossHead(l),byt.insertArrowFilledHead(l),byt.insertSequenceNumber(l),Ae(T,"activeEnd");let E=1,_=1,C=[],S=[],A=0;for(x of g){let t,e,r;switch(x.type){case i.db.LINETYPE.NOTE:B.resetVerticalPos(),e=x.noteModel,await Lyt(l,e);break;case i.db.LINETYPE.ACTIVE_START:B.newActivation(x,l,c);break;case i.db.LINETYPE.ACTIVE_END:T(x,B.getVerticalPos());break;case i.db.LINETYPE.LOOP_START:_yt(k,x,P.boxMargin,P.boxMargin+P.boxTextMargin,t=>B.newLoop(t));break;case i.db.LINETYPE.LOOP_END:t=B.endLoop(),await byt.drawLoop(l,t,"loop",P),B.bumpVerticalPos(t.stopy-B.getVerticalPos()),B.models.addLoop(t);break;case i.db.LINETYPE.RECT_START:_yt(k,x,P.boxMargin,P.boxMargin,t=>B.newLoop(void 0,t.message));break;case i.db.LINETYPE.RECT_END:t=B.endLoop(),S.push(t),B.models.addLoop(t),B.bumpVerticalPos(t.stopy-B.getVerticalPos());break;case i.db.LINETYPE.OPT_START:_yt(k,x,P.boxMargin,P.boxMargin+P.boxTextMargin,t=>B.newLoop(t));break;case i.db.LINETYPE.OPT_END:t=B.endLoop(),await byt.drawLoop(l,t,"opt",P),B.bumpVerticalPos(t.stopy-B.getVerticalPos()),B.models.addLoop(t);break;case i.db.LINETYPE.ALT_START:_yt(k,x,P.boxMargin,P.boxMargin+P.boxTextMargin,t=>B.newLoop(t));break;case i.db.LINETYPE.ALT_ELSE:_yt(k,x,P.boxMargin+P.boxTextMargin,P.boxMargin,t=>B.addSectionToLoop(t));break;case i.db.LINETYPE.ALT_END:t=B.endLoop(),await byt.drawLoop(l,t,"alt",P),B.bumpVerticalPos(t.stopy-B.getVerticalPos()),B.models.addLoop(t);break;case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:_yt(k,x,P.boxMargin,P.boxMargin+P.boxTextMargin,t=>B.newLoop(t)),B.saveVerticalPos();break;case i.db.LINETYPE.PAR_AND:_yt(k,x,P.boxMargin+P.boxTextMargin,P.boxMargin,t=>B.addSectionToLoop(t));break;case i.db.LINETYPE.PAR_END:t=B.endLoop(),await byt.drawLoop(l,t,"par",P),B.bumpVerticalPos(t.stopy-B.getVerticalPos()),B.models.addLoop(t);break;case i.db.LINETYPE.AUTONUMBER:E=x.message.start||E,_=x.message.step||_,x.message.visible?i.db.enableSequenceNumbers():i.db.disableSequenceNumbers();break;case i.db.LINETYPE.CRITICAL_START:_yt(k,x,P.boxMargin,P.boxMargin+P.boxTextMargin,t=>B.newLoop(t));break;case i.db.LINETYPE.CRITICAL_OPTION:_yt(k,x,P.boxMargin+P.boxTextMargin,P.boxMargin,t=>B.addSectionToLoop(t));break;case i.db.LINETYPE.CRITICAL_END:t=B.endLoop(),await byt.drawLoop(l,t,"critical",P),B.bumpVerticalPos(t.stopy-B.getVerticalPos()),B.models.addLoop(t);break;case i.db.LINETYPE.BREAK_START:_yt(k,x,P.boxMargin,P.boxMargin+P.boxTextMargin,t=>B.newLoop(t));break;case i.db.LINETYPE.BREAK_END:t=B.endLoop(),await byt.drawLoop(l,t,"break",P),B.bumpVerticalPos(t.stopy-B.getVerticalPos()),B.models.addLoop(t);break;default:try{(r=x.msgModel).starty=B.getVerticalPos(),r.sequenceIndex=E,r.sequenceVisible=i.db.showSequenceNumbers();var L=await Eyt(l,r);Cyt(x,r,L,A,c,h,u),C.push({messageModel:r,lineStartY:L}),B.models.addMessage(r)}catch(n){R.error("error while drawing message",n)}}[i.db.LINETYPE.SOLID_OPEN,i.db.LINETYPE.DOTTED_OPEN,i.db.LINETYPE.SOLID,i.db.LINETYPE.DOTTED,i.db.LINETYPE.SOLID_CROSS,i.db.LINETYPE.DOTTED_CROSS,i.db.LINETYPE.SOLID_POINT,i.db.LINETYPE.DOTTED_POINT,i.db.LINETYPE.BIDIRECTIONAL_SOLID,i.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(x.type)&&(E+=_),A++}R.debug("createdActors",h),R.debug("destroyedActors",u),await Oyt(l,c,p,!1);for(b of C)await Ryt(l,b.messageModel,b.lineStartY,i);P.mirrorActors&&await Oyt(l,c,p,!0),S.forEach(t=>byt.drawBackgroundRect(l,t)),tyt(l,c,p,P);for(w of B.models.boxes)w.height=B.getVerticalPos()-w.y,B.insert(w.x,w.y,w.x+w.width,w.height),w.startx=w.x,w.starty=w.y,w.stopx=w.startx+w.width,w.stopy=w.starty+w.height,w.stroke="rgb(0,0,0, 0.5)",byt.drawBox(l,w,P);m&&B.bumpVerticalPos(P.boxMargin),r=Pyt(l,c,p,s),void 0===(a=B.getBounds().bounds).startx&&(a.startx=0),void 0===a.starty&&(a.starty=0),void 0===a.stopx&&(a.stopx=0),void 0===a.stopy&&(a.stopy=0);let N=a.stopy-a.starty,I=(Ns?-t:t,"adjustValue");t.from===t.to?c=l:(t.activate&&!h&&(c+=u(P.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(c+=u(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(l-=u(3)));var e=[n,i,a,o],r=Math.abs(l-c),d=(t.wrap&&t.message&&(t.message=H8.wrapLabel(t.message,L.getMax(r+2*P.wrapPadding,P.width),Nyt(P))),H8.calculateTextDimensions(t.message,Nyt(P)));return{width:L.getMax(t.wrap?0:d.width+2*P.wrapPadding,r+2*P.wrapPadding,P.width),height:0,startx:l,stopx:c,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,e),toBounds:Math.max.apply(null,e)}},"buildMessageModel"),Yyt=Ae(async function(t,n,e,i){let a={},o=[],s,l,c;for(let r of t){switch(r.id=H8.random({length:10}),r.type){case i.db.LINETYPE.LOOP_START:case i.db.LINETYPE.ALT_START:case i.db.LINETYPE.OPT_START:case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:case i.db.LINETYPE.CRITICAL_START:case i.db.LINETYPE.BREAK_START:o.push({id:r.id,msg:r.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case i.db.LINETYPE.ALT_ELSE:case i.db.LINETYPE.PAR_AND:case i.db.LINETYPE.CRITICAL_OPTION:r.message&&(s=o.pop(),a[s.id]=s,a[r.id]=s,o.push(s));break;case i.db.LINETYPE.LOOP_END:case i.db.LINETYPE.ALT_END:case i.db.LINETYPE.OPT_END:case i.db.LINETYPE.PAR_END:case i.db.LINETYPE.CRITICAL_END:case i.db.LINETYPE.BREAK_END:s=o.pop(),a[s.id]=s;break;case i.db.LINETYPE.ACTIVE_START:var h=n.get(r.from||r.to.actor),u=Fyt(r.from||r.to.actor).length,u={startx:h=h.x+h.width/2+(u-1)*P.activationWidth/2,stopx:h+P.activationWidth,actor:r.from,enabled:!0};B.activations.push(u);break;case i.db.LINETYPE.ACTIVE_END:h=B.activations.map(t=>t.actor).lastIndexOf(r.from),B.activations.splice(h,1).splice(0,1)}void 0!==r.placement?(l=await Uyt(r,n,i),r.noteModel=l,o.forEach(t=>{(s=t).from=L.getMin(s.from,l.startx),s.to=L.getMax(s.to,l.startx+l.width),s.width=L.getMax(s.width,Math.abs(s.from-s.to))-P.labelBoxWidth})):(c=qyt(r,n,i),(r.msgModel=c).startx&&c.stopx&&0{var e;s=t,c.startx===c.stopx?(t=n.get(r.from),e=n.get(r.to),s.from=L.getMin(t.x-c.width/2,t.x-t.width/2,s.from),s.to=L.getMax(e.x+c.width/2,e.x+t.width/2,s.to),s.width=L.getMax(s.width,Math.abs(s.to-s.from))-P.labelBoxWidth):(s.from=L.getMin(c.startx,s.from),s.to=L.getMax(c.stopx,s.to),s.width=L.getMax(s.width,c.width)-P.labelBoxWidth)}))}return B.activations=[],R.debug("Loop type widths:",a),a},"calculateLoopBounds"),jyt={bounds:B,drawActors:Oyt,drawActorsPopup:Pyt,setConf:Byt,draw:zyt}}),Wyt={};J(Wyt,{diagram:()=>Vyt});var Vyt,Xyt,Kyt,Zyt,Qyt,Jyt,t2t,e2t,r2t,n2t,i2t,a2t,o2t,s2t,l2t,c2t,h2t,u2t,d2t,p2t,g2t,f2t,m2t,y2t,v2t,x2t,b2t,w2t,k2t,T2t,E2t,_2t,C2t,S2t,A2t,L2t,N2t,I2t,M2t,R2t,D2t,O2t,P2t,B2t,F2t,$2t,z2t,G2t,U2t,q2t,Y2t,j2t,H2t,W2t,V2t,X2t,K2t,Z2t,Q2t,J2t,tvt,evt,rvt=t(()=>{nmt(),wyt(),kyt(),Hyt(),Vyt={parser:emt,db:Gmt,renderer:jyt,styles:qmt,init:Ae(({wrap:t})=>{Gmt.setWrap(t)},"init")}}),nvt=t(()=>{function t(){this.yy={}}var e=Ae(function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r},"o"),r=[1,17],n=[1,18],i=[1,19],a=[1,39],o=[1,40],s=[1,25],l=[1,23],P=[1,24],B=[1,31],F=[1,32],$=[1,33],z=[1,34],G=[1,35],U=[1,36],q=[1,26],Y=[1,27],j=[1,28],H=[1,29],c=[1,43],W=[1,30],h=[1,42],u=[1,44],d=[1,41],p=[1,45],V=[1,9],g=[1,8,9],f=[1,56],m=[1,57],y=[1,58],v=[1,59],x=[1,60],X=[1,61],K=[1,62],b=[1,8,9,39],Z=[1,74],w=[1,8,9,12,13,21,37,39,42,59,60,61,62,63,64,65,70,72],k=[1,8,9,12,13,19,21,37,39,42,46,59,60,61,62,63,64,65,70,72,74,80,95,97,98],T=[13,74,80,95,97,98],E=[13,64,65,74,80,95,97,98],Q=[13,59,60,61,62,63,74,80,95,97,98],J=[1,93],_=[1,110],C=[1,108],S=[1,102],A=[1,103],L=[1,104],N=[1,105],I=[1,106],M=[1,107],R=[1,109],tt=[1,8,9,37,39,42],D=[1,8,9,21],et=[1,8,9,78],O=[1,8,9,21,73,74,78,80,81,82,83,84,85],k={trace:Ae(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,className:17,classLiteralName:18,GENERICTYPE:19,relationStatement:20,LABEL:21,namespaceStatement:22,classStatement:23,memberStatement:24,annotationStatement:25,clickStatement:26,styleStatement:27,cssClassStatement:28,noteStatement:29,direction:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,namespaceIdentifier:36,STRUCT_START:37,classStatements:38,STRUCT_STOP:39,NAMESPACE:40,classIdentifier:41,STYLE_SEPARATOR:42,members:43,CLASS:44,ANNOTATION_START:45,ANNOTATION_END:46,MEMBER:47,SEPARATOR:48,relation:49,NOTE_FOR:50,noteText:51,NOTE:52,direction_tb:53,direction_bt:54,direction_rl:55,direction_lr:56,relationType:57,lineType:58,AGGREGATION:59,EXTENSION:60,COMPOSITION:61,DEPENDENCY:62,LOLLIPOP:63,LINE:64,DOTTED_LINE:65,CALLBACK:66,LINK:67,LINK_TARGET:68,CLICK:69,CALLBACK_NAME:70,CALLBACK_ARGS:71,HREF:72,STYLE:73,ALPHA:74,stylesOpt:75,CSSCLASS:76,style:77,COMMA:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,commentToken:86,textToken:87,graphCodeTokens:88,textNoTagsToken:89,TAGSTART:90,TAGEND:91,"==":92,"--":93,DEFAULT:94,MINUS:95,keywords:96,UNICODE_TEXT:97,BQUOTE_STR:98,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",19:"GENERICTYPE",21:"LABEL",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",37:"STRUCT_START",39:"STRUCT_STOP",40:"NAMESPACE",42:"STYLE_SEPARATOR",44:"CLASS",45:"ANNOTATION_START",46:"ANNOTATION_END",47:"MEMBER",48:"SEPARATOR",50:"NOTE_FOR",52:"NOTE",53:"direction_tb",54:"direction_bt",55:"direction_rl",56:"direction_lr",59:"AGGREGATION",60:"EXTENSION",61:"COMPOSITION",62:"DEPENDENCY",63:"LOLLIPOP",64:"LINE",65:"DOTTED_LINE",66:"CALLBACK",67:"LINK",68:"LINK_TARGET",69:"CLICK",70:"CALLBACK_NAME",71:"CALLBACK_ARGS",72:"HREF",73:"STYLE",74:"ALPHA",76:"CSSCLASS",78:"COMMA",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",88:"graphCodeTokens",90:"TAGSTART",91:"TAGEND",92:"==",93:"--",94:"DEFAULT",95:"MINUS",96:"keywords",97:"UNICODE_TEXT",98:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,2],[17,1],[17,1],[17,2],[17,2],[17,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[22,4],[22,5],[36,2],[38,1],[38,2],[38,3],[23,1],[23,3],[23,4],[23,6],[41,2],[41,3],[25,4],[43,1],[43,2],[24,1],[24,2],[24,1],[24,1],[20,3],[20,4],[20,4],[20,5],[29,3],[29,2],[30,1],[30,1],[30,1],[30,1],[49,3],[49,2],[49,2],[49,1],[57,1],[57,1],[57,1],[57,1],[57,1],[58,1],[58,1],[26,3],[26,4],[26,3],[26,4],[26,4],[26,5],[26,3],[26,4],[26,4],[26,5],[26,4],[26,5],[26,5],[26,6],[27,3],[28,3],[75,1],[75,3],[77,1],[77,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[86,1],[86,1],[87,1],[87,1],[87,1],[87,1],[87,1],[87,1],[87,1],[89,1],[89,1],[89,1],[89,1],[16,1],[16,1],[16,1],[16,1],[18,1],[51,1]],performAction:Ae(function(t,e,r,n,i,a,o){var s=a.length-1;switch(i){case 8:this.$=a[s-1];break;case 9:case 11:case 12:this.$=a[s];break;case 10:case 13:this.$=a[s-1]+a[s];break;case 14:case 15:this.$=a[s-1]+"~"+a[s]+"~";break;case 16:n.addRelation(a[s]);break;case 17:a[s-1].title=n.cleanupLabel(a[s]),n.addRelation(a[s-1]);break;case 27:this.$=a[s].trim(),n.setAccTitle(this.$);break;case 28:case 29:this.$=a[s].trim(),n.setAccDescription(this.$);break;case 30:n.addClassesToNamespace(a[s-3],a[s-1]);break;case 31:n.addClassesToNamespace(a[s-4],a[s-1]);break;case 32:this.$=a[s],n.addNamespace(a[s]);break;case 33:this.$=[a[s]];break;case 34:this.$=[a[s-1]];break;case 35:a[s].unshift(a[s-2]),this.$=a[s];break;case 37:n.setCssClass(a[s-2],a[s]);break;case 38:n.addMembers(a[s-3],a[s-1]);break;case 39:n.setCssClass(a[s-5],a[s-3]),n.addMembers(a[s-5],a[s-1]);break;case 40:this.$=a[s],n.addClass(a[s]);break;case 41:this.$=a[s-1],n.addClass(a[s-1]),n.setClassLabel(a[s-1],a[s]);break;case 42:n.addAnnotation(a[s],a[s-2]);break;case 43:this.$=[a[s]];break;case 44:a[s].push(a[s-1]),this.$=a[s];break;case 45:break;case 46:n.addMember(a[s-1],n.cleanupLabel(a[s]));break;case 47:case 48:break;case 49:this.$={id1:a[s-2],id2:a[s],relation:a[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 50:this.$={id1:a[s-3],id2:a[s],relation:a[s-1],relationTitle1:a[s-2],relationTitle2:"none"};break;case 51:this.$={id1:a[s-3],id2:a[s],relation:a[s-2],relationTitle1:"none",relationTitle2:a[s-1]};break;case 52:this.$={id1:a[s-4],id2:a[s],relation:a[s-2],relationTitle1:a[s-3],relationTitle2:a[s-1]};break;case 53:n.addNote(a[s],a[s-1]);break;case 54:n.addNote(a[s]);break;case 55:n.setDirection("TB");break;case 56:n.setDirection("BT");break;case 57:n.setDirection("RL");break;case 58:n.setDirection("LR");break;case 59:this.$={type1:a[s-2],type2:a[s],lineType:a[s-1]};break;case 60:this.$={type1:"none",type2:a[s],lineType:a[s-1]};break;case 61:this.$={type1:a[s-1],type2:"none",lineType:a[s]};break;case 62:this.$={type1:"none",type2:"none",lineType:a[s]};break;case 63:this.$=n.relationType.AGGREGATION;break;case 64:this.$=n.relationType.EXTENSION;break;case 65:this.$=n.relationType.COMPOSITION;break;case 66:this.$=n.relationType.DEPENDENCY;break;case 67:this.$=n.relationType.LOLLIPOP;break;case 68:this.$=n.lineType.LINE;break;case 69:this.$=n.lineType.DOTTED_LINE;break;case 70:case 76:this.$=a[s-2],n.setClickEvent(a[s-1],a[s]);break;case 71:case 77:this.$=a[s-3],n.setClickEvent(a[s-2],a[s-1]),n.setTooltip(a[s-2],a[s]);break;case 72:this.$=a[s-2],n.setLink(a[s-1],a[s]);break;case 73:this.$=a[s-3],n.setLink(a[s-2],a[s-1],a[s]);break;case 74:this.$=a[s-3],n.setLink(a[s-2],a[s-1]),n.setTooltip(a[s-2],a[s]);break;case 75:this.$=a[s-4],n.setLink(a[s-3],a[s-2],a[s]),n.setTooltip(a[s-3],a[s-1]);break;case 78:this.$=a[s-3],n.setClickEvent(a[s-2],a[s-1],a[s]);break;case 79:this.$=a[s-4],n.setClickEvent(a[s-3],a[s-2],a[s-1]),n.setTooltip(a[s-3],a[s]);break;case 80:this.$=a[s-3],n.setLink(a[s-2],a[s]);break;case 81:this.$=a[s-4],n.setLink(a[s-3],a[s-1],a[s]);break;case 82:this.$=a[s-4],n.setLink(a[s-3],a[s-1]),n.setTooltip(a[s-3],a[s]);break;case 83:this.$=a[s-5],n.setLink(a[s-4],a[s-2],a[s]),n.setTooltip(a[s-4],a[s-1]);break;case 84:this.$=a[s-2],n.setCssStyle(a[s-1],a[s]);break;case 85:n.setCssClass(a[s-1],a[s]);break;case 86:this.$=[a[s]];break;case 87:a[s-2].push(a[s]),this.$=a[s-2];break;case 89:this.$=a[s-1]+a[s]}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:37,17:20,18:38,20:7,22:8,23:9,24:10,25:11,26:12,27:13,28:14,29:15,30:16,31:r,33:n,35:i,36:21,40:a,41:22,44:o,45:s,47:l,48:P,50:B,52:F,53:$,54:z,55:G,56:U,66:q,67:Y,69:j,73:H,74:c,76:W,80:h,95:u,97:d,98:p},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},e(V,[2,5],{8:[1,46]}),{8:[1,47]},e(g,[2,16],{21:[1,48]}),e(g,[2,18]),e(g,[2,19]),e(g,[2,20]),e(g,[2,21]),e(g,[2,22]),e(g,[2,23]),e(g,[2,24]),e(g,[2,25]),e(g,[2,26]),{32:[1,49]},{34:[1,50]},e(g,[2,29]),e(g,[2,45],{49:51,57:54,58:55,13:[1,52],21:[1,53],59:f,60:m,61:y,62:v,63:x,64:X,65:K}),{37:[1,63]},e(b,[2,36],{37:[1,65],42:[1,64]}),e(g,[2,47]),e(g,[2,48]),{16:66,74:c,80:h,95:u,97:d},{16:37,17:67,18:38,74:c,80:h,95:u,97:d,98:p},{16:37,17:68,18:38,74:c,80:h,95:u,97:d,98:p},{16:37,17:69,18:38,74:c,80:h,95:u,97:d,98:p},{74:[1,70]},{13:[1,71]},{16:37,17:72,18:38,74:c,80:h,95:u,97:d,98:p},{13:Z,51:73},e(g,[2,55]),e(g,[2,56]),e(g,[2,57]),e(g,[2,58]),e(w,[2,11],{16:37,18:38,17:75,19:[1,76],74:c,80:h,95:u,97:d,98:p}),e(w,[2,12],{19:[1,77]}),{15:78,16:79,74:c,80:h,95:u,97:d},{16:37,17:80,18:38,74:c,80:h,95:u,97:d,98:p},e(k,[2,112]),e(k,[2,113]),e(k,[2,114]),e(k,[2,115]),e([1,8,9,12,13,19,21,37,39,42,59,60,61,62,63,64,65,70,72],[2,116]),e(V,[2,6],{10:5,20:7,22:8,23:9,24:10,25:11,26:12,27:13,28:14,29:15,30:16,17:20,36:21,41:22,16:37,18:38,5:81,31:r,33:n,35:i,40:a,44:o,45:s,47:l,48:P,50:B,52:F,53:$,54:z,55:G,56:U,66:q,67:Y,69:j,73:H,74:c,76:W,80:h,95:u,97:d,98:p}),{5:82,10:5,16:37,17:20,18:38,20:7,22:8,23:9,24:10,25:11,26:12,27:13,28:14,29:15,30:16,31:r,33:n,35:i,36:21,40:a,41:22,44:o,45:s,47:l,48:P,50:B,52:F,53:$,54:z,55:G,56:U,66:q,67:Y,69:j,73:H,74:c,76:W,80:h,95:u,97:d,98:p},e(g,[2,17]),e(g,[2,27]),e(g,[2,28]),{13:[1,84],16:37,17:83,18:38,74:c,80:h,95:u,97:d,98:p},{49:85,57:54,58:55,59:f,60:m,61:y,62:v,63:x,64:X,65:K},e(g,[2,46]),{58:86,64:X,65:K},e(T,[2,62],{57:87,59:f,60:m,61:y,62:v,63:x}),e(E,[2,63]),e(E,[2,64]),e(E,[2,65]),e(E,[2,66]),e(E,[2,67]),e(Q,[2,68]),e(Q,[2,69]),{8:[1,89],23:90,38:88,41:22,44:o},{16:91,74:c,80:h,95:u,97:d},{43:92,47:J},{46:[1,94]},{13:[1,95]},{13:[1,96]},{70:[1,97],72:[1,98]},{21:_,73:C,74:S,75:99,77:100,79:101,80:A,81:L,82:N,83:I,84:M,85:R},{74:[1,111]},{13:Z,51:112},e(g,[2,54]),e(g,[2,117]),e(w,[2,13]),e(w,[2,14]),e(w,[2,15]),{37:[2,32]},{15:113,16:79,37:[2,9],74:c,80:h,95:u,97:d},e(tt,[2,40],{11:114,12:[1,115]}),e(V,[2,7]),{9:[1,116]},e(D,[2,49]),{16:37,17:117,18:38,74:c,80:h,95:u,97:d,98:p},{13:[1,119],16:37,17:118,18:38,74:c,80:h,95:u,97:d,98:p},e(T,[2,61],{57:120,59:f,60:m,61:y,62:v,63:x}),e(T,[2,60]),{39:[1,121]},{23:90,38:122,41:22,44:o},{8:[1,123],39:[2,33]},e(b,[2,37],{37:[1,124]}),{39:[1,125]},{39:[2,43],43:126,47:J},{16:37,17:127,18:38,74:c,80:h,95:u,97:d,98:p},e(g,[2,70],{13:[1,128]}),e(g,[2,72],{13:[1,130],68:[1,129]}),e(g,[2,76],{13:[1,131],71:[1,132]}),{13:[1,133]},e(g,[2,84],{78:[1,134]}),e(et,[2,86],{79:135,21:_,73:C,74:S,80:A,81:L,82:N,83:I,84:M,85:R}),e(O,[2,88]),e(O,[2,90]),e(O,[2,91]),e(O,[2,92]),e(O,[2,93]),e(O,[2,94]),e(O,[2,95]),e(O,[2,96]),e(O,[2,97]),e(O,[2,98]),e(g,[2,85]),e(g,[2,53]),{37:[2,10]},e(tt,[2,41]),{13:[1,136]},{1:[2,4]},e(D,[2,51]),e(D,[2,50]),{16:37,17:137,18:38,74:c,80:h,95:u,97:d,98:p},e(T,[2,59]),e(g,[2,30]),{39:[1,138]},{23:90,38:139,39:[2,34],41:22,44:o},{43:140,47:J},e(b,[2,38]),{39:[2,44]},e(g,[2,42]),e(g,[2,71]),e(g,[2,73]),e(g,[2,74],{68:[1,141]}),e(g,[2,77]),e(g,[2,78],{13:[1,142]}),e(g,[2,80],{13:[1,144],68:[1,143]}),{21:_,73:C,74:S,77:145,79:101,80:A,81:L,82:N,83:I,84:M,85:R},e(O,[2,89]),{14:[1,146]},e(D,[2,52]),e(g,[2,31]),{39:[2,35]},{39:[1,147]},e(g,[2,75]),e(g,[2,79]),e(g,[2,81]),e(g,[2,82],{68:[1,148]}),e(et,[2,87],{79:135,21:_,73:C,74:S,80:A,81:L,82:N,83:I,84:M,85:R}),e(tt,[2,8]),e(b,[2,39]),e(g,[2,83])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],78:[2,32],113:[2,10],116:[2,4],126:[2,44],139:[2,35]},parseError:Ae(function(t,e){var r;if(!e.recoverable)throw(r=new Error(t)).hash=e,r;this.trace(t)},"parseError"),parse:Ae(function(t){var e,r=this,n=[0],i=[],a=[null],o=[],s=this.table,l="",c=0,h=0,u=0,d=1,p=o.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,e)&&(f.yy[e]=this.yy[e]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,"u"{function e(t,e,r,n,i,a,o){g(e.append("text").attr("x",r).attr("y",n).style("text-anchor","start").text(t),o)}function l(t,e,r,n,i,a,o,s){var{actorFontSize:l,actorFontFamily:c,actorFontWeight:h}=s,u=t.split(L.lineBreakRegex);for(let t=0;tr?s.width:r);if((t=l.append("rect")).attr("class","actorPopupMenuPanel"+i),t.attr("x",s.x),t.attr("y",s.height),t.attr("fill",s.fill),t.attr("stroke",s.stroke),t.attr("width",c),t.attr("height",s.height),t.attr("rx",s.rx),t.attr("ry",s.ry),null!=a){var h,u=20;for(h in a){var d=l.append("a"),p=(0,Ymt.sanitizeUrl)(a[h]);d.attr("xlink:href",p),d.attr("target","_blank"),xyt(n)(h,d,s.x+10,s.height+u,c,20,{class:"actor"},n),u+=30}}return t.attr("height",u),{height:s.height+u,width:c}},"drawPopup"),Xmt=Ae(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Kmt=Ae(async function(n,i,a=null){var o=n.append("foreignObject"),s=await jl(i.text,Rr()),s=o.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(s).node().getBoundingClientRect();if(o.attr("height",Math.round(s.height)).attr("width",Math.round(s.width)),"noteText"===i.class)(n=n.node().firstChild).setAttribute("height",s.height+2*i.textMargin),n=n.getBBox(),o.attr("x",Math.round(n.x+n.width/2-s.width/2)).attr("y",Math.round(n.y+n.height/2-s.height/2));else if(a){let{startx:t,stopx:e,starty:r}=a;t>e&&(n=t,t=e,e=n),o.attr("x",Math.round(t+Math.abs(t-e)/2-s.width/2)),"loopText"===i.class?o.attr("y",Math.round(r)):o.attr("y",Math.round(r-s.height))}return[o]},"drawKatex"),Zmt=Ae(function(t,e){let r=0,n=0,i=e.text.split(L.lineBreakRegex),[a,o]=j8(e.fontSize),s=[],l=0,c=Ae(()=>e.y,"yfunc");if(void 0!==e.valign&&void 0!==e.textMargin&&0Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":c=Ae(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":c=Ae(()=>Math.round(e.y+(r+n+2*e.textMargin)-e.textMargin),"yfunc")}if(void 0!==e.anchor&&void 0!==e.textMargin&&void 0!==e.width)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle"}for(var[h,u]of i.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==a&&(l=h*a),(h=t.append("text")).attr("x",e.x),h.attr("y",c()),void 0!==e.anchor&&h.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&h.style("font-family",e.fontFamily),void 0!==o&&h.style("font-size",o),void 0!==e.fontWeight&&h.style("font-weight",e.fontWeight),void 0!==e.fill&&h.attr("fill",e.fill),void 0!==e.class&&h.attr("class",e.class),void 0!==e.dy?h.attr("dy",e.dy):0!==l&&h.attr("dy",l);var d,u=u||k8;(e.tspan?((d=h.append("tspan")).attr("x",e.x),void 0!==e.fill&&d.attr("fill",e.fill),d):h).text(u),void 0!==e.valign&&void 0!==e.textMargin&&0{r.select&&t.forEach(t=>{var t=n.get(t),e=r.select("#actor"+t.actorCnt);!i.mirrorActors&&t.stopy?e.attr("y2",t.stopy+t.height/2):i.mirrorActors&&e.attr("y2",t.stopy)})},"fixLifeLineHeights"),eyt=Ae(function(t,e,r,n){var i=n?e.stopy:e.starty,a=e.x+e.width/2,o=i+e.height,s=t=t.append("g").lower(),o=(n||(Jmt++,Object.keys(e.links||{}).length&&!r.forceMenus&&s.attr("onclick",Xmt(`actor${Jmt}_popup`)).attr("cursor","pointer"),s.append("line").attr("id","actor"+Jmt).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),s=t.append("g"),e.actorCnt=Jmt,null!=e.links&&s.attr("id","root-"+Jmt)),T3()),a="actor",t=(e.properties?.class?a=e.properties.class:o.fill="#eaeaea",a+=n?" "+Hmt:" actor-top",o.x=e.x,o.y=i,o.width=e.width,o.height=e.height,o.class=a,o.rx=3,o.ry=3,o.name=e.name,Wmt(s,o));e.rectData=o,e.properties?.icon&&("@"===(n=e.properties.icon.trim()).charAt(0)?k3(s,o.x+o.width-20,o.y+10,n.substr(1)):w3(s,o.x+o.width-20,o.y+10,n)),vyt(r,ql(e.description))(e.description,s,o.x,o.y,o.width,o.height,{class:"actor actor-box"},r);let l=e.height;return t.node&&(i=t.node().getBBox(),e.height=i.height,l=i.height),l},"drawActorTypeParticipant"),ryt=Ae(function(t,e,r,n){var i=n?e.stopy:e.starty,a=e.x+e.width/2,o=i+80,s=t.append("g").lower(),l=(n||(Jmt++,s.append("line").attr("id","actor"+Jmt).attr("x1",a).attr("y1",o).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=Jmt),t.append("g")),c="actor-man";return l.attr("class",c+=n?" "+Hmt:" actor-top"),l.attr("name",e.name),(s=T3()).x=e.x,s.y=i,s.fill="#eaeaea",s.width=e.width,s.height=e.height,s.class="actor",s.rx=3,s.ry=3,l.append("line").attr("id","actor-man-torso"+Jmt).attr("x1",a).attr("y1",i+25).attr("x2",a).attr("y2",i+45),l.append("line").attr("id","actor-man-arms"+Jmt).attr("x1",a-jmt/2).attr("y1",i+33).attr("x2",a+jmt/2).attr("y2",i+33),l.append("line").attr("x1",a-jmt/2).attr("y1",i+60).attr("x2",a).attr("y2",i+45),l.append("line").attr("x1",a).attr("y1",i+45).attr("x2",a+jmt/2-2).attr("y2",i+60),(o=l.append("circle")).attr("cx",e.x+e.width/2),o.attr("cy",i+10),o.attr("r",15),o.attr("width",e.width),o.attr("height",e.height),t=l.node().getBBox(),e.height=t.height,vyt(r,ql(e.description))(e.description,l,s.x,s.y+35,s.width,s.height,{class:"actor actor-man"},r),e.height},"drawActorTypeActor"),nyt=Ae(async function(t,e,r,n){switch(e.type){case"actor":return ryt(t,e,r,n);case"participant":return eyt(t,e,r,n)}},"drawActor"),iyt=Ae(function(t,e,r){t=t.append("g"),lyt(t,e),e.name&&vyt(r)(e.name,t,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),t.lower()},"drawBox"),ayt=Ae(function(t){return t.append("g")},"anchorElement"),oyt=Ae(function(t,e,r,n,i){var a=T3(),o=e.anchored;a.x=e.startx,a.y=e.starty,a.class="activation"+i%3,a.width=e.stopx-e.startx,a.height=r-e.starty,Wmt(o,a)},"drawActivation"),syt=Ae(async function(t,e,r,n){let{boxMargin:i,boxTextMargin:a,labelBoxHeight:o,labelBoxWidth:s,messageFontFamily:l,messageFontSize:c,messageFontWeight:h}=n,u=t.append("g"),d=Ae(function(t,e,r,n){return u.append("line").attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",n).attr("class","loopLine")},"drawLoopLine"),p=(d(e.startx,e.starty,e.stopx,e.starty),d(e.stopx,e.starty,e.stopx,e.stopy),d(e.startx,e.stopy,e.stopx,e.stopy),d(e.startx,e.starty,e.startx,e.stopy),void 0!==e.sections&&e.sections.forEach(function(t){d(e.startx,t.y,e.stopx,t.y).style("stroke-dasharray","3, 3")}),E3());p.text=r,p.x=e.startx,p.y=e.starty,p.fontFamily=l,p.fontSize=c,p.fontWeight=h,p.anchor="middle",p.valign="middle",p.tspan=!1,p.width=s||50,p.height=o||20,p.textMargin=a,p.class="labelText",Qmt(u,p),(p=myt()).text=e.title,p.x=e.startx+s/2+(e.stopx-e.startx)/2,p.y=e.starty+i+a,p.anchor="middle",p.valign="middle",p.textMargin=a,p.class="loopText",p.fontFamily=l,p.fontSize=c,p.fontWeight=h,p.wrap=!0;var g=ql(p.text)?await Kmt(u,p,e):Zmt(u,p);if(void 0!==e.sectionTitles)for(var[f,m]of Object.entries(e.sectionTitles))m.message&&(p.text=m.message,p.x=e.startx+(e.stopx-e.startx)/2,p.y=e.sections[f].y+i+a,p.class="loopText",p.anchor="middle",p.valign="middle",p.tspan=!1,p.fontFamily=l,p.fontSize=c,p.fontWeight=h,p.wrap=e.wrap,ql(p.text)?(e.starty=e.sections[f].y,await Kmt(u,p,e)):Zmt(u,p),m=Math.round(g.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e)),e.sections[f].height+=m-(i+a));return e.height=Math.round(e.stopy-e.starty),u},"drawLoop"),lyt=Ae(function(t,e){x3(t,e)},"drawBackgroundRect"),cyt=Ae(function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),hyt=Ae(function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),uyt=Ae(function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),dyt=Ae(function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),pyt=Ae(function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),gyt=Ae(function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),fyt=Ae(function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),myt=Ae(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),yyt=Ae(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Ae(n,"byText"),Ae(c,"byTspan"),Ae(i,"byFo"),Ae(a,"byKatex"),Ae(f,"_setTextAttrs"),vyt=function(t,e=!1){return e?a:"fo"===t.textPlacement?i:"old"===t.textPlacement?n:c},Ae(e,"byText"),Ae(l,"byTspan"),Ae(r,"byFo"),Ae(g,"_setTextAttrs"),xyt=function(t){return"fo"===t.textPlacement?r:"old"===t.textPlacement?e:l},byt={drawRect:Wmt,drawText:Zmt,drawLabel:Qmt,drawActor:nyt,drawBox:iyt,drawPopup:Vmt,anchorElement:ayt,drawActivation:oyt,drawLoop:syt,drawBackgroundRect:lyt,insertArrowHead:dyt,insertArrowFilledHead:pyt,insertSequenceNumber:gyt,insertArrowCrossHead:fyt,insertDatabaseIcon:cyt,insertComputerIcon:hyt,insertClockIcon:uyt,getTextObj:myt,getNoteRect:yyt,fixLifeLineHeights:tyt,sanitizeUrl:Ymt.sanitizeUrl}});async function Eyt(t,e){B.bumpVerticalPos(10);var{startx:r,stopx:n,message:i}=e,a=L.splitBreaks(i).length,o=ql(i),i=o?await Yl(i,D()):H8.calculateTextDimensions(i,Nyt(P));o||(o=i.height/a,e.height+=o,B.bumpVerticalPos(o));let s,l=i.height-10,c=i.width;return r===n?(s=B.getVerticalPos()+l,P.rightAngles||(l+=P.boxMargin,s=B.getVerticalPos()+l),l+=30,a=L.getMax(c/2,P.width/2),B.insert(r-a,B.getVerticalPos()-10+l,n+a,B.getVerticalPos()+30+l)):(l+=P.boxMargin,s=B.getVerticalPos()+l,B.insert(r,s-10,n,s)),B.bumpVerticalPos(l),e.height+=l,e.stopy=e.starty+e.height,B.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),s}function _yt(t,e,r,n,i){B.bumpVerticalPos(r);let a=n;e.id&&e.message&&t[e.id]&&(r=t[e.id].width,t=Nyt(P),e.message=H8.wrapLabel(`[${e.message}]`,r-2*P.wrapPadding,t),e.width=r,e.wrap=!0,r=H8.calculateTextDimensions(e.message,t),t=L.getMax(r.height,P.labelBoxHeight),a=n+t,R.debug(t+" - "+e.message)),i(e),B.bumpVerticalPos(a)}function Cyt(r,n,t,e,i,a,o){function s(t,e){t.x{var e=Nyt(P),r=t.actorKeys.reduce((t,e)=>t+(n.get(e).width+(n.get(e).margin||0)),0),e=(r-=2*P.boxTextMargin,t.wrap&&(t.name=H8.wrapLabel(t.name,r-2*P.wrapPadding,e)),H8.calculateTextDimensions(t.name,e)),e=(c=L.getMax(e.height,c),L.getMax(r,e.width+2*P.wrapPadding));t.margin=P.boxTextMargin,rt.textMaxHeight=c),L.getMax(r,P.height)}var P,B,Lyt,Nyt,Iyt,Myt,Ryt,Dyt,Oyt,Pyt,Byt,Fyt,$yt,zyt,Gyt,Uyt,qyt,Yyt,jyt,Hyt=t(()=>{Q3(),Tyt(),e(),tc(),e5(),i(),Hr(),K8(),ec(),P={},B={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:Ae(function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map(t=>t.height||0))+(0===this.loops.length?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(0===this.messages.length?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(0===this.notes.length?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:Ae(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:Ae(function(t){this.boxes.push(t)},"addBox"),addActor:Ae(function(t){this.actors.push(t)},"addActor"),addLoop:Ae(function(t){this.loops.push(t)},"addLoop"),addMessage:Ae(function(t){this.messages.push(t)},"addMessage"),addNote:Ae(function(t){this.notes.push(t)},"addNote"),lastActor:Ae(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:Ae(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:Ae(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:Ae(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:Ae(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,Byt(D())},"init"),updateVal:Ae(function(t,e,r,n){void 0===t[e]?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:Ae(function(n,i,a,o){let s=this,l=0;function t(r){return Ae(function(t){l++;var e=s.sequenceItems.length-l+1;s.updateVal(t,"starty",i-e*P.boxMargin,Math.min),s.updateVal(t,"stopy",o+e*P.boxMargin,Math.max),s.updateVal(B.data,"startx",n-e*P.boxMargin,Math.min),s.updateVal(B.data,"stopx",a+e*P.boxMargin,Math.max),"activation"!==r&&(s.updateVal(t,"startx",n-e*P.boxMargin,Math.min),s.updateVal(t,"stopx",a+e*P.boxMargin,Math.max),s.updateVal(B.data,"starty",i-e*P.boxMargin,Math.min),s.updateVal(B.data,"stopy",o+e*P.boxMargin,Math.max))},"updateItemBounds")}Ae(t,"updateFn"),this.sequenceItems.forEach(t()),this.activations.forEach(t("activation"))},"updateBounds"),insert:Ae(function(t,e,r,n){var i=L.getMin(t,r),t=L.getMax(t,r),r=L.getMin(e,n),e=L.getMax(e,n);this.updateVal(B.data,"startx",i,Math.min),this.updateVal(B.data,"starty",r,Math.min),this.updateVal(B.data,"stopx",t,Math.max),this.updateVal(B.data,"stopy",e,Math.max),this.updateBounds(i,r,t,e)},"insert"),newActivation:Ae(function(t,e,r){var r=r.get(t.from),n=Fyt(t.from).length||0,r=r.x+r.width/2+(n-1)*P.activationWidth/2;this.activations.push({startx:r,starty:this.verticalPos+2,stopx:r+P.activationWidth,stopy:void 0,actor:t.from,anchored:byt.anchorElement(e)})},"newActivation"),endActivation:Ae(function(t){return t=this.activations.map(function(t){return t.actor}).lastIndexOf(t.from),this.activations.splice(t,1)[0]},"endActivation"),createLoop:Ae(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:Ae(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:Ae(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:Ae(function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap},"isLoopOverlap"),addSectionToLoop:Ae(function(t){var e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:B.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:Ae(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:Ae(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:Ae(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=L.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:Ae(function(){return this.verticalPos},"getVerticalPos"),getBounds:Ae(function(){return{bounds:this.data,models:this.models}},"getBounds")},Lyt=Ae(async function(t,e){B.bumpVerticalPos(P.boxMargin),e.height=P.boxMargin,e.starty=B.getVerticalPos();var r=T3(),t=(r.x=e.startx,r.y=e.starty,r.width=e.width||P.width,r.class="note",t.append("g")),n=byt.drawRect(t,r),t=((i=E3()).x=e.startx,i.y=e.starty,i.width=r.width,i.dy="1em",i.text=e.message,i.class="noteText",i.fontFamily=P.noteFontFamily,i.fontSize=P.noteFontSize,i.fontWeight=P.noteFontWeight,i.anchor=P.noteAlign,i.textMargin=P.noteMargin,i.valign="center",ql(i.text)?await Kmt(t,i):Zmt(t,i)),i=Math.round(t.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e));n.attr("height",i+2*P.noteMargin),e.height+=i+2*P.noteMargin,B.bumpVerticalPos(i+2*P.noteMargin),e.stopy=e.starty+i+2*P.noteMargin,e.stopx=e.startx+r.width,B.insert(e.startx,e.starty,e.stopx,e.stopy),B.models.addNote(e)},"drawNote"),Nyt=Ae(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),Iyt=Ae(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),Myt=Ae(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont"),Ae(Eyt,"boundMessage"),Ryt=Ae(async function(t,e,r,n){var{startx:e,stopx:i,starty:a,message:o,type:s,sequenceIndex:l,sequenceVisible:c}=e,h=H8.calculateTextDimensions(o,Nyt(P)),u=E3();u.x=e,u.y=a+10,u.width=i-e,u.class="messageText",u.dy="1em",u.text=o,u.fontFamily=P.messageFontFamily,u.fontSize=P.messageFontSize,u.fontWeight=P.messageFontWeight,u.anchor=P.messageAlign,u.valign="center",u.textMargin=P.wrapPadding,u.tspan=!1,ql(u.text)?await Kmt(t,u,{startx:e,stopx:i,starty:r}):Zmt(t,u);let d=h.width,p,g=(e===i?p=P.rightAngles?t.append("path").attr("d",`M ${e},${r} H ${e+L.getMax(P.width/2,d/2)} V ${r+25} H `+e):t.append("path").attr("d","M "+e+","+r+" C "+(e+60)+","+(r-10)+" "+(e+60)+","+(r+30)+" "+e+","+(r+20)):((p=t.append("line")).attr("x1",e),p.attr("y1",r),p.attr("x2",i),p.attr("y2",r)),s===n.db.LINETYPE.DOTTED||s===n.db.LINETYPE.DOTTED_CROSS||s===n.db.LINETYPE.DOTTED_POINT||s===n.db.LINETYPE.DOTTED_OPEN||s===n.db.LINETYPE.BIDIRECTIONAL_DOTTED?(p.style("stroke-dasharray","3, 3"),p.attr("class","messageLine1")):p.attr("class","messageLine0"),"");P.arrowMarkerAbsolute&&(g=(g=(g=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search).replace(/\(/g,"\\(")).replace(/\)/g,"\\)")),p.attr("stroke-width",2),p.attr("stroke","none"),p.style("fill","none"),s!==n.db.LINETYPE.SOLID&&s!==n.db.LINETYPE.DOTTED||p.attr("marker-end","url("+g+"#arrowhead)"),s!==n.db.LINETYPE.BIDIRECTIONAL_SOLID&&s!==n.db.LINETYPE.BIDIRECTIONAL_DOTTED||(p.attr("marker-start","url("+g+"#arrowhead)"),p.attr("marker-end","url("+g+"#arrowhead)")),s!==n.db.LINETYPE.SOLID_POINT&&s!==n.db.LINETYPE.DOTTED_POINT||p.attr("marker-end","url("+g+"#filled-head)"),s!==n.db.LINETYPE.SOLID_CROSS&&s!==n.db.LINETYPE.DOTTED_CROSS||p.attr("marker-end","url("+g+"#crosshead)"),(c||P.showSequenceNumbers)&&(p.attr("marker-start","url("+g+"#sequencenumber)"),t.append("text").attr("x",e).attr("y",r+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(l))},"drawMessage"),Dyt=Ae(function(t,e,r,n,i,a,o){let s=0,l=0,c,h=0;for(var u of n){var d=(u=e.get(u)).box;c&&c!=d&&(o||B.models.addBox(c),l+=P.boxMargin+c.margin),d&&d!=c&&(o||(d.x=s+l,d.y=i),l+=d.margin),u.width=u.width||P.width,u.height=L.getMax(u.height||P.height,P.height),u.margin=u.margin||P.actorMargin,h=L.getMax(h,u.height),r.get(u.name)&&(l+=u.width/2),u.x=s+l,u.starty=B.getVerticalPos(),B.insert(u.x,i,u.x+u.width,u.height),s+=u.width+l,u.box&&(u.box.width=s+d.margin-u.box.x),l=u.margin,c=u.box,B.models.addActor(u)}c&&!o&&B.models.addBox(c),B.bumpVerticalPos(h)},"addActorRenderingData"),Oyt=Ae(async function(e,r,n,t){if(t){let t=0;B.bumpVerticalPos(2*P.boxMargin);for(var i of n)(i=r.get(i)).stopy||(i.stopy=B.getVerticalPos()),i=await byt.drawActor(e,i,P,!0),t=L.getMax(t,i);B.bumpVerticalPos(t+P.boxMargin)}else for(var a of n)a=r.get(a),await byt.drawActor(e,a,P,!1)},"drawActors"),Pyt=Ae(function(t,e,r,n){let i=0,a=0;for(var o of r){var o=e.get(o),s=Gyt(o);(s=byt.drawPopup(t,o,s,P,P.forceMenus,n)).height>i&&(i=s.height),s.width+o.x>a&&(a=s.width+o.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),Byt=Ae(function(t){ae(P,t),t.fontFamily&&(P.actorFontFamily=P.noteFontFamily=P.messageFontFamily=t.fontFamily),t.fontSize&&(P.actorFontSize=P.noteFontSize=P.messageFontSize=t.fontSize),t.fontWeight&&(P.actorFontWeight=P.noteFontWeight=P.messageFontWeight=t.fontWeight)},"setConf"),Fyt=Ae(function(e){return B.activations.filter(function(t){return t.actor===e})},"actorActivations"),$yt=Ae(function(t,e){return e=e.get(t),[(t=Fyt(t)).reduce(function(t,e){return L.getMin(t,e.startx)},e.x+e.width/2-1),t.reduce(function(t,e){return L.getMax(t,e.stopx)},e.x+e.width/2+1)]},"activationBounds"),Ae(_yt,"adjustLoopHeightForWrap"),Ae(Cyt,"adjustCreatedDestroyedData"),zyt=Ae(async function(n,t,e,i){var{securityLevel:r,sequence:a}=D();P=a;let o;"sandbox"===r&&(o=O("#i"+t));var a=O("sandbox"===r?o.nodes()[0].contentDocument.body:"body"),s="sandbox"===r?o.nodes()[0].contentDocument:document;B.init(),R.debug(i.db);let l="sandbox"===r?a.select(`[id="${t}"]`):O(`[id="${t}"]`),c=i.db.getActors(),h=i.db.getCreatedActors(),u=i.db.getDestroyedActors(),d=i.db.getBoxes(),p=i.db.getActorKeys(),g=i.db.getMessages(),f=i.db.getDiagramTitle(),m=i.db.hasAtLeastOneBox(),y=i.db.hasAtLeastOneBoxWithTitle(),v=await Syt(c,g,i);if(P.height=await Ayt(c,v,d),byt.insertComputerIcon(l),byt.insertDatabaseIcon(l),byt.insertClockIcon(l),m&&(B.bumpVerticalPos(P.boxMargin),y)&&B.bumpVerticalPos(d[0].textMaxHeight),!0===P.hideUnusedParticipants){let e=new Set;g.forEach(t=>{e.add(t.from),e.add(t.to)}),p=p.filter(t=>e.has(t))}Dyt(l,c,h,p,0,g,!1);var x,b,w,k=await Yyt(g,c,v,i);function T(t,e){var r=B.endActivation(t);r.starty+18>e&&(r.starty=e-6,e+=12),byt.drawActivation(l,r,e,P,Fyt(t.from).length),B.insert(r.startx,e-10,r.stopx,e)}byt.insertArrowHead(l),byt.insertArrowCrossHead(l),byt.insertArrowFilledHead(l),byt.insertSequenceNumber(l),Ae(T,"activeEnd");let E=1,_=1,C=[],S=[],A=0;for(x of g){let t,e,r;switch(x.type){case i.db.LINETYPE.NOTE:B.resetVerticalPos(),e=x.noteModel,await Lyt(l,e);break;case i.db.LINETYPE.ACTIVE_START:B.newActivation(x,l,c);break;case i.db.LINETYPE.ACTIVE_END:T(x,B.getVerticalPos());break;case i.db.LINETYPE.LOOP_START:_yt(k,x,P.boxMargin,P.boxMargin+P.boxTextMargin,t=>B.newLoop(t));break;case i.db.LINETYPE.LOOP_END:t=B.endLoop(),await byt.drawLoop(l,t,"loop",P),B.bumpVerticalPos(t.stopy-B.getVerticalPos()),B.models.addLoop(t);break;case i.db.LINETYPE.RECT_START:_yt(k,x,P.boxMargin,P.boxMargin,t=>B.newLoop(void 0,t.message));break;case i.db.LINETYPE.RECT_END:t=B.endLoop(),S.push(t),B.models.addLoop(t),B.bumpVerticalPos(t.stopy-B.getVerticalPos());break;case i.db.LINETYPE.OPT_START:_yt(k,x,P.boxMargin,P.boxMargin+P.boxTextMargin,t=>B.newLoop(t));break;case i.db.LINETYPE.OPT_END:t=B.endLoop(),await byt.drawLoop(l,t,"opt",P),B.bumpVerticalPos(t.stopy-B.getVerticalPos()),B.models.addLoop(t);break;case i.db.LINETYPE.ALT_START:_yt(k,x,P.boxMargin,P.boxMargin+P.boxTextMargin,t=>B.newLoop(t));break;case i.db.LINETYPE.ALT_ELSE:_yt(k,x,P.boxMargin+P.boxTextMargin,P.boxMargin,t=>B.addSectionToLoop(t));break;case i.db.LINETYPE.ALT_END:t=B.endLoop(),await byt.drawLoop(l,t,"alt",P),B.bumpVerticalPos(t.stopy-B.getVerticalPos()),B.models.addLoop(t);break;case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:_yt(k,x,P.boxMargin,P.boxMargin+P.boxTextMargin,t=>B.newLoop(t)),B.saveVerticalPos();break;case i.db.LINETYPE.PAR_AND:_yt(k,x,P.boxMargin+P.boxTextMargin,P.boxMargin,t=>B.addSectionToLoop(t));break;case i.db.LINETYPE.PAR_END:t=B.endLoop(),await byt.drawLoop(l,t,"par",P),B.bumpVerticalPos(t.stopy-B.getVerticalPos()),B.models.addLoop(t);break;case i.db.LINETYPE.AUTONUMBER:E=x.message.start||E,_=x.message.step||_,x.message.visible?i.db.enableSequenceNumbers():i.db.disableSequenceNumbers();break;case i.db.LINETYPE.CRITICAL_START:_yt(k,x,P.boxMargin,P.boxMargin+P.boxTextMargin,t=>B.newLoop(t));break;case i.db.LINETYPE.CRITICAL_OPTION:_yt(k,x,P.boxMargin+P.boxTextMargin,P.boxMargin,t=>B.addSectionToLoop(t));break;case i.db.LINETYPE.CRITICAL_END:t=B.endLoop(),await byt.drawLoop(l,t,"critical",P),B.bumpVerticalPos(t.stopy-B.getVerticalPos()),B.models.addLoop(t);break;case i.db.LINETYPE.BREAK_START:_yt(k,x,P.boxMargin,P.boxMargin+P.boxTextMargin,t=>B.newLoop(t));break;case i.db.LINETYPE.BREAK_END:t=B.endLoop(),await byt.drawLoop(l,t,"break",P),B.bumpVerticalPos(t.stopy-B.getVerticalPos()),B.models.addLoop(t);break;default:try{(r=x.msgModel).starty=B.getVerticalPos(),r.sequenceIndex=E,r.sequenceVisible=i.db.showSequenceNumbers();var L=await Eyt(l,r);Cyt(x,r,L,A,c,h,u),C.push({messageModel:r,lineStartY:L}),B.models.addMessage(r)}catch(n){R.error("error while drawing message",n)}}[i.db.LINETYPE.SOLID_OPEN,i.db.LINETYPE.DOTTED_OPEN,i.db.LINETYPE.SOLID,i.db.LINETYPE.DOTTED,i.db.LINETYPE.SOLID_CROSS,i.db.LINETYPE.DOTTED_CROSS,i.db.LINETYPE.SOLID_POINT,i.db.LINETYPE.DOTTED_POINT,i.db.LINETYPE.BIDIRECTIONAL_SOLID,i.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(x.type)&&(E+=_),A++}R.debug("createdActors",h),R.debug("destroyedActors",u),await Oyt(l,c,p,!1);for(b of C)await Ryt(l,b.messageModel,b.lineStartY,i);P.mirrorActors&&await Oyt(l,c,p,!0),S.forEach(t=>byt.drawBackgroundRect(l,t)),tyt(l,c,p,P);for(w of B.models.boxes)w.height=B.getVerticalPos()-w.y,B.insert(w.x,w.y,w.x+w.width,w.height),w.startx=w.x,w.starty=w.y,w.stopx=w.startx+w.width,w.stopy=w.starty+w.height,w.stroke="rgb(0,0,0, 0.5)",byt.drawBox(l,w,P);m&&B.bumpVerticalPos(P.boxMargin),r=Pyt(l,c,p,s),void 0===(a=B.getBounds().bounds).startx&&(a.startx=0),void 0===a.starty&&(a.starty=0),void 0===a.stopx&&(a.stopx=0),void 0===a.stopy&&(a.stopy=0);let N=a.stopy-a.starty,I=(Ns?-t:t,"adjustValue");t.from===t.to?c=l:(t.activate&&!h&&(c+=u(P.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(c+=u(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(l-=u(3)));var e=[n,i,a,o],r=Math.abs(l-c),d=(t.wrap&&t.message&&(t.message=H8.wrapLabel(t.message,L.getMax(r+2*P.wrapPadding,P.width),Nyt(P))),H8.calculateTextDimensions(t.message,Nyt(P)));return{width:L.getMax(t.wrap?0:d.width+2*P.wrapPadding,r+2*P.wrapPadding,P.width),height:0,startx:l,stopx:c,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,e),toBounds:Math.max.apply(null,e)}},"buildMessageModel"),Yyt=Ae(async function(t,n,e,i){let a={},o=[],s,l,c;for(let r of t){switch(r.id=H8.random({length:10}),r.type){case i.db.LINETYPE.LOOP_START:case i.db.LINETYPE.ALT_START:case i.db.LINETYPE.OPT_START:case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:case i.db.LINETYPE.CRITICAL_START:case i.db.LINETYPE.BREAK_START:o.push({id:r.id,msg:r.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case i.db.LINETYPE.ALT_ELSE:case i.db.LINETYPE.PAR_AND:case i.db.LINETYPE.CRITICAL_OPTION:r.message&&(s=o.pop(),a[s.id]=s,a[r.id]=s,o.push(s));break;case i.db.LINETYPE.LOOP_END:case i.db.LINETYPE.ALT_END:case i.db.LINETYPE.OPT_END:case i.db.LINETYPE.PAR_END:case i.db.LINETYPE.CRITICAL_END:case i.db.LINETYPE.BREAK_END:s=o.pop(),a[s.id]=s;break;case i.db.LINETYPE.ACTIVE_START:var h=n.get(r.from||r.to.actor),u=Fyt(r.from||r.to.actor).length,u={startx:h=h.x+h.width/2+(u-1)*P.activationWidth/2,stopx:h+P.activationWidth,actor:r.from,enabled:!0};B.activations.push(u);break;case i.db.LINETYPE.ACTIVE_END:h=B.activations.map(t=>t.actor).lastIndexOf(r.from),B.activations.splice(h,1).splice(0,1)}void 0!==r.placement?(l=await Uyt(r,n,i),r.noteModel=l,o.forEach(t=>{(s=t).from=L.getMin(s.from,l.startx),s.to=L.getMax(s.to,l.startx+l.width),s.width=L.getMax(s.width,Math.abs(s.from-s.to))-P.labelBoxWidth})):(c=qyt(r,n,i),(r.msgModel=c).startx&&c.stopx&&0{var e;s=t,c.startx===c.stopx?(t=n.get(r.from),e=n.get(r.to),s.from=L.getMin(t.x-c.width/2,t.x-t.width/2,s.from),s.to=L.getMax(e.x+c.width/2,e.x+t.width/2,s.to),s.width=L.getMax(s.width,Math.abs(s.to-s.from))-P.labelBoxWidth):(s.from=L.getMin(c.startx,s.from),s.to=L.getMax(c.stopx,s.to),s.width=L.getMax(s.width,c.width)-P.labelBoxWidth)}))}return B.activations=[],R.debug("Loop type widths:",a),a},"calculateLoopBounds"),jyt={bounds:B,drawActors:Oyt,drawActorsPopup:Pyt,setConf:Byt,draw:zyt}}),Wyt={};J(Wyt,{diagram:()=>Vyt});var Vyt,Xyt,Kyt,Zyt,Qyt,Jyt,t2t,e2t,r2t,n2t,i2t,a2t,o2t,s2t,l2t,c2t,h2t,u2t,d2t,p2t,g2t,f2t,m2t,y2t,v2t,x2t,b2t,w2t,k2t,T2t,E2t,_2t,C2t,S2t,A2t,L2t,N2t,I2t,M2t,R2t,D2t,O2t,P2t,B2t,F2t,$2t,z2t,G2t,U2t,q2t,Y2t,j2t,H2t,W2t,V2t,X2t,K2t,Z2t,Q2t,J2t,tvt,evt,rvt=t(()=>{nmt(),wyt(),kyt(),Hyt(),Vyt={parser:emt,db:Gmt,renderer:jyt,styles:qmt,init:Ae(({wrap:t})=>{Gmt.setWrap(t)},"init")}}),nvt=t(()=>{function t(){this.yy={}}var e=Ae(function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r},"o"),r=[1,17],n=[1,18],i=[1,19],a=[1,39],o=[1,40],s=[1,25],l=[1,23],P=[1,24],B=[1,31],F=[1,32],$=[1,33],z=[1,34],G=[1,35],U=[1,36],q=[1,26],Y=[1,27],j=[1,28],H=[1,29],c=[1,43],W=[1,30],h=[1,42],u=[1,44],d=[1,41],p=[1,45],V=[1,9],g=[1,8,9],f=[1,56],m=[1,57],y=[1,58],v=[1,59],x=[1,60],X=[1,61],K=[1,62],b=[1,8,9,39],Z=[1,74],w=[1,8,9,12,13,21,37,39,42,59,60,61,62,63,64,65,70,72],k=[1,8,9,12,13,19,21,37,39,42,46,59,60,61,62,63,64,65,70,72,74,80,95,97,98],T=[13,74,80,95,97,98],E=[13,64,65,74,80,95,97,98],Q=[13,59,60,61,62,63,74,80,95,97,98],J=[1,93],_=[1,110],C=[1,108],S=[1,102],A=[1,103],L=[1,104],N=[1,105],I=[1,106],M=[1,107],R=[1,109],tt=[1,8,9,37,39,42],D=[1,8,9,21],et=[1,8,9,78],O=[1,8,9,21,73,74,78,80,81,82,83,84,85],k={trace:Ae(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,className:17,classLiteralName:18,GENERICTYPE:19,relationStatement:20,LABEL:21,namespaceStatement:22,classStatement:23,memberStatement:24,annotationStatement:25,clickStatement:26,styleStatement:27,cssClassStatement:28,noteStatement:29,direction:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,namespaceIdentifier:36,STRUCT_START:37,classStatements:38,STRUCT_STOP:39,NAMESPACE:40,classIdentifier:41,STYLE_SEPARATOR:42,members:43,CLASS:44,ANNOTATION_START:45,ANNOTATION_END:46,MEMBER:47,SEPARATOR:48,relation:49,NOTE_FOR:50,noteText:51,NOTE:52,direction_tb:53,direction_bt:54,direction_rl:55,direction_lr:56,relationType:57,lineType:58,AGGREGATION:59,EXTENSION:60,COMPOSITION:61,DEPENDENCY:62,LOLLIPOP:63,LINE:64,DOTTED_LINE:65,CALLBACK:66,LINK:67,LINK_TARGET:68,CLICK:69,CALLBACK_NAME:70,CALLBACK_ARGS:71,HREF:72,STYLE:73,ALPHA:74,stylesOpt:75,CSSCLASS:76,style:77,COMMA:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,commentToken:86,textToken:87,graphCodeTokens:88,textNoTagsToken:89,TAGSTART:90,TAGEND:91,"==":92,"--":93,DEFAULT:94,MINUS:95,keywords:96,UNICODE_TEXT:97,BQUOTE_STR:98,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",19:"GENERICTYPE",21:"LABEL",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",37:"STRUCT_START",39:"STRUCT_STOP",40:"NAMESPACE",42:"STYLE_SEPARATOR",44:"CLASS",45:"ANNOTATION_START",46:"ANNOTATION_END",47:"MEMBER",48:"SEPARATOR",50:"NOTE_FOR",52:"NOTE",53:"direction_tb",54:"direction_bt",55:"direction_rl",56:"direction_lr",59:"AGGREGATION",60:"EXTENSION",61:"COMPOSITION",62:"DEPENDENCY",63:"LOLLIPOP",64:"LINE",65:"DOTTED_LINE",66:"CALLBACK",67:"LINK",68:"LINK_TARGET",69:"CLICK",70:"CALLBACK_NAME",71:"CALLBACK_ARGS",72:"HREF",73:"STYLE",74:"ALPHA",76:"CSSCLASS",78:"COMMA",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",88:"graphCodeTokens",90:"TAGSTART",91:"TAGEND",92:"==",93:"--",94:"DEFAULT",95:"MINUS",96:"keywords",97:"UNICODE_TEXT",98:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,2],[17,1],[17,1],[17,2],[17,2],[17,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[22,4],[22,5],[36,2],[38,1],[38,2],[38,3],[23,1],[23,3],[23,4],[23,6],[41,2],[41,3],[25,4],[43,1],[43,2],[24,1],[24,2],[24,1],[24,1],[20,3],[20,4],[20,4],[20,5],[29,3],[29,2],[30,1],[30,1],[30,1],[30,1],[49,3],[49,2],[49,2],[49,1],[57,1],[57,1],[57,1],[57,1],[57,1],[58,1],[58,1],[26,3],[26,4],[26,3],[26,4],[26,4],[26,5],[26,3],[26,4],[26,4],[26,5],[26,4],[26,5],[26,5],[26,6],[27,3],[28,3],[75,1],[75,3],[77,1],[77,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[86,1],[86,1],[87,1],[87,1],[87,1],[87,1],[87,1],[87,1],[87,1],[89,1],[89,1],[89,1],[89,1],[16,1],[16,1],[16,1],[16,1],[18,1],[51,1]],performAction:Ae(function(t,e,r,n,i,a,o){var s=a.length-1;switch(i){case 8:this.$=a[s-1];break;case 9:case 11:case 12:this.$=a[s];break;case 10:case 13:this.$=a[s-1]+a[s];break;case 14:case 15:this.$=a[s-1]+"~"+a[s]+"~";break;case 16:n.addRelation(a[s]);break;case 17:a[s-1].title=n.cleanupLabel(a[s]),n.addRelation(a[s-1]);break;case 27:this.$=a[s].trim(),n.setAccTitle(this.$);break;case 28:case 29:this.$=a[s].trim(),n.setAccDescription(this.$);break;case 30:n.addClassesToNamespace(a[s-3],a[s-1]);break;case 31:n.addClassesToNamespace(a[s-4],a[s-1]);break;case 32:this.$=a[s],n.addNamespace(a[s]);break;case 33:this.$=[a[s]];break;case 34:this.$=[a[s-1]];break;case 35:a[s].unshift(a[s-2]),this.$=a[s];break;case 37:n.setCssClass(a[s-2],a[s]);break;case 38:n.addMembers(a[s-3],a[s-1]);break;case 39:n.setCssClass(a[s-5],a[s-3]),n.addMembers(a[s-5],a[s-1]);break;case 40:this.$=a[s],n.addClass(a[s]);break;case 41:this.$=a[s-1],n.addClass(a[s-1]),n.setClassLabel(a[s-1],a[s]);break;case 42:n.addAnnotation(a[s],a[s-2]);break;case 43:this.$=[a[s]];break;case 44:a[s].push(a[s-1]),this.$=a[s];break;case 45:break;case 46:n.addMember(a[s-1],n.cleanupLabel(a[s]));break;case 47:case 48:break;case 49:this.$={id1:a[s-2],id2:a[s],relation:a[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 50:this.$={id1:a[s-3],id2:a[s],relation:a[s-1],relationTitle1:a[s-2],relationTitle2:"none"};break;case 51:this.$={id1:a[s-3],id2:a[s],relation:a[s-2],relationTitle1:"none",relationTitle2:a[s-1]};break;case 52:this.$={id1:a[s-4],id2:a[s],relation:a[s-2],relationTitle1:a[s-3],relationTitle2:a[s-1]};break;case 53:n.addNote(a[s],a[s-1]);break;case 54:n.addNote(a[s]);break;case 55:n.setDirection("TB");break;case 56:n.setDirection("BT");break;case 57:n.setDirection("RL");break;case 58:n.setDirection("LR");break;case 59:this.$={type1:a[s-2],type2:a[s],lineType:a[s-1]};break;case 60:this.$={type1:"none",type2:a[s],lineType:a[s-1]};break;case 61:this.$={type1:a[s-1],type2:"none",lineType:a[s]};break;case 62:this.$={type1:"none",type2:"none",lineType:a[s]};break;case 63:this.$=n.relationType.AGGREGATION;break;case 64:this.$=n.relationType.EXTENSION;break;case 65:this.$=n.relationType.COMPOSITION;break;case 66:this.$=n.relationType.DEPENDENCY;break;case 67:this.$=n.relationType.LOLLIPOP;break;case 68:this.$=n.lineType.LINE;break;case 69:this.$=n.lineType.DOTTED_LINE;break;case 70:case 76:this.$=a[s-2],n.setClickEvent(a[s-1],a[s]);break;case 71:case 77:this.$=a[s-3],n.setClickEvent(a[s-2],a[s-1]),n.setTooltip(a[s-2],a[s]);break;case 72:this.$=a[s-2],n.setLink(a[s-1],a[s]);break;case 73:this.$=a[s-3],n.setLink(a[s-2],a[s-1],a[s]);break;case 74:this.$=a[s-3],n.setLink(a[s-2],a[s-1]),n.setTooltip(a[s-2],a[s]);break;case 75:this.$=a[s-4],n.setLink(a[s-3],a[s-2],a[s]),n.setTooltip(a[s-3],a[s-1]);break;case 78:this.$=a[s-3],n.setClickEvent(a[s-2],a[s-1],a[s]);break;case 79:this.$=a[s-4],n.setClickEvent(a[s-3],a[s-2],a[s-1]),n.setTooltip(a[s-3],a[s]);break;case 80:this.$=a[s-3],n.setLink(a[s-2],a[s]);break;case 81:this.$=a[s-4],n.setLink(a[s-3],a[s-1],a[s]);break;case 82:this.$=a[s-4],n.setLink(a[s-3],a[s-1]),n.setTooltip(a[s-3],a[s]);break;case 83:this.$=a[s-5],n.setLink(a[s-4],a[s-2],a[s]),n.setTooltip(a[s-4],a[s-1]);break;case 84:this.$=a[s-2],n.setCssStyle(a[s-1],a[s]);break;case 85:n.setCssClass(a[s-1],a[s]);break;case 86:this.$=[a[s]];break;case 87:a[s-2].push(a[s]),this.$=a[s-2];break;case 89:this.$=a[s-1]+a[s]}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:37,17:20,18:38,20:7,22:8,23:9,24:10,25:11,26:12,27:13,28:14,29:15,30:16,31:r,33:n,35:i,36:21,40:a,41:22,44:o,45:s,47:l,48:P,50:B,52:F,53:$,54:z,55:G,56:U,66:q,67:Y,69:j,73:H,74:c,76:W,80:h,95:u,97:d,98:p},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},e(V,[2,5],{8:[1,46]}),{8:[1,47]},e(g,[2,16],{21:[1,48]}),e(g,[2,18]),e(g,[2,19]),e(g,[2,20]),e(g,[2,21]),e(g,[2,22]),e(g,[2,23]),e(g,[2,24]),e(g,[2,25]),e(g,[2,26]),{32:[1,49]},{34:[1,50]},e(g,[2,29]),e(g,[2,45],{49:51,57:54,58:55,13:[1,52],21:[1,53],59:f,60:m,61:y,62:v,63:x,64:X,65:K}),{37:[1,63]},e(b,[2,36],{37:[1,65],42:[1,64]}),e(g,[2,47]),e(g,[2,48]),{16:66,74:c,80:h,95:u,97:d},{16:37,17:67,18:38,74:c,80:h,95:u,97:d,98:p},{16:37,17:68,18:38,74:c,80:h,95:u,97:d,98:p},{16:37,17:69,18:38,74:c,80:h,95:u,97:d,98:p},{74:[1,70]},{13:[1,71]},{16:37,17:72,18:38,74:c,80:h,95:u,97:d,98:p},{13:Z,51:73},e(g,[2,55]),e(g,[2,56]),e(g,[2,57]),e(g,[2,58]),e(w,[2,11],{16:37,18:38,17:75,19:[1,76],74:c,80:h,95:u,97:d,98:p}),e(w,[2,12],{19:[1,77]}),{15:78,16:79,74:c,80:h,95:u,97:d},{16:37,17:80,18:38,74:c,80:h,95:u,97:d,98:p},e(k,[2,112]),e(k,[2,113]),e(k,[2,114]),e(k,[2,115]),e([1,8,9,12,13,19,21,37,39,42,59,60,61,62,63,64,65,70,72],[2,116]),e(V,[2,6],{10:5,20:7,22:8,23:9,24:10,25:11,26:12,27:13,28:14,29:15,30:16,17:20,36:21,41:22,16:37,18:38,5:81,31:r,33:n,35:i,40:a,44:o,45:s,47:l,48:P,50:B,52:F,53:$,54:z,55:G,56:U,66:q,67:Y,69:j,73:H,74:c,76:W,80:h,95:u,97:d,98:p}),{5:82,10:5,16:37,17:20,18:38,20:7,22:8,23:9,24:10,25:11,26:12,27:13,28:14,29:15,30:16,31:r,33:n,35:i,36:21,40:a,41:22,44:o,45:s,47:l,48:P,50:B,52:F,53:$,54:z,55:G,56:U,66:q,67:Y,69:j,73:H,74:c,76:W,80:h,95:u,97:d,98:p},e(g,[2,17]),e(g,[2,27]),e(g,[2,28]),{13:[1,84],16:37,17:83,18:38,74:c,80:h,95:u,97:d,98:p},{49:85,57:54,58:55,59:f,60:m,61:y,62:v,63:x,64:X,65:K},e(g,[2,46]),{58:86,64:X,65:K},e(T,[2,62],{57:87,59:f,60:m,61:y,62:v,63:x}),e(E,[2,63]),e(E,[2,64]),e(E,[2,65]),e(E,[2,66]),e(E,[2,67]),e(Q,[2,68]),e(Q,[2,69]),{8:[1,89],23:90,38:88,41:22,44:o},{16:91,74:c,80:h,95:u,97:d},{43:92,47:J},{46:[1,94]},{13:[1,95]},{13:[1,96]},{70:[1,97],72:[1,98]},{21:_,73:C,74:S,75:99,77:100,79:101,80:A,81:L,82:N,83:I,84:M,85:R},{74:[1,111]},{13:Z,51:112},e(g,[2,54]),e(g,[2,117]),e(w,[2,13]),e(w,[2,14]),e(w,[2,15]),{37:[2,32]},{15:113,16:79,37:[2,9],74:c,80:h,95:u,97:d},e(tt,[2,40],{11:114,12:[1,115]}),e(V,[2,7]),{9:[1,116]},e(D,[2,49]),{16:37,17:117,18:38,74:c,80:h,95:u,97:d,98:p},{13:[1,119],16:37,17:118,18:38,74:c,80:h,95:u,97:d,98:p},e(T,[2,61],{57:120,59:f,60:m,61:y,62:v,63:x}),e(T,[2,60]),{39:[1,121]},{23:90,38:122,41:22,44:o},{8:[1,123],39:[2,33]},e(b,[2,37],{37:[1,124]}),{39:[1,125]},{39:[2,43],43:126,47:J},{16:37,17:127,18:38,74:c,80:h,95:u,97:d,98:p},e(g,[2,70],{13:[1,128]}),e(g,[2,72],{13:[1,130],68:[1,129]}),e(g,[2,76],{13:[1,131],71:[1,132]}),{13:[1,133]},e(g,[2,84],{78:[1,134]}),e(et,[2,86],{79:135,21:_,73:C,74:S,80:A,81:L,82:N,83:I,84:M,85:R}),e(O,[2,88]),e(O,[2,90]),e(O,[2,91]),e(O,[2,92]),e(O,[2,93]),e(O,[2,94]),e(O,[2,95]),e(O,[2,96]),e(O,[2,97]),e(O,[2,98]),e(g,[2,85]),e(g,[2,53]),{37:[2,10]},e(tt,[2,41]),{13:[1,136]},{1:[2,4]},e(D,[2,51]),e(D,[2,50]),{16:37,17:137,18:38,74:c,80:h,95:u,97:d,98:p},e(T,[2,59]),e(g,[2,30]),{39:[1,138]},{23:90,38:139,39:[2,34],41:22,44:o},{43:140,47:J},e(b,[2,38]),{39:[2,44]},e(g,[2,42]),e(g,[2,71]),e(g,[2,73]),e(g,[2,74],{68:[1,141]}),e(g,[2,77]),e(g,[2,78],{13:[1,142]}),e(g,[2,80],{13:[1,144],68:[1,143]}),{21:_,73:C,74:S,77:145,79:101,80:A,81:L,82:N,83:I,84:M,85:R},e(O,[2,89]),{14:[1,146]},e(D,[2,52]),e(g,[2,31]),{39:[2,35]},{39:[1,147]},e(g,[2,75]),e(g,[2,79]),e(g,[2,81]),e(g,[2,82],{68:[1,148]}),e(et,[2,87],{79:135,21:_,73:C,74:S,80:A,81:L,82:N,83:I,84:M,85:R}),e(tt,[2,8]),e(b,[2,39]),e(g,[2,83])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],78:[2,32],113:[2,10],116:[2,4],126:[2,44],139:[2,35]},parseError:Ae(function(t,e){var r;if(!e.recoverable)throw(r=new Error(t)).hash=e,r;this.trace(t)},"parseError"),parse:Ae(function(t){var e,r=this,n=[0],i=[],a=[null],o=[],s=this.table,l="",c=0,h=0,u=0,d=1,p=o.slice.call(arguments,1),g=Object.create(this.lexer),f={yy:{}};for(e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,e)&&(f.yy[e]=this.yy[e]);g.setInput(t,f.yy),f.yy.lexer=g,f.yy.parser=this,"u"