code-server
Version:
Run VS Code on a remote server.
63 lines • 116 kB
JavaScript
import{a as v}from"./chunk-XJWARXV4.js";import{a as le,b as vt,d as W,e as R}from"./chunk-HBYVLBIR.js";import{c as Rt,e as pt}from"./chunk-6XUBHLNE.js";import{c as ne,d as kt}from"./chunk-G2EWPYLQ.js";import{g as wt}from"./chunk-OZ4ASJEX.js";import{k as At,o as ce,s as Mt,u as Q}from"./chunk-7RYOY7AM.js";import{$ as z,C as $t,G as xt,I as Lt,K as Tt,L as ie,ca as _t,r as re,v as mt}from"./chunk-YX6DBKFT.js";import{b as J,h as Z}from"./chunk-TOKYXDRE.js";import{a as b}from"./chunk-TZZ523SA.js";var fs=1,ps=3;async function Jt(n){let t=n.getElementsByTagName("img");if(!t||t.length===0)return;let s=!Kt(n);await Promise.all([...t].map(l=>new Promise(o=>{function c(){if(l.style.display="flex",l.style.flexDirection="column",s){let p=z().fontSize?z().fontSize:window.getComputedStyle(document.body).fontSize,r=5,[h=re.fontSize]=ce(p),i=h*r+"px";l.style.minWidth=i,l.style.maxWidth=i}else l.style.width="100%";o(l)}b(c,"setupImage"),setTimeout(()=>{l.complete&&c()}),l.addEventListener("error",c),l.addEventListener("load",c)})))}b(Jt,"configureLabelImages");function Kt(n){return n.nodeType===ps?n.textContent?.trim()!=="":n.nodeType!==fs||n.tagName.toLowerCase()==="img"?!1:[...n.childNodes].some(Kt)}b(Kt,"hasTextBesidesImages");var oe=3,us=32,ds=b(async(n,t,s)=>{let l=z(),o=n.insert("g").attr("class",s??"node default").attr("id",t.domId||t.id),c=o.insert("g").attr("class","label").attr("style",Q(t.labelStyle)),r=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(d=>({text:d,cssClass:"c4-descr"}))].filter(d=>d.text),h=t.width?Math.max(t.width-2*(t.padding??0),us):z().flowchart?.wrappingWidth??200,e=l.c4?.wrap??!0?h:Number.POSITIVE_INFINITY,a=await Promise.all(r.map(async d=>{let x=c.append("g").attr("class",d.cssClass),w=await pt(x,Lt(Mt(d.text??""),l),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:e,style:t.labelStyle},l);return Z(w).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),Z(w).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:x,box:x.node().getBBox()}})),g=Math.max(...a.map(({box:d})=>d.width),0),f=0;for(let{el:d,box:x}of a)d.attr("transform",`translate(${g/2-x.x-x.width/2}, ${f-x.y})`),f+=x.height+oe;let y=a.length>0?f-oe:0;c.insert("rect",":first-child"),c.attr("transform",`translate(${-g/2}, ${-y/2})`);let u=c.node().getBBox(),m=(t.padding??0)/2;return{shapeSvg:o,bbox:u,halfPadding:m,label:c}},"c4LabelHelper"),he=b((n,t)=>{let{x:s,y:l,width:o,height:c}=n;return o>=t?n:"left"in n?{x:s,y:l,width:t,height:c,top:l,left:s,bottom:l+c,right:s+t,toJSON:b(()=>({}),"toJSON")}:{x:s-(t-o)/2,y:l,width:t,height:c}},"withMinWidth"),X=b(async(n,t,s,{ignoreMinWidth:l=!1}={})=>{if(t.stereotype!==void 0)return ds(n,t,s);let o,c=t.useHtmlLabels||mt(z()?.htmlLabels);s?o=s:o="node default";let p=n.insert("g").attr("class",o).attr("id",t.domId||t.id),r=p.insert("g").attr("class","label").attr("style",Q(t.labelStyle)),h;t.label===void 0?h="":h=typeof t.label=="string"?t.label:t.label[0];let i=!!t.icon||!!t.img,e=t.labelType==="markdown",a=h&&!t.width&&!l?t.minWidth??0:0,g=await pt(r,Lt(Mt(h),z()),{useHtmlLabels:c,width:t.width||t.wrappingWidth||z().flowchart?.wrappingWidth,minWidth:a,classes:e?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:i,markdown:e},z()),f=(t?.padding??0)/2,y;if(c){let u=g.children[0],m=Z(g);await Jt(u),y=await Rt.measure(()=>u.getBoundingClientRect()),y=he(y,a),m.attr("width",y.width),m.attr("height",y.height)}else y=await Rt.measure(()=>g.getBBox()),y=he(y,a);return c?r.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"):r.attr("transform","translate(0, "+-y.height/2+")"),t.centerLabel&&r.attr("transform","translate("+-y.width/2+", "+-y.height/2+")"),r.insert("rect",":first-child"),{shapeSvg:p,bbox:y,halfPadding:f,label:r}},"labelHelper"),St=b(async(n,t,s)=>{let l=s.useHtmlLabels??xt(z()),o=n.insert("g").attr("class","label").attr("style",s.labelStyle||""),c=await pt(o,Lt(Mt(t),z()),{useHtmlLabels:l,width:s.width||z()?.flowchart?.wrappingWidth,style:s.labelStyle,addSvgBackground:!!s.icon||!!s.img}),p=s.padding/2,r;if(xt(z())){let h=c.children[0],i=Z(c);r=await Rt.measure(()=>h.getBoundingClientRect()),i.attr("width",r.width),i.attr("height",r.height)}else r=await Rt.measure(()=>c.getBBox());return l?o.attr("transform","translate("+-r.width/2+", "+-r.height/2+")"):o.attr("transform","translate(0, "+-r.height/2+")"),s.centerLabel&&o.attr("transform","translate("+-r.width/2+", "+-r.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:n,bbox:r,halfPadding:p,label:o}},"insertLabel"),H=b((n,t,s)=>{if(s){n.width=s.width,n.height=s.height;return}let l=t.node().getBBox();n.width=l.width,n.height=l.height},"updateNodeBounds"),Y=b((n,t)=>(n.look==="handDrawn"?"rough-node":"node")+" "+n.cssClasses+" "+(t||""),"getNodeClasses");function F(n){let t=n.map((s,l)=>`${l===0?"M":"L"}${s.x},${s.y}`);return t.push("Z"),t.join(" ")}b(F,"createPathFromPoints");function ut(n,t,s,l,o,c){let p=[],h=s-n,i=l-t,e=h/c,a=2*Math.PI/e,g=t+i/2;for(let f=0;f<=50;f++){let y=f/50,u=n+y*h,m=g+o*Math.sin(a*(u-n));p.push({x:u,y:m})}return p}b(ut,"generateFullSineWavePoints");function lt(n,t,s,l,o,c){let p=[],r=o*Math.PI/180,e=(c*Math.PI/180-r)/(l-1);for(let a=0;a<l;a++){let g=r+a*e,f=n+s*Math.cos(g),y=t+s*Math.sin(g);p.push({x:-f,y:-y})}return p}b(lt,"generateCirclePoints");function zt(n){let t=Array.from(n.childNodes).filter(h=>h.tagName==="path"),s=document.createElementNS("http://www.w3.org/2000/svg","path"),l=t.map(h=>h.getAttribute("d")).filter(h=>h!==null).join(" ");s.setAttribute("d",l);let o=t.find(h=>h.getAttribute("fill")!=="none"),c=t.find(h=>h.getAttribute("stroke")!=="none"),p=b((h,i)=>h?.getAttribute(i)??void 0,"getAttr");if(o){let h={fill:p(o,"fill"),"fill-opacity":p(o,"fill-opacity")??"1"};Object.entries(h).forEach(([i,e])=>{e&&s.setAttribute(i,e)})}if(c){let h={stroke:p(c,"stroke"),"stroke-width":p(c,"stroke-width")??"1","stroke-opacity":p(c,"stroke-opacity")??"1"};Object.entries(h).forEach(([i,e])=>{e&&s.setAttribute(i,e)})}let r=document.createElementNS("http://www.w3.org/2000/svg","g");return r.appendChild(s),r}b(zt,"mergePaths");var ms=b((n,t)=>{var s=n.x,l=n.y,o=t.x-s,c=t.y-l,p=n.width/2,r=n.height/2,h,i;return Math.abs(c)*p>Math.abs(o)*r?(c<0&&(r=-r),h=c===0?0:r*o/c,i=r):(o<0&&(p=-p),h=p,i=o===0?0:p*c/o),{x:s+h,y:l+i}},"intersectRect"),xs=ms;function He(n,t){return n.intersect(t)}b(He,"intersectNode");var ws=He;function Ie(n,t,s,l){var o=n.x,c=n.y,p=o-l.x,r=c-l.y,h=Math.sqrt(t*t*r*r+s*s*p*p),i=Math.abs(t*s*p/h);l.x<o&&(i=-i);var e=Math.abs(t*s*r/h);return l.y<c&&(e=-e),{x:o+i,y:c+e}}b(Ie,"intersectEllipse");var Le=Ie;function Ee(n,t,s){return Le(n,t,t,s)}b(Ee,"intersectCircle");var bs=Ee;function We(n,t,s,l){{let o=t.y-n.y,c=n.x-t.x,p=t.x*n.y-n.x*t.y,r=o*s.x+c*s.y+p,h=o*l.x+c*l.y+p,i=1e-6;if(r!==0&&h!==0&&Vt(r,h))return;let e=l.y-s.y,a=s.x-l.x,g=l.x*s.y-s.x*l.y,f=e*n.x+a*n.y+g,y=e*t.x+a*t.y+g;if(Math.abs(f)<i&&Math.abs(y)<i&&Vt(f,y))return;let u=o*a-e*c;if(u===0)return;let m=(c*g-a*p)/u,d=(e*p-o*g)/u;return{x:m,y:d}}}b(We,"intersectLine");function Vt(n,t){return n*t>0}b(Vt,"sameSign");var Ss=We;function Te(n,t,s){let l=n.x,o=n.y,c=[],p=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(e){p=Math.min(p,e.x),r=Math.min(r,e.y)}):(p=Math.min(p,t.x),r=Math.min(r,t.y));let h=l-n.width/2-p,i=o-n.height/2-r;for(let e=0;e<t.length;e++){let a=t[e],g=t[e<t.length-1?e+1:0],f=Ss(n,s,{x:h+a.x,y:i+a.y},{x:h+g.x,y:i+g.y});f&&c.push(f)}return c.length?(c.length>1&&c.sort(function(e,a){let g=e.x-s.x,f=e.y-s.y,y=Math.sqrt(g*g+f*f),u=a.x-s.x,m=a.y-s.y,d=Math.sqrt(u*u+m*m);return y<d?-1:y===d?0:1}),c[0]):n}b(Te,"intersectPolygon");var $s=Te,N={node:ws,circle:bs,ellipse:Le,polygon:$s,rect:xs},gt=b((n,t,s,l,o)=>["M",n+o,t,"H",n+s-o,"A",o,o,0,0,1,n+s,t+o,"V",t+l-o,"A",o,o,0,0,1,n+s-o,t+l,"H",n+o,"A",o,o,0,0,1,n,t+l-o,"V",t+o,"A",o,o,0,0,1,n+o,t,"Z"].join(" "),"createRoundedRectPathD"),vs=b(async(n,t,s,l=!1,o=!1)=>{let c=t||"";typeof c=="object"&&(c=c[0]);let p=z(),r=xt(p);return await pt(n,c,{style:s,isTitle:l,useHtmlLabels:r,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},p)},"createLabel"),ge=vs;function _e(n,t){let{labelStyles:s}=W(t);t.labelStyle=s;let l=Y(t),o=l;l||(o="anchor");let c=n.insert("g").attr("class",o).attr("id",t.domId||t.id),p=1,{cssStyles:r}=t,h=v.svg(c),i=R(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(i.roughness=0);let e=h.circle(0,0,p*2,i),a=c.insert(()=>e,":first-child");return a.attr("class","anchor").attr("style",Q(r)),H(t,a),t.intersect=function(g){return J.info("Circle intersect",t,p,g),N.circle(t,p,g)},c}b(_e,"anchor");function Zt(n,t,s,l,o,c,p){let h=(n+s)/2,i=(t+l)/2,e=Math.atan2(l-t,s-n),a=(s-n)/2,g=(l-t)/2,f=a/o,y=g/c,u=Math.sqrt(f**2+y**2);if(u>1)throw new Error("The given radii are too small to create an arc between the points.");let m=Math.sqrt(1-u**2),d=h+m*c*Math.sin(e)*(p?-1:1),x=i-m*o*Math.cos(e)*(p?-1:1),w=Math.atan2((t-x)/c,(n-d)/o),$=Math.atan2((l-x)/c,(s-d)/o)-w;p&&$<0&&($+=2*Math.PI),!p&&$>0&&($-=2*Math.PI);let M=[];for(let k=0;k<20;k++){let P=k/19,_=w+P*$,B=d+o*Math.cos(_),C=x+c*Math.sin(_);M.push({x:B,y:C})}return M}b(Zt,"generateArcPoints");function Ye(n,t,s){let[l,o]=[t,s].sort((c,p)=>p-c);return o*(1-Math.sqrt(1-(n/l/2)**2))}b(Ye,"calculateArcSagitta");async function Oe(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?12:o,r=b(_=>_+p,"calcTotalHeight"),h=b(_=>{let B=_/2;return[B/(2.5+_/50),B]},"calcEllipseRadius"),{shapeSvg:i,bbox:e}=await X(n,t,Y(t)),a=r(t?.height?t?.height:e.height),[g,f]=h(a),y=Ye(a,g,f),m=(t?.width?t?.width:e.width)+c*2+y-y,d=a,{cssStyles:x}=t,w=[{x:m/2,y:-d/2},{x:-m/2,y:-d/2},...Zt(-m/2,-d/2,-m/2,d/2,g,f,!1),{x:m/2,y:d/2},...Zt(m/2,d/2,m/2,-d/2,g,f,!0)],S=v.svg(i),$=R(t,{});t.look!=="handDrawn"&&($.roughness=0,$.fillStyle="solid");let M=F(w),k=S.path(M,$),P=i.insert(()=>k,":first-child");return P.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",x),l&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",l),P.attr("transform",`translate(${g/2}, 0)`),H(t,P),t.intersect=function(_){return N.polygon(t,w,_)},i}b(Oe,"bowTieRect");async function Xe(n,t,{config:{themeVariables:s}}){let{labelStyles:l,nodeStyles:o}=W(t);t.labelStyle=l;let{shapeSvg:c,bbox:p,label:r}=await X(n,t,Y(t)),h=s?.nodeBorder??s?.lineColor??"currentColor",i=t.padding??12,e=Math.max(p.width+i*2,t.width??0,80),a=Math.max(Math.min(e*.08,12),5),g=Math.max(p.height+i*2+a,t.height??0),f=-g/2+a,y=g/2,u=e*.72,m=[`M${-e/2},${f}`,`L${-u/2},${y}`,`A${u/2},${a} 0 0 0 ${u/2},${y}`,`L${e/2},${f}`,`A${e/2},${a} 0 0 0 ${-e/2},${f}`,"Z"].join(" "),{cssStyles:d}=t,x=c.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let P=v.svg(c).path(m,R(t,{}));x.node()?.appendChild(P),d&&x.attr("style",d)}else x.append("path").attr("d",m).attr("style",o);x.append("ellipse").attr("cx",0).attr("cy",f).attr("rx",e/2).attr("ry",a).attr("style",`fill:none;stroke:${h};stroke-width:1px`),H(t,x);let w=f+(y-f)/2;r.attr("transform",`translate(${-(p.width/2)-(p.x-(p.left??0))}, ${w-p.height/2-(p.y-(p.top??0))})`);let S=12,$=b((k,P,_)=>Array.from({length:S+1},(B,C)=>{let I=Math.PI-C*Math.PI/S;return{x:k*Math.cos(I),y:P+_*a*Math.sin(I)}}),"arc"),M=[...$(e/2,f,-1),...$(u/2,y,1).reverse()];return t.intersect=function(k){return N.polygon(t,M,k)},c}b(Xe,"bucket");var Yt=20,Ot=8,ks=80,Ms=8;function je(n){let{themeVariables:t}=z(),s=t.clusterBkg,l=t.clusterBorder;return n==="flow"?{rx:10,fill:"none",stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:"flow-collapsed"}:{rx:Ms,fill:s,stroke:l,cssClass:"collapsed-group"}}b(je,"getCollapsedStyle");async function Ge(n,t){let s=je(t.metadata?.containerType),{fill:l,stroke:o}=s,{nodeStyles:c}=W(t),{shapeSvg:p,bbox:r}=await X(n,t,Y(t)),{theme:h,themeVariables:i}=z();wt(p,t.colorIndex,h,i.borderColorArray);let e=t.padding??8,a=r.height,g=Math.max(r.width+e*2,ks,t?.width??0),f=Math.max(a+Ot+Yt+e*2,t?.height??0),y=-g/2,u=-f/2,m=-(Ot+Yt)/2,d=p.select(".label");d&&(t.useHtmlLabels??xt(z())?d.attr("transform",`translate(${-r.width/2}, ${-r.height/2+m})`):d.attr("transform",`translate(0, ${-r.height/2+m})`));let x;if(t.look==="handDrawn"){let k=v.svg(p),P=R(t,{fill:l,stroke:o,...s.strokeWidth===void 0?{}:{strokeWidth:s.strokeWidth},...l==="none"?{fillWeight:0}:{fillStyle:"solid"}}),_=k.path(gt(y,u,g,f,s.rx),P);x=p.insert(()=>_,":first-child"),x.attr("class","basic label-container "+s.cssClass).attr("style",Q(t.cssStyles))}else x=p.insert("rect",":first-child"),x.attr("class","basic label-container "+s.cssClass).attr("style",c).attr("rx",s.rx).attr("ry",s.rx).attr("x",y).attr("y",u).attr("width",g).attr("height",f).attr("fill",l).attr("stroke",o),s.strokeWidth!==void 0&&x.attr("stroke-width",s.strokeWidth+"px");let w=u+e+a+Ot;p.append("line").attr("class","collapsed-separator").attr("x1",y+8).attr("y1",w).attr("x2",y+g-8).attr("y2",w).attr("stroke",o).attr("stroke-dasharray","3, 3");let S=w+Yt/2,$=2.5,M=10;for(let k=-1;k<=1;k++)p.append("circle").attr("class","collapsed-indicator").attr("cx",k*M).attr("cy",S).attr("r",$).attr("fill",o);return H(t,x),t.calcIntersect=function(k,P){return N.rect(k,P)},t.intersect=function(k){return N.rect(t,k)},p}b(Ge,"collapsedGroup");function nt(n,t,s,l){return n.insert("polygon",":first-child").attr("points",l.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+s/2+")")}b(nt,"insertPolygonShape");var Ps=["right","left","up","down"],Qt="point",Ds=b(n=>{let t=new Set;for(let s of n)switch(s){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(s);break}return t},"expandAndDeduplicateDirections"),Cs=b(n=>Ps.filter(t=>n.has(t)).join("|")||Qt,"getDirectionKey"),ye={"right|left|up|down":b(({height:n,midpoint:t,padding:s,width:l})=>[{x:0,y:0},{x:t,y:0},{x:l/2,y:2*s},{x:l-t,y:0},{x:l,y:0},{x:l,y:-n/3},{x:l+2*s,y:-n/2},{x:l,y:-2*n/3},{x:l,y:-n},{x:l-t,y:-n},{x:l/2,y:-n-2*s},{x:t,y:-n},{x:0,y:-n},{x:0,y:-2*n/3},{x:-2*s,y:-n/2},{x:0,y:-n/3}],"right|left|up|down"),"right|left|up":b(({height:n,midpoint:t,width:s})=>[{x:t,y:0},{x:s-t,y:0},{x:s,y:-n/2},{x:s-t,y:-n},{x:t,y:-n},{x:0,y:-n/2}],"right|left|up"),"right|left|down":b(({height:n,midpoint:t,width:s})=>[{x:0,y:0},{x:t,y:-n},{x:s-t,y:-n},{x:s,y:0}],"right|left|down"),"right|up|down":b(({height:n,midpoint:t,width:s})=>[{x:0,y:0},{x:s,y:-t},{x:s,y:-n+t},{x:0,y:-n}],"right|up|down"),"left|up|down":b(({height:n,midpoint:t,width:s})=>[{x:s,y:0},{x:0,y:-t},{x:0,y:-n+t},{x:s,y:-n}],"left|up|down"),"right|left":b(({height:n,midpoint:t,padding:s,width:l})=>[{x:t,y:0},{x:t,y:-s},{x:l-t,y:-s},{x:l-t,y:0},{x:l,y:-n/2},{x:l-t,y:-n},{x:l-t,y:-n+s},{x:t,y:-n+s},{x:t,y:-n},{x:0,y:-n/2}],"right|left"),"up|down":b(({height:n,midpoint:t,padding:s,width:l})=>[{x:l/2,y:0},{x:0,y:-s},{x:t,y:-s},{x:t,y:-n+s},{x:0,y:-n+s},{x:l/2,y:-n},{x:l,y:-n+s},{x:l-t,y:-n+s},{x:l-t,y:-s},{x:l,y:-s}],"up|down"),"right|up":b(({height:n,midpoint:t,width:s})=>[{x:0,y:0},{x:s,y:-t},{x:0,y:-n}],"right|up"),"right|down":b(({height:n,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-n}],"right|down"),"left|up":b(({height:n,midpoint:t,width:s})=>[{x:s,y:0},{x:0,y:-t},{x:s,y:-n}],"left|up"),"left|down":b(({height:n,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-n}],"left|down"),right:b(({height:n,midpoint:t,padding:s,width:l})=>[{x:t,y:-s},{x:t,y:-s},{x:l-t,y:-s},{x:l-t,y:0},{x:l,y:-n/2},{x:l-t,y:-n},{x:l-t,y:-n+s},{x:t,y:-n+s},{x:t,y:-n+s}],"right"),left:b(({height:n,midpoint:t,padding:s,width:l})=>[{x:t,y:0},{x:t,y:-s},{x:l-t,y:-s},{x:l-t,y:-n+s},{x:t,y:-n+s},{x:t,y:-n},{x:0,y:-n/2}],"left"),up:b(({height:n,midpoint:t,padding:s,width:l})=>[{x:t,y:-s},{x:t,y:-n+s},{x:0,y:-n+s},{x:l/2,y:-n},{x:l,y:-n+s},{x:l-t,y:-n+s},{x:l-t,y:-s}],"up"),down:b(({height:n,midpoint:t,padding:s,width:l})=>[{x:l/2,y:0},{x:0,y:-s},{x:t,y:-s},{x:t,y:-n+s},{x:l-t,y:-n+s},{x:l-t,y:-s},{x:l,y:-s}],"down"),[Qt]:()=>[{x:0,y:0}]},Bs=b((n,t,s,l)=>{let o=Ds(n),c=(s.padding??0)/2,p=t.height+4*c,r=p/2,h=l??t.width+2*r+2*c,i=Cs(o);return(ye[i]??ye[Qt])({height:p,midpoint:r,padding:c,width:h})},"getArrowPoints");async function Fe(n,t){let s=t,{shapeSvg:l,bbox:o}=await X(n,s,Y(s)),c=s.padding??0,p=o.height+2*c,r=p/2,h=o.width+2*r+c,i=s.width??0,a=s.positioned&&(s.widthInColumns??1)>1&&i>h?i:h,g=Bs(s.directions??[],o,s,a),f=nt(l,a,p,g);return f.attr("style",s.style??null),H(s,f),s.intersect=function(y){return N.polygon(s,g,y)},l}b(Fe,"block_arrow");async function qe(n,t,{config:{themeVariables:s}}){let{labelStyles:l,nodeStyles:o}=W(t);t.labelStyle=l;let{shapeSvg:c,bbox:p,label:r}=await X(n,t,Y(t)),h=s?.nodeBorder??s?.lineColor??"currentColor",i=t.padding??12,e=18,a=12,g=Math.max(p.width+i*2,t.width??0,90),f=Math.max(p.height+i*2+e,t.height??0),y=-f/2,{cssStyles:u}=t,m=c.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let w=v.svg(c).path(gt(-g/2,y,g,f,a),R(t,{}));m.node()?.appendChild(w),u&&m.attr("style",u)}else m.append("rect").attr("x",-g/2).attr("y",y).attr("width",g).attr("height",f).attr("rx",a).attr("ry",a).attr("style",o);m.append("line").attr("x1",-g/2).attr("y1",y+e).attr("x2",g/2).attr("y2",y+e).attr("style",`stroke:${h};stroke-width:1px`);for(let x=0;x<3;x++)m.append("circle").attr("cx",-g/2+12+x*9).attr("cy",y+e/2).attr("r",2.5).attr("style",`fill:${h};stroke:none`);m.append("rect").attr("class","browser-address-bar").attr("x",-g/2+44).attr("y",y+4).attr("width",Math.max(g-56,10)).attr("height",e-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${h};stroke-width:1px;opacity:0.6`),H(t,m);let d=y+e+(f-e)/2;return r.attr("transform",`translate(${-(p.width/2)-(p.x-(p.left??0))}, ${d-p.height/2-(p.y-(p.top??0))})`),t.intersect=function(x){return N.rect(t,x)},c}b(qe,"browser");var Et=12;async function ze(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?28:o,p=t.look==="neo"?24:o,{shapeSvg:r,bbox:h}=await X(n,t,Y(t)),i=(t?.width??h.width)+(t.look==="neo"?c*2:c+Et),e=(t?.height??h.height)+(t.look==="neo"?p*2:p),a=0,g=i,f=-e,y=0,u=[{x:a+Et,y:f},{x:g,y:f},{x:g,y},{x:a,y},{x:a,y:f+Et},{x:a+Et,y:f}],m,{cssStyles:d}=t;if(t.look==="handDrawn"){let x=v.svg(r),w=R(t,{}),S=F(u),$=x.path(S,w);m=r.insert(()=>$,":first-child").attr("transform",`translate(${-i/2}, ${e/2})`),d&&m.attr("style",d)}else m=nt(r,i,e,u);return l&&m.attr("style",l),H(t,m),t.intersect=function(x){return N.polygon(t,u,x)},r}b(ze,"card");function Ve(n,t){let{nodeStyles:s}=W(t);t.label="";let l=n.insert("g").attr("class",Y(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,c=Math.max(28,t.width??0),p=[{x:0,y:c/2},{x:c/2,y:0},{x:0,y:-c/2},{x:-c/2,y:0}],r=v.svg(l),h=R(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let i=F(p),e=r.path(i,h),a=l.insert(()=>e,":first-child");return o&&t.look!=="handDrawn"&&a.selectAll("path").attr("style",o),s&&t.look!=="handDrawn"&&a.selectAll("path").attr("style",s),t.width=28,t.height=28,t.intersect=function(g){return N.polygon(t,p,g)},l}b(Ve,"choice");async function te(n,t,s){let{labelStyles:l,nodeStyles:o}=W(t);t.labelStyle=l;let{shapeSvg:c,bbox:p,halfPadding:r}=await X(n,t,Y(t),{ignoreMinWidth:!0}),h=16,i=s?.padding??r,e=Math.sqrt(p.width**2+p.height**2)/2,a=t.look==="neo"?e+h:e+i,g,{cssStyles:f}=t;if(t.look==="handDrawn"){let y=v.svg(c),u=R(t,{}),m=y.circle(0,0,a*2,u);g=c.insert(()=>m,":first-child"),g.attr("class","basic label-container").attr("style",Q(f))}else g=c.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",a).attr("cx",0).attr("cy",0);return H(t,g),t.calcIntersect=function(y,u){let m=y.width/2;return N.circle(y,m,u)},t.intersect=function(y){return J.info("Circle intersect",t,a,y),N.circle(t,a,y)},c}b(te,"circle");async function Ze(n,t){let s=t,l=["node",s.cssClasses,s.class].filter(Boolean).join(" "),{shapeSvg:o,bbox:c,halfPadding:p}=await X(n,s,l),r=o.insert("rect",":first-child"),h=s.padding??0,i=s.positioned?s.width??0:c.width+h,e=s.positioned?s.height??0:c.height+h,a=s.positioned?-i/2:-c.width/2-p,g=s.positioned?-e/2:-c.height/2-p;return r.attr("class","basic cluster composite label-container").attr("style",s.style??null).attr("rx",s.rx??null).attr("ry",s.ry??null).attr("x",a).attr("y",g).attr("width",i).attr("height",e),H(s,r),s.intersect=function(f){return N.rect(s,f)},o}b(Ze,"composite");async function Ue(n,t,{config:{themeVariables:s}}){let{labelStyles:l,nodeStyles:o}=W(t);t.labelStyle=l;let{shapeSvg:c,bbox:p,label:r}=await X(n,t,Y(t)),h=s?.nodeBorder??s?.lineColor??"currentColor",i=t.padding??12,e=20,a=12,g=Math.max(p.width+i*2,t.width??0,90),f=Math.max(p.height+i*2+e,t.height??0),y=-f/2,{cssStyles:u}=t,m=c.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let w=v.svg(c).path(gt(-g/2,y,g,f,a),R(t,{}));m.node()?.appendChild(w),u&&m.attr("style",u)}else m.append("rect").attr("x",-g/2).attr("y",y).attr("width",g).attr("height",f).attr("rx",a).attr("ry",a).attr("style",o);m.append("text").attr("x",-g/2+12).attr("y",y+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${h}`).text(">_"),H(t,m);let d=y+e+(f-e)/2;return r.attr("transform",`translate(${-(p.width/2)-(p.x-(p.left??0))}, ${d-p.height/2-(p.y-(p.top??0))})`),t.intersect=function(x){return N.rect(t,x)},c}b(Ue,"consoleWindow");function Je(n){let t=Math.cos(Math.PI/4),s=Math.sin(Math.PI/4),l=n*2,o={x:l/2*t,y:l/2*s},c={x:-(l/2)*t,y:l/2*s},p={x:-(l/2)*t,y:-(l/2)*s},r={x:l/2*t,y:-(l/2)*s};return`M ${c.x},${c.y} L ${r.x},${r.y}
M ${o.x},${o.y} L ${p.x},${p.y}`}b(Je,"createLine");function Ke(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s,t.label="";let o=n.insert("g").attr("class",Y(t)).attr("id",t.domId??t.id),c=Math.max(30,t?.width??0),{cssStyles:p}=t,r=v.svg(o),h=R(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let i=r.circle(0,0,c*2,h),e=Je(c),a=r.path(e,h),g=o.insert(()=>i,":first-child");return g.insert(()=>a),g.attr("class","outer-path"),p&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",p),l&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",l),H(t,g),t.intersect=function(f){return J.info("crossedCircle intersect",t,{radius:c,point:f}),N.circle(t,c,f)},o}b(Ke,"crossedCircle");function ot(n,t,s,l=100,o=0,c=180){let p=[],r=o*Math.PI/180,e=(c*Math.PI/180-r)/(l-1);for(let a=0;a<l;a++){let g=r+a*e,f=n+s*Math.cos(g),y=t+s*Math.sin(g);p.push({x:-f,y:-y})}return p}b(ot,"generateCirclePoints");async function Qe(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await X(n,t,Y(t)),r=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,i=c.width+r,e=c.height+h,a=Math.max(5,e*.1),{cssStyles:g}=t,f=[...ot(i/2,-e/2,a,30,-90,0),{x:-i/2-a,y:a},...ot(i/2+a*2,-a,a,20,-180,-270),...ot(i/2+a*2,a,a,20,-90,-180),{x:-i/2-a,y:-e/2},...ot(i/2,e/2,a,20,0,90)],y=[{x:i/2,y:-e/2-a},{x:-i/2,y:-e/2-a},...ot(i/2,-e/2,a,20,-90,0),{x:-i/2-a,y:-a},...ot(i/2+i*.1,-a,a,20,-180,-270),...ot(i/2+i*.1,a,a,20,-90,-180),{x:-i/2-a,y:e/2},...ot(i/2,e/2,a,20,0,90),{x:-i/2,y:e/2+a},{x:i/2,y:e/2+a}],u=v.svg(o),m=R(t,{fill:"none"});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let x=F(f).replace("Z",""),w=u.path(x,m),S=F(y),$=u.path(S,{...m}),M=o.insert("g",":first-child");return M.insert(()=>$,":first-child").attr("stroke-opacity",0),M.insert(()=>w,":first-child"),M.attr("class","text"),g&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",g),l&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",l),M.attr("transform",`translate(${a}, 0)`),p.attr("transform",`translate(${-i/2+a-(c.x-(c.left??0))},${-e/2+(t.padding??0)/2-(c.y-(c.top??0))})`),H(t,M),t.intersect=function(k){return N.polygon(t,y,k)},o}b(Qe,"curlyBraceLeft");function ht(n,t,s,l=100,o=0,c=180){let p=[],r=o*Math.PI/180,e=(c*Math.PI/180-r)/(l-1);for(let a=0;a<l;a++){let g=r+a*e,f=n+s*Math.cos(g),y=t+s*Math.sin(g);p.push({x:f,y})}return p}b(ht,"generateCirclePoints");async function ta(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await X(n,t,Y(t)),r=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,i=c.width+(t.look==="neo"?r*2:r),e=c.height+(t.look==="neo"?h*2:h),a=Math.max(5,e*.1),{cssStyles:g}=t,f=[...ht(i/2,-e/2,a,20,-90,0),{x:i/2+a,y:-a},...ht(i/2+a*2,-a,a,20,-180,-270),...ht(i/2+a*2,a,a,20,-90,-180),{x:i/2+a,y:e/2},...ht(i/2,e/2,a,20,0,90)],y=[{x:-i/2,y:-e/2-a},{x:i/2,y:-e/2-a},...ht(i/2,-e/2,a,20,-90,0),{x:i/2+a,y:-a},...ht(i/2+a*2,-a,a,20,-180,-270),...ht(i/2+a*2,a,a,20,-90,-180),{x:i/2+a,y:e/2},...ht(i/2,e/2,a,20,0,90),{x:i/2,y:e/2+a},{x:-i/2,y:e/2+a}],u=v.svg(o),m=R(t,{fill:"none"});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let x=F(f).replace("Z",""),w=u.path(x,m),S=F(y),$=u.path(S,{...m}),M=o.insert("g",":first-child");return M.insert(()=>$,":first-child").attr("stroke-opacity",0),M.insert(()=>w,":first-child"),M.attr("class","text"),g&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",g),l&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",l),M.attr("transform",`translate(${-a}, 0)`),p.attr("transform",`translate(${-i/2+(t.padding??0)/2-(c.x-(c.left??0))},${-e/2+(t.padding??0)/2-(c.y-(c.top??0))})`),H(t,M),t.intersect=function(k){return N.polygon(t,y,k)},o}b(ta,"curlyBraceRight");function tt(n,t,s,l=100,o=0,c=180){let p=[],r=o*Math.PI/180,e=(c*Math.PI/180-r)/(l-1);for(let a=0;a<l;a++){let g=r+a*e,f=n+s*Math.cos(g),y=t+s*Math.sin(g);p.push({x:-f,y:-y})}return p}b(tt,"generateCirclePoints");async function ea(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await X(n,t,Y(t)),r=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,i=c.width+(t.look==="neo"?r*2:r),e=c.height+(t.look==="neo"?h*2:h),a=Math.max(5,e*.1),{cssStyles:g}=t,f=[...tt(i/2,-e/2,a,30,-90,0),{x:-i/2-a,y:a},...tt(i/2+a*2,-a,a,20,-180,-270),...tt(i/2+a*2,a,a,20,-90,-180),{x:-i/2-a,y:-e/2},...tt(i/2,e/2,a,20,0,90)],y=[...tt(-i/2+a+a/2,-e/2,a,20,-90,-180),{x:i/2-a/2,y:a},...tt(-i/2-a/2,-a,a,20,0,90),...tt(-i/2-a/2,a,a,20,-90,0),{x:i/2-a/2,y:-a},...tt(-i/2+a+a/2,e/2,a,30,-180,-270)],u=[{x:i/2,y:-e/2-a},{x:-i/2,y:-e/2-a},...tt(i/2,-e/2,a,20,-90,0),{x:-i/2-a,y:-a},...tt(i/2+a*2,-a,a,20,-180,-270),...tt(i/2+a*2,a,a,20,-90,-180),{x:-i/2-a,y:e/2},...tt(i/2,e/2,a,20,0,90),{x:-i/2,y:e/2+a},{x:i/2-a-a/2,y:e/2+a},...tt(-i/2+a+a/2,-e/2,a,20,-90,-180),{x:i/2-a/2,y:a},...tt(-i/2-a/2,-a,a,20,0,90),...tt(-i/2-a/2,a,a,20,-90,0),{x:i/2-a/2,y:-a},...tt(-i/2+a+a/2,e/2,a,30,-180,-270)],m=v.svg(o),d=R(t,{fill:"none"});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let w=F(f).replace("Z",""),S=m.path(w,d),M=F(y).replace("Z",""),k=m.path(M,d),P=F(u),_=m.path(P,{...d}),B=o.insert("g",":first-child");return B.insert(()=>_,":first-child").attr("stroke-opacity",0),B.insert(()=>S,":first-child"),B.insert(()=>k,":first-child"),B.attr("class","text"),g&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",g),l&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",l),B.attr("transform",`translate(${a-a/4}, 0)`),p.attr("transform",`translate(${-i/2+(t.padding??0)/2-(c.x-(c.left??0))},${-e/2+(t.padding??0)/2-(c.y-(c.top??0))})`),H(t,B),t.intersect=function(C){return N.polygon(t,u,C)},o}b(ea,"curlyBraces");async function aa(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?12:o,r=20,h=5,{shapeSvg:i,bbox:e}=await X(n,t,Y(t)),a=Math.max(h,e.height+p*2,t?.height??0),g=a/2,f=g-Math.sqrt(Math.max(0,g**2-(e.height/2)**2)),y=Math.max(a/4,f),u=Math.max(r,e.width+c*2+y*2,(e.width+c*2)*1.25,t?.width??0),{cssStyles:m}=t,d=v.svg(i),x=R(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let w=u,S=a,$=w-g,M=S/4,k=[{x:$,y:0},{x:M,y:0},{x:0,y:S/2},{x:M,y:S},{x:$,y:S},...lt(-$,-S/2,g,50,270,90)],P=F(k),_=d.path(P,x),B=i.insert(()=>_,":first-child");return B.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",m),l&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",l),B.attr("transform",`translate(${-u/2}, ${-a/2})`),H(t,B),t.intersect=function(C){return N.polygon(t,k,C)},i}b(aa,"curvedTrapezoid");async function sa(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await X(n,t,Y(t)),r=t.padding??20,h=Math.max(c.width+r*2,t.width??0,100),i=Math.min(Math.max(h*.23,16),56),e=i*.27,a=Math.max(c.height+r*2,t.height?t.height-(2*i-e):0),g=Math.min(h*.177,a*.45),f=a+2*i-e,y=-f/2,u=y+2*i-e,m=o.insert("g",":first-child").attr("class","basic label-container"),{cssStyles:d}=t;if(t.look==="handDrawn"){let P=v.svg(o),_=R(t,{}),B=P.path(gt(-h/2,u,h,a,g),_),C=P.circle(0,y+i,i*2,_);m.insert(()=>C,":first-child"),m.insert(()=>B,":first-child"),d&&m.attr("style",d)}else m.append("rect").attr("x",-h/2).attr("y",u).attr("width",h).attr("height",a).attr("rx",g).attr("ry",g).attr("style",l),m.append("circle").attr("cx",0).attr("cy",y+i).attr("r",i).attr("style",l);H(t,m);let x=u+a/2;p.attr("transform",`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${x-c.height/2-(c.y-(c.top??0))})`);let w=y+i,S=Math.asin(Math.min(1,(u-w)/i))*180/Math.PI,k=[...lt(0,-w,i,24,180+S,-S),...lt(-(-h/2+g),-(u+g),g,12,90,0),...lt(-(-h/2+g),-(f/2-g),g,12,360,270),...lt(-(h/2-g),-(f/2-g),g,12,270,180),...lt(-(h/2-g),-(u+g),g,12,180,90)];return t.intersect=function(P){return N.polygon(t,k,P)},o}b(sa,"person");var Ns=b((n,t,s,l,o,c)=>[`M${n},${t+c}`,`a${o},${c} 0,0,0 ${s},0`,`a${o},${c} 0,0,0 ${-s},0`,`l0,${l}`,`a${o},${c} 0,0,0 ${s},0`,`l0,${-l}`].join(" "),"createCylinderPathD"),As=b((n,t,s,l,o,c)=>[`M${n},${t+c}`,`M${n+s},${t+c}`,`a${o},${c} 0,0,0 ${-s},0`,`l0,${l}`,`a${o},${c} 0,0,0 ${s},0`,`l0,${-l}`].join(" "),"createOuterCylinderPathD"),Rs=b((n,t,s,l,o,c)=>[`M${n-s/2},${-l/2}`,`a${o},${c} 0,0,0 ${s},0`].join(" "),"createInnerCylinderPathD"),fe=8,pe=8;async function ra(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?24:o,p=t.look==="neo"?24:o,r=t.width??0;if(t.width&&(t.width=t.width-p,t.width<pe&&(t.width=pe)),t.height){let x=r/2/(2.5+r/50);t.height=t.height-c-x*3,t.height<fe&&(t.height=fe)}let{shapeSvg:h,bbox:i,label:e}=await X(n,t,Y(t)),a=Math.max(t.width??0,i.width)+p,g=a/2,f=g/(2.5+a/50),y=Math.max(t.height??0,i.height)+c+f,u,{cssStyles:m}=t;if(t.look==="handDrawn"){let d=v.svg(h),x=As(0,0,a,y,g,f),w=Rs(0,f,a,y,g,f),S=R(t,{}),$=d.path(x,S),M=d.path(w,R(t,{fill:"none"}));u=h.insert(()=>M,":first-child"),u=h.insert(()=>$,":first-child"),u.attr("class","basic label-container"),m&&u.attr("style",m)}else{let d=Ns(0,0,a,y,g,f);u=h.insert("path",":first-child").attr("d",d).attr("class","basic label-container outer-path").attr("style",Q(m)).attr("style",l)}return u.attr("label-offset-y",f),u.attr("transform",`translate(${-a/2}, ${-(y/2+f)})`),H(t,u),e.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)+(t.padding??0)/1.5-(i.y-(i.top??0))})`),t.intersect=function(d){let x=N.rect(t,d),w=x.x-(t.x??0);if(g!=0&&(Math.abs(w)<(t.width??0)/2||Math.abs(w)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-f)){let S=f*f*(1-w*w/(g*g));S>0&&(S=Math.sqrt(S)),S=f-S,d.y-(t.y??0)>0&&(S=-S),x.y+=S}return x},h}b(ra,"cylinder");async function Nt(n,t,s){let{labelStyles:l,nodeStyles:o}=W(t);t.labelStyle=l;let{shapeSvg:c,bbox:p}=await X(n,t,Y(t)),r=Math.max(p.width+s.labelPaddingX*2,t?.width||0),h=Math.max(p.height+s.labelPaddingY*2,t?.height||0),i=-r/2,e=-h/2,a,{rx:g,ry:f}=t,{cssStyles:y}=t;if(s?.rx&&s.ry&&(g=s.rx,f=s.ry),t.look==="handDrawn"){let u=v.svg(c),m=R(t,{}),d=g||f?u.path(gt(i,e,r,h,g||0),m):u.rectangle(i,e,r,h,m);a=c.insert(()=>d,":first-child"),a.attr("class","basic label-container").attr("style",Q(y))}else a=c.insert("rect",":first-child"),a.attr("class","basic label-container").attr("style",o).attr("rx",Q(g)).attr("ry",Q(f)).attr("x",i).attr("y",e).attr("width",r).attr("height",h);return H(t,a,t.look==="handDrawn"?void 0:{width:r,height:h}),t.calcIntersect=function(u,m){return N.rect(u,m)},t.intersect=function(u){return N.rect(t,u)},c}b(Nt,"drawRect");async function ia(n,t){let{cssClasses:s,labelPaddingX:l,labelPaddingY:o,padding:c,width:p,height:r}=t,h={rx:0,ry:0,classes:s??"",labelPaddingX:l??(c??0)*2,labelPaddingY:o??c??0},i=await Nt(n,t,h);if(t.look==="handDrawn"){let f=v.svg(i),y=R(t,{}),u=i.select(".basic.label-container > path:nth-child(2)"),m=u.node();if(!m)return i;let d=null;if(m instanceof SVGGraphicsElement)d=m.getBBox();else return i;return i.insert(()=>f.line(d.x,d.y,d.x+d.width,d.y,y),".basic.label-container g.label"),i.insert(()=>f.line(d.x,d.y+d.height,d.x+d.width,d.y+d.height,y),".basic.label-container g.label"),u.remove(),i}let e=i.select(".basic.label-container"),a=(Number(e.attr("width"))||p)??0,g=(Number(e.attr("height"))||r)??0;return a>0&&g>0&&e.attr("stroke-dasharray",`${a} ${g}`),i}b(ia,"datastore");async function la(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.look==="neo"?16:t.padding??0,c=t.look==="neo"?16:t.padding??0,{shapeSvg:p,bbox:r,label:h}=await X(n,t,Y(t)),i=r.width+o,e=r.height+c,a=e*.2,g=-i/2,f=-e/2-a/2,{cssStyles:y}=t,u=v.svg(p),m=R(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let d=[{x:g,y:f+a},{x:-g,y:f+a},{x:-g,y:-f},{x:g,y:-f},{x:g,y:f},{x:-g,y:f},{x:-g,y:f+a}],x=u.polygon(d.map(S=>[S.x,S.y]),m),w=p.insert(()=>x,":first-child");return w.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",y),l&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",l),h.attr("transform",`translate(${g+(t.padding??0)/2-(r.x-(r.left??0))}, ${f+a+(t.padding??0)/2-(r.y-(r.top??0))})`),H(t,w),t.intersect=function(S){return N.rect(t,S)},p}b(la,"dividedRectangle");async function na(n,t){let{labelStyles:s,nodeStyles:l}=W(t),o=t.look==="neo"?12:5;t.labelStyle=s;let c=t.padding??0,p=t.look==="neo"?16:c,{shapeSvg:r,bbox:h}=await X(n,t,Y(t),{ignoreMinWidth:!0}),i=Math.sqrt(h.width**2+h.height**2)/2,e=(t?.width?t?.width/2:i)+(p??0),a=e+o,g,{cssStyles:f}=t;if(t.look==="handDrawn"){let y=v.svg(r),u=R(t,{roughness:.2,strokeWidth:2.5}),m=R(t,{roughness:.2,strokeWidth:1.5}),d=y.circle(0,0,a*2,u),x=y.circle(0,0,e*2,m);g=r.insert("g",":first-child"),g.attr("class",Q(t.cssClasses)).attr("style",Q(f)),g.node()?.appendChild(d),g.node()?.appendChild(x)}else{g=r.insert("g",":first-child");let y=g.insert("circle",":first-child"),u=g.insert("circle");g.attr("class","basic label-container").attr("style",l),y.attr("class","outer-circle").attr("style",l).attr("r",a).attr("cx",0).attr("cy",0),u.attr("class","inner-circle").attr("style",l).attr("r",e).attr("cx",0).attr("cy",0)}return H(t,g),t.intersect=function(y){return J.info("DoubleCircle intersect",t,a,y),N.circle(t,a,y)},r}b(na,"doublecircle");async function ca(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,halfPadding:p}=await X(n,t,Y(t)),{theme:r,themeVariables:h}=z();wt(o,t.colorIndex,r,h.borderColorArray);let i=p??10,e=c.width/2+i*2,a=c.height/2+i*2,g,{cssStyles:f}=t;if(t.look==="handDrawn"){let y=v.svg(o),u=R(t,{}),m=y.ellipse(0,0,e*2,a*2,u);g=o.insert(()=>m,":first-child"),g.attr("class","basic label-container"),f&&g.attr("style",f)}else g=o.insert("ellipse",":first-child").attr("class","basic label-container").attr("style",l).attr("rx",e).attr("ry",a).attr("cx",0).attr("cy",0);return t.width=e*2,t.height=a*2,H(t,g),t.calcIntersect=function(y,u){let m=y.width/2,d=y.height/2;return N.ellipse(y,m,d,u)},t.intersect=function(y){return N.ellipse(t,e,a,y)},o}b(ca,"usecaseEllipse");function oa(n,t,{config:{themeVariables:s}}){let{labelStyles:l,nodeStyles:o}=W(t);t.label="",t.labelStyle=l;let c=n.insert("g").attr("class",Y(t)).attr("id",t.domId??t.id),p=7,{cssStyles:r}=t,h=v.svg(c),{nodeBorder:i}=s,e=R(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(e.roughness=0);let a=h.circle(0,0,p*2,e),g=c.insert(()=>a,":first-child");return g.selectAll("path").attr("style",`fill: ${i} !important;`),r&&r.length>0&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",r),o&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",o),H(t,g),t.intersect=function(f){return J.info("filledCircle intersect",t,{radius:p,point:f}),N.circle(t,p,f)},c}b(oa,"filledCircle");var ue=10,de=10;async function ha(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.height<ue&&(t.height=ue),t.width=(t?.width??0)-c-c/2,t.width<de&&(t.width=de));let{shapeSvg:p,bbox:r,label:h}=await X(n,t,Y(t)),i=(t?.width?t?.width:r.width)+(c??0),e=t?.height?t?.height:i+r.height,a=e,g=[{x:0,y:-e},{x:a,y:-e},{x:a/2,y:0}],{cssStyles:f}=t,y=v.svg(p),u=R(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let m=F(g),d=y.path(m,u),x=p.insert(()=>d,":first-child").attr("transform",`translate(${-e/2}, ${e/2})`).attr("class","outer-path");return f&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",f),l&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",l),t.width=i,t.height=e,H(t,x),h.attr("transform",`translate(${-r.width/2-(r.x-(r.left??0))}, ${-e/2+(t.padding??0)/2+(r.y-(r.top??0))})`),t.intersect=function(w){return J.info("Triangle intersect",t,g,w),N.polygon(t,g,w)},p}b(ha,"flippedTriangle");async function ga(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await X(n,t,Y(t)),r=t.padding??12,h=Math.max(c.width+r*2,t.width??0,90),i=c.height+r*2,e=Math.max(Math.min(i*.16,14),8),a=Math.max(i+e,t.height??0),g=a-e,f=Math.max(h*.38,28),y=-a/2,u=[{x:-h/2,y},{x:-h/2+f,y},{x:-h/2+f,y:y+e},{x:h/2,y:y+e},{x:h/2,y:a/2},{x:-h/2,y:a/2}],m=[`M${u[0].x},${u[0].y}`,...u.slice(1).map(S=>`L${S.x},${S.y}`),"Z"].join(" "),{cssStyles:d}=t,x;if(t.look==="handDrawn"){let $=v.svg(o).path(m,R(t,{}));x=o.insert(()=>$,":first-child").attr("class","basic label-container"),d&&x.attr("style",d)}else x=o.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",l);t.look==="handDrawn"?H(t,x):H(t,x,{width:h,height:a});let w=y+e+g/2;return p.attr("transform",`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${w-c.height/2-(c.y-(c.top??0))})`),t.intersect=function(S){return N.polygon(t,u,S)},o}b(ga,"folder");function ya(n,t,{dir:s,config:{state:l,themeVariables:o}}){let{nodeStyles:c}=W(t);t.label="";let p=n.insert("g").attr("class",Y(t)).attr("id",t.domId??t.id),{cssStyles:r}=t,h=Math.max(70,t?.width??0),i=Math.max(10,t?.height??0);(s==="LR"||s==="RL")&&(h=Math.max(10,t?.width??0),i=Math.max(70,t?.height??0));let e=-1*h/2,a=-1*i/2,g=v.svg(p),f=R(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let y=g.rectangle(e,a,h,i,f),u=p.insert(()=>y,":first-child");r&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",r),c&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",c),H(t,u);let m=l?.padding??0;return t.width&&t.height&&(t.width+=m/2||0,t.height+=m/2||0),t.intersect=function(d){return N.rect(t,d)},p}b(ya,"forkJoin");async function fa(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=15,c=10,p=t.look==="neo"?16:t.padding??0,r=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-r*2,t.height<c&&(t.height=c),t.width=(t?.width??0)-p*2,t.width<o&&(t.width=o));let{shapeSvg:h,bbox:i}=await X(n,t,Y(t)),e=(t?.height?t?.height:Math.max(c,i.height))+r*2,a=e/2,g=a-Math.sqrt(Math.max(0,a**2-(i.height/2)**2)),f=(t?.width?t?.width:Math.max(o,i.width)+g*2)+p*2,{cssStyles:y}=t,u=v.svg(h),m=R(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let d=[{x:-f/2,y:-e/2},{x:f/2-a,y:-e/2},...lt(-f/2+a,0,a,50,90,270),{x:f/2-a,y:e/2},{x:-f/2,y:e/2}],x=F(d),w=u.path(x,m),S=h.insert(()=>w,":first-child");return S.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",y),l&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",l),H(t,S),t.intersect=function($){return J.info("Pill intersect",t,{radius:a,point:$}),N.polygon(t,d,$)},h}b(fa,"halfRoundedRectangle");var Hs=b((n,t,s,l,o)=>[`M${n+o},${t}`,`L${n+s-o},${t}`,`L${n+s},${t-l/2}`,`L${n+s-o},${t-l}`,`L${n+o},${t-l}`,`L${n},${t-l/2}`,"Z"].join(" "),"createHexagonPathD");async function pa(n,t){let{labelStyles:s,nodeStyles:l}=W(t),o=t.look==="neo"?3.5:4;t.labelStyle=s;let c=t.padding??0,p=70,r=32,h=t.look==="neo"?p:c,i=t.look==="neo"?r:c;if(t.width||t.height){let w=(t.height??0)/o;t.width=(t?.width??0)-2*w-i,t.height=(t.height??0)-h}let{shapeSvg:e,bbox:a}=await X(n,t,Y(t)),g=(t?.height?t?.height:a.height)+h,f=g/o,y=(t?.width?t?.width:a.width)+2*f+i,u=[{x:f,y:0},{x:y-f,y:0},{x:y,y:-g/2},{x:y-f,y:-g},{x:f,y:-g},{x:0,y:-g/2}],m,{cssStyles:d}=t;if(t.look==="handDrawn"){let x=v.svg(e),w=R(t,{}),S=Hs(0,0,y,g,f),$=x.path(S,w);m=e.insert(()=>$,":first-child").attr("transform",`translate(${-y/2}, ${g/2})`),d&&m.attr("style",d)}else m=nt(e,y,g,u);return l&&m.attr("style",l),t.width=y,t.height=g,H(t,m),t.intersect=function(x){return N.polygon(t,u,x)},e}b(pa,"hexagon");async function ua(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.label="",t.labelStyle=s;let{shapeSvg:o}=await X(n,t,Y(t)),c=Math.max(30,t?.width??0),p=Math.max(30,t?.height??0),{cssStyles:r}=t,h=v.svg(o),i=R(t,{});t.look!=="handDrawn"&&(i.roughness=0,i.fillStyle="solid");let e=[{x:0,y:0},{x:c,y:0},{x:0,y:p},{x:c,y:p}],a=F(e),g=h.path(a,i),f=o.insert(()=>g,":first-child");return f.attr("class","basic label-container outer-path"),r&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",r),l&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",l),f.attr("transform",`translate(${-c/2}, ${-p/2})`),H(t,f),t.intersect=function(y){return J.info("Pill intersect",t,{points:e}),N.polygon(t,e,y)},o}b(ua,"hourglass");async function da(n,t,{config:{themeVariables:s,flowchart:l}}){let{labelStyles:o}=W(t);t.labelStyle=o;let c=t.assetHeight??48,p=t.assetWidth??48,r=Math.max(c,p),h=l?.wrappingWidth;t.width=Math.max(r,h??0);let{shapeSvg:i,bbox:e,label:a}=await X(n,t,"icon-shape default"),g=t.pos==="t",f=r,y=r,{nodeBorder:u}=s,{stylesMap:m}=vt(t),d=-y/2,x=-f/2,w=t.label?8:0,S=v.svg(i),$=R(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&($.roughness=0,$.fillStyle="solid");let M=S.rectangle(d,x,y,f,$),k=Math.max(y,e.width),P=f+e.height+w,_=S.rectangle(-k/2,-P/2,k,P,{...$,fill:"transparent",stroke:"none"}),B=i.insert(()=>M,":first-child"),C=i.insert(()=>_);if(t.icon){let I=i.append("g");I.html(`<g>${await kt(t.icon,{height:r,width:r,fallbackPrefix:""})}</g>`);let D=I.node().getBBox(),L=D.width,E=D.height,A=D.x,T=D.y;I.attr("transform",`translate(${-L/2-A},${g?e.height/2+w/2-E/2-T:-e.height/2-w/2-E/2-T})`),I.attr("style",`color: ${m.get("stroke")??u};`)}return a.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${g?-P/2:P/2-e.height})`),B.attr("transform",`translate(0,${g?e.height/2+w/2:-e.height/2-w/2})`),H(t,C),t.intersect=function(I){if(J.info("iconSquare intersect",t,I),!t.label)return N.rect(t,I);let D=t.x??0,L=t.y??0,E=t.height??0,A=[];return g?A=[{x:D-e.width/2,y:L-E/2},{x:D+e.width/2,y:L-E/2},{x:D+e.width/2,y:L-E/2+e.height+w},{x:D+y/2,y:L-E/2+e.height+w},{x:D+y/2,y:L+E/2},{x:D-y/2,y:L+E/2},{x:D-y/2,y:L-E/2+e.height+w},{x:D-e.width/2,y:L-E/2+e.height+w}]:A=[{x:D-y/2,y:L-E/2},{x:D+y/2,y:L-E/2},{x:D+y/2,y:L-E/2+f},{x:D+e.width/2,y:L-E/2+f},{x:D+e.width/2/2,y:L+E/2},{x:D-e.width/2,y:L+E/2},{x:D-e.width/2,y:L-E/2+f},{x:D-y/2,y:L-E/2+f}],N.polygon(t,A,I)},i}b(da,"icon");async function ma(n,t,{config:{themeVariables:s,flowchart:l}}){let{labelStyles:o}=W(t);t.labelStyle=o;let c=t.assetHeight??48,p=t.assetWidth??48,r=Math.max(c,p),h=l?.wrappingWidth;t.width=Math.max(r,h??0);let{shapeSvg:i,bbox:e,label:a}=await X(n,t,"icon-shape default"),g=20,f=t.label?8:0,y=t.pos==="t",{nodeBorder:u,mainBkg:m}=s,{stylesMap:d}=vt(t),x=v.svg(i),w=R(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let S=d.get("fill");w.stroke=S??m;let $=i.append("g");t.icon&&$.html(`<g>${await kt(t.icon,{height:r,width:r,fallbackPrefix:""})}</g>`);let M=$.node().getBBox(),k=M.width,P=M.height,_=M.x,B=M.y,C=Math.max(k,P)*Math.SQRT2+g*2,I=x.circle(0,0,C,w),D=Math.max(C,e.width),L=C+e.height+f,E=x.rectangle(-D/2,-L/2,D,L,{...w,fill:"transparent",stroke:"none"}),A=i.insert(()=>I,":first-child"),T=i.insert(()=>E);return $.attr("transform",`translate(${-k/2-_},${y?e.height/2+f/2-P/2-B:-e.height/2-f/2-P/2-B})`),$.attr("style",`color: ${d.get("stroke")??u};`),a.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${y?-L/2:L/2-e.height})`),A.attr("transform",`translate(0,${y?e.height/2+f/2:-e.height/2-f/2})`),H(t,T),t.intersect=function(O){return J.info("iconSquare intersect",t,O),N.rect(t,O)},i}b(ma,"iconCircle");async function xa(n,t,{config:{themeVariables:s,flowchart:l}}){let{labelStyles:o}=W(t);t.labelStyle=o;let c=t.assetHeight??48,p=t.assetWidth??48,r=Math.max(c,p),h=l?.wrappingWidth;t.width=Math.max(r,h??0);let{shapeSvg:i,bbox:e,halfPadding:a,label:g}=await X(n,t,"icon-shape default"),f=t.pos==="t",y=r+a*2,u=r+a*2,{nodeBorder:m,mainBkg:d}=s,{stylesMap:x}=vt(t),w=-u/2,S=-y/2,$=t.label?8:0,M=v.svg(i),k=R(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let P=x.get("fill");k.stroke=P??d;let _=M.path(gt(w,S,u,y,5),k),B=Math.max(u,e.width),C=y+e.height+$,I=M.rectangle(-B/2,-C/2,B,C,{...k,fill:"transparent",stroke:"none"}),D=i.insert(()=>_,":first-child").attr("class","icon-shape2"),L=i.insert(()=>I);if(t.icon){let E=i.append("g");E.html(`<g>${await kt(t.icon,{height:r,width:r,fallbackPrefix:""})}</g>`);let A=E.node().getBBox(),T=A.width,O=A.height,G=A.x,V=A.y;E.attr("transform",`translate(${-T/2-G},${f?e.height/2+$/2-O/2-V:-e.height/2-$/2-O/2-V})`),E.attr("style",`color: ${x.get("stroke")??m};`)}return g.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${f?-C/2:C/2-e.height})`),D.attr("transform",`translate(0,${f?e.height/2+$/2:-e.height/2-$/2})`),H(t,L),t.intersect=function(E){if(J.info("iconSquare intersect",t,E),!t.label)return N.rect(t,E);let A=t.x??0,T=t.y??0,O=t.height??0,G=[];return f?G=[{x:A-e.width/2,y:T-O/2},{x:A+e.width/2,y:T-O/2},{x:A+e.width/2,y:T-O/2+e.height+$},{x:A+u/2,y:T-O/2+e.height+$},{x:A+u/2,y:T+O/2},{x:A-u/2,y:T+O/2},{x:A-u/2,y:T-O/2+e.height+$},{x:A-e.width/2,y:T-O/2+e.height+$}]:G=[{x:A-u/2,y:T-O/2},{x:A+u/2,y:T-O/2},{x:A+u/2,y:T-O/2+y},{x:A+e.width/2,y:T-O/2+y},{x:A+e.width/2/2,y:T+O/2},{x:A-e.width/2,y:T+O/2},{x:A-e.width/2,y:T-O/2+y},{x:A-u/2,y:T-O/2+y}],N.polygon(t,G,E)},i}b(xa,"iconRounded");async function wa(n,t,{config:{themeVariables:s,flowchart:l}}){let{labelStyles:o}=W(t);t.labelStyle=o;let c=t.assetHeight??48,p=t.assetWidth??48,r=Math.max(c,p),h=l?.wrappingWidth;t.width=Math.max(r,h??0);let{shapeSvg:i,bbox:e,halfPadding:a,label:g}=await X(n,t,"icon-shape default"),f=t.pos==="t",y=r+a*2,u=r+a*2,{nodeBorder:m,mainBkg:d}=s,{stylesMap:x}=vt(t),w=-u/2,S=-y/2,$=t.label?8:0,M=v.svg(i),k=R(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let P=x.get("fill");k.stroke=P??d;let _=M.path(gt(w,S,u,y,.1),k),B=Math.max(u,e.width),C=y+e.height+$,I=M.rectangle(-B/2,-C/2,B,C,{...k,fill:"transparent",stroke:"none"}),D=i.insert(()=>_,":first-child"),L=i.insert(()=>I);if(t.icon){let E=i.append("g");E.html(`<g>${await kt(t.icon,{height:r,width:r,fallbackPrefix:""})}</g>`);let A=E.node().getBBox(),T=A.width,O=A.height,G=A.x,V=A.y;E.attr("transform",`translate(${-T/2-G},${f?e.height/2+$/2-O/2-V:-e.height/2-$/2-O/2-V})`),E.attr("style",`color: ${x.get("stroke")??m};`)}return g.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${f?-C/2:C/2-e.height})`),D.attr("transform",`translate(0,${f?e.height/2+$/2:-e.height/2-$/2})`),H(t,L),t.intersect=function(E){if(J.info("iconSquare intersect",t,E),!t.label)return N.rect(t,E);let A=t.x??0,T=t.y??0,O=t.height??0,G=[];return f?G=[{x:A-e.width/2,y:T-O/2},{x:A+e.width/2,y:T-O/2},{x:A+e.width/2,y:T-O/2+e.height+$},{x:A+u/2,y:T-O/2+e.height+$},{x:A+u/2,y:T+O/2},{x:A-u/2,y:T+O/2},{x:A-u/2,y:T-O/2+e.height+$},{x:A-e.width/2,y:T-O/2+e.height+$}]:G=[{x:A-u/2,y:T-O/2},{x:A+u/2,y:T-O/2},{x:A+u/2,y:T-O/2+y},{x:A+e.width/2,y:T-O/2+y},{x:A+e.width/2/2,y:T+O/2},{x:A-e.width/2,y:T+O/2},{x:A-e.width/2,y:T-O/2+y},{x:A-u/2,y:T-O/2+y}],N.polygon(t,G,E)},i}b(wa,"iconSquare");async function ba(n,t,{config:{flowchart:s}}){let l=new Image;l.src=t?.img??"",await l.decode();let o=Number(l.naturalWidth.toString().replace("px","")),c=Number(l.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/c;let{labelStyles:p}=W(t);t.labelStyle=p;let r=s?.wrappingWidth;t.defaultWidth=s?.wrappingWidth;let h=Math.max(t.label?r??0:0,t?.assetWidth??o),i=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:h,e=t.constraint==="on"?i/t.imageAspectRatio:t?.assetHeight??c;t.width=Math.max(i,r??0);let{shapeSvg:a,bbox:g,label:f}=await X(n,t,"image-shape default"),y=t.pos==="t",u=-i/2,m=-e/2,d=t.label?8:0,x=v.svg(a),w=R(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let S=x.rectangle(u,m,i,e,w),$=Math.max(i,g.width),M=e+g.height+d,k=x.rectangle(-$/2,-M/2,$,M,{...w,fill:"none",stroke:"none"}),P=a.insert(()=>S,":first-child"),_=a.insert(()=>k);if(t.img){let B=a.append("image");B.attr("href",t.img),B.attr("width",i),B.attr("height",e),B.attr("preserveAspectRatio","none"),B.attr("transform",`translate(${-i/2},${y?M/2-e:-M/2})`)}return f.attr("transform",`translate(${-g.width/2-(g.x-(g.left??0))},${y?-e/2-g.height/2-d/2:e/2-g.height/2+d/2})`),P.attr("transform",`translate(0,${y?g.height/2+d/2:-g.height/2-d/2})`),H(t,_),t.intersect=function(B){if(J.info("iconSquare intersect",t,B),!t.label)return N.rect(t,B);let C=t.x??0,I=t.y??0,D=t.height??0,L=[];return y?L=[{x:C-g.width/2,y:I-D/2},{x:C+g.width/2,y:I-D/2},{x:C+g.width/2,y:I-D/2+g.height+d},{x:C+i/2,y:I-D/2+g.height+d},{x:C+i/2,y:I+D/2},{x:C-i/2,y:I+D/2},{x:C-i/2,y:I-D/2+g.height+d},{x:C-g.width/2,y:I-D/2+g.height+d}]:L=[{x:C-i/2,y:I-D/2},{x:C+i/2,y:I-D/2},{x:C+i/2,y:I-D/2+e},{x:C+g.width/2,y:I-D/2+e},{x:C+g.width/2/2,y:I+D/2},{x:C-g.width/2,y:I+D/2},{x:C-g.width/2,y:I-D/2+e},{x:C-i/2,y:I-D/2+e}],N.polygon(t,L,B)},a}b(ba,"imageSquare");async function Sa(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=o,p=t.look==="neo"?o*2:o,{shapeSvg:r,bbox:h}=await X(n,t,Y(t)),i=Math.max(h.height+c*2,t.height??0),e=Math.max(h.width+p*2,(t.width??0)-i),a=[{x:0,y:0},{x:e,y:0},{x:e+3*i/6,y:-i},{x:-3*i/6,y:-i}],g,{cssStyles:f}=t;if(t.look==="handDrawn"){let y=v.svg(r),u=R(t,{}),m=F(a),d=y.path(m,u);g=r.insert(()=>d,":first-child").attr("transform",`translate(${-e/2}, ${i/2})`),f&&g.attr("style",f)}else g=nt(r,e,i,a);return l&&g.attr("style",l),t.width=e,t.height=i,H(t,g),t.intersect=function(y){return N.polygon(t,a,y)},r}b(Sa,"inv_trapezoid");async function $a(n,t){let{shapeSvg:s,bbox:l,label:o}=await X(n,t,"label"),c=s.insert("rect",":first-child");return c.attr("width",.1).attr("height",.1),s.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),H(t,c),t.intersect=function(h){return N.rect(t,h)},s}b($a,"labelRect");async function va(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=o,p=t.look==="neo"?o*2:o,{shapeSvg:r,bbox:h}=await X(n,t,Y(t)),i=Math.max(h.height+c,t.height??0),e=Math.max(h.width+p,(t.width??0)-i),a=[{x:0,y:0},{x:e+3*i/6,y:0},{x:e,y:-i},{x:-(3*i)/6,y:-i}],g,{cssStyles:f}=t;if(t.look==="handDrawn"){let y=v.svg(r),u=R(t,{}),m=F(a),d=y.path(m,u);g=r.insert(()=>d,":first-child").attr("transform",`translate(${-e/2}, ${i/2})`),f&&g.attr("style",f)}else g=nt(r,e,i,a);return l&&g.attr("style",l),t.width=e,t.height=i,H(t,g),t.intersect=function(y){return N.polygon(t,a,y)},r}b(va,"lean_left");async function ka(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=o,p=t.look==="neo"?o*2:o,{shapeSvg:r,bbox:h}=await X(n,t,Y(t)),i=Math.max(h.height+c,t.height??0),e=Math.max(h.width+p,(t.width??0)-i),a=[{x:-3*i/6,y:0},{x:e,y:0},{x:e+3*i/6,y:-i},{x:0,y:-i}],g,{cssStyles:f}=t;if(t.look==="handDrawn"){let y=v.svg(r),u=R(t,{}),m=F(a),d=y.path(m,u);g=r.insert(()=>d,":first-child").attr("transform",`translate(${-e/2}, ${i/2})`),f&&g.attr("style",f)}else g=nt(r,e,i,a);return l&&g.attr("style",l),t.width=e,t.height=i,H(t,g),t.intersect=function(y){return N.polygon(t,a,y)},r}b(ka,"lean_right");function Ma(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.label="",t.labelStyle=s;let o=n.insert("g").attr("class",Y(t)).attr("id",t.domId??t.id),{cssStyles:c}=t,p=Math.max(35,t?.width??0),r=Math.max(35,t?.height??0),h=7,i=[{x:p,y:0},{x:0,y:r+h/2},{x:p-2*h,y:r+h/2},{x:0,y:2*r},{x:p,y:r-h/2},{x:2*h,y:r-h/2}],e=v.svg(o),a=R(t,{});t.look!=="handDrawn"&&(a.roughness=0,a.fillStyle="solid");let g=F(i),f=e.path(g,a),y=o.insert(()=>f,":first-child");return y.attr("class","outer-path"),c&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",c),l&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",l),y.attr("transform",`translate(-${p/2},${-r})`),H(t,y),t.intersect=function(u){return J.info("lightningBolt intersect",t,u),N.polygon(t,i,u)},o}b(Ma,"lightningBolt");var Is=b((n,t,s,l,o,c,p)=>[`M${n},${t+c}`,`a${o},${c} 0,0,0 ${s},0`,`a${o},${c} 0,0,0 ${-s},0`,`l0,${l}`,`a${o},${c} 0,0,0 ${s},0`,`l0,${-l}`,`M${n},${t+c+p}`,`a${o},${c} 0,0,0 ${s},0`].join(" "),"createCylinderPathD"),Ls=b((n,t,s,l,o,c,p)=>[`M${n},${t+c}`,`M${n+s},${t+c}`,`a${o},${c} 0,0,0 ${-s},0`,`l0,${l}`,`a${o},${c} 0,0,0 ${s},0`,`l0,${-l}`,`M${n},${t+c+p}`,`a${o},${c} 0,0,0 ${s},0`].join(" "),"createOuterCylinderPathD"),Es=b((n,t,s,l,o,c)=>[`M${n-s/2},${-l/2}`,`a${o},${c} 0,0,0 ${s},0`].join(" "),"createInnerCylinderPathD"),me=10,xe=10;async function Pa(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?24:o;if(t.width||t.height){let d=t.width??0;t.width=(t.width??0)-c,t.width<xe&&(t.width=xe);let w=d/2/(2.5+d/50);t.height=(t.height??0)-p-w*3,t.height<me&&(t.height=me)}let{shapeSvg:r,bbox:h,label:i}=await X(n,t,Y(t)),e=(t?.width?t?.width:h.width)+c*2,a=e/2,g=a/(2.5+e/50),f=(t?.height?t?.height:h.height)+g+p*2,y=f*.1,u,{cssStyles:m}=t;if(t.look==="handDrawn"){let d=v.svg(r),x=Ls(0,0,e,f,a,g,y),w=Es(0,g,e,f,a,g),S=R(t,{}),$=d.path(x,S),M=d.path(w,S);r.insert(()=>M,":first-child").attr("class","line"),u=r.insert(()=>$,":first-child"),u.attr("class","basic label-container"),m&&u.attr("style",m)}else{let d=Is(0,0,e,f,a,g,y);u=r.insert("path",":first-child").attr("d",d).attr("class","basic label-container outer-path").attr("style",Q(m)).attr("style",l)}return u.attr("label-offset-y",g),u.attr("transform",`translate(${-e/2}, ${-(f/2+g)})`),H(t,u),i.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)+g-(h.y-(h.top??0))})`),t.intersect=function(d){let x=N.rect(t,d),w=x.x-(t.x??0);if(a!=0&&(Math.abs(w)<(t.width??0)/2||Math.abs(w)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-g)){let S=g*g*(1-w*w/(a*a));S>0&&(S=Math.sqrt(S)),S=g-S,d.y-(t.y??0)>0&&(S=-S),x.y+=S}return x},r}b(Pa,"linedCylinder");async function Da(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?12:o;if(t.width||t.height){let S=t.width;t.width=(S??0)*10/11-c*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-p*2,t.height<10&&(t.height=10)}let{shapeSvg:r,bbox:h,label:i}=await X(n,t,Y(t)),e=(t?.width?t?.width:h.width)+(c??0)*2,a=(t?.height?t?.height:h.height)+(p??0)*2,g=t.look==="neo"?a/4:a/8,f=a+g,{cssStyles:y}=t,u=v.svg(r),m=R(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let d=[{x:-e/2-e/2*.1,y:-f/2},{x:-e/2-e/2*.1,y:f/2},...ut(-e/2-e/2*.1,f/2,e/2+e/2*.1,f/2,g,.8),{x:e/2+e/2*.1,y:-f/2},{x:-e/2-e/2*.1,y:-f/2},{x:-e/2,y:-f/2},{x:-e/2,y:f/2*1.1},{x:-e/2,y:-f/2}],x=u.polygon(d.map(S=>[S.x,S.y]),m),w=r.insert(()=>x,":first-child");return w.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",y),l&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",l),w.attr("transform",`translate(0,${-g/2})`),i.attr("transform",`translate(${-e/2+(t.padding??0)+e/2*.1/2-(h.x-(h.left??0))},${-a/2+(t.padding??0)-g-(h.y-(h.top??0))})`),H(t,w),t.intersect=function(S){return N.polygon(t,d,S)},r}b(Da,"linedWaveEdgedRect");var Ws=56,Xt=72,we=8,be=2,Ts=8,_s={normal:"usecase-actor-shape usecase-actor-normal",hollow:"usecase-actor-hollow",awesome:"usecase-actor-awesome",icon:"usecase-actor-icon"},Se=Math.PI/3,$e=.6,jt=b((n,t)=>{let s=t*$e,l=t*Math.sqrt(1-$e**2),o=Math.cos(Se),c=-Math.sin(Se),p=s*-c,r=n+s*o,h=l*o,i=l*c;return`M ${p-h} ${r-i} L ${p+h} ${r+i}`},"businessMarkerPathForCircle"),Ys={normal:jt(-24,12),hollow:jt(-23,9),awesome:jt(-21,13),icon:"M 12 -8 L 26 -26"},ve=b((n,t,s)=>{let l=(t.x??0)-(t.left??0),o=(t.y??0)-(t.top??0);n.attr("transform",`translate(${-t.width/2-l},${s-t.height/2-o})`)},"positionLabel"),ee=b((n,t,s,l,o=!1)=>{if(t.look==="handDrawn"){let r=v.svg(n).path(s,R(t,o?{fill:"none"}:{}));return n.insert(()=>r,":first-child").attr("class",l)}let c=n.append("path").attr("class",l).attr("d",s);return o&&c.attr("fill","none"),c},"appendActorPath"),Os=b((n,t,s,l,o,c,p=!1)=>{if(t.look==="handDrawn"){let i=v.svg(n).circle(s,l,o*2,R(t,p?{fill:"none"}:{}));return n.insert(()=>i,":first-child").attr("class",c)}let r=n.append("circle").attr("class",c).attr("cx",s).attr("cy",l).attr("r",o);return p&&r.attr("fill","none"),r},"appendActorCircle"),Xs=b((n,t,s)=>{t.business&&n.append("path").attr("class","usecase-business-marker usecase-actor-business-marker").attr("d",Ys[s]).attr("fill","none").attr("style","stroke: inherit !important; stroke-width: inherit !important")},"appendBusinessActorMarker");async function It(n,t,s,l){let{labelStyles:o,nodeStyles:c}=W(t);t.labelStyle=o;let p=s==="icon"||t.stereotype!==void 0?{...t,icon:s==="icon"?void 0:t.icon,stereotype:void 0}:t,{shapeSvg:r,bbox:h,label:i}=await X(n,p,Y(t,`usecase-actor-variant usecase-actor-${s}`)),e=t.accessibleName??t.label;e&&r.attr("role","img").attr("aria-label",e),i.attr("class","label actor-label usecase-actor-label");let{theme:a,themeVariables:g}=z();wt(r,t.colorIndex,a,g.borderColorArray);let f,y;if(t.stereotype){let P=await St(r,`\xAB${t.stereotype}\xBB`,{labelStyle:o,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});f=P.label.attr("class","label usecase-stereotype"),y=P.bbox}let u=r.append("g").attr("class",`usecase-actor-glyph ${_s[s]}`).attr("style",c||null);await l(u,t),Xs(u,t,s);let m=t.padding??Ts,d=y?.height??0,x=Xt+we+h.height+(y?d+be:0),w=Math.max(Ws,h.width,y?.width??0)+m*2,S=x+m*2,$=-x/2;u.attr("transform",`translate(0,${$+Xt/2})`);let M=$+Xt+we;f&&y&&(M+=d/2,ve(f,y,M),M+=d/2+be),ve(i,h,M+h.height/2);let k=r.insert("rect",":first-child").attr("class","usecase-actor-outline").attr("x",-w/2).attr("y",-S/2).attr("width",w).attr("height",S).attr("opacity",0).attr("aria-hidden","true");return H(t,k),t.intersect=P=>N.rect(t,P),r}b(It,"renderUsecaseActor");var js=["M 0 -12","C 6.627 -12 12 -17.373 12 -24","C 12 -30.627 6.627 -36 0 -36","C -6.627 -36 -12 -30.627 -12 -24","C -12 -17.373 -6.627 -12 0 -12 Z","M 0 -12 V 8","M -17 -5 H 17","M 0 8 L -15 28","M 0 8 L 15 28"].join(" ");async function Ca(n,t){return It(n,t,"normal",(s,l)=>{ee(s,l,js,"usecase-actor-stick")})}b(Ca,"usecaseActor");var Gs=["M 0 -34","C 7.18 -34 13 -28.18 13 -21","C 13 -13.82 7.18 -8 0 -8","C -7.18 -8 -13 -13.82 -13 -21","C -13 -28.18 -7.18 -34 0 -34 Z","M -24 25","C -24 7 -14 -3 0 -3","C 14 -3 24 7 24 25","C 24 28 21 30 18 30","H -18","C -21 30 -24 28 -24 25 Z"].join(" ");async function Ba(n,t){return It(n,t,"awesome",(s,l)=>{ee(s,l,Gs,"usecase-actor-awesome-silhouette")})}b(Ba,"usecaseActorAwesome");var Fs=["M -22 -10","H 22","V 0","H 6","L 22 17","L 13 28","L 0 13","L -13 28","L -22 17","L -6 0","H -22","Z"].join(" ");async function Na(n,t){return It(n,t,"hollow",(s,l)=>{Os(s,l,0,-23,9,"usecase-actor-hollow-head",!0),ee(s,l,Fs,"usecase-actor-hollow-body",!0)})}b(Na,"usecaseActorHollow");var Pt=52,ke=42,Me=-2,qs=b(async(n,t)=>{let s=-Pt/2,l=Me-Pt/2;if(t.look==="handDrawn"){let e=v.svg(n).rectangle(s,l,Pt,Pt,R(t,{}));n.insert(()=>e,":first-child").attr("class","usecase-actor-icon-frame")}else n.append("rect").attr("class","usecase-actor-icon-frame").attr("x",s).attr("y",l).attr("width",Pt).attr("height",Pt).attr("rx",4).attr("ry",4);let o=t.icon??"",c=await ne(o.includes(":")?o:`fa:${o}`),p=await kt(o,{height:ke,width:ke,fallbackPrefix:"fa"}),r=n.append("g").attr("class",`usecase-actor-icon-symbol${c?"":" usecase-actor-icon-fallback"}`).attr("aria-hidden","true").html(`<g>${p}</g>`),h=r.node()?.getBBox();h&&r.attr("transform",`translate(${-h.width/2-h.x},${Me-h.height/2-h.y})`)},"drawIconActor");async function Aa(n,t){return It(n,t,"icon",qs)}b(Aa,"usecaseActorIcon");var Pe=b((n,t,s)=>{let l=(t.x??0)-(t.left??0),o=(t.y??0)-(t.top??0);n.attr("transform",`translate(${-t.width/2-l},${s-t.height/2-o})`)},"positionLabel");async function Ra(n,t){let s=t,{labelStyles:l,nodeStyles:o}=W(t);t.labelStyle=l;let c=s.stereotype?{...t,stereotype:void 0}:t,{shapeSvg:p,bbox:r,halfPadding:h,label:i}=await X(n,c,Y(t,"usecase-business-shape"));i.attr("class","label usecase-label");let{theme:e,themeVariables:a}=z();wt(p,t.colorIndex,e,a.borderColorArray);let g,f;if(s.stereotype){let D=await St(p,`\xAB${s.stereotype}\xBB`,{labelStyle:l,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});g=D.label.attr("class","label usecase-stereotype"),f=D.bbox}let y=f?2:0,u=r.height+(f?.height??0)+y,m=Math.max(r.width,f?.width??0),d=h??10,x=m/2+d*2,w=u/2+d*2,S=Math.min(Math.max(d/5,1),d/2),$=m/2+S,M=x-S,k=$/x,P=M/x,_=w*Math.sqrt(Math.max(0,1-k*k)),B=-w*Math.sqrt(Math.max(0,1-P*P));g&&f&&Pe(g,f,-u/2+f.height/2),Pe(i,r,u/2-r.height/2);let C;if(t.look==="handDrawn"){let L=v.svg(p).ellipse(0,0,x*2,w*2,R(t,{}));C=p.insert(()=>L,":first-child").attr("class","basic label-container usecase-business-ellipse")}else C=p.insert("ellipse",":first-child").attr("class","basic label-container usecase-business-ellipse").attr("style",o).attr("rx",x).attr("ry",w).attr("cx",0).attr("cy",0);p.append("path").attr("class","usecase-business-marker").attr("d",`M ${$} ${_} L ${M} ${B}`).attr("fill","none").attr("style",o||null);let I=s.accessibleName??s.label;return I&&p.attr("role","img").attr("aria-label",I),H(t,C),t.calcIntersect=(D,L)=>N.ellipse(D,D.width/2,D.height/2,L),t.intersect=D=>N.ellipse(t,x,w,D),p}b(Ra,"usecaseBusiness");var Gt=8,De=4,zs=1,Ft=b((n,t,s,l)=>{let o=(t.x??0)-(t.left??0),c=(t.y??0)-(t.top??0);n.attr("transform",`translate(${s-t.width/2-o},${l-t.height/2-c})`)},"positionLabel"),Vs=b(n=>{let t=Number.parseFloat(n??"");return Number.isFinite(t)&&t>=0?t:zs},"numericStrokeWidth");async function Ha(n,t){let s=t,{labelStyles:l,nodeStyles:o}=W(t),{stylesMap:c}=vt(t);t.labelStyle=l;let{shapeSvg:p,bbox:r,label:h}=await X(n,t,Y(t,"usecase-json-table"));p.attr("role","img"),s.accessibleName&&p.attr("aria-label",s.accessibleName),h.attr("class","label usecase-json-title");let i=p.append("g").attr("class","usecase-json-table-grid"),e=[];for(let D of s.jsonRows??[]){let L=await St(i,D.key,{labelStyle:l,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0}),E=await St(i,D.value,{labelStyle:l,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0});e.push({key:{label:L.label.attr("class","label usecase-json-key"),bbox:L.bbox},value:{label:E.label.attr("class","label usecase-json-value"),bbox:E.bbox}})}let a=Math.max(0,...e.map(({key:D})=>D.bbox.width))+Gt*2,g=Math.max(0,...e.map(({value:D})=>D.bbox.width))+Gt*2,f=r.width+Gt*2,y=Math.max(f,a+g),u=g+Math.max(0,y-a-g),m=r.height+De*2,d=e.map(({key:D,value:L})=>Math.max(D.bbox.height,L.bbox.height)+De*2),x=m+d.reduce((D,L)=>D+L,0),w=Vs(c.get("stroke-width")),S=y+w*2,$=x+w*2,M=-y/2,k=-x/2,P=t.look==="handDrawn"?v.svg(p):void 0,_=P?R(t,{}):void 0,B=b((D,L,E,A,T,O)=>{if(P&&_){let G=P.rectangle(E,A,T,O,_);return D.insert(()=>G,":first-child").attr("class",L)}return D.insert("rect",":first-child").attr("class",L).attr("x",E).attr("y",A).attr("width",T).attr("height",O).attr("style",o)},"insertCell"),C=B(p,"label-container usecase-json-border",-S/2,-$/2,S,$);B(i,"usecase-json-cell usecase-json-title-cell",M,k,y,m),i.node()?.append(h.node()),Ft(h,r,0,k+m/2);let I=k+m;return e.forEach(({key:D,value:L},E)=>{let A=d[E],T=i.append("g").attr("class","usecase-json-row").attr("data-row-index",E).attr("transform",`translate(0,${I})`);B(T,"usecase-json-cell usecase-json-key-cell",M,0,a,A),B(T,"usecase-json-cell usecase-json-value-cell",M+a,0,u,A),T.node()?.append(D.label.node(),L.label.node()),Ft(D.label,D.bbox,M+a/2,A/2),Ft(L.label,L.bbox,M+a+u/2,A/2),I+=A}),H(t,C),t.intersect=D=>N.rect(t,D),p}b(Ha,"usecaseJsonTable");async function Ia(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?12:o,r=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-c*2-2*r,10),t.height=Math.max((t?.height??0)-p*2-2*r,10));let{shapeSvg:h,bbox:i,label:e}=await X(n,t,Y(t)),a=(t?.width?t?.width:i.width)+c*2+2*r,g=(t?.height?t?.height:i.height)+p*2+2*r,f=a-2*r,y=g-2*r,u=-f/2,m=-y/2,{cssStyles:d}=t,x=v.svg(h),w=R(t,{}),S=[{x:u-r,y:m+r},{x:u-r,y:m+y+r},{x:u+f-r,y:m+y+r},{x:u+f-r,y:m+y},{x:u+f,y:m+y},{x:u+f,y:m+y-r},{x:u+f+r,y:m+y-r},{x:u+f+r,y:m-r},{x:u+r,y:m-r},{x:u+r,y:m},{x:u,y:m},{x:u,y:m+r}],$=[{x:u,y:m+r},{x:u+f-r,y:m+r},{x:u+f-r,y:m+y},{x:u+f,y:m+y},{x:u+f,y:m},{x:u,y:m}];t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let M=F(S),k=x.path(M,w),P=F($),_=x.path(P,w);t.look!=="handDrawn"&&(k=zt(k),_=zt(_));let B=h.insert("g",":first-child");return B.insert(()=>k),B.insert(()=>_),B.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",d),l&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",l),e.attr("transform",`translate(${-(i.width/2)-r-(i.x-(i.left??0))}, ${-(i.height/2)+r-(i.y-(i.top??0))})`),H(t,B),t.intersect=function(C){return N.polygon(t,S,C)},h}b(Ia,"multiRect");async function La(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await X(n,t,Y(t)),r=t.padding??0,h=t.look==="neo"?16:r,i=t.look==="neo"?12:r,e=!0;(t.width||t.height)&&(e=!1,t.width=(t?.width??0)-h*2,t.height=(t?.height??0)-i*3);let a=Math.max(c.width,t?.width??0)+h*2,g=Math.max(c.height,t?.height??0)+i*3,f=t.look==="neo"?g/4:g/8,y=g+(e?f/2:-f/2),u=-a/2,m=-y/2,d=10,{cssStyles:x}=t,w=ut(u-d,m+y+d,u+a-d,m+y+d,f,.8),S=w?.[w.length-1],$=[{x:u-d,y:m+d},{x:u-d,y:m+y+d},...w,{x:u+a-d,y:S.y-d},{x:u+a,y:S.y-d},{x:u+a,y:S.y-2*d},{x:u+a+d,y:S.y-2*d},{x:u+a+d,y:m-d},{x:u+d,y:m-d},{x:u+d,y:m},{x:u,y:m},{x:u,y:m+d}],M=[{x:u,y:m+d},{x:u+a-d,y:m+d},{x:u+a-d,y:S.y-d},{x:u+a,y:S.y-d},{x:u+a,y:m},{x:u,y:m}],k=v.svg(o),P=R(t,{});t.look!=="handDrawn"&&(P.roughness=0,P.fillStyle="solid");let _=F($),B=k.path(_,P),C=F(M),I=k.path(C,P),D=o.insert(()=>B,":first-child");return D.insert(()=>I),D.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&D.selectAll("path").attr("style",x),l&&t.look!=="handDrawn"&&D.selectAll("path").attr("style",l),D.attr("transform",`translate(0,${-f/2})`),p.attr("transform",`translate(${-(c.width/2)-d-(c.x-(c.left??0))}, ${-(c.height/2)+d-f-(c.y-(c.top??0))})`),H(t,D),t.intersect=function(L){return N.polygon(t,$,L)},o}b(La,"multiWaveEdgedRectangle");async function Ea(n,t,{config:{themeVariables:s}}){let{labelStyles:l,nodeStyles:o}=W(t);t.labelStyle=l,t.useHtmlLabels||xt($t())||(t.centerLabel=!0);let{shapeSvg:p,bbox:r,label:h}=await X(n,t,Y(t)),i=Math.max(r.width+(t.padding??0)*2,t?.width??0),e=Math.max(r.height+(t.padding??0)*2,t?.height??0),a=-i/2,g=-e/2,{cssStyles:f}=t,y=v.svg(p),u=R(t,{fill:s.noteBkgColor,stroke:s.noteBorderColor});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let m=y.rectangle(a,g,i,e,u),d=p.insert(()=>m,":first-child");return d.attr("class","basic label-container outer-path"),h.attr("class","label noteLabel"),f&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",f),o&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),h.attr("transform",`translate(${-r.width/2-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),H(t,d),t.intersect=function(x){return N.rect(t,x)},p}b(Ea,"note");var Zs=b((n,t,s)=>[`M${n+s/2},${t}`,`L${n+s},${t-s/2}`,`L${n+s/2},${t-s}`,`L${n},${t-s/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function Wa(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let{shapeSvg:o,bbox:c}=await X(n,t,Y(t)),p=c.width+(t.padding??0),r=c.height+(t.padding??0),h=p+r,i=.5,e=[{x:h/2,y:0},{x:h,y:-h/2},{x:h/2,y:-h},{x:0,y:-h/2}],a,{cssStyles:g}=t;if(t.look==="handDrawn"){let f=v.svg(o),y=R(t,{}),u=Zs(0,0,h),m=f.path(u,y);a=o.insert(()=>m,":first-child").attr("transform",`translate(${-h/2+i}, ${h/2})`),g&&a.attr("style",g)}else a=nt(o,h,h,e),a.attr("transform",`translate(${-h/2+i}, ${h/2})`);return l&&a.attr("style",l),H(t,a),t.calcIntersect=function(f,y){let u=f.width,m=[{x:u/2,y:0},{x:u,y:-u/2},{x:u/2,y:-u},{x:0,y:-u/2}];return N.polygon(f,m,y)},t.intersect=function(f){return this.calcIntersect(t,f)},o}b(Wa,"question");async function Ta(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?21:o??0,p=t.look==="neo"?12:o??0,{shapeSvg:r,bbox:h,label:i}=await X(n,t,Y(t)),e=h.width+(t.look==="neo"?c*2:c),a=Math.max(h.height+(t.look==="neo"?p*2:p),t.height??0),g=a/4,y=-Math.max(e,(t.width??0)-g)/2,u=-a/2,m=u/2,d=[{x:y+m,y:u},{x:y,y:0},{x:y+m,y:-u},{x:-y,y:-u},{x:-y,y:u}],{cssStyles:x}=t,w=v.svg(r),S=R(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let $=F(d),M=w.path($,S),k=r.insert(()=>M,":first-child");return k.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",x),l&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",l),k.attr("transform",`translate(${-m/2},0)`),i.attr("transform",`translate(${-m/2-h.width/2-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),H(t,k),t.intersect=function(P){return N.polygon(t,d,P)},r}b(Ta,"rect_left_inv_arrow");async function _a(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";let c=n.insert("g").attr("class",o).attr("id",t.domId||t.id),p=c.insert("g"),r=c.insert("g").attr("class","label").attr("style",l),h=t.description,i=t.label,e=await ge(r,i,t.labelStyle,!0,!0),a={width:0,height:0};if(xt(z())){let P=e.children[0],_=Z(e);a=P.getBoundingClientRect(),_.attr("width",a.width),_.attr("height",a.height)}J.info("Text 2",h);let g=h||[],f=e.getBBox(),y=await ge(r,Array.isArray(g)?g.join("<br/>"):g,t.labelStyle,!0,!0),u=y.children[0],m=Z(y);a=u.getBoundingClientRect(),m.attr("width",a.width),m.attr("height",a.height);let d=(t.padding||0)/2;Z(y).attr("transform","translate( "+(a.width>f.width?0:(f.width-a.width)/2)+", "+(f.height+d+5)+")"),Z(e).attr("transform","translate( "+(a.width<f.width?0:-(f.width-a.width)/2)+", 0)"),a=r.node().getBBox(),r.attr("transform","translate("+-a.width/2+", "+(-a.height/2-d+3)+")");let x=a.width+(t.padding||0),w=a.height+(t.padding||0),S=-a.width/2-d,$=-a.height/2-d,M,k;if(t.look==="handDrawn"){let P=v.svg(c),_=R(t,{}),B=P.path(gt(S,$,x,w,t.rx||0),_),C=P.line(-a.width/2-d,-a.height/2-d+f.height+d,a.width/2+d,-a.height/2-d+f.height+d,_);k=c.insert(()=>(J.debug("Rough node insert CXC",B),C),":first-child"),M=c.insert(()=>(J.debug("Rough node insert CXC",B),B),":first-child")}else M=p.insert("rect",":first-child"),k=p.insert("line"),M.attr("class","outer title-state").attr("style",l).attr("x",-a.width/2-d).attr("y",-a.height/2-d).attr("width",a.width+(t.padding||0)).attr("height",a.height+(t.padding||0)),k.attr("class","divider").attr("x1",-a.width/2-d).attr("x2",a.width/2+d).attr("y1",-a.height/2-d+f.height+d).attr("y2",-a.height/2-d+f.height+d);return H(t,M),t.intersect=function(P){return N.rect(t,P)},c}b(_a,"rectWithTitle");async function Ya(n,t,{config:{themeVariables:s}}){let l=s?.radius??5,o={rx:l,ry:l,classes:"",labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return Nt(n,t,o)}b(Ya,"roundedRect");var bt=8;async function Oa(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.look==="neo"?16:t.padding??0,c=t.look==="neo"?12:t.padding??0,{shapeSvg:p,bbox:r,label:h}=await X(n,t,Y(t)),i=(t?.width??r.width)+o*2+(t.look==="neo"?bt:bt*2),e=(t?.height??r.height)+c*2,a=i-bt,g=e,f=bt-i/2,y=-e/2,{cssStyles:u}=t,m=v.svg(p),d=R(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let x=[{x:f,y},{x:f+a,y},{x:f+a,y:y+g},{x:f-bt,y:y+g},{x:f-bt,y},{x:f,y},{x:f,y:y+g}],w=m.polygon(x.map($=>[$.x,$.y]),d),S=p.insert(()=>w,":first-child");return S.attr("class","basic label-container outer-path").attr("style",Q(u)),l&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",l),u&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",l),h.attr("transform",`translate(${bt/2-r.width/2-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),H(t,S),t.intersect=function($){return N.rect(t,$)},p}b(Oa,"shadedProcess");async function Xa(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-c*2,10),t.height=Math.max((t?.height??0)/1.5-p*2,10));let{shapeSvg:r,bbox:h,label:i}=await X(n,t,Y(t)),e=(t?.width?t?.width:h.width)+c*2,a=((t?.height?t?.height:h.height)+p*2)*1.5,g=e,f=a/1.5,y=-g/2,u=-f/2,{cssStyles:m}=t,d=v.svg(r),x=R(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let w=[{x:y,y:u},{x:y,y:u+f},{x:y+g,y:u+f},{x:y+g,y:u-f/2}],S=F(w),$=d.path(S,x),M=r.insert(()=>$,":first-child");return M.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&M.selectChildren("path").attr("style",m),l&&t.look!=="handDrawn"&&M.selectChildren("path").attr("style",l),M.attr("transform",`translate(0, ${f/4})`),i.attr("transform",`translate(${-g/2+(t.padding??0)-(h.x-(h.left??0))}, ${-f/4+(t.padding??0)-(h.y-(h.top??0))})`),H(t,M),t.intersect=function(k){return N.polygon(t,w,k)},r}b(Xa,"slopedRect");async function ja(n,t){let s=t.padding??0,l=t.look==="neo"?16:s*2,o=t.look==="neo"?12:s,c={rx:0,ry:0,classes:"",labelPaddingX:t.labelPaddingX??l,labelPaddingY:o},p=await Nt(n,t,c);if(t.colorIndex!==void 0){let{theme:r,themeVariables:h}=z();wt(p,t.colorIndex,r,h.borderColorArray)}return p}b(ja,"squareRect");var Ut=50,Us=b((n,t,s)=>{let l=n.height+s,o=l*Math.cos(Math.PI/(2*(Ut-1))),c=Math.sqrt(Math.max(0,o**2-n.height**2));return{w:Math.max(n.width+l/4+t,1.5*l+(l-o),n.width+t+l-c),h:l}},"stadiumDimensions");async function Ga(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?40:o,p=t.look==="neo"?24:o,{shapeSvg:r,bbox:h}=await X(n,t,Y(t)),{w:i,h:e}=Us(h,c,p),a=e/2,{cssStyles:g}=t,f=v.svg(r),y=R(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let u=[{x:-i/2+a,y:-e/2},{x:i/2-a,y:-e/2},...lt(-i/2+a,0,a,Ut,90,270),{x:i/2-a,y:e/2},...lt(i/2-a,0,a,Ut,270,450)],m=F(u),d=f.path(m,y),x=r.insert(()=>d,":first-child");return x.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",g),l&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",l),H(t,x),t.intersect=function(w){return N.polygon(t,u,w)},r}b(Ga,"stadium");async function Fa(n,t){let s={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5,classes:"flowchart-node"};return Nt(n,t,s)}b(Fa,"state");function qa(n,t,{config:{themeVariables:s}}){let{labelStyles:l,nodeStyles:o}=W(t);t.labelStyle=l;let{cssStyles:c}=t,{lineColor:p,stateBorder:r,nodeBorder:h,nodeShadow:i}=s;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);let e=n.insert("g").attr("class","node default").attr("id",t.domId??t.id),a=v.svg(e),g=R(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let f=a.circle(0,0,t.width,{...g,stroke:p,strokeWidth:2}),y=r??h,u=(t.width??0)*5/14,m=a.circle(0,0,u,{...g,fill:y,stroke:y,strokeWidth:2,fillStyle:"solid"}),d=e.insert(()=>f,":first-child");if(d.insert(()=>m),t.look!=="handDrawn"&&d.attr("class","outer-path"),c&&d.selectAll("path").attr("style",c),o&&d.selectAll("path").attr("style",o),t.width<25&&i&&t.look!=="handDrawn"){let x=n.node()?.ownerSVGElement?.id??"",w=x?`${x}-drop-shadow-small`:"drop-shadow-small";d.attr("style",`filter:url(#${w})`)}return H(t,d),t.intersect=function(x){return N.circle(t,(t.width??0)/2,x)},e}b(qa,"stateEnd");function za(n,t,{config:{themeVariables:s}}){let{lineColor:l,nodeShadow:o}=s;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);let c=n.insert("g").attr("class","node default").attr("id",t.domId||t.id),p;if(t.look==="handDrawn"){let h=v.svg(c).circle(0,0,t.width,le(l));p=c.insert(()=>h),p.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else p=c.insert("circle",":first-child"),p.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&o&&t.look!=="handDrawn"){let r=n.node()?.ownerSVGElement?.id??"",h=r?`${r}-drop-shadow-small`:"drop-shadow-small";p.attr("style",`filter:url(#${h})`)}return H(t,p),t.intersect=function(r){return N.circle(t,(t.width??7)/2,r)},c}b(za,"stateStart");var Dt=8;async function Va(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t?.padding??8,c=t.look==="neo"?28:o,p=t.look==="neo"?12:o,{shapeSvg:r,bbox:h}=await X(n,t,Y(t)),i=Math.max(h.width+2*Dt+c,t.width??0),e=Math.max(h.height+p,t.height??0),a=i-2*Dt,g=e,f=-i/2,y=-e/2,u=[{x:0,y:0},{x:a,y:0},{x:a,y:-g},{x:0,y:-g},{x:0,y:0},{x:-8,y:0},{x:a+8,y:0},{x:a+8,y:-g},{x:-8,y:-g},{x:-8,y:0}];if(t.look==="handDrawn"){let m=v.svg(r),d=R(t,{}),x=m.rectangle(f,y,a+16,g,d),w=m.line(f+Dt,y,f+Dt,y+g,d),S=m.line(f+Dt+a,y,f+Dt+a,y+g,d);r.insert(()=>w,":first-child"),r.insert(()=>S,":first-child");let $=r.insert(()=>x,":first-child"),{cssStyles:M}=t;$.attr("class","basic label-container").attr("style",Q(M)),H(t,$)}else{let m=nt(r,a,g,u);l&&m.attr("style",l),H(t,m)}return t.intersect=function(m){return N.polygon(t,u,m)},r}b(Va,"subroutine");var qt=.2;async function Za(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-p*2,10),t.width=Math.max((t?.width??0)-c*2-qt*(t.height+p*2),10));let{shapeSvg:r,bbox:h}=await X(n,t,Y(t)),i=(t?.height?t?.height:h.height)+p*2,e=qt*i,a=qt*i,f=(t?.width?t?.width:h.width)+c*2+e-e,y=i,u=-f/2,m=-y/2,{cssStyles:d}=t,x=v.svg(r),w=R(t,{}),S=[{x:u-e/2,y:m},{x:u+f+e/2,y:m},{x:u+f+e/2,y:m+y},{x:u-e/2,y:m+y}],$=[{x:u+f-e/2,y:m+y},{x:u+f+e/2,y:m+y},{x:u+f+e/2,y:m+y-a}];t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let M=F(S),k=x.path(M,w),P=F($),_=x.path(P,{...w,fillStyle:"solid"}),B=r.insert(()=>_,":first-child");return B.insert(()=>k,":first-child"),B.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",d),l&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",l),H(t,B),t.intersect=function(C){return N.polygon(t,S,C)},r}b(Za,"taggedRect");async function Ua(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,label:p}=await X(n,t,Y(t)),r=Math.max(c.width+(t.padding??0)*2,t?.width??0),h=Math.max(c.height+(t.padding??0)*2,t?.height??0),i=h/8,e=.2*r,a=.2*h,g=h+i,{cssStyles:f}=t,y=v.svg(o),u=R(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let m=[{x:-r/2-r/2*.1,y:g/2},...ut(-r/2-r/2*.1,g/2,r/2+r/2*.1,g/2,i,.8),{x:r/2+r/2*.1,y:-g/2},{x:-r/2-r/2*.1,y:-g/2}],d=-r/2+r/2*.1,x=-g/2-a*.4,w=[{x:d+r-e,y:(x+h)*1.3},{x:d+r,y:x+h-a},{x:d+r,y:(x+h)*.9},...ut(d+r,(x+h)*1.25,d+r-e,(x+h)*1.3,-h*.02,.5)],S=F(m),$=y.path(S,u),M=F(w),k=y.path(M,{...u,fillStyle:"solid"}),P=o.insert(()=>k,":first-child");return P.insert(()=>$,":first-child"),P.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",f),l&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",l),P.attr("transform",`translate(0,${-i/2})`),p.attr("transform",`translate(${-r/2+(t.padding??0)-(c.x-(c.left??0))},${-h/2+(t.padding??0)-i/2-(c.y-(c.top??0))})`),H(t,P),t.intersect=function(_){return N.polygon(t,m,_)},o}b(Ua,"taggedWaveEdgedRectangle");async function Ja(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let{shapeSvg:o,bbox:c}=await X(n,t,Y(t)),p=Math.max(c.width+(t.padding??0),t?.width||0),r=Math.max(c.height+(t.padding??0),t?.height||0),h=-p/2,i=-r/2,e=o.insert("rect",":first-child");return e.attr("class","text").attr("style",l).attr("rx",0).attr("ry",0).attr("x",h).attr("y",i).attr("width",p).attr("height",r),H(t,e),t.intersect=function(a){return N.rect(t,a)},o}b(Ja,"text");var Js=b((n,t,s,l,o,c)=>`M${n},${t}
a${o},${c} 0,0,1 0,${-l}
l${s},0
a${o},${c} 0,0,1 0,${l}
M${s},${-l}
a${o},${c} 0,0,0 0,${l}
l${-s},0`,"createCylinderPathD"),Ks=b((n,t,s,l,o,c)=>[`M${n},${t}`,`M${n+s},${t}`,`a${o},${c} 0,0,0 0,${-l}`,`l${-s},0`,`a${o},${c} 0,0,0 0,${l}`,`l${s},0`].join(" "),"createOuterCylinderPathD"),Qs=b((n,t,s,l,o,c)=>[`M${n+s/2},${-l/2}`,`a${o},${c} 0,0,0 0,${l}`].join(" "),"createInnerCylinderPathD"),Ce=5,Be=10;async function Ka(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?12:o/2,p=t.height??0;if(t.height&&(t.height=t.height-c,t.height<Ce&&(t.height=Ce)),t.width){let d=p/2/(2.5+p/50);t.width=t.width-c-d*3,t.width<Be&&(t.width=Be)}let{shapeSvg:r,bbox:h,label:i}=await X(n,t,Y(t)),e=Math.max(t.height??0,h.height)+c,a=e/2,g=a/(2.5+e/50),f=Math.max(t.width??0,h.width)+g+c,{cssStyles:y}=t,u;if(t.look==="handDrawn"){let m=v.svg(r),d=Ks(0,0,f,e,g,a),x=Qs(0,0,f,e,g,a),w=m.path(d,R(t,{})),S=m.path(x,R(t,{fill:"none"}));u=r.insert(()=>S,":first-child"),u=r.insert(()=>w,":first-child"),u.attr("class","basic label-container"),y&&u.attr("style",y)}else{let m=Js(0,0,f,e,g,a);u=r.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Q(y)).attr("style",l),u.attr("class","basic label-container outer-path"),y&&u.selectAll("path").attr("style",y),l&&u.selectAll("path").attr("style",l)}return u.attr("label-offset-x",g),u.attr("transform",`translate(${-f/2}, ${e/2} )`),i.attr("transform",`translate(${-(h.width/2)-g-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),H(t,u),t.intersect=function(m){let d=N.rect(t,m),x=d.y-(t.y??0);if(a!=0&&(Math.abs(x)<(t.height??0)/2||Math.abs(x)==(t.height??0)/2&&Math.abs(d.x-(t.x??0))>(t.width??0)/2-g)){let w=g*g*(1-x*x/(a*a));w!=0&&(w=Math.sqrt(Math.abs(w))),w=g-w,m.x-(t.x??0)>0&&(w=-w),d.x+=w}return d},r}b(Ka,"tiltedCylinder");async function Qa(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=(t.look==="neo",o),p=t.look==="neo"?o*2:o,{shapeSvg:r,bbox:h}=await X(n,t,Y(t)),i=Math.max(h.height+c,t.height??0),e=Math.max(h.width+p,(t.width??0)-i),a=[{x:-3*i/6,y:0},{x:e+3*i/6,y:0},{x:e,y:-i},{x:0,y:-i}],g,{cssStyles:f}=t;if(t.look==="handDrawn"){let y=v.svg(r),u=R(t,{}),m=F(a),d=y.path(m,u);g=r.insert(()=>d,":first-child").attr("transform",`translate(${-e/2}, ${i/2})`),f&&g.attr("style",f)}else g=nt(r,e,i,a);return l&&g.attr("style",l),t.width=e,t.height=i,H(t,g),t.intersect=function(y){return N.polygon(t,a,y)},r}b(Qa,"trapezoid");async function ts(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?12:o,r=15,h=5;(t.width||t.height)&&(t.height=(t.height??0)-p*2,t.height<h&&(t.height=h),t.width=(t.width??0)-c*2,t.width<r&&(t.width=r));let{shapeSvg:i,bbox:e}=await X(n,t,Y(t)),a=(t?.width?t?.width:e.width)+c*2,g=(t?.height?t?.height:e.height)+p*2,{cssStyles:f}=t,y=v.svg(i),u=R(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let m=[{x:-a/2*.8,y:-g/2},{x:a/2*.8,y:-g/2},{x:a/2,y:-g/2*.6},{x:a/2,y:g/2},{x:-a/2,y:g/2},{x:-a/2,y:-g/2*.6}],d=F(m),x=y.path(d,u),w=i.insert(()=>x,":first-child");return w.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",f),l&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",l),H(t,w),t.intersect=function(S){return N.polygon(t,m,S)},i}b(ts,"trapezoidalPentagon");var Ne=10,Ae=10;async function es(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.width=((t?.width??0)-c)/2,t.width<Ae&&(t.width=Ae),t.height=t?.height??0,t.height<Ne&&(t.height=Ne));let{shapeSvg:p,bbox:r,label:h}=await X(n,t,Y(t)),i=mt(z().flowchart?.htmlLabels),e=(t?.width?t?.width:r.width)+c,a=t?.height?t?.height:e+r.height,g=a,f=[{x:0,y:0},{x:g,y:0},{x:g/2,y:-a}],{cssStyles:y}=t,u=v.svg(p),m=R(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let d=F(f),x=u.path(d,m),w=p.insert(()=>x,":first-child").attr("transform",`translate(${-a/2}, ${a/2})`).attr("class","outer-path");return y&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",y),l&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",l),t.width=e,t.height=a,H(t,w),h.attr("transform",`translate(${-r.width/2-(r.x-(r.left??0))}, ${a/2-(r.height+(t.padding??0)/(i?2:1)-(r.y-(r.top??0)))})`),t.intersect=function(S){return J.info("Triangle intersect",t,f,S),N.polygon(t,f,S)},p}b(es,"triangle");async function as(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?12:o,r=!0;(t.width||t.height)&&(r=!1,t.width=(t?.width??0)-c*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-p*2,t.height<10&&(t.height=10));let{shapeSvg:h,bbox:i,label:e}=await X(n,t,Y(t)),a=(t?.width?t?.width:i.width)+(c??0)*2,g=(t?.height?t?.height:i.height)+(p??0)*2,f=t.look==="neo"?g/4:g/8,y=g+(r?f:-f),{cssStyles:u}=t,d=14-a,x=d>0?d/2:0,w=v.svg(h),S=R(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let $=[{x:-a/2-x,y:y/2},...ut(-a/2-x,y/2,a/2+x,y/2,f,.8),{x:a/2+x,y:-y/2},{x:-a/2-x,y:-y/2}],M=F($),k=w.path(M,S),P=h.insert(()=>k,":first-child");return P.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",u),l&&t.look!=="handDrawn"&&P.selectAll("path").attr("style",l),P.attr("transform",`translate(0,${-f/2})`),e.attr("transform",`translate(${-a/2+(t.padding??0)-(i.x-(i.left??0))},${-g/2+(t.padding??0)-f-(i.y-(i.top??0))})`),H(t,P),t.intersect=function(_){return N.polygon(t,$,_)},h}b(as,"waveEdgedRectangle");async function ss(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.padding??0,c=t.look==="neo"?16:o,p=t.look==="neo"?20:o;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let S=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-p-S*(20/9)),t.width=t.width-c*2}let{shapeSvg:r,bbox:h}=await X(n,t,Y(t)),i=(t?.width?t?.width:h.width)+c*2,e=(t?.height?t?.height:h.height)+p,a=e/8,g=e+a*2,{cssStyles:f}=t,y=v.svg(r),u=R(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let m=[{x:-i/2,y:g/2},...ut(-i/2,g/2,i/2,g/2,a,1),{x:i/2,y:-g/2},...ut(i/2,-g/2,-i/2,-g/2,a,-1)],d=F(m),x=y.path(d,u),w=r.insert(()=>x,":first-child");return w.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",f),l&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",l),H(t,w),t.intersect=function(S){return N.polygon(t,m,S)},r}b(ss,"waveRectangle");var U=10;async function rs(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t.look==="neo"?16:t.padding??0,c=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-U,10),t.height=Math.max((t?.height??0)-c*2-U,10));let{shapeSvg:p,bbox:r,label:h}=await X(n,t,Y(t)),i=(t?.width?t?.width:r.width)+o*2+U,e=(t?.height?t?.height:r.height)+c*2+U,a=i-U,g=e-U,f=-a/2,y=-g/2,{cssStyles:u}=t,m=v.svg(p),d=R(t,{}),x=[{x:f-U,y:y-U},{x:f-U,y:y+g},{x:f+a,y:y+g},{x:f+a,y:y-U}],w=`M${f-U},${y-U} L${f+a},${y-U} L${f+a},${y+g} L${f-U},${y+g} L${f-U},${y-U}
M${f-U},${y} L${f+a},${y}
M${f},${y-U} L${f},${y+g}`;t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let S=m.path(w,d),$=p.insert(()=>S,":first-child");return $.attr("transform",`translate(${U/2}, ${U/2})`),$.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",u),l&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",l),h.attr("transform",`translate(${-(r.width/2)+U/2-(r.x-(r.left??0))}, ${-(r.height/2)+U/2-(r.y-(r.top??0))})`),H(t,$),t.intersect=function(M){return N.polygon(t,x,M)},p}b(rs,"windowPane");var Re=new Set(["redux-color","redux-dark-color"]),tr=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function ae(n,t){let s=t;s.alias&&(t.label=s.alias);let{theme:l,themeVariables:o}=$t(),{rowEven:c,rowOdd:p,nodeBorder:r,borderColorArray:h}=o;if(t.look==="handDrawn"){let{themeVariables:j}=$t(),{background:q}=j,K={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${q}`]};await ae(n,K)}let i=$t();t.useHtmlLabels=i.htmlLabels;let e=i.er?.diagramPadding??10,a=i.er?.entityPadding??6,{cssStyles:g}=t,{labelStyles:f,nodeStyles:y}=W(t);if(s.attributes.length===0&&t.label){let j={rx:0,ry:0,labelPaddingX:e,labelPaddingY:e*1.5,classes:""};At(t.label,i)+j.labelPaddingX*2<i.er.minEntityWidth&&(t.width=i.er.minEntityWidth);let q=await Nt(n,t,j);if(l!=null&&Re.has(l)){let K=s.colorIndex??0;q.attr("data-color-id",`color-${K%h.length}`)}if(!mt(i.htmlLabels)){let K=q.select("text"),st=K.node()?.getBBox();K.attr("transform",`translate(${-st.width/2}, 0)`)}return q}i.htmlLabels||(e*=1.25,a*=1.25);let u=Y(t);u||(u="node default");let m=n.insert("g").attr("class",u).attr("id",t.domId||t.id),d=await Ct(m,t.label??"",i,0,0,["name"],f);d.height+=a;let x=0,w=[],S=[],$=0,M=0,k=0,P=0,_=!0,B=!0;for(let j of s.attributes){let q=await Ct(m,j.type,i,0,x,["attribute-type"],f);$=Math.max($,q.width+e);let K=await Ct(m,j.name,i,0,x,["attribute-name"],f);M=Math.max(M,K.width+e);let st=await Ct(m,j.keys.join(),i,0,x,["attribute-keys"],f);k=Math.max(k,st.width+e);let dt=await Ct(m,j.comment,i,0,x,["attribute-comment"],f);P=Math.max(P,dt.width+e);let ft=Math.max(q.height,K.height,st.height,dt.height)+a;S.push({yOffset:x,rowHeight:ft}),x+=ft}let C=4;k<=e&&(_=!1,k=0,C--),P<=e&&(B=!1,P=0,C--);let I=m.node().getBBox();if(d.width+e*2-($+M+k+P)>0){let j=d.width+e*2-($+M+k+P);$+=j/C,M+=j/C,k>0&&(k+=j/C),P>0&&(P+=j/C)}let D=$+M+k+P,L=v.svg(m),E=R(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");let A=0;S.length>0&&(A=S.reduce((j,q)=>j+(q?.rowHeight??0),0));let T=Math.max(I.width+e*2,t?.width||0,D),O=Math.max((A??0)+d.height,t?.height||0),G=-T/2,V=-O/2;if(m.selectAll("g:not(:first-child)").each((j,q,K)=>{let st=Z(K[q]),dt=st.attr("transform"),ft=0,se=0;if(dt){let Wt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(dt);Wt&&(ft=parseFloat(Wt[1]),se=parseFloat(Wt[2]),st.attr("class").includes("attribute-name")?ft+=$:st.attr("class").includes("attribute-keys")?ft+=$+M:st.attr("class").includes("attribute-comment")&&(ft+=$+M+k))}st.attr("transform",`translate(${G+e/2+ft}, ${se+V+d.height+a/2})`)}),m.select(".name").attr("transform","translate("+-d.width/2+", "+(V+a/2)+")"),l!=null&&Re.has(l)){let j=s.colorIndex??0;m.attr("data-color-id",`color-${j%h.length}`)}let rt=L.rectangle(G,V,T,O,E),yt=m.insert(()=>rt,":first-child").attr("class","outer-path").attr("style",g.join(""));w.push(0);for(let[j,q]of S.entries()){let st=(j+1)%2===0&&q.yOffset!==0,dt=L.rectangle(G,d.height+V+q?.yOffset,T,q?.rowHeight,{...E,fill:st?c:p,stroke:r});m.insert(()=>dt,"g.label").attr("style",g.join("")).attr("class",`row-rect-${st?"even":"odd"}`)}let ct=1e-4,et=Bt(G,d.height+V,T+G,d.height+V,ct),at=L.polygon(et.map(j=>[j.x,j.y]),E);if(m.insert(()=>at).attr("class","divider"),et=Bt($+G,d.height+V,$+G,O+V,ct),at=L.polygon(et.map(j=>[j.x,j.y]),E),m.insert(()=>at).attr("class","divider"),_){let j=$+M+G;et=Bt(j,d.height+V,j,O+V,ct),at=L.polygon(et.map(q=>[q.x,q.y]),E),m.insert(()=>at).attr("class","divider")}if(B){let j=$+M+k+G;et=Bt(j,d.height+V,j,O+V,ct),at=L.polygon(et.map(q=>[q.x,q.y]),E),m.insert(()=>at).attr("class","divider")}for(let j of w){let q=d.height+V+j;et=Bt(G,q,T+G,q,ct),at=L.polygon(et.map(K=>[K.x,K.y]),E),m.insert(()=>at).attr("class","divider")}if(H(t,yt),y&&t.look!=="handDrawn")if(l!=null&&tr.has(l))m.selectAll("path").attr("style",y);else{let q=y.split(";")?.filter(K=>K.includes("stroke"))?.map(K=>`${K}`).join("; ");m.selectAll("path").attr("style",q??""),m.selectAll(".row-rect-even path").attr("style",y)}return t.intersect=function(j){return N.rect(t,j)},m}b(ae,"erBox");async function Ct(n,t,s,l=0,o=0,c=[],p=""){let r=n.insert("g").attr("class",`label ${c.join(" ")}`).attr("transform",`translate(${l}, ${o})`).attr("style",p);t!==Tt(t)&&(t=Tt(t),t=t.replaceAll("<","<").replaceAll(">",">"));let h=r.node().appendChild(await pt(r,t,{width:At(t,s)+100,style:p,useHtmlLabels:s.htmlLabels},s));if(t.includes("<")||t.includes(">")){let e=h.children[0];for(e.textContent=e.textContent.replaceAll("<","<").replaceAll(">",">");e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll("<","<").replaceAll(">",">")}let i=h.getBBox();if(mt(s.htmlLabels)){let e=h.children[0];e.style.textAlign="start";let a=Z(h);i=e.getBoundingClientRect(),a.attr("width",i.width),a.attr("height",i.height)}return i}b(Ct,"addText");function Bt(n,t,s,l,o){return n===s?[{x:n-o/2,y:t},{x:n+o/2,y:t},{x:s+o/2,y:l},{x:s-o/2,y:l}]:[{x:n,y:t-o/2},{x:n,y:t+o/2},{x:s,y:l+o/2},{x:s,y:l-o/2}]}b(Bt,"lineToPolygon");async function is(n,t,s,l,o=s.class.padding??12){let c=l?0:3,p=n.insert("g").attr("class",Y(t)).attr("id",t.domId||t.id),r=null,h=null,i=null,e=null,a=0,g=0,f=0;if(r=p.insert("g").attr("class","annotation-group text"),t.annotations.length>0){let x=t.annotations[0];await Ht(r,{text:`\xAB${x}\xBB`},0),a=r.node().getBBox().height}h=p.insert("g").attr("class","label-group text"),await Ht(h,t,0,["font-weight: bolder"]);let y=h.node().getBBox();g=y.height,i=p.insert("g").attr("class","members-group text");let u=0;for(let x of t.members){let w=await Ht(i,x,u,[x.parseClassifier()]);u+=w+c}f=i.node().getBBox().height,f<=0&&(f=o/2),e=p.insert("g").attr("class","methods-group text");let m=0;for(let x of t.methods){let w=await Ht(e,x,m,[x.parseClassifier()]);m+=w+c}let d=p.node().getBBox();if(r!==null){let x=r.node().getBBox();r.attr("transform",`translate(${-x.width/2})`)}return h.attr("transform",`translate(${-y.width/2}, ${a})`),d=p.node().getBBox(),i.attr("transform",`translate(0, ${a+g+o*2})`),d=p.node().getBBox(),e.attr("transform",`translate(0, ${a+g+(f?f+o*4:o*2)})`),d=p.node().getBBox(),{shapeSvg:p,bbox:d}}b(is,"textHelper");async function Ht(n,t,s,l=[]){let o=n.insert("g").attr("class","label").attr("style",l.join("; ")),c=$t(),p="useHtmlLabels"in t?t.useHtmlLabels:mt(c.htmlLabels)??!0,r="";"text"in t?r=t.text:r=t.label,!p&&r.startsWith("\\")&&(r=r.substring(1)),ie(r)&&(p=!0);let h=await pt(o,_t(Mt(r)),{width:At(r,c)+50,classes:"markdown-node-label",useHtmlLabels:p},c),i,e=1;if(p){let a=h.children[0],g=Z(h);e=a.innerHTML.split("<br>").length,a.innerHTML.includes("</math>")&&(e+=a.innerHTML.split("<mrow>").length-1),await Jt(a),i=a.getBoundingClientRect(),g.attr("width",i.width),g.attr("height",i.height)}else{l.includes("font-weight: bolder")&&Z(h).selectAll("tspan").attr("font-weight",""),e=h.children.length;let a=h.children[0];(h.textContent===""||h.textContent.includes(">"))&&(a.textContent=r[0]+r.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),r[1]===" "&&(a.textContent=a.textContent[0]+" "+a.textContent.substring(1))),a.textContent==="undefined"&&(a.textContent=""),i=h.getBBox()}return o.attr("transform","translate(0,"+(-i.height/(2*e)+s)+")"),i.height}b(Ht,"addText");async function ls(n,t){let s=z(),{theme:l,themeVariables:o}=s,{useGradient:c,borderColorArray:p}=o,r=s.class.padding??12,h=r,i=t.useHtmlLabels??mt(s.htmlLabels)??!0,e=t;e.annotations=e.annotations??[],e.members=e.members??[],e.methods=e.methods??[];let{shapeSvg:a,bbox:g}=await is(n,t,s,i,h);wt(a,t.colorIndex,l,p);let{labelStyles:f,nodeStyles:y}=W(t);t.labelStyle=f,t.cssStyles=e.styles||"";let u=e.styles?.join(";")||y||"";t.cssStyles||(t.cssStyles=u.replaceAll("!important","").split(";"));let m=e.members.length===0&&e.methods.length===0&&!s.class?.hideEmptyMembersBox,d=v.svg(a),x=R(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let w=Math.max(t.width??0,g.width),S=Math.max(t.height??0,g.height),$=(t.height??0)>g.height;e.members.length===0&&e.methods.length===0?S+=h:e.members.length>0&&e.methods.length===0&&(S+=h*2);let M=-w/2,k=-S/2,P=m?r*2:e.members.length===0&&e.methods.length===0?-r:0;$&&(P=r*2);let _=d.rectangle(M-r,k-r-(m?r:e.members.length===0&&e.methods.length===0?-r/2:0),w+2*r,S+2*r+P,x),B=a.insert(()=>_,":first-child");B.attr("class","basic label-container outer-path");let C=B.node().getBBox(),I=a.select(".annotation-group").node().getBBox().height-(m?r/2:0)||0,D=a.select(".label-group").node().getBBox().height-(m?r/2:0)||0,L=a.select(".members-group").node().getBBox().height-(m?r/2:0)||0,E=(I+D+k+r-(k-r-(m?r:e.members.length===0&&e.methods.length===0?-r/2:0)))/2;if(a.selectAll(".text").each((A,T,O)=>{let G=Z(O[T]),V=G.attr("transform"),rt=0;if(V){let at=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(V);at&&(rt=parseFloat(at[2]))}let yt=rt+k+r-(m?r:e.members.length===0&&e.methods.length===0?-r/2:0);if(G.attr("class").includes("methods-group")){let et=Math.max(L,h/2);$?yt=Math.max(E,I+D+et+k+h*2+r)+h*2:yt=I+D+et+k+h*4+r}e.members.length===0&&e.methods.length===0&&s.class?.hideEmptyMembersBox&&(e.annotations.length>0?yt=rt-h:yt=rt),i||(yt-=4);let ct=M;(G.attr("class").includes("label-group")||G.attr("class").includes("annotation-group"))&&(ct=-G.node()?.getBBox().width/2||0,a.selectAll("text").each(function(et,at,j){window.getComputedStyle(j[at]).textAnchor==="middle"&&(ct=0)})),G.attr("transform",`translate(${ct}, ${yt})`)}),e.members.length>0||e.methods.length>0||m){let A=I+D+k+r,T=d.line(C.x,A,C.x+C.width,A+.001,x);a.insert(()=>T).attr("class",`divider${t.look==="neo"&&!c?" neo-line":""}`).attr("style",u)}if(m||e.members.length>0||e.methods.length>0){let A=I+D+L+k+h*2+r,T=d.line(C.x,$?Math.max(E,A):A,C.x+C.width,($?Math.max(E,A):A)+.001,x);a.insert(()=>T).attr("class",`divider${t.look==="neo"&&!c?" neo-line":""}`).attr("style",u)}if(e.look!=="handDrawn"&&a.selectAll("path").attr("style",u),B.select(":nth-child(2)").attr("style",u),a.selectAll(".divider").select("path").attr("style",u),t.labelStyle?a.selectAll("span").attr("style",t.labelStyle):a.selectAll("span").attr("style",u),!i){let A=RegExp(/color\s*:\s*([^;]*)/),T=A.exec(u);if(T){let O=T[0].replace("color","fill");a.selectAll("tspan").attr("style",O)}else if(f){let O=A.exec(f);if(O){let G=O[0].replace("color","fill");a.selectAll("tspan").attr("style",G)}}}return H(t,B),t.intersect=function(A){return N.rect(t,A)},a}b(ls,"classBox");async function ns(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let o=t,c=t,p=20,r=20,h="verifyMethod"in t,i=Y(t),e=z(),{themeVariables:a}=e,{borderColorArray:g,requirementEdgeLabelBackground:f}=a,y=e.layout==="elk"?"start":"center",u=n.insert("g").attr("class",i).attr("id",t.domId??t.id),m;h?m=await it(u,`<<${o.type}>>`,0,t.labelStyle):m=await it(u,"<<Element>>",0,t.labelStyle);let d=m,x=await it(u,o.name,d,t.labelStyle+"; font-weight: bold;");if(d+=x+r,h){let C=await it(u,`${o.requirementId?`ID: ${o.requirementId}`:""}`,d,t.labelStyle,y);d+=C;let I=await it(u,`${o.text?`Text: ${o.text}`:""}`,d,t.labelStyle,y);d+=I;let D=await it(u,`${o.risk?`Risk: ${o.risk}`:""}`,d,t.labelStyle,y);d+=D,await it(u,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,d,t.labelStyle,y)}else{let C=await it(u,`${c.type?`Type: ${c.type}`:""}`,d,t.labelStyle,y);d+=C,await it(u,`${c.docRef?`Doc Ref: ${c.docRef}`:""}`,d,t.labelStyle,y)}let w=(u.node()?.getBBox().width??200)+p,S=(u.node()?.getBBox().height??200)+p,$=-w/2,M=-S/2,k=v.svg(u),P=R(t,{});t.look!=="handDrawn"&&(P.roughness=0,P.fillStyle="solid");let _=k.rectangle($,M,w,S,P),B=u.insert(()=>_,":first-child");if(B.attr("class","basic label-container outer-path").attr("style",l),g?.length){let C=t.colorIndex??0;u.attr("data-color-id",`color-${C%g.length}`)}if(u.selectAll(".label").each((C,I,D)=>{let L=Z(D[I]),E=L.attr("transform"),A=0,T=0;if(E){let rt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(E);rt&&(A=parseFloat(rt[1]),T=parseFloat(rt[2]))}let O=T-S/2,G=$+p/2;(I===0||I===1)&&(G=A),L.attr("transform",`translate(${G}, ${O+p})`)}),d>m+x+r){let C=M+m+x+r,I;if(t.look==="neo"){let E=[[$,C],[$+w,C],[$+w,C+.001],[$,C+.001]];I=k.polygon(E,P)}else I=k.line($,C,$+w,C,P);u.insert(()=>I).attr("class","divider")}return H(t,B),t.intersect=function(C){return N.rect(t,C)},l&&t.look!=="handDrawn"&&(f||g?.length)&&u.selectAll("path").attr("style",l),u}b(ns,"requirementBox");async function it(n,t,s,l="",o="center"){if(t==="")return 0;let c=n.insert("g").attr("class","label").attr("style",l),p=z(),r=p.htmlLabels??!0,h=await pt(c,_t(Mt(t)),{width:At(t,p)+50,classes:"markdown-node-label",useHtmlLabels:r,style:l},p),i;if(r){let e=h.children[0],a=Z(h);o==="start"&&Z(e).style("text-align","left"),i=e.getBoundingClientRect(),a.attr("width",i.width),a.attr("height",i.height)}else{let e=h.children[0];for(let a of e.children)l&&a.setAttribute("style",l);if(o==="start"){e.setAttribute("text-anchor","start");for(let a of e.children)a.setAttribute("text-anchor","start")}i=h.getBBox(),i.height+=6}return c.attr("transform",`translate(${-i.width/2},${-i.height/2+s})`),i.height}b(it,"addText");var er=b(n=>{switch(n){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function cs(n,t,{config:s}){let{labelStyles:l,nodeStyles:o}=W(t);t.labelStyle=l||"";let c=10,p=t.width;t.width=(t.width??200)-10;let{shapeSvg:r,bbox:h,label:i}=await X(n,t,Y(t)),e=t.padding||10,a="",g;"ticket"in t&&t.ticket&&s?.kanban?.ticketBaseUrl&&(a=s?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),g=r.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",a).attr("target","_blank"));let f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},y,u;g?{label:y,bbox:u}=await St(g,"ticket"in t&&t.ticket||"",f):{label:y,bbox:u}=await St(r,"ticket"in t&&t.ticket||"",f);let{label:m,bbox:d}=await St(r,"assigned"in t&&t.assigned||"",f);t.width=p;let x=10,w=t?.width||0,S=Math.max(u.height,d.height)/2,$=Math.max(h.height+x*2,t?.height||0)+S,M=-w/2,k=-$/2;i.attr("transform","translate("+(e-w/2)+", "+(-S-h.height/2)+")"),y.attr("transform","translate("+(e-w/2)+", "+(-S+h.height/2)+")"),m.attr("transform","translate("+(e+w/2-d.width-2*c)+", "+(-S+h.height/2)+")");let P,{rx:_,ry:B}=t,{cssStyles:C}=t;if(t.look==="handDrawn"){let I=v.svg(r),D=R(t,{}),L=_||B?I.path(gt(M,k,w,$,_||0),D):I.rectangle(M,k,w,$,D);P=r.insert(()=>L,":first-child"),P.attr("class","basic label-container").attr("style",C||null)}else{P=r.insert("rect",":first-child"),P.attr("class","basic label-container __APA__").attr("style",o).attr("rx",_??5).attr("ry",B??5).attr("x",M).attr("y",k).attr("width",w).attr("height",$);let I="priority"in t&&t.priority;if(I){let D=r.append("line"),L=M+2,E=k+Math.floor((_??0)/2),A=k+$-Math.floor((_??0)/2);D.attr("x1",L).attr("y1",E).attr("x2",L).attr("y2",A).attr("stroke-width","4").attr("stroke",er(I))}}return H(t,P),t.height=$,t.intersect=function(I){return N.rect(t,I)},r}b(cs,"kanbanItem");async function os(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,halfPadding:p,label:r}=await X(n,t,Y(t)),h=c.width+10*p,i=c.height+8*p,e=.15*h,{cssStyles:a}=t,g=c.width+20,f=c.height+20,y=Math.max(h,g),u=Math.max(i,f);r.attr("transform",`translate(${-c.width/2}, ${-c.height/2})`);let m,d=`M0 0
a${e},${e} 1 0,0 ${y*.25},${-1*u*.1}
a${e},${e} 1 0,0 ${y*.25},0
a${e},${e} 1 0,0 ${y*.25},0
a${e},${e} 1 0,0 ${y*.25},${u*.1}
a${e},${e} 1 0,0 ${y*.15},${u*.33}
a${e*.8},${e*.8} 1 0,0 0,${u*.34}
a${e},${e} 1 0,0 ${-1*y*.15},${u*.33}
a${e},${e} 1 0,0 ${-1*y*.25},${u*.15}
a${e},${e} 1 0,0 ${-1*y*.25},0
a${e},${e} 1 0,0 ${-1*y*.25},0
a${e},${e} 1 0,0 ${-1*y*.25},${-1*u*.15}
a${e},${e} 1 0,0 ${-1*y*.1},${-1*u*.33}
a${e*.8},${e*.8} 1 0,0 0,${-1*u*.34}
a${e},${e} 1 0,0 ${y*.1},${-1*u*.33}
H0 V0 Z`;if(t.look==="handDrawn"){let x=v.svg(o),w=R(t,{}),S=x.path(d,w);m=o.insert(()=>S,":first-child"),m.attr("class","basic label-container").attr("style",Q(a))}else m=o.insert("path",":first-child").attr("class","basic label-container").attr("style",l).attr("d",d);return m.attr("transform",`translate(${-y/2}, ${-u/2})`),H(t,m),t.calcIntersect=function(x,w){return N.rect(x,w)},t.intersect=function(x){return J.info("Bang intersect",t,x),N.rect(t,x)},o}b(os,"bang");async function hs(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,halfPadding:p,label:r}=await X(n,t,Y(t)),h=c.width+2*p,i=c.height+2*p,e=.15*h,a=.25*h,g=.35*h,f=.2*h,{cssStyles:y}=t,u,m=`M0 0
a${e},${e} 0 0,1 ${h*.25},${-1*h*.1}
a${g},${g} 1 0,1 ${h*.4},${-1*h*.1}
a${a},${a} 1 0,1 ${h*.35},${h*.2}
a${e},${e} 1 0,1 ${h*.15},${i*.35}
a${f},${f} 1 0,1 ${-1*h*.15},${i*.65}
a${a},${e} 1 0,1 ${-1*h*.25},${h*.15}
a${g},${g} 1 0,1 ${-1*h*.5},0
a${e},${e} 1 0,1 ${-1*h*.25},${-1*h*.15}
a${e},${e} 1 0,1 ${-1*h*.1},${-1*i*.35}
a${f},${f} 1 0,1 ${h*.1},${-1*i*.65}
H0 V0 Z`;if(t.look==="handDrawn"){let d=v.svg(o),x=R(t,{}),w=d.path(m,x);u=o.insert(()=>w,":first-child"),u.attr("class","basic label-container").attr("style",Q(y))}else u=o.insert("path",":first-child").attr("class","basic label-container").attr("style",l).attr("d",m);return r.attr("transform",`translate(${-c.width/2}, ${-c.height/2})`),u.attr("transform",`translate(${-h/2}, ${-i/2})`),H(t,u),t.calcIntersect=function(d,x){return N.rect(d,x)},t.intersect=function(d){return J.info("Cloud intersect",t,d),N.rect(t,d)},o}b(hs,"cloud");async function gs(n,t){let{labelStyles:s,nodeStyles:l}=W(t);t.labelStyle=s;let{shapeSvg:o,bbox:c,halfPadding:p,label:r}=await X(n,t,Y(t)),h=c.width+8*p,i=c.height+2*p,e=5,a=t.look==="neo"?`
M${-h/2} ${i/2-e}
v${-i+2*e}
q0,-${e} ${e},-${e}
h${h-2*e}
q${e},0 ${e},${e}
v${i-e}
H${-h/2}
Z
`:`
M${-h/2} ${i/2-e}
v${-i+2*e}
q0,-${e} ${e},-${e}
h${h-2*e}
q${e},0 ${e},${e}
v${i-2*e}
q0,${e} ${-e},${e}
h${-(h-2*e)}
q${-e},0 ${-e},${-e}
Z
`;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);let g=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",l).attr("d",a);return o.append("line").attr("class","node-line-").attr("x1",-h/2).attr("y1",i/2).attr("x2",h/2).attr("y2",i/2),r.attr("transform",`translate(${-c.width/2}, ${-c.height/2})`),o.append(()=>r.node()),H(t,g),t.calcIntersect=function(f,y){return N.rect(f,y)},t.intersect=function(f){return N.rect(t,f)},o}b(gs,"defaultMindmapNode");async function ys(n,t){let s={padding:t.padding??0};return te(n,t,s)}b(ys,"mindmapCircle");var ar=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:ja},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Ya},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Ga},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Va},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:ra},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:ia},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:ga},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:Xe},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:Ue},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:qe},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:sa},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:te},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:os},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:hs},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Wa},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:pa},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:ka},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:va},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Qa},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Sa},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:na},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Ja},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:ze},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Oa},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:za},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:qa},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:ya},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:ua},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Qe},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:ta},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:ea},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Ma},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:as},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:fa},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Ka},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Pa},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:aa},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:la},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:es},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:rs},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:oa},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:ts},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:ha},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Xa},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:La},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Ia},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Oe},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Ke},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Ua},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Za},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:ss},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Ta},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Da}],sr=b(()=>{let t=[...Object.entries({state:Fa,choice:Ve,note:Ea,composite:Ze,rectWithTitle:_a,labelRect:$a,block_arrow:Fe,collapsedGroup:Ge,iconSquare:wa,iconCircle:ma,icon:da,iconRounded:xa,imageSquare:ba,anchor:_e,kanbanItem:cs,mindmapCircle:ys,defaultMindmapNode:gs,classBox:ls,erBox:ae,requirementBox:ns,usecaseActor:Ca,usecaseActorHollow:Na,usecaseActorAwesome:Ba,usecaseActorIcon:Aa,usecaseBusiness:Ra,usecaseEllipse:ca,usecaseJsonTable:Ha}),...ar.flatMap(s=>[s.shortName,..."aliases"in s?s.aliases:[],..."internalAliases"in s?s.internalAliases:[]].map(o=>[o,s.handler]))];return Object.fromEntries(t)},"generateShapeMap"),rr=sr();function ir(n){return n in rr}b(ir,"isValidShape");export{X as a,H as b,xs as c,N as d,gt as e,ge as f,rr as g,ir as h};