UNPKG

mermaid

Version:

Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.

2 lines 98.7 kB
import{a as Ut,b as yt,d as D,e as k}from"./chunk-73ENG63I.mjs";import{a as zt,b as It}from"./chunk-SRFB55UJ.mjs";import{a as P}from"./chunk-IWDTEBJL.mjs";import{c as dt,f as rt}from"./chunk-BWNR3NKH.mjs";import{i as wt,o as Nt,q}from"./chunk-2HR5LOFI.mjs";import{$ as Rt,B as Vt,C as qt,Y as Z,m as lt,s as ft,w as tt,z as Lt}from"./chunk-5YUVU3PZ.mjs";import{b as Y,h as J}from"./chunk-MGPAVIPZ.mjs";import{a as x}from"./chunk-VELTKBKT.mjs";var G=x(async(d,t,c)=>{let h,a=t.useHtmlLabels||lt(Z()?.htmlLabels);c?h=c:h="node default";let o=d.insert("g").attr("class",h).attr("id",t.domId||t.id),f=o.insert("g").attr("class","label").attr("style",q(t.labelStyle)),i;t.label===void 0?i="":i=typeof t.label=="string"?t.label:t.label[0];let n=!!t.icon||!!t.img,r=t.labelType==="markdown",e=await rt(f,Lt(Nt(i),Z()),{useHtmlLabels:a,width:t.width||Z().flowchart?.wrappingWidth,classes:r?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:n,markdown:r},Z()),s=e.getBBox(),p=(t?.padding??0)/2;if(a){let l=e.children[0],m=J(e);await zt(l,i),s=l.getBoundingClientRect(),m.attr("width",s.width),m.attr("height",s.height)}return a?f.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):f.attr("transform","translate(0, "+-s.height/2+")"),t.centerLabel&&f.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),f.insert("rect",":first-child"),{shapeSvg:o,bbox:s,halfPadding:p,label:f}},"labelHelper"),Gt=x(async(d,t,c)=>{let h=c.useHtmlLabels??tt(Z()),a=d.insert("g").attr("class","label").attr("style",c.labelStyle||""),o=await rt(a,Lt(Nt(t),Z()),{useHtmlLabels:h,width:c.width||Z()?.flowchart?.wrappingWidth,style:c.labelStyle,addSvgBackground:!!c.icon||!!c.img}),f=o.getBBox(),i=c.padding/2;if(tt(Z())){let n=o.children[0],r=J(o);f=n.getBoundingClientRect(),r.attr("width",f.width),r.attr("height",f.height)}return h?a.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"):a.attr("transform","translate(0, "+-f.height/2+")"),c.centerLabel&&a.attr("transform","translate("+-f.width/2+", "+-f.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:d,bbox:f,halfPadding:i,label:a}},"insertLabel"),v=x((d,t)=>{let c=t.node().getBBox();d.width=c.width,d.height=c.height},"updateNodeBounds");var T=x((d,t)=>(d.look==="handDrawn"?"rough-node":"node")+" "+d.cssClasses+" "+(t||""),"getNodeClasses");function I(d){let t=d.map((c,h)=>`${h===0?"M":"L"}${c.x},${c.y}`);return t.push("Z"),t.join(" ")}x(I,"createPathFromPoints");function at(d,t,c,h,a,o){let f=[],n=c-d,r=h-t,e=n/o,s=2*Math.PI/e,p=t+r/2;for(let l=0;l<=50;l++){let m=l/50,g=d+m*n,u=p+a*Math.sin(s*(g-d));f.push({x:g,y:u})}return f}x(at,"generateFullSineWavePoints");function $t(d,t,c,h,a,o){let f=[],i=a*Math.PI/180,e=(o*Math.PI/180-i)/(h-1);for(let s=0;s<h;s++){let p=i+s*e,l=d+c*Math.cos(p),m=t+c*Math.sin(p);f.push({x:-l,y:-m})}return f}x($t,"generateCirclePoints");function Wt(d){let t=Array.from(d.childNodes).filter(n=>n.tagName==="path"),c=document.createElementNS("http://www.w3.org/2000/svg","path"),h=t.map(n=>n.getAttribute("d")).filter(n=>n!==null).join(" ");c.setAttribute("d",h);let a=t.find(n=>n.getAttribute("fill")!=="none"),o=t.find(n=>n.getAttribute("stroke")!=="none"),f=x((n,r)=>n?.getAttribute(r)??void 0,"getAttr");if(a){let n={fill:f(a,"fill"),"fill-opacity":f(a,"fill-opacity")??"1"};Object.entries(n).forEach(([r,e])=>{e&&c.setAttribute(r,e)})}if(o){let n={stroke:f(o,"stroke"),"stroke-width":f(o,"stroke-width")??"1","stroke-opacity":f(o,"stroke-opacity")??"1"};Object.entries(n).forEach(([r,e])=>{e&&c.setAttribute(r,e)})}let i=document.createElementNS("http://www.w3.org/2000/svg","g");return i.appendChild(c),i}x(Wt,"mergePaths");var Ds=x((d,t)=>{var c=d.x,h=d.y,a=t.x-c,o=t.y-h,f=d.width/2,i=d.height/2,n,r;return Math.abs(o)*f>Math.abs(a)*i?(o<0&&(i=-i),n=o===0?0:i*a/o,r=i):(a<0&&(f=-f),n=f,r=a===0?0:f*o/a),{x:c+n,y:h+r}},"intersectRect"),ut=Ds;var Ps=x(async(d,t,c,h=!1,a=!1)=>{let o=t||"";typeof o=="object"&&(o=o[0]);let f=Z(),i=tt(f);return await rt(d,o,{style:c,isTitle:h,useHtmlLabels:i,markdown:!1,isNode:a,width:Number.POSITIVE_INFINITY},f)},"createLabel"),vt=Ps;var it=x((d,t,c,h,a)=>["M",d+a,t,"H",d+c-a,"A",a,a,0,0,1,d+c,t+a,"V",t+h-a,"A",a,a,0,0,1,d+c-a,t+h,"H",d+a,"A",a,a,0,0,1,d,t+h-a,"V",t+a,"A",a,a,0,0,1,d+a,t,"Z"].join(" "),"createRoundedRectPathD");var Zt=x(async(d,t)=>{Y.info("Creating subgraph rect for ",t.id,t);let c=Z(),{themeVariables:h,handDrawnSeed:a}=c,{clusterBkg:o,clusterBorder:f}=h,{labelStyles:i,nodeStyles:n,borderStyles:r,backgroundStyles:e}=D(t),s=d.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),p=tt(c),l=s.insert("g").attr("class","cluster-label "),m;t.labelType==="markdown"?m=await rt(l,t.label,{style:t.labelStyle,useHtmlLabels:p,isNode:!0,width:t.width}):m=await vt(l,t.label,t.labelStyle||"",!1,!0);let g=m.getBBox();if(tt(c)){let C=m.children[0],R=J(m);g=C.getBoundingClientRect(),R.attr("width",g.width),R.attr("height",g.height)}let u=t.width<=g.width+t.padding?g.width+t.padding:t.width;t.width<=g.width+t.padding?t.diff=(u-t.width)/2-t.padding:t.diff=-t.padding;let y=t.height,b=t.x-u/2,S=t.y-y/2;Y.trace("Data ",t,JSON.stringify(t));let N;if(t.look==="handDrawn"){let C=P.svg(s),R=k(t,{roughness:.7,fill:o,stroke:f,fillWeight:3,seed:a}),M=C.path(it(b,S,u,y,0),R);N=s.insert(()=>(Y.debug("Rough node insert CXC",M),M),":first-child"),N.select("path:nth-child(2)").attr("style",r.join(";")),N.select("path").attr("style",e.join(";").replace("fill","stroke"))}else N=s.insert("rect",":first-child"),N.attr("style",n).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",S).attr("width",u).attr("height",y);let{subGraphTitleTopMargin:w}=It(c);if(l.attr("transform",`translate(${t.x-g.width/2}, ${t.y-t.height/2+w})`),i){let C=l.select("span");C&&C.attr("style",i)}let B=N.node().getBBox();return t.offsetX=0,t.width=B.width,t.height=B.height,t.offsetY=g.height-t.padding/2,t.intersect=function(C){return ut(t,C)},{cluster:s,labelBBox:g}},"rect"),vs=x((d,t)=>{let c=d.insert("g").attr("class","note-cluster").attr("id",t.domId),h=c.insert("rect",":first-child"),a=0*t.padding,o=a/2;h.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-o).attr("y",t.y-t.height/2-o).attr("width",t.width+a).attr("height",t.height+a).attr("fill","none");let f=h.node().getBBox();return t.width=f.width,t.height=f.height,t.intersect=function(i){return ut(t,i)},{cluster:c,labelBBox:{width:0,height:0}}},"noteGroup"),ks=x(async(d,t)=>{let c=Z(),{themeVariables:h,handDrawnSeed:a}=c,{altBackground:o,compositeBackground:f,compositeTitleBackground:i,nodeBorder:n}=h,r=d.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),e=r.insert("g",":first-child"),s=r.insert("g").attr("class","cluster-label"),p=r.append("rect"),l=await vt(s,t.label,t.labelStyle,void 0,!0),m=l.getBBox();if(tt(c)){let M=l.children[0],E=J(l);m=M.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}let g=0*t.padding,u=g/2,y=(t.width<=m.width+t.padding?m.width+t.padding:t.width)+g;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;let b=t.height+g,S=t.height+g-m.height-6,N=t.x-y/2,w=t.y-b/2;t.width=y;let B=t.y-t.height/2-u+m.height+2,C;if(t.look==="handDrawn"){let M=t.cssClasses.includes("statediagram-cluster-alt"),E=P.svg(r),H=t.rx||t.ry?E.path(it(N,w,y,b,10),{roughness:.7,fill:i,fillStyle:"solid",stroke:n,seed:a}):E.rectangle(N,w,y,b,{seed:a});C=r.insert(()=>H,":first-child");let W=E.rectangle(N,B,y,S,{fill:M?o:f,fillStyle:M?"hachure":"solid",stroke:n,seed:a});C=r.insert(()=>H,":first-child"),p=r.insert(()=>W)}else C=e.insert("rect",":first-child"),C.attr("class","outer").attr("x",N).attr("y",w).attr("width",y).attr("height",b).attr("data-look",t.look),p.attr("class","inner").attr("x",N).attr("y",B).attr("width",y).attr("height",S);s.attr("transform",`translate(${t.x-m.width/2}, ${w+1-(tt(c)?0:3)})`);let R=C.node().getBBox();return t.height=R.height,t.offsetX=0,t.offsetY=m.height-t.padding/2,t.labelBBox=m,t.intersect=function(M){return ut(t,M)},{cluster:r,labelBBox:m}},"roundedWithTitle"),Bs=x(async(d,t)=>{Y.info("Creating subgraph rect for ",t.id,t);let c=Z(),{themeVariables:h,handDrawnSeed:a}=c,{clusterBkg:o,clusterBorder:f}=h,{labelStyles:i,nodeStyles:n,borderStyles:r,backgroundStyles:e}=D(t),s=d.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),p=tt(c),l=s.insert("g").attr("class","cluster-label "),m=await rt(l,t.label,{style:t.labelStyle,useHtmlLabels:p,isNode:!0,width:t.width}),g=m.getBBox();if(tt(c)){let C=m.children[0],R=J(m);g=C.getBoundingClientRect(),R.attr("width",g.width),R.attr("height",g.height)}let u=t.width<=g.width+t.padding?g.width+t.padding:t.width;t.width<=g.width+t.padding?t.diff=(u-t.width)/2-t.padding:t.diff=-t.padding;let y=t.height,b=t.x-u/2,S=t.y-y/2;Y.trace("Data ",t,JSON.stringify(t));let N;if(t.look==="handDrawn"){let C=P.svg(s),R=k(t,{roughness:.7,fill:o,stroke:f,fillWeight:4,seed:a}),M=C.path(it(b,S,u,y,t.rx),R);N=s.insert(()=>(Y.debug("Rough node insert CXC",M),M),":first-child"),N.select("path:nth-child(2)").attr("style",r.join(";")),N.select("path").attr("style",e.join(";").replace("fill","stroke"))}else N=s.insert("rect",":first-child"),N.attr("style",n).attr("rx",t.rx).attr("ry",t.ry).attr("x",b).attr("y",S).attr("width",u).attr("height",y);let{subGraphTitleTopMargin:w}=It(c);if(l.attr("transform",`translate(${t.x-g.width/2}, ${t.y-t.height/2+w})`),i){let C=l.select("span");C&&C.attr("style",i)}let B=N.node().getBBox();return t.offsetX=0,t.width=B.width,t.height=B.height,t.offsetY=g.height-t.padding/2,t.intersect=function(C){return ut(t,C)},{cluster:s,labelBBox:g}},"kanbanSection"),Ts=x((d,t)=>{let c=Z(),{themeVariables:h,handDrawnSeed:a}=c,{nodeBorder:o}=h,f=d.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),i=f.insert("g",":first-child"),n=0*t.padding,r=t.width+n;t.diff=-t.padding;let e=t.height+n,s=t.x-r/2,p=t.y-e/2;t.width=r;let l;if(t.look==="handDrawn"){let u=P.svg(f).rectangle(s,p,r,e,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:o,seed:a});l=f.insert(()=>u,":first-child")}else{l=i.insert("rect",":first-child");let g="outer";t.look,g="divider",l.attr("class",g).attr("x",s).attr("y",p).attr("width",r).attr("height",e).attr("data-look",t.look)}let m=l.node().getBBox();return t.height=m.height,t.offsetX=0,t.offsetY=0,t.intersect=function(g){return ut(t,g)},{cluster:f,labelBBox:{}}},"divider"),Cs=Zt,Rs={rect:Zt,squareRect:Cs,roundedWithTitle:ks,noteGroup:vs,divider:Ts,kanbanSection:Bs},Jt=new Map,Cr=x(async(d,t)=>{let c=t.shape||"rect",h=await Rs[c](d,t);return Jt.set(t.id,h),h},"insertCluster");var Rr=x(()=>{Jt=new Map},"clear");function Gs(d,t){return d.intersect(t)}x(Gs,"intersectNode");var Kt=Gs;function Ms(d,t,c,h){var a=d.x,o=d.y,f=a-h.x,i=o-h.y,n=Math.sqrt(t*t*i*i+c*c*f*f),r=Math.abs(t*c*f/n);h.x<a&&(r=-r);var e=Math.abs(t*c*i/n);return h.y<o&&(e=-e),{x:a+r,y:o+e}}x(Ms,"intersectEllipse");var Mt=Ms;function Es(d,t,c){return Mt(d,t,t,c)}x(Es,"intersectCircle");var Qt=Es;function Hs(d,t,c,h){{let a=t.y-d.y,o=d.x-t.x,f=t.x*d.y-d.x*t.y,i=a*c.x+o*c.y+f,n=a*h.x+o*h.y+f,r=1e-6;if(i!==0&&n!==0&&te(i,n))return;let e=h.y-c.y,s=c.x-h.x,p=h.x*c.y-c.x*h.y,l=e*d.x+s*d.y+p,m=e*t.x+s*t.y+p;if(Math.abs(l)<r&&Math.abs(m)<r&&te(l,m))return;let g=a*s-e*o;if(g===0)return;let u=Math.abs(g/2),y=o*p-s*f,b=y<0?(y-u)/g:(y+u)/g;y=e*f-a*p;let S=y<0?(y-u)/g:(y+u)/g;return{x:b,y:S}}}x(Hs,"intersectLine");function te(d,t){return d*t>0}x(te,"sameSign");var ee=Hs;function js(d,t,c){let h=d.x,a=d.y,o=[],f=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(e){f=Math.min(f,e.x),i=Math.min(i,e.y)}):(f=Math.min(f,t.x),i=Math.min(i,t.y));let n=h-d.width/2-f,r=a-d.height/2-i;for(let e=0;e<t.length;e++){let s=t[e],p=t[e<t.length-1?e+1:0],l=ee(d,c,{x:n+s.x,y:r+s.y},{x:n+p.x,y:r+p.y});l&&o.push(l)}return o.length?(o.length>1&&o.sort(function(e,s){let p=e.x-c.x,l=e.y-c.y,m=Math.sqrt(p*p+l*l),g=s.x-c.x,u=s.y-c.y,y=Math.sqrt(g*g+u*u);return m<y?-1:m===y?0:1}),o[0]):d}x(js,"intersectPolygon");var se=js;var $={node:Kt,circle:Qt,ellipse:Mt,polygon:se,rect:ut};function re(d,t){let{labelStyles:c}=D(t);t.labelStyle=c;let h=T(t),a=h;h||(a="anchor");let o=d.insert("g").attr("class",a).attr("id",t.domId||t.id),f=1,{cssStyles:i}=t,n=P.svg(o),r=k(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(r.roughness=0);let e=n.circle(0,0,f*2,r),s=o.insert(()=>e,":first-child");return s.attr("class","anchor").attr("style",q(i)),v(t,s),t.intersect=function(p){return Y.info("Circle intersect",t,f,p),$.circle(t,f,p)},o}x(re,"anchor");function ie(d,t,c,h,a,o,f){let n=(d+c)/2,r=(t+h)/2,e=Math.atan2(h-t,c-d),s=(c-d)/2,p=(h-t)/2,l=s/a,m=p/o,g=Math.sqrt(l**2+m**2);if(g>1)throw new Error("The given radii are too small to create an arc between the points.");let u=Math.sqrt(1-g**2),y=n+u*o*Math.sin(e)*(f?-1:1),b=r-u*a*Math.cos(e)*(f?-1:1),S=Math.atan2((t-b)/o,(d-y)/a),w=Math.atan2((h-b)/o,(c-y)/a)-S;f&&w<0&&(w+=2*Math.PI),!f&&w>0&&(w-=2*Math.PI);let B=[];for(let C=0;C<20;C++){let R=C/19,M=S+R*w,E=y+a*Math.cos(M),H=b+o*Math.sin(M);B.push({x:E,y:H})}return B}x(ie,"generateArcPoints");function As(d,t,c){let[h,a]=[t,c].sort((o,f)=>f-o);return a*(1-Math.sqrt(1-(d/h/2)**2))}x(As,"calculateArcSagitta");async function oe(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c;let a=t.padding??0,o=t.look==="neo"?16:a,f=t.look==="neo"?12:a,i=x(M=>M+f,"calcTotalHeight"),n=x(M=>{let E=M/2;return[E/(2.5+M/50),E]},"calcEllipseRadius"),{shapeSvg:r,bbox:e}=await G(d,t,T(t)),s=i(t?.height?t?.height:e.height),[p,l]=n(s),m=As(s,p,l),u=(t?.width?t?.width:e.width)+o*2+m-m,y=s,{cssStyles:b}=t,S=[{x:u/2,y:-y/2},{x:-u/2,y:-y/2},...ie(-u/2,-y/2,-u/2,y/2,p,l,!1),{x:u/2,y:y/2},...ie(u/2,y/2,u/2,-y/2,p,l,!0)],N=P.svg(r),w=k(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let B=I(S),C=N.path(B,w),R=r.insert(()=>C,":first-child");return R.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",b),h&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",h),R.attr("transform",`translate(${p/2}, 0)`),v(t,R),t.intersect=function(M){return $.polygon(t,S,M)},r}x(oe,"bowTieRect");function et(d,t,c,h){return d.insert("polygon",":first-child").attr("points",h.map(function(a){return a.x+","+a.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+c/2+")")}x(et,"insertPolygonShape");var Et=12;async function ae(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c;let a=t.padding??0,o=t.look==="neo"?28:a,f=t.look==="neo"?24:a,{shapeSvg:i,bbox:n}=await G(d,t,T(t)),r=(t?.width??n.width)+(t.look==="neo"?o*2:o+Et),e=(t?.height??n.height)+(t.look==="neo"?f*2:f),s=0,p=r,l=-e,m=0,g=[{x:s+Et,y:l},{x:p,y:l},{x:p,y:m},{x:s,y:m},{x:s,y:l+Et},{x:s+Et,y:l}],u,{cssStyles:y}=t;if(t.look==="handDrawn"){let b=P.svg(i),S=k(t,{}),N=I(g),w=b.path(N,S);u=i.insert(()=>w,":first-child").attr("transform",`translate(${-r/2}, ${e/2})`),y&&u.attr("style",y)}else u=et(i,r,e,g);return h&&u.attr("style",h),v(t,u),t.intersect=function(b){return $.polygon(t,g,b)},i}x(ae,"card");function ne(d,t){let{nodeStyles:c}=D(t);t.label="";let h=d.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),{cssStyles:a}=t,o=Math.max(28,t.width??0),f=[{x:0,y:o/2},{x:o/2,y:0},{x:0,y:-o/2},{x:-o/2,y:0}],i=P.svg(h),n=k(t,{});t.look!=="handDrawn"&&(n.roughness=0,n.fillStyle="solid");let r=I(f),e=i.path(r,n),s=h.insert(()=>e,":first-child");return a&&t.look!=="handDrawn"&&s.selectAll("path").attr("style",a),c&&t.look!=="handDrawn"&&s.selectAll("path").attr("style",c),t.width=28,t.height=28,t.intersect=function(p){return $.polygon(t,f,p)},h}x(ne,"choice");async function Ht(d,t,c){let{labelStyles:h,nodeStyles:a}=D(t);t.labelStyle=h;let{shapeSvg:o,bbox:f,halfPadding:i}=await G(d,t,T(t)),n=16,r=c?.padding??i,e=t.look==="neo"?f.width/2+n*2:f.width/2+r,s,{cssStyles:p}=t;if(t.look==="handDrawn"){let l=P.svg(o),m=k(t,{}),g=l.circle(0,0,e*2,m);s=o.insert(()=>g,":first-child"),s.attr("class","basic label-container").attr("style",q(p))}else s=o.insert("circle",":first-child").attr("class","basic label-container").attr("style",a).attr("r",e).attr("cx",0).attr("cy",0);return v(t,s),t.calcIntersect=function(l,m){let g=l.width/2;return $.circle(l,g,m)},t.intersect=function(l){return Y.info("Circle intersect",t,e,l),$.circle(t,e,l)},o}x(Ht,"circle");function Os(d){let t=Math.cos(Math.PI/4),c=Math.sin(Math.PI/4),h=d*2,a={x:h/2*t,y:h/2*c},o={x:-(h/2)*t,y:h/2*c},f={x:-(h/2)*t,y:-(h/2)*c},i={x:h/2*t,y:-(h/2)*c};return`M ${o.x},${o.y} L ${i.x},${i.y} M ${a.x},${a.y} L ${f.x},${f.y}`}x(Os,"createLine");function le(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c,t.label="";let a=d.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),o=Math.max(30,t?.width??0),{cssStyles:f}=t,i=P.svg(a),n=k(t,{});t.look!=="handDrawn"&&(n.roughness=0,n.fillStyle="solid");let r=i.circle(0,0,o*2,n),e=Os(o),s=i.path(e,n),p=a.insert(()=>r,":first-child");return p.insert(()=>s),p.attr("class","outer-path"),f&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",f),h&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",h),v(t,p),t.intersect=function(l){return Y.info("crossedCircle intersect",t,{radius:o,point:l}),$.circle(t,o,l)},a}x(le,"crossedCircle");function xt(d,t,c,h=100,a=0,o=180){let f=[],i=a*Math.PI/180,e=(o*Math.PI/180-i)/(h-1);for(let s=0;s<h;s++){let p=i+s*e,l=d+c*Math.cos(p),m=t+c*Math.sin(p);f.push({x:-l,y:-m})}return f}x(xt,"generateCirclePoints");async function ce(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c;let{shapeSvg:a,bbox:o,label:f}=await G(d,t,T(t)),i=t.look==="neo"?18:t.padding??0,n=t.look==="neo"?12:t.padding??0,r=o.width+i,e=o.height+n,s=Math.max(5,e*.1),{cssStyles:p}=t,l=[...xt(r/2,-e/2,s,30,-90,0),{x:-r/2-s,y:s},...xt(r/2+s*2,-s,s,20,-180,-270),...xt(r/2+s*2,s,s,20,-90,-180),{x:-r/2-s,y:-e/2},...xt(r/2,e/2,s,20,0,90)],m=[{x:r/2,y:-e/2-s},{x:-r/2,y:-e/2-s},...xt(r/2,-e/2,s,20,-90,0),{x:-r/2-s,y:-s},...xt(r/2+r*.1,-s,s,20,-180,-270),...xt(r/2+r*.1,s,s,20,-90,-180),{x:-r/2-s,y:e/2},...xt(r/2,e/2,s,20,0,90),{x:-r/2,y:e/2+s},{x:r/2,y:e/2+s}],g=P.svg(a),u=k(t,{fill:"none"});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let b=I(l).replace("Z",""),S=g.path(b,u),N=I(m),w=g.path(N,{...u}),B=a.insert("g",":first-child");return B.insert(()=>w,":first-child").attr("stroke-opacity",0),B.insert(()=>S,":first-child"),B.attr("class","text"),p&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",p),h&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",h),B.attr("transform",`translate(${s}, 0)`),f.attr("transform",`translate(${-r/2+s-(o.x-(o.left??0))},${-e/2+(t.padding??0)/2-(o.y-(o.top??0))})`),v(t,B),t.intersect=function(C){return $.polygon(t,m,C)},a}x(ce,"curlyBraceLeft");function bt(d,t,c,h=100,a=0,o=180){let f=[],i=a*Math.PI/180,e=(o*Math.PI/180-i)/(h-1);for(let s=0;s<h;s++){let p=i+s*e,l=d+c*Math.cos(p),m=t+c*Math.sin(p);f.push({x:l,y:m})}return f}x(bt,"generateCirclePoints");async function he(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c;let{shapeSvg:a,bbox:o,label:f}=await G(d,t,T(t)),i=t.look==="neo"?18:t.padding??0,n=t.look==="neo"?12:t.padding??0,r=o.width+(t.look==="neo"?i*2:i),e=o.height+(t.look==="neo"?n*2:n),s=Math.max(5,e*.1),{cssStyles:p}=t,l=[...bt(r/2,-e/2,s,20,-90,0),{x:r/2+s,y:-s},...bt(r/2+s*2,-s,s,20,-180,-270),...bt(r/2+s*2,s,s,20,-90,-180),{x:r/2+s,y:e/2},...bt(r/2,e/2,s,20,0,90)],m=[{x:-r/2,y:-e/2-s},{x:r/2,y:-e/2-s},...bt(r/2,-e/2,s,20,-90,0),{x:r/2+s,y:-s},...bt(r/2+s*2,-s,s,20,-180,-270),...bt(r/2+s*2,s,s,20,-90,-180),{x:r/2+s,y:e/2},...bt(r/2,e/2,s,20,0,90),{x:r/2,y:e/2+s},{x:-r/2,y:e/2+s}],g=P.svg(a),u=k(t,{fill:"none"});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let b=I(l).replace("Z",""),S=g.path(b,u),N=I(m),w=g.path(N,{...u}),B=a.insert("g",":first-child");return B.insert(()=>w,":first-child").attr("stroke-opacity",0),B.insert(()=>S,":first-child"),B.attr("class","text"),p&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",p),h&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",h),B.attr("transform",`translate(${-s}, 0)`),f.attr("transform",`translate(${-r/2+(t.padding??0)/2-(o.x-(o.left??0))},${-e/2+(t.padding??0)/2-(o.y-(o.top??0))})`),v(t,B),t.intersect=function(C){return $.polygon(t,m,C)},a}x(he,"curlyBraceRight");function st(d,t,c,h=100,a=0,o=180){let f=[],i=a*Math.PI/180,e=(o*Math.PI/180-i)/(h-1);for(let s=0;s<h;s++){let p=i+s*e,l=d+c*Math.cos(p),m=t+c*Math.sin(p);f.push({x:-l,y:-m})}return f}x(st,"generateCirclePoints");async function pe(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c;let{shapeSvg:a,bbox:o,label:f}=await G(d,t,T(t)),i=t.look==="neo"?18:t.padding??0,n=t.look==="neo"?12:t.padding??0,r=o.width+(t.look==="neo"?i*2:i),e=o.height+(t.look==="neo"?n*2:n),s=Math.max(5,e*.1),{cssStyles:p}=t,l=[...st(r/2,-e/2,s,30,-90,0),{x:-r/2-s,y:s},...st(r/2+s*2,-s,s,20,-180,-270),...st(r/2+s*2,s,s,20,-90,-180),{x:-r/2-s,y:-e/2},...st(r/2,e/2,s,20,0,90)],m=[...st(-r/2+s+s/2,-e/2,s,20,-90,-180),{x:r/2-s/2,y:s},...st(-r/2-s/2,-s,s,20,0,90),...st(-r/2-s/2,s,s,20,-90,0),{x:r/2-s/2,y:-s},...st(-r/2+s+s/2,e/2,s,30,-180,-270)],g=[{x:r/2,y:-e/2-s},{x:-r/2,y:-e/2-s},...st(r/2,-e/2,s,20,-90,0),{x:-r/2-s,y:-s},...st(r/2+s*2,-s,s,20,-180,-270),...st(r/2+s*2,s,s,20,-90,-180),{x:-r/2-s,y:e/2},...st(r/2,e/2,s,20,0,90),{x:-r/2,y:e/2+s},{x:r/2-s-s/2,y:e/2+s},...st(-r/2+s+s/2,-e/2,s,20,-90,-180),{x:r/2-s/2,y:s},...st(-r/2-s/2,-s,s,20,0,90),...st(-r/2-s/2,s,s,20,-90,0),{x:r/2-s/2,y:-s},...st(-r/2+s+s/2,e/2,s,30,-180,-270)],u=P.svg(a),y=k(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let S=I(l).replace("Z",""),N=u.path(S,y),B=I(m).replace("Z",""),C=u.path(B,y),R=I(g),M=u.path(R,{...y}),E=a.insert("g",":first-child");return E.insert(()=>M,":first-child").attr("stroke-opacity",0),E.insert(()=>N,":first-child"),E.insert(()=>C,":first-child"),E.attr("class","text"),p&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",p),h&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",h),E.attr("transform",`translate(${s-s/4}, 0)`),f.attr("transform",`translate(${-r/2+(t.padding??0)/2-(o.x-(o.left??0))},${-e/2+(t.padding??0)/2-(o.y-(o.top??0))})`),v(t,E),t.intersect=function(H){return $.polygon(t,g,H)},a}x(pe,"curlyBraces");async function me(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c;let a=t.padding??0,o=t.look==="neo"?16:a,f=t.look==="neo"?12:a,i=20,n=5,{shapeSvg:r,bbox:e}=await G(d,t,T(t)),s=Math.max(i,(e.width+o*2)*1.25,t?.width??0),p=Math.max(n,e.height+f*2,t?.height??0),l=p/2,{cssStyles:m}=t,g=P.svg(r),u=k(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let y=s,b=p,S=y-l,N=b/4,w=[{x:S,y:0},{x:N,y:0},{x:0,y:b/2},{x:N,y:b},{x:S,y:b},...$t(-S,-b/2,l,50,270,90)],B=I(w),C=g.path(B,u),R=r.insert(()=>C,":first-child");return R.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&R.selectChildren("path").attr("style",m),h&&t.look!=="handDrawn"&&R.selectChildren("path").attr("style",h),R.attr("transform",`translate(${-s/2}, ${-p/2})`),v(t,R),t.intersect=function(M){return $.polygon(t,w,M)},r}x(me,"curvedTrapezoid");var Ls=x((d,t,c,h,a,o)=>[`M${d},${t+o}`,`a${a},${o} 0,0,0 ${c},0`,`a${a},${o} 0,0,0 ${-c},0`,`l0,${h}`,`a${a},${o} 0,0,0 ${c},0`,`l0,${-h}`].join(" "),"createCylinderPathD"),Vs=x((d,t,c,h,a,o)=>[`M${d},${t+o}`,`M${d+c},${t+o}`,`a${a},${o} 0,0,0 ${-c},0`,`l0,${h}`,`a${a},${o} 0,0,0 ${c},0`,`l0,${-h}`].join(" "),"createOuterCylinderPathD"),Is=x((d,t,c,h,a,o)=>[`M${d-c/2},${-h/2}`,`a${a},${o} 0,0,0 ${c},0`].join(" "),"createInnerCylinderPathD"),ge=8,fe=8;async function de(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c;let a=t.padding??0,o=t.look==="neo"?24:a,f=t.look==="neo"?24:a;if(t.width||t.height){let u=t.width??0;t.width=(t.width??0)-f,t.width<fe&&(t.width=fe);let b=u/2/(2.5+u/50);t.height=(t.height??0)-o-b*3,t.height<ge&&(t.height=ge)}let{shapeSvg:i,bbox:n,label:r}=await G(d,t,T(t)),e=(t.width?t.width:n.width)+f,s=e/2,p=s/(2.5+e/50),l=(t.height?t.height:n.height)+o+p,m,{cssStyles:g}=t;if(t.look==="handDrawn"){let u=P.svg(i),y=Vs(0,0,e,l,s,p),b=Is(0,p,e,l,s,p),S=k(t,{}),N=u.path(y,S),w=u.path(b,k(t,{fill:"none"}));m=i.insert(()=>w,":first-child"),m=i.insert(()=>N,":first-child"),m.attr("class","basic label-container"),g&&m.attr("style",g)}else{let u=Ls(0,0,e,l,s,p);m=i.insert("path",":first-child").attr("d",u).attr("class","basic label-container outer-path").attr("style",q(g)).attr("style",h)}return m.attr("label-offset-y",p),m.attr("transform",`translate(${-e/2}, ${-(l/2+p)})`),v(t,m),r.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)+(t.padding??0)/1.5-(n.y-(n.top??0))})`),t.intersect=function(u){let y=$.rect(t,u),b=y.x-(t.x??0);if(s!=0&&(Math.abs(b)<(t.width??0)/2||Math.abs(b)==(t.width??0)/2&&Math.abs(y.y-(t.y??0))>(t.height??0)/2-p)){let S=p*p*(1-b*b/(s*s));S>0&&(S=Math.sqrt(S)),S=p-S,u.y-(t.y??0)>0&&(S=-S),y.y+=S}return y},i}x(de,"cylinder");async function ye(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c;let a=t.look==="neo"?16:t.padding??0,o=t.look==="neo"?16:t.padding??0,{shapeSvg:f,bbox:i,label:n}=await G(d,t,T(t)),r=i.width+a,e=i.height+o,s=e*.2,p=-r/2,l=-e/2-s/2,{cssStyles:m}=t,g=P.svg(f),u=k(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let y=[{x:p,y:l+s},{x:-p,y:l+s},{x:-p,y:-l},{x:p,y:-l},{x:p,y:l},{x:-p,y:l},{x:-p,y:l+s}],b=g.polygon(y.map(N=>[N.x,N.y]),u),S=f.insert(()=>b,":first-child");return S.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",m),h&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",h),n.attr("transform",`translate(${p+(t.padding??0)/2-(i.x-(i.left??0))}, ${l+s+(t.padding??0)/2-(i.y-(i.top??0))})`),v(t,S),t.intersect=function(N){return $.rect(t,N)},f}x(ye,"dividedRectangle");async function ue(d,t){let{labelStyles:c,nodeStyles:h}=D(t),a=t.look==="neo"?12:5;t.labelStyle=c;let o=t.padding??0,f=t.look==="neo"?16:o,{shapeSvg:i,bbox:n}=await G(d,t,T(t)),r=(t?.width?t?.width/2:n.width/2)+(f??0),e=r-a,s,{cssStyles:p}=t;if(t.look==="handDrawn"){let l=P.svg(i),m=k(t,{roughness:.2,strokeWidth:2.5}),g=k(t,{roughness:.2,strokeWidth:1.5}),u=l.circle(0,0,r*2,m),y=l.circle(0,0,e*2,g);s=i.insert("g",":first-child"),s.attr("class",q(t.cssClasses)).attr("style",q(p)),s.node()?.appendChild(u),s.node()?.appendChild(y)}else{s=i.insert("g",":first-child");let l=s.insert("circle",":first-child"),m=s.insert("circle");s.attr("class","basic label-container").attr("style",h),l.attr("class","outer-circle").attr("style",h).attr("r",r).attr("cx",0).attr("cy",0),m.attr("class","inner-circle").attr("style",h).attr("r",e).attr("cx",0).attr("cy",0)}return v(t,s),t.intersect=function(l){return Y.info("DoubleCircle intersect",t,r,l),$.circle(t,r,l)},i}x(ue,"doublecircle");function xe(d,t,{config:{themeVariables:c}}){let{labelStyles:h,nodeStyles:a}=D(t);t.label="",t.labelStyle=h;let o=d.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),f=7,{cssStyles:i}=t,n=P.svg(o),{nodeBorder:r}=c,e=k(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(e.roughness=0);let s=n.circle(0,0,f*2,e),p=o.insert(()=>s,":first-child");return p.selectAll("path").attr("style",`fill: ${r} !important;`),i&&i.length>0&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",i),a&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",a),v(t,p),t.intersect=function(l){return Y.info("filledCircle intersect",t,{radius:f,point:l}),$.circle(t,f,l)},o}x(xe,"filledCircle");var be=10,Se=10;async function we(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c;let a=t.padding??0,o=t.look==="neo"?a*2:a;(t.width||t.height)&&(t.height=t?.height??0,t.height<be&&(t.height=be),t.width=(t?.width??0)-o-o/2,t.width<Se&&(t.width=Se));let{shapeSvg:f,bbox:i,label:n}=await G(d,t,T(t)),r=(t?.width?t?.width:i.width)+(o??0),e=t?.height?t?.height:r+i.height,s=e,p=[{x:0,y:-e},{x:s,y:-e},{x:s/2,y:0}],{cssStyles:l}=t,m=P.svg(f),g=k(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let u=I(p),y=m.path(u,g),b=f.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${e/2})`).attr("class","outer-path");return l&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",l),h&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",h),t.width=r,t.height=e,v(t,b),n.attr("transform",`translate(${-i.width/2-(i.x-(i.left??0))}, ${-e/2+(t.padding??0)/2+(i.y-(i.top??0))})`),t.intersect=function(S){return Y.info("Triangle intersect",t,p,S),$.polygon(t,p,S)},f}x(we,"flippedTriangle");function Ne(d,t,{dir:c,config:{state:h,themeVariables:a}}){let{nodeStyles:o}=D(t);t.label="";let f=d.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),{cssStyles:i}=t,n=Math.max(70,t?.width??0),r=Math.max(10,t?.height??0);c==="LR"&&(n=Math.max(10,t?.width??0),r=Math.max(70,t?.height??0));let e=-1*n/2,s=-1*r/2,p=P.svg(f),l=k(t,{stroke:a.lineColor,fill:a.lineColor});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");let m=p.rectangle(e,s,n,r,l),g=f.insert(()=>m,":first-child");i&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",i),o&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",o),v(t,g);let u=h?.padding??0;return t.width&&t.height&&(t.width+=u/2||0,t.height+=u/2||0),t.intersect=function(y){return $.rect(t,y)},f}x(Ne,"forkJoin");async function $e(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c;let a=15,o=10,f=t.look==="neo"?16:t.padding??0,i=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-i*2,t.height<o&&(t.height=o),t.width=(t?.width??0)-f*2,t.width<a&&(t.width=a));let{shapeSvg:n,bbox:r}=await G(d,t,T(t)),e=(t?.width?t?.width:Math.max(a,r.width))+f*2,s=(t?.height?t?.height:Math.max(o,r.height))+i*2,p=s/2,{cssStyles:l}=t,m=P.svg(n),g=k(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let u=[{x:-e/2,y:-s/2},{x:e/2-p,y:-s/2},...$t(-e/2+p,0,p,50,90,270),{x:e/2-p,y:s/2},{x:-e/2,y:s/2}],y=I(u),b=m.path(y,g),S=n.insert(()=>b,":first-child");return S.attr("class","basic label-container outer-path"),l&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",l),h&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",h),v(t,S),t.intersect=function(N){return Y.info("Pill intersect",t,{radius:p,point:N}),$.polygon(t,u,N)},n}x($e,"halfRoundedRectangle");var Ws=x((d,t,c,h,a)=>[`M${d+a},${t}`,`L${d+c-a},${t}`,`L${d+c},${t-h/2}`,`L${d+c-a},${t-h}`,`L${d+a},${t-h}`,`L${d},${t-h/2}`,"Z"].join(" "),"createHexagonPathD");async function De(d,t){let{labelStyles:c,nodeStyles:h}=D(t),a=t.look==="neo"?3.5:4;t.labelStyle=c;let o=t.padding??0,f=70,i=32,n=t.look==="neo"?f:o,r=t.look==="neo"?i:o;if(t.width||t.height){let S=(t.height??0)/a;t.width=(t?.width??0)-2*S-r,t.height=(t.height??0)-n}let{shapeSvg:e,bbox:s}=await G(d,t,T(t)),p=(t?.height?t?.height:s.height)+n,l=p/a,m=(t?.width?t?.width:s.width)+2*l+r,g=[{x:l,y:0},{x:m-l,y:0},{x:m,y:-p/2},{x:m-l,y:-p},{x:l,y:-p},{x:0,y:-p/2}],u,{cssStyles:y}=t;if(t.look==="handDrawn"){let b=P.svg(e),S=k(t,{}),N=Ws(0,0,m,p,l),w=b.path(N,S);u=e.insert(()=>w,":first-child").attr("transform",`translate(${-m/2}, ${p/2})`),y&&u.attr("style",y)}else u=et(e,m,p,g);return h&&u.attr("style",h),t.width=m,t.height=p,v(t,u),t.intersect=function(b){return $.polygon(t,g,b)},e}x(De,"hexagon");async function Pe(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.label="",t.labelStyle=c;let{shapeSvg:a}=await G(d,t,T(t)),o=Math.max(30,t?.width??0),f=Math.max(30,t?.height??0),{cssStyles:i}=t,n=P.svg(a),r=k(t,{});t.look!=="handDrawn"&&(r.roughness=0,r.fillStyle="solid");let e=[{x:0,y:0},{x:o,y:0},{x:0,y:f},{x:o,y:f}],s=I(e),p=n.path(s,r),l=a.insert(()=>p,":first-child");return l.attr("class","basic label-container outer-path"),i&&t.look!=="handDrawn"&&l.selectChildren("path").attr("style",i),h&&t.look!=="handDrawn"&&l.selectChildren("path").attr("style",h),l.attr("transform",`translate(${-o/2}, ${-f/2})`),v(t,l),t.intersect=function(m){return Y.info("Pill intersect",t,{points:e}),$.polygon(t,e,m)},a}x(Pe,"hourglass");async function ve(d,t,{config:{themeVariables:c,flowchart:h}}){let{labelStyles:a}=D(t);t.labelStyle=a;let o=t.assetHeight??48,f=t.assetWidth??48,i=Math.max(o,f),n=h?.wrappingWidth;t.width=Math.max(i,n??0);let{shapeSvg:r,bbox:e,label:s}=await G(d,t,"icon-shape default"),p=t.pos==="t",l=i,m=i,{nodeBorder:g}=c,{stylesMap:u}=yt(t),y=-m/2,b=-l/2,S=t.label?8:0,N=P.svg(r),w=k(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let B=N.rectangle(y,b,m,l,w),C=Math.max(m,e.width),R=l+e.height+S,M=N.rectangle(-C/2,-R/2,C,R,{...w,fill:"transparent",stroke:"none"}),E=r.insert(()=>B,":first-child"),H=r.insert(()=>M);if(t.icon){let W=r.append("g");W.html(`<g>${await dt(t.icon,{height:i,width:i,fallbackPrefix:""})}</g>`);let j=W.node().getBBox(),L=j.width,O=j.height,A=j.x,V=j.y;W.attr("transform",`translate(${-L/2-A},${p?e.height/2+S/2-O/2-V:-e.height/2-S/2-O/2-V})`),W.attr("style",`color: ${u.get("stroke")??g};`)}return s.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${p?-R/2:R/2-e.height})`),E.attr("transform",`translate(0,${p?e.height/2+S/2:-e.height/2-S/2})`),v(t,H),t.intersect=function(W){if(Y.info("iconSquare intersect",t,W),!t.label)return $.rect(t,W);let j=t.x??0,L=t.y??0,O=t.height??0,A=[];return p?A=[{x:j-e.width/2,y:L-O/2},{x:j+e.width/2,y:L-O/2},{x:j+e.width/2,y:L-O/2+e.height+S},{x:j+m/2,y:L-O/2+e.height+S},{x:j+m/2,y:L+O/2},{x:j-m/2,y:L+O/2},{x:j-m/2,y:L-O/2+e.height+S},{x:j-e.width/2,y:L-O/2+e.height+S}]:A=[{x:j-m/2,y:L-O/2},{x:j+m/2,y:L-O/2},{x:j+m/2,y:L-O/2+l},{x:j+e.width/2,y:L-O/2+l},{x:j+e.width/2/2,y:L+O/2},{x:j-e.width/2,y:L+O/2},{x:j-e.width/2,y:L-O/2+l},{x:j-m/2,y:L-O/2+l}],$.polygon(t,A,W)},r}x(ve,"icon");async function ke(d,t,{config:{themeVariables:c,flowchart:h}}){let{labelStyles:a}=D(t);t.labelStyle=a;let o=t.assetHeight??48,f=t.assetWidth??48,i=Math.max(o,f),n=h?.wrappingWidth;t.width=Math.max(i,n??0);let{shapeSvg:r,bbox:e,label:s}=await G(d,t,"icon-shape default"),p=20,l=t.label?8:0,m=t.pos==="t",{nodeBorder:g,mainBkg:u}=c,{stylesMap:y}=yt(t),b=P.svg(r),S=k(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let N=y.get("fill");S.stroke=N??u;let w=r.append("g");t.icon&&w.html(`<g>${await dt(t.icon,{height:i,width:i,fallbackPrefix:""})}</g>`);let B=w.node().getBBox(),C=B.width,R=B.height,M=B.x,E=B.y,H=Math.max(C,R)*Math.SQRT2+p*2,W=b.circle(0,0,H,S),j=Math.max(H,e.width),L=H+e.height+l,O=b.rectangle(-j/2,-L/2,j,L,{...S,fill:"transparent",stroke:"none"}),A=r.insert(()=>W,":first-child"),V=r.insert(()=>O);return w.attr("transform",`translate(${-C/2-M},${m?e.height/2+l/2-R/2-E:-e.height/2-l/2-R/2-E})`),w.attr("style",`color: ${y.get("stroke")??g};`),s.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${m?-L/2:L/2-e.height})`),A.attr("transform",`translate(0,${m?e.height/2+l/2:-e.height/2-l/2})`),v(t,V),t.intersect=function(X){return Y.info("iconSquare intersect",t,X),$.rect(t,X)},r}x(ke,"iconCircle");async function Be(d,t,{config:{themeVariables:c,flowchart:h}}){let{labelStyles:a}=D(t);t.labelStyle=a;let o=t.assetHeight??48,f=t.assetWidth??48,i=Math.max(o,f),n=h?.wrappingWidth;t.width=Math.max(i,n??0);let{shapeSvg:r,bbox:e,halfPadding:s,label:p}=await G(d,t,"icon-shape default"),l=t.pos==="t",m=i+s*2,g=i+s*2,{nodeBorder:u,mainBkg:y}=c,{stylesMap:b}=yt(t),S=-g/2,N=-m/2,w=t.label?8:0,B=P.svg(r),C=k(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");let R=b.get("fill");C.stroke=R??y;let M=B.path(it(S,N,g,m,5),C),E=Math.max(g,e.width),H=m+e.height+w,W=B.rectangle(-E/2,-H/2,E,H,{...C,fill:"transparent",stroke:"none"}),j=r.insert(()=>M,":first-child").attr("class","icon-shape2"),L=r.insert(()=>W);if(t.icon){let O=r.append("g");O.html(`<g>${await dt(t.icon,{height:i,width:i,fallbackPrefix:""})}</g>`);let A=O.node().getBBox(),V=A.width,X=A.height,_=A.x,z=A.y;O.attr("transform",`translate(${-V/2-_},${l?e.height/2+w/2-X/2-z:-e.height/2-w/2-X/2-z})`),O.attr("style",`color: ${b.get("stroke")??u};`)}return p.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${l?-H/2:H/2-e.height})`),j.attr("transform",`translate(0,${l?e.height/2+w/2:-e.height/2-w/2})`),v(t,L),t.intersect=function(O){if(Y.info("iconSquare intersect",t,O),!t.label)return $.rect(t,O);let A=t.x??0,V=t.y??0,X=t.height??0,_=[];return l?_=[{x:A-e.width/2,y:V-X/2},{x:A+e.width/2,y:V-X/2},{x:A+e.width/2,y:V-X/2+e.height+w},{x:A+g/2,y:V-X/2+e.height+w},{x:A+g/2,y:V+X/2},{x:A-g/2,y:V+X/2},{x:A-g/2,y:V-X/2+e.height+w},{x:A-e.width/2,y:V-X/2+e.height+w}]:_=[{x:A-g/2,y:V-X/2},{x:A+g/2,y:V-X/2},{x:A+g/2,y:V-X/2+m},{x:A+e.width/2,y:V-X/2+m},{x:A+e.width/2/2,y:V+X/2},{x:A-e.width/2,y:V+X/2},{x:A-e.width/2,y:V-X/2+m},{x:A-g/2,y:V-X/2+m}],$.polygon(t,_,O)},r}x(Be,"iconRounded");async function Te(d,t,{config:{themeVariables:c,flowchart:h}}){let{labelStyles:a}=D(t);t.labelStyle=a;let o=t.assetHeight??48,f=t.assetWidth??48,i=Math.max(o,f),n=h?.wrappingWidth;t.width=Math.max(i,n??0);let{shapeSvg:r,bbox:e,halfPadding:s,label:p}=await G(d,t,"icon-shape default"),l=t.pos==="t",m=i+s*2,g=i+s*2,{nodeBorder:u,mainBkg:y}=c,{stylesMap:b}=yt(t),S=-g/2,N=-m/2,w=t.label?8:0,B=P.svg(r),C=k(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");let R=b.get("fill");C.stroke=R??y;let M=B.path(it(S,N,g,m,.1),C),E=Math.max(g,e.width),H=m+e.height+w,W=B.rectangle(-E/2,-H/2,E,H,{...C,fill:"transparent",stroke:"none"}),j=r.insert(()=>M,":first-child"),L=r.insert(()=>W);if(t.icon){let O=r.append("g");O.html(`<g>${await dt(t.icon,{height:i,width:i,fallbackPrefix:""})}</g>`);let A=O.node().getBBox(),V=A.width,X=A.height,_=A.x,z=A.y;O.attr("transform",`translate(${-V/2-_},${l?e.height/2+w/2-X/2-z:-e.height/2-w/2-X/2-z})`),O.attr("style",`color: ${b.get("stroke")??u};`)}return p.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${l?-H/2:H/2-e.height})`),j.attr("transform",`translate(0,${l?e.height/2+w/2:-e.height/2-w/2})`),v(t,L),t.intersect=function(O){if(Y.info("iconSquare intersect",t,O),!t.label)return $.rect(t,O);let A=t.x??0,V=t.y??0,X=t.height??0,_=[];return l?_=[{x:A-e.width/2,y:V-X/2},{x:A+e.width/2,y:V-X/2},{x:A+e.width/2,y:V-X/2+e.height+w},{x:A+g/2,y:V-X/2+e.height+w},{x:A+g/2,y:V+X/2},{x:A-g/2,y:V+X/2},{x:A-g/2,y:V-X/2+e.height+w},{x:A-e.width/2,y:V-X/2+e.height+w}]:_=[{x:A-g/2,y:V-X/2},{x:A+g/2,y:V-X/2},{x:A+g/2,y:V-X/2+m},{x:A+e.width/2,y:V-X/2+m},{x:A+e.width/2/2,y:V+X/2},{x:A-e.width/2,y:V+X/2},{x:A-e.width/2,y:V-X/2+m},{x:A-g/2,y:V-X/2+m}],$.polygon(t,_,O)},r}x(Te,"iconSquare");async function Ce(d,t,{config:{flowchart:c}}){let h=new Image;h.src=t?.img??"",await h.decode();let a=Number(h.naturalWidth.toString().replace("px","")),o=Number(h.naturalHeight.toString().replace("px",""));t.imageAspectRatio=a/o;let{labelStyles:f}=D(t);t.labelStyle=f;let i=c?.wrappingWidth;t.defaultWidth=c?.wrappingWidth;let n=Math.max(t.label?i??0:0,t?.assetWidth??a),r=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:n,e=t.constraint==="on"?r/t.imageAspectRatio:t?.assetHeight??o;t.width=Math.max(r,i??0);let{shapeSvg:s,bbox:p,label:l}=await G(d,t,"image-shape default"),m=t.pos==="t",g=-r/2,u=-e/2,y=t.label?8:0,b=P.svg(s),S=k(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let N=b.rectangle(g,u,r,e,S),w=Math.max(r,p.width),B=e+p.height+y,C=b.rectangle(-w/2,-B/2,w,B,{...S,fill:"none",stroke:"none"}),R=s.insert(()=>N,":first-child"),M=s.insert(()=>C);if(t.img){let E=s.append("image");E.attr("href",t.img),E.attr("width",r),E.attr("height",e),E.attr("preserveAspectRatio","none"),E.attr("transform",`translate(${-r/2},${m?B/2-e:-B/2})`)}return l.attr("transform",`translate(${-p.width/2-(p.x-(p.left??0))},${m?-e/2-p.height/2-y/2:e/2-p.height/2+y/2})`),R.attr("transform",`translate(0,${m?p.height/2+y/2:-p.height/2-y/2})`),v(t,M),t.intersect=function(E){if(Y.info("iconSquare intersect",t,E),!t.label)return $.rect(t,E);let H=t.x??0,W=t.y??0,j=t.height??0,L=[];return m?L=[{x:H-p.width/2,y:W-j/2},{x:H+p.width/2,y:W-j/2},{x:H+p.width/2,y:W-j/2+p.height+y},{x:H+r/2,y:W-j/2+p.height+y},{x:H+r/2,y:W+j/2},{x:H-r/2,y:W+j/2},{x:H-r/2,y:W-j/2+p.height+y},{x:H-p.width/2,y:W-j/2+p.height+y}]:L=[{x:H-r/2,y:W-j/2},{x:H+r/2,y:W-j/2},{x:H+r/2,y:W-j/2+e},{x:H+p.width/2,y:W-j/2+e},{x:H+p.width/2/2,y:W+j/2},{x:H-p.width/2,y:W+j/2},{x:H-p.width/2,y:W-j/2+e},{x:H-r/2,y:W-j/2+e}],$.polygon(t,L,E)},s}x(Ce,"imageSquare");async function Re(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c;let a=t.padding??0,o=a,f=t.look==="neo"?a*2:a,{shapeSvg:i,bbox:n}=await G(d,t,T(t)),r=Math.max(n.width+(f??0)*2,t?.width??0),e=Math.max(n.height+(o??0)*2,t?.height??0),s=[{x:0,y:0},{x:r,y:0},{x:r+3*e/6,y:-e},{x:-3*e/6,y:-e}],p,{cssStyles:l}=t;if(t.look==="handDrawn"){let m=P.svg(i),g=k(t,{}),u=I(s),y=m.path(u,g);p=i.insert(()=>y,":first-child").attr("transform",`translate(${-r/2}, ${e/2})`),l&&p.attr("style",l)}else p=et(i,r,e,s);return h&&p.attr("style",h),t.width=r,t.height=e,v(t,p),t.intersect=function(m){return $.polygon(t,s,m)},i}x(Re,"inv_trapezoid");async function pt(d,t,c){let{labelStyles:h,nodeStyles:a}=D(t);t.labelStyle=h;let{shapeSvg:o,bbox:f}=await G(d,t,T(t)),i=Math.max(f.width+c.labelPaddingX*2,t?.width||0),n=Math.max(f.height+c.labelPaddingY*2,t?.height||0),r=-i/2,e=-n/2,s,{rx:p,ry:l}=t,{cssStyles:m}=t;if(c?.rx&&c.ry&&(p=c.rx,l=c.ry),t.look==="handDrawn"){let g=P.svg(o),u=k(t,{}),y=p||l?g.path(it(r,e,i,n,p||0),u):g.rectangle(r,e,i,n,u);s=o.insert(()=>y,":first-child"),s.attr("class","basic label-container").attr("style",q(m))}else s=o.insert("rect",":first-child"),s.attr("class","basic label-container").attr("style",a).attr("rx",q(p)).attr("ry",q(l)).attr("x",r).attr("y",e).attr("width",i).attr("height",n);return v(t,s),t.calcIntersect=function(g,u){return $.rect(g,u)},t.intersect=function(g){return $.rect(t,g)},o}x(pt,"drawRect");async function Ge(d,t){let{shapeSvg:c,bbox:h,label:a}=await G(d,t,"label"),o=c.insert("rect",":first-child");return o.attr("width",.1).attr("height",.1),c.attr("class","label edgeLabel"),a.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),v(t,o),t.intersect=function(n){return $.rect(t,n)},c}x(Ge,"labelRect");async function Me(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c;let a=t.padding??0,o=a,f=t.look==="neo"?a*2:a,{shapeSvg:i,bbox:n}=await G(d,t,T(t)),r=(t?.height??n.height)+o,e=(t?.width??n.width)+f,s=[{x:0,y:0},{x:e+3*r/6,y:0},{x:e,y:-r},{x:-(3*r)/6,y:-r}],p,{cssStyles:l}=t;if(t.look==="handDrawn"){let m=P.svg(i),g=k(t,{}),u=I(s),y=m.path(u,g);p=i.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${r/2})`),l&&p.attr("style",l)}else p=et(i,e,r,s);return h&&p.attr("style",h),t.width=e,t.height=r,v(t,p),t.intersect=function(m){return $.polygon(t,s,m)},i}x(Me,"lean_left");async function Ee(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c;let a=t.padding??0,o=a,f=t.look==="neo"?a*2:a,{shapeSvg:i,bbox:n}=await G(d,t,T(t)),r=(t?.height??n.height)+o,e=(t?.width??n.width)+f,s=[{x:-3*r/6,y:0},{x:e,y:0},{x:e+3*r/6,y:-r},{x:0,y:-r}],p,{cssStyles:l}=t;if(t.look==="handDrawn"){let m=P.svg(i),g=k(t,{}),u=I(s),y=m.path(u,g);p=i.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${r/2})`),l&&p.attr("style",l)}else p=et(i,e,r,s);return h&&p.attr("style",h),t.width=e,t.height=r,v(t,p),t.intersect=function(m){return $.polygon(t,s,m)},i}x(Ee,"lean_right");function He(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.label="",t.labelStyle=c;let a=d.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,f=Math.max(35,t?.width??0),i=Math.max(35,t?.height??0),n=7,r=[{x:f,y:0},{x:0,y:i+n/2},{x:f-2*n,y:i+n/2},{x:0,y:2*i},{x:f,y:i-n/2},{x:2*n,y:i-n/2}],e=P.svg(a),s=k(t,{});t.look!=="handDrawn"&&(s.roughness=0,s.fillStyle="solid");let p=I(r),l=e.path(p,s),m=a.insert(()=>l,":first-child");return m.attr("class","outer-path"),o&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",o),h&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",h),m.attr("transform",`translate(-${f/2},${-i})`),v(t,m),t.intersect=function(g){return Y.info("lightningBolt intersect",t,g),$.polygon(t,r,g)},a}x(He,"lightningBolt");var Xs=x((d,t,c,h,a,o,f)=>[`M${d},${t+o}`,`a${a},${o} 0,0,0 ${c},0`,`a${a},${o} 0,0,0 ${-c},0`,`l0,${h}`,`a${a},${o} 0,0,0 ${c},0`,`l0,${-h}`,`M${d},${t+o+f}`,`a${a},${o} 0,0,0 ${c},0`].join(" "),"createCylinderPathD"),Ys=x((d,t,c,h,a,o,f)=>[`M${d},${t+o}`,`M${d+c},${t+o}`,`a${a},${o} 0,0,0 ${-c},0`,`l0,${h}`,`a${a},${o} 0,0,0 ${c},0`,`l0,${-h}`,`M${d},${t+o+f}`,`a${a},${o} 0,0,0 ${c},0`].join(" "),"createOuterCylinderPathD"),Fs=x((d,t,c,h,a,o)=>[`M${d-c/2},${-h/2}`,`a${a},${o} 0,0,0 ${c},0`].join(" "),"createInnerCylinderPathD"),je=10,Ae=10;async function Oe(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c;let a=t.padding??0,o=t.look==="neo"?16:a,f=t.look==="neo"?24:a;if(t.width||t.height){let y=t.width??0;t.width=(t.width??0)-o,t.width<Ae&&(t.width=Ae);let S=y/2/(2.5+y/50);t.height=(t.height??0)-f-S*3,t.height<je&&(t.height=je)}let{shapeSvg:i,bbox:n,label:r}=await G(d,t,T(t)),e=(t?.width?t?.width:n.width)+o*2,s=e/2,p=s/(2.5+e/50),l=(t?.height?t?.height:n.height)+p+f*2,m=l*.1,g,{cssStyles:u}=t;if(t.look==="handDrawn"){let y=P.svg(i),b=Ys(0,0,e,l,s,p,m),S=Fs(0,p,e,l,s,p),N=k(t,{}),w=y.path(b,N),B=y.path(S,N);i.insert(()=>B,":first-child").attr("class","line"),g=i.insert(()=>w,":first-child"),g.attr("class","basic label-container"),u&&g.attr("style",u)}else{let y=Xs(0,0,e,l,s,p,m);g=i.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",q(u)).attr("style",h)}return g.attr("label-offset-y",p),g.attr("transform",`translate(${-e/2}, ${-(l/2+p)})`),v(t,g),r.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)+p-(n.y-(n.top??0))})`),t.intersect=function(y){let b=$.rect(t,y),S=b.x-(t.x??0);if(s!=0&&(Math.abs(S)<(t.width??0)/2||Math.abs(S)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-p)){let N=p*p*(1-S*S/(s*s));N>0&&(N=Math.sqrt(N)),N=p-N,y.y-(t.y??0)>0&&(N=-N),b.y+=N}return b},i}x(Oe,"linedCylinder");async function Le(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c;let a=t.padding??0,o=t.look==="neo"?16:a,f=t.look==="neo"?12:a;if(t.width||t.height){let N=t.width;t.width=(N??0)*10/11-o*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-f*2,t.height<10&&(t.height=10)}let{shapeSvg:i,bbox:n,label:r}=await G(d,t,T(t)),e=(t?.width?t?.width:n.width)+(o??0)*2,s=(t?.height?t?.height:n.height)+(f??0)*2,p=t.look==="neo"?s/4:s/8,l=s+p,{cssStyles:m}=t,g=P.svg(i),u=k(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let y=[{x:-e/2-e/2*.1,y:-l/2},{x:-e/2-e/2*.1,y:l/2},...at(-e/2-e/2*.1,l/2,e/2+e/2*.1,l/2,p,.8),{x:e/2+e/2*.1,y:-l/2},{x:-e/2-e/2*.1,y:-l/2},{x:-e/2,y:-l/2},{x:-e/2,y:l/2*1.1},{x:-e/2,y:-l/2}],b=g.polygon(y.map(N=>[N.x,N.y]),u),S=i.insert(()=>b,":first-child");return S.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",m),h&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",h),S.attr("transform",`translate(0,${-p/2})`),r.attr("transform",`translate(${-e/2+(t.padding??0)+e/2*.1/2-(n.x-(n.left??0))},${-s/2+(t.padding??0)-p/2-(n.y-(n.top??0))})`),v(t,S),t.intersect=function(N){return $.polygon(t,y,N)},i}x(Le,"linedWaveEdgedRect");async function Ve(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c;let a=t.padding??0,o=t.look==="neo"?16:a,f=t.look==="neo"?12:a,i=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-2*i,10),t.height=Math.max((t?.height??0)-f*2-2*i,10));let{shapeSvg:n,bbox:r,label:e}=await G(d,t,T(t)),s=(t?.width?t?.width:r.width)+o*2+2*i,p=(t?.height?t?.height:r.height)+f*2+2*i,l=s-2*i,m=p-2*i,g=-l/2,u=-m/2,{cssStyles:y}=t,b=P.svg(n),S=k(t,{}),N=[{x:g-i,y:u+i},{x:g-i,y:u+m+i},{x:g+l-i,y:u+m+i},{x:g+l-i,y:u+m},{x:g+l,y:u+m},{x:g+l,y:u+m-i},{x:g+l+i,y:u+m-i},{x:g+l+i,y:u-i},{x:g+i,y:u-i},{x:g+i,y:u},{x:g,y:u},{x:g,y:u+i}],w=[{x:g,y:u+i},{x:g+l-i,y:u+i},{x:g+l-i,y:u+m},{x:g+l,y:u+m},{x:g+l,y:u},{x:g,y:u}];t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let B=I(N),C=b.path(B,S),R=I(w),M=b.path(R,S);t.look!=="handDrawn"&&(C=Wt(C),M=Wt(M));let E=n.insert("g",":first-child");return E.insert(()=>C),E.insert(()=>M),E.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",y),h&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",h),e.attr("transform",`translate(${-(r.width/2)-i-(r.x-(r.left??0))}, ${-(r.height/2)+i-(r.y-(r.top??0))})`),v(t,E),t.intersect=function(H){return $.polygon(t,N,H)},n}x(Ve,"multiRect");async function Ie(d,t){let{labelStyles:c,nodeStyles:h}=D(t);t.labelStyle=c;let{shapeSvg:a,bbox:o,label:f}=await G(d,t,T(t)),i=t.padding??0,n=t.look==="neo"?16:i,r=t.look==="neo"?12:i,e=!0;(t.width||t.height)&&(e=!1,t.width=(t?.width??0)-n*2,t.height=(t?.height??0)-r*3);let s=Math.max(o.width,t?.width??0)+n*2,p=Math.max(o.height,t?.height??0)+r*3,l=t.look==="neo"?p/4:p/8,m=p+(e?l/2:-l/2),g=-s/2,u=-m/2,y=10,{cssStyles:b}=t,S=at(g-y,u+m+y,g+s-y,u+m+y,l,.8),N=S?.[S.length-1],w=[{x:g-y,y:u+y},{x:g-y,y:u+m+y},...S,{x:g+s-y,y:N.y-y},{x:g+s,y:N.y-y},{x:g+s,y:N.y-2*y},{x:g+s+y,y:N.y-2*y},{x:g+s+y,y:u-y},{x:g+y,y:u-y},{x:g+y,y:u},{x:g,y:u},{x:g,y:u+y}],B=[{x:g,y:u+y},{x:g+s-y,y:u+y},{x:g+s-y,y:N.y-y},{x:g+s,y:N.y-y},{x:g+s,y:u},{x:g,y:u}],C=P.svg(a),R=k(t,{});t.look!=="handDrawn"&&(R.roughness=0,R.fillStyle="solid");let M=I(w),E=C.path(M,R),H=I(B),W=C.path(H,R),j=a.insert(()=>E,":first-child");return j.insert(()=>W),j.attr("class","basic label-container outer-path"),b&&t.look!=="handDrawn"&&j.selectAll("path").attr("style",b),h&&t.look!=="handDrawn"&&j.selectAll("path").attr("style",h),j.attr("transform",`translate(0,${-l/2})`),f.attr("transform",`translate(${-(o.width/2)-y-(o.x-(o.left??0))}, ${-(o.height/2)+y-l/2-(o.y-(o.top??0))})`),v(t,j),t.intersect=function(L){return $.polygon(t,w,L)},a}x(Ie,"multiWaveEdgedRectangle");async function We(d,t,{config:{themeVariables:c}}){let{labelStyles:h,nodeStyles:a}=D(t);t.labelStyle=h,t.useHtmlLabels||tt(ft(