UNPKG

@eventcatalogtest/studio

Version:

A drag and drop UI for distributed systems that keeps your diagrams where they belong – in your repo

2 lines 89.5 kB
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1946],{91703:(t,e,a)=>{a.d(e,{DA:()=>b,IU:()=>B,U:()=>K,U7:()=>en,U_:()=>eh,Zk:()=>d,aP:()=>el,gh:()=>es,lC:()=>g,on:()=>ei});var l=a(52418),r=a(75982),i=a(37389),n=a(25381),s=a(52357),h=a(40139),o=a(78588),d=(0,s.K2)(async(t,e,a)=>{let l,r=e.useHtmlLabels||(0,s._3)((0,s.D7)()?.htmlLabels),o=t.insert("g").attr("class",a||"node default").attr("id",e.domId||e.id),d=o.insert("g").attr("class","label").attr("style",(0,n.KL)(e.labelStyle));l=void 0===e.label?"":"string"==typeof e.label?e.label:e.label[0];let c=await (0,i.GZ)(d,(0,s.jZ)((0,n.Sm)(l),(0,s.D7)()),{useHtmlLabels:r,width:e.width||(0,s.D7)().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:e.labelStyle,addSvgBackground:!!e.icon||!!e.img}),g=c.getBBox(),y=(e?.padding??0)/2;if(r){let t=c.children[0],e=(0,h.Ltv)(c),a=t.getElementsByTagName("img");if(a){let t=""===l.replace(/<img[^>]*>/g,"").trim();await Promise.all([...a].map(e=>new Promise(a=>{function l(){if(e.style.display="flex",e.style.flexDirection="column",t){let t=(0,s.D7)().fontSize?(0,s.D7)().fontSize:window.getComputedStyle(document.body).fontSize,[a=s.UI.fontSize]=(0,n.I5)(t),l=5*a+"px";e.style.minWidth=l,e.style.maxWidth=l}else e.style.width="100%";a(e)}(0,s.K2)(l,"setupImage"),setTimeout(()=>{e.complete&&l()}),e.addEventListener("error",l),e.addEventListener("load",l)})))}g=t.getBoundingClientRect(),e.attr("width",g.width),e.attr("height",g.height)}return r?d.attr("transform","translate("+-g.width/2+", "+-g.height/2+")"):d.attr("transform","translate(0, "+-g.height/2+")"),e.centerLabel&&d.attr("transform","translate("+-g.width/2+", "+-g.height/2+")"),d.insert("rect",":first-child"),{shapeSvg:o,bbox:g,halfPadding:y,label:d}},"labelHelper"),c=(0,s.K2)(async(t,e,a)=>{let l=a.useHtmlLabels||(0,s._3)((0,s.D7)()?.flowchart?.htmlLabels),r=t.insert("g").attr("class","label").attr("style",a.labelStyle||""),o=await (0,i.GZ)(r,(0,s.jZ)((0,n.Sm)(e),(0,s.D7)()),{useHtmlLabels:l,width:a.width||(0,s.D7)()?.flowchart?.wrappingWidth,style:a.labelStyle,addSvgBackground:!!a.icon||!!a.img}),d=o.getBBox(),c=a.padding/2;if((0,s._3)((0,s.D7)()?.flowchart?.htmlLabels)){let t=o.children[0],e=(0,h.Ltv)(o);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}return l?r.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):r.attr("transform","translate(0, "+-d.height/2+")"),a.centerLabel&&r.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),r.insert("rect",":first-child"),{shapeSvg:t,bbox:d,halfPadding:c,label:r}},"insertLabel"),g=(0,s.K2)((t,e)=>{let a=e.node().getBBox();t.width=a.width,t.height=a.height},"updateNodeBounds"),y=(0,s.K2)((t,e)=>("handDrawn"===t.look?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function f(t){let e=t.map((t,e)=>`${0===e?"M":"L"}${t.x},${t.y}`);return e.push("Z"),e.join(" ")}function p(t,e,a,l,r,i){let n=[],s=a-t,h=2*Math.PI/(s/i),o=e+(l-e)/2;for(let e=0;e<=50;e++){let a=t+e/50*s,l=o+r*Math.sin(h*(a-t));n.push({x:a,y:l})}return n}function m(t,e,a,l,r,i){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}(0,s.K2)(f,"createPathFromPoints"),(0,s.K2)(p,"generateFullSineWavePoints"),(0,s.K2)(m,"generateCirclePoints");var u=(0,s.K2)((t,e)=>{var a,l,r=t.x,i=t.y,n=e.x-r,s=e.y-i,h=t.width/2,o=t.height/2;return Math.abs(s)*h>Math.abs(n)*o?(s<0&&(o=-o),a=0===s?0:o*n/s,l=o):(n<0&&(h=-h),a=h,l=0===n?0:h*s/n),{x:r+a,y:i+l}},"intersectRect");function x(t,e){e&&t.attr("style",e)}async function w(t){let e=(0,h.Ltv)(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),a=e.append("xhtml:div"),l=t.label;t.label&&(0,s.Wi)(t.label)&&(l=await (0,s.VJ)(t.label.replace(s.Y2.lineBreakRegex,"\n"),(0,s.D7)()));let r=t.isNode?"nodeLabel":"edgeLabel";return a.html('<span class="'+r+'" '+(t.labelStyle?'style="'+t.labelStyle+'"':"")+">"+l+"</span>"),x(a,t.labelStyle),a.style("display","inline-block"),a.style("padding-right","1px"),a.style("white-space","nowrap"),a.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}(0,s.K2)(x,"applyStyle"),(0,s.K2)(w,"addHtmlLabel");var b=(0,s.K2)(async(t,e,a,l)=>{let r=t||"";if("object"==typeof r&&(r=r[0]),(0,s._3)((0,s.D7)().flowchart.htmlLabels)){r=r.replace(/\\n|\n/g,"<br />"),s.Rm.info("vertexText"+r);let t={isNode:l,label:(0,n.Sm)(r).replace(/fa[blrs]?:fa-[\w-]+/g,t=>`<i class='${t.replace(":"," ")}'></i>`),labelStyle:e?e.replace("fill:","color:"):e};return await w(t)}{let t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));for(let e of"string"==typeof r?r.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(r)?r:[]){let l=document.createElementNS("http://www.w3.org/2000/svg","tspan");l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),l.setAttribute("dy","1em"),l.setAttribute("x","0"),a?l.setAttribute("class","title-row"):l.setAttribute("class","row"),l.textContent=e.trim(),t.appendChild(l)}return t}},"createLabel"),$=(0,s.K2)((t,e,a,l,r)=>["M",t+r,e,"H",t+a-r,"A",r,r,"0 0 1",t+a,e+r,"V",e+l-r,"A",r,r,"0 0 1",t+a-r,e+l,"H",t+r,"A",r,r,"0 0 1",t,e+l-r,"V",e+r,"A",r,r,"0 0 1",t+r,e,"Z"].join(" "),"createRoundedRectPathD"),k=(0,s.K2)(async(t,e)=>{let a;s.Rm.info("Creating subgraph rect for ",e.id,e);let n=(0,s.D7)(),{themeVariables:d,handDrawnSeed:c}=n,{clusterBkg:g,clusterBorder:y}=d,{labelStyles:f,nodeStyles:p,borderStyles:m,backgroundStyles:x}=(0,r.GX)(e),w=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),b=(0,s._3)(n.flowchart.htmlLabels),k=w.insert("g").attr("class","cluster-label "),M=await (0,i.GZ)(k,e.label,{style:e.labelStyle,useHtmlLabels:b,isNode:!0}),S=M.getBBox();if((0,s._3)(n.flowchart.htmlLabels)){let t=M.children[0],e=(0,h.Ltv)(M);S=t.getBoundingClientRect(),e.attr("width",S.width),e.attr("height",S.height)}let D=e.width<=S.width+e.padding?S.width+e.padding:e.width;e.width<=S.width+e.padding?e.diff=(D-e.width)/2-e.padding:e.diff=-e.padding;let A=e.height,v=e.x-D/2,K=e.y-A/2;if(s.Rm.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){let t=o.A.svg(w),l=(0,r.Fr)(e,{roughness:.7,fill:g,stroke:y,fillWeight:3,seed:c}),i=t.path($(v,K,D,A,0),l);(a=w.insert(()=>(s.Rm.debug("Rough node insert CXC",i),i),":first-child")).select("path:nth-child(2)").attr("style",m.join(";")),a.select("path").attr("style",x.join(";").replace("fill","stroke"))}else(a=w.insert("rect",":first-child")).attr("style",p).attr("rx",e.rx).attr("ry",e.ry).attr("x",v).attr("y",K).attr("width",D).attr("height",A);let{subGraphTitleTopMargin:B}=(0,l.O)(n);if(k.attr("transform",`translate(${e.x-S.width/2}, ${e.y-e.height/2+B})`),f){let t=k.select("span");t&&t.attr("style",f)}let C=a.node().getBBox();return e.offsetX=0,e.width=C.width,e.height=C.height,e.offsetY=S.height-e.padding/2,e.intersect=function(t){return u(e,t)},{cluster:w,labelBBox:S}},"rect"),M=(0,s.K2)((t,e)=>{let a=t.insert("g").attr("class","note-cluster").attr("id",e.id),l=a.insert("rect",":first-child"),r=0*e.padding,i=r/2;l.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-i).attr("y",e.y-e.height/2-i).attr("width",e.width+r).attr("height",e.height+r).attr("fill","none");let n=l.node().getBBox();return e.width=n.width,e.height=n.height,e.intersect=function(t){return u(e,t)},{cluster:a,labelBBox:{width:0,height:0}}},"noteGroup"),S=(0,s.K2)(async(t,e)=>{let a,l=(0,s.D7)(),{themeVariables:r,handDrawnSeed:i}=l,{altBackground:n,compositeBackground:d,compositeTitleBackground:c,nodeBorder:g}=r,y=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),f=y.insert("g",":first-child"),p=y.insert("g").attr("class","cluster-label"),m=y.append("rect"),x=p.node().appendChild(await b(e.label,e.labelStyle,void 0,!0)),w=x.getBBox();if((0,s._3)(l.flowchart.htmlLabels)){let t=x.children[0],e=(0,h.Ltv)(x);w=t.getBoundingClientRect(),e.attr("width",w.width),e.attr("height",w.height)}let k=0*e.padding,M=(e.width<=w.width+e.padding?w.width+e.padding:e.width)+k;e.width<=w.width+e.padding?e.diff=(M-e.width)/2-e.padding:e.diff=-e.padding;let S=e.height+k,D=e.height+k-w.height-6,A=e.x-M/2,v=e.y-S/2;e.width=M;let K=e.y-e.height/2-k/2+w.height+2;if("handDrawn"===e.look){let t=e.cssClasses.includes("statediagram-cluster-alt"),l=o.A.svg(y),r=e.rx||e.ry?l.path($(A,v,M,S,10),{roughness:.7,fill:c,fillStyle:"solid",stroke:g,seed:i}):l.rectangle(A,v,M,S,{seed:i});a=y.insert(()=>r,":first-child");let s=l.rectangle(A,K,M,D,{fill:t?n:d,fillStyle:t?"hachure":"solid",stroke:g,seed:i});a=y.insert(()=>r,":first-child"),m=y.insert(()=>s)}else(a=f.insert("rect",":first-child")).attr("class","outer").attr("x",A).attr("y",v).attr("width",M).attr("height",S).attr("data-look",e.look),m.attr("class","inner").attr("x",A).attr("y",K).attr("width",M).attr("height",D);return p.attr("transform",`translate(${e.x-w.width/2}, ${v+1-3*!(0,s._3)(l.flowchart.htmlLabels)})`),e.height=a.node().getBBox().height,e.offsetX=0,e.offsetY=w.height-e.padding/2,e.labelBBox=w,e.intersect=function(t){return u(e,t)},{cluster:y,labelBBox:w}},"roundedWithTitle"),D=(0,s.K2)(async(t,e)=>{let a;s.Rm.info("Creating subgraph rect for ",e.id,e);let n=(0,s.D7)(),{themeVariables:d,handDrawnSeed:c}=n,{clusterBkg:g,clusterBorder:y}=d,{labelStyles:f,nodeStyles:p,borderStyles:m,backgroundStyles:x}=(0,r.GX)(e),w=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),b=(0,s._3)(n.flowchart.htmlLabels),k=w.insert("g").attr("class","cluster-label "),M=await (0,i.GZ)(k,e.label,{style:e.labelStyle,useHtmlLabels:b,isNode:!0,width:e.width}),S=M.getBBox();if((0,s._3)(n.flowchart.htmlLabels)){let t=M.children[0],e=(0,h.Ltv)(M);S=t.getBoundingClientRect(),e.attr("width",S.width),e.attr("height",S.height)}let D=e.width<=S.width+e.padding?S.width+e.padding:e.width;e.width<=S.width+e.padding?e.diff=(D-e.width)/2-e.padding:e.diff=-e.padding;let A=e.height,v=e.x-D/2,K=e.y-A/2;if(s.Rm.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){let t=o.A.svg(w),l=(0,r.Fr)(e,{roughness:.7,fill:g,stroke:y,fillWeight:4,seed:c}),i=t.path($(v,K,D,A,e.rx),l);(a=w.insert(()=>(s.Rm.debug("Rough node insert CXC",i),i),":first-child")).select("path:nth-child(2)").attr("style",m.join(";")),a.select("path").attr("style",x.join(";").replace("fill","stroke"))}else(a=w.insert("rect",":first-child")).attr("style",p).attr("rx",e.rx).attr("ry",e.ry).attr("x",v).attr("y",K).attr("width",D).attr("height",A);let{subGraphTitleTopMargin:B}=(0,l.O)(n);if(k.attr("transform",`translate(${e.x-S.width/2}, ${e.y-e.height/2+B})`),f){let t=k.select("span");t&&t.attr("style",f)}let C=a.node().getBBox();return e.offsetX=0,e.width=C.width,e.height=C.height,e.offsetY=S.height-e.padding/2,e.intersect=function(t){return u(e,t)},{cluster:w,labelBBox:S}},"kanbanSection"),A={rect:k,squareRect:k,roundedWithTitle:S,noteGroup:M,divider:(0,s.K2)((t,e)=>{let a,{themeVariables:l,handDrawnSeed:r}=(0,s.D7)(),{nodeBorder:i}=l,n=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),h=n.insert("g",":first-child"),d=0*e.padding,c=e.width+d;e.diff=-e.padding;let g=e.height+d,y=e.x-c/2,f=e.y-g/2;if(e.width=c,"handDrawn"===e.look){let t=o.A.svg(n).rectangle(y,f,c,g,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:i,seed:r});a=n.insert(()=>t,":first-child")}else(a=h.insert("rect",":first-child")).attr("class","divider").attr("x",y).attr("y",f).attr("width",c).attr("height",g).attr("data-look",e.look);return e.height=a.node().getBBox().height,e.offsetX=0,e.offsetY=0,e.intersect=function(t){return u(e,t)},{cluster:n,labelBBox:{}}},"divider"),kanbanSection:D},v=new Map,K=(0,s.K2)(async(t,e)=>{let a=e.shape||"rect",l=await A[a](t,e);return v.set(e.id,l),l},"insertCluster"),B=(0,s.K2)(()=>{v=new Map},"clear");function C(t,e,a,l){var r=t.x,i=t.y,n=r-l.x,s=i-l.y,h=Math.sqrt(e*e*s*s+a*a*n*n),o=Math.abs(e*a*n/h);l.x<r&&(o=-o);var d=Math.abs(e*a*s/h);return l.y<i&&(d=-d),{x:r+o,y:i+d}}function L(t,e,a){return C(t,e,e,a)}function N(t,e,a,l){var r,i,n,s,h,o,d,c,g,y,f,p,m;if(r=e.y-t.y,n=t.x-e.x,h=e.x*t.y-t.x*e.y,g=r*a.x+n*a.y+h,y=r*l.x+n*l.y+h,!(0!==g&&0!==y&&R(g,y))){if((i=l.y-a.y,s=a.x-l.x,o=l.x*a.y-a.x*l.y,d=i*t.x+s*t.y+o,c=i*e.x+s*e.y+o,!(0!==d&&0!==c&&R(d,c)))&&0!=(f=r*s-i*n))return p=Math.abs(f/2),{x:(m=n*o-s*h)<0?(m-p)/f:(m+p)/f,y:(m=i*h-r*o)<0?(m-p)/f:(m+p)/f}}}function R(t,e){return t*e>0}function P(t,e,a){let l=t.x,r=t.y,i=[],n=1/0,s=1/0;"function"==typeof e.forEach?e.forEach(function(t){n=Math.min(n,t.x),s=Math.min(s,t.y)}):(n=Math.min(n,e.x),s=Math.min(s,e.y));let h=l-t.width/2-n,o=r-t.height/2-s;for(let l=0;l<e.length;l++){let r=e[l],n=e[l<e.length-1?l+1:0],s=N(t,a,{x:h+r.x,y:o+r.y},{x:h+n.x,y:o+n.y});s&&i.push(s)}return i.length?(i.length>1&&i.sort(function(t,e){let l=t.x-a.x,r=t.y-a.y,i=Math.sqrt(l*l+r*r),n=e.x-a.x,s=e.y-a.y,h=Math.sqrt(n*n+s*s);return i<h?-1:+(i!==h)}),i[0]):t}(0,s.K2)(function(t,e){return t.intersect(e)},"intersectNode"),(0,s.K2)(C,"intersectEllipse"),(0,s.K2)(L,"intersectCircle"),(0,s.K2)(N,"intersectLine"),(0,s.K2)(R,"sameSign"),(0,s.K2)(P,"intersectPolygon");var F={circle:L,polygon:P,rect:u};function X(t,e){let{labelStyles:a}=(0,r.GX)(e);e.labelStyle=a;let l=y(e),i=l;l||(i="anchor");let h=t.insert("g").attr("class",i).attr("id",e.domId||e.id),{cssStyles:d}=e,c=o.A.svg(h),f=(0,r.Fr)(e,{fill:"black",stroke:"none",fillStyle:"solid"});"handDrawn"!==e.look&&(f.roughness=0);let p=c.circle(0,0,2,f),m=h.insert(()=>p,":first-child");return m.attr("class","anchor").attr("style",(0,n.KL)(d)),g(e,m),e.intersect=function(t){return s.Rm.info("Circle intersect",e,1,t),F.circle(e,1,t)},h}function G(t,e,a,l,r,i,n){let s=Math.atan2(l-e,a-t),h=Math.sqrt(((a-t)/2/r)**2+((l-e)/2/i)**2);if(h>1)throw Error("The given radii are too small to create an arc between the points.");let o=Math.sqrt(1-h**2),d=(t+a)/2+o*i*Math.sin(s)*(n?-1:1),c=(e+l)/2-o*r*Math.cos(s)*(n?-1:1),g=Math.atan2((e-c)/i,(t-d)/r),y=Math.atan2((l-c)/i,(a-d)/r)-g;n&&y<0&&(y+=2*Math.PI),!n&&y>0&&(y-=2*Math.PI);let f=[];for(let t=0;t<20;t++){let e=g+t/19*y,a=d+r*Math.cos(e),l=c+i*Math.sin(e);f.push({x:a,y:l})}return f}async function T(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.GX)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=n.width+e.padding+20,h=n.height+e.padding,c=h/2,p=c/(2.5+h/50),{cssStyles:m}=e,u=[{x:s/2,y:-h/2},{x:-s/2,y:-h/2},...G(-s/2,-h/2,-s/2,h/2,p,c,!1),{x:s/2,y:h/2},...G(s/2,h/2,s/2,-h/2,p,c,!0)],x=o.A.svg(i),w=(0,r.Fr)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=f(u),$=x.path(b,w),k=i.insert(()=>$,":first-child");return k.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),k.attr("transform",`translate(${p/2}, 0)`),g(e,k),e.intersect=function(t){return F.polygon(e,u,t)},i}function W(t,e,a,l){return t.insert("polygon",":first-child").attr("points",l.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+a/2+")")}async function I(t,e){let a,{labelStyles:l,nodeStyles:i}=(0,r.GX)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=s.height+e.padding,c=s.width+e.padding+12,p=-h,m=[{x:12,y:p},{x:c,y:p},{x:c,y:0},{x:0,y:0},{x:0,y:p+12},{x:12,y:p}],{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.A.svg(n),l=(0,r.Fr)(e,{}),i=f(m),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),u&&a.attr("style",u)}else a=W(n,c,h,m);return i&&a.attr("style",i),g(e,a),e.intersect=function(t){return F.polygon(e,m,t)},n}function _(t,e){let{nodeStyles:a}=(0,r.GX)(e);e.label="";let l=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,n=Math.max(28,e.width??0),s=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}],h=o.A.svg(l),d=(0,r.Fr)(e,{});"handDrawn"!==e.look&&(d.roughness=0,d.fillStyle="solid");let c=f(s),g=h.path(c,d),p=l.insert(()=>g,":first-child");return i&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",i),a&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",a),e.width=28,e.height=28,e.intersect=function(t){return F.polygon(e,s,t)},l}async function E(t,e){let a,{labelStyles:l,nodeStyles:i}=(0,r.GX)(e);e.labelStyle=l;let{shapeSvg:h,bbox:c,halfPadding:f}=await d(t,e,y(e)),p=c.width/2+f,{cssStyles:m}=e;if("handDrawn"===e.look){let t=o.A.svg(h),l=(0,r.Fr)(e,{}),i=t.circle(0,0,2*p,l);(a=h.insert(()=>i,":first-child")).attr("class","basic label-container").attr("style",(0,n.KL)(m))}else a=h.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",p).attr("cx",0).attr("cy",0);return g(e,a),e.intersect=function(t){return s.Rm.info("Circle intersect",e,p,t),F.circle(e,p,t)},h}function H(t){let e=Math.cos(Math.PI/4),a=Math.sin(Math.PI/4),l=2*t,r={x:l/2*e,y:l/2*a},i={x:-(l/2)*e,y:l/2*a},n={x:-(l/2)*e,y:-(l/2)*a},s={x:l/2*e,y:-(l/2)*a};return`M ${i.x},${i.y} L ${s.x},${s.y} M ${r.x},${r.y} L ${n.x},${n.y}`}function j(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.GX)(e);e.labelStyle=a,e.label="";let i=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),n=Math.max(30,e?.width??0),{cssStyles:h}=e,d=o.A.svg(i),c=(0,r.Fr)(e,{});"handDrawn"!==e.look&&(c.roughness=0,c.fillStyle="solid");let f=d.circle(0,0,2*n,c),p=H(n),m=d.path(p,c),u=i.insert(()=>f,":first-child");return u.insert(()=>m),h&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",h),l&&"handDrawn"!==e.look&&u.selectAll("path").attr("style",l),g(e,u),e.intersect=function(t){return s.Rm.info("crossedCircle intersect",e,{radius:n,point:t}),F.circle(e,n,t)},i}function z(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}async function q(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.GX)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=n.width+(e.padding??0),c=n.height+(e.padding??0),p=Math.max(5,.1*c),{cssStyles:m}=e,u=[...z(h/2,-c/2,p,30,-90,0),{x:-h/2-p,y:p},...z(h/2+2*p,-p,p,20,-180,-270),...z(h/2+2*p,p,p,20,-90,-180),{x:-h/2-p,y:-c/2},...z(h/2,c/2,p,20,0,90)],x=[{x:h/2,y:-c/2-p},{x:-h/2,y:-c/2-p},...z(h/2,-c/2,p,20,-90,0),{x:-h/2-p,y:-p},...z(h/2+.1*h,-p,p,20,-180,-270),...z(h/2+.1*h,p,p,20,-90,-180),{x:-h/2-p,y:c/2},...z(h/2,c/2,p,20,0,90),{x:-h/2,y:c/2+p},{x:h/2,y:c/2+p}],w=o.A.svg(i),b=(0,r.Fr)(e,{fill:"none"});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=f(u).replace("Z",""),k=w.path($,b),M=f(x),S=w.path(M,{...b}),D=i.insert("g",":first-child");return D.insert(()=>S,":first-child").attr("stroke-opacity",0),D.insert(()=>k,":first-child"),D.attr("class","text"),m&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",l),D.attr("transform",`translate(${p}, 0)`),s.attr("transform",`translate(${-h/2+p-(n.x-(n.left??0))},${-c/2+(e.padding??0)/2-(n.y-(n.top??0))})`),g(e,D),e.intersect=function(t){return F.polygon(e,x,t)},i}function O(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:i,y:o})}return n}async function Z(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.GX)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=n.width+(e.padding??0),c=n.height+(e.padding??0),p=Math.max(5,.1*c),{cssStyles:m}=e,u=[...O(h/2,-c/2,p,20,-90,0),{x:h/2+p,y:-p},...O(h/2+2*p,-p,p,20,-180,-270),...O(h/2+2*p,p,p,20,-90,-180),{x:h/2+p,y:c/2},...O(h/2,c/2,p,20,0,90)],x=[{x:-h/2,y:-c/2-p},{x:h/2,y:-c/2-p},...O(h/2,-c/2,p,20,-90,0),{x:h/2+p,y:-p},...O(h/2+2*p,-p,p,20,-180,-270),...O(h/2+2*p,p,p,20,-90,-180),{x:h/2+p,y:c/2},...O(h/2,c/2,p,20,0,90),{x:h/2,y:c/2+p},{x:-h/2,y:c/2+p}],w=o.A.svg(i),b=(0,r.Fr)(e,{fill:"none"});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=f(u).replace("Z",""),k=w.path($,b),M=f(x),S=w.path(M,{...b}),D=i.insert("g",":first-child");return D.insert(()=>S,":first-child").attr("stroke-opacity",0),D.insert(()=>k,":first-child"),D.attr("class","text"),m&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",l),D.attr("transform",`translate(${-p}, 0)`),s.attr("transform",`translate(${-h/2+(e.padding??0)/2-(n.x-(n.left??0))},${-c/2+(e.padding??0)/2-(n.y-(n.top??0))})`),g(e,D),e.intersect=function(t){return F.polygon(e,x,t)},i}function Y(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}async function U(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.GX)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=n.width+(e.padding??0),c=n.height+(e.padding??0),p=Math.max(5,.1*c),{cssStyles:m}=e,u=[...Y(h/2,-c/2,p,30,-90,0),{x:-h/2-p,y:p},...Y(h/2+2*p,-p,p,20,-180,-270),...Y(h/2+2*p,p,p,20,-90,-180),{x:-h/2-p,y:-c/2},...Y(h/2,c/2,p,20,0,90)],x=[...Y(-h/2+p+p/2,-c/2,p,20,-90,-180),{x:h/2-p/2,y:p},...Y(-h/2-p/2,-p,p,20,0,90),...Y(-h/2-p/2,p,p,20,-90,0),{x:h/2-p/2,y:-p},...Y(-h/2+p+p/2,c/2,p,30,-180,-270)],w=[{x:h/2,y:-c/2-p},{x:-h/2,y:-c/2-p},...Y(h/2,-c/2,p,20,-90,0),{x:-h/2-p,y:-p},...Y(h/2+2*p,-p,p,20,-180,-270),...Y(h/2+2*p,p,p,20,-90,-180),{x:-h/2-p,y:c/2},...Y(h/2,c/2,p,20,0,90),{x:-h/2,y:c/2+p},{x:h/2-p-p/2,y:c/2+p},...Y(-h/2+p+p/2,-c/2,p,20,-90,-180),{x:h/2-p/2,y:p},...Y(-h/2-p/2,-p,p,20,0,90),...Y(-h/2-p/2,p,p,20,-90,0),{x:h/2-p/2,y:-p},...Y(-h/2+p+p/2,c/2,p,30,-180,-270)],b=o.A.svg(i),$=(0,r.Fr)(e,{fill:"none"});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let k=f(u).replace("Z",""),M=b.path(k,$),S=f(x).replace("Z",""),D=b.path(S,$),A=f(w),v=b.path(A,{...$}),K=i.insert("g",":first-child");return K.insert(()=>v,":first-child").attr("stroke-opacity",0),K.insert(()=>M,":first-child"),K.insert(()=>D,":first-child"),K.attr("class","text"),m&&"handDrawn"!==e.look&&K.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&K.selectAll("path").attr("style",l),K.attr("transform",`translate(${p-p/4}, 0)`),s.attr("transform",`translate(${-h/2+(e.padding??0)/2-(n.x-(n.left??0))},${-c/2+(e.padding??0)/2-(n.y-(n.top??0))})`),g(e,K),e.intersect=function(t){return F.polygon(e,w,t)},i}async function J(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.GX)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),s=Math.max(80,(n.width+(e.padding??0)*2)*1.25,e?.width??0),h=Math.max(20,n.height+(e.padding??0)*2,e?.height??0),c=h/2,{cssStyles:p}=e,u=o.A.svg(i),x=(0,r.Fr)(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=s-c,b=h/4,$=[{x:w,y:0},{x:b,y:0},{x:0,y:h/2},{x:b,y:h},{x:w,y:h},...m(-w,-h/2,c,50,270,90)],k=f($),M=u.path(k,x),S=i.insert(()=>M,":first-child");return S.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",p),l&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",l),S.attr("transform",`translate(${-s/2}, ${-h/2})`),g(e,S),e.intersect=function(t){return F.polygon(e,$,t)},i}(0,s.K2)(X,"anchor"),(0,s.K2)(G,"generateArcPoints"),(0,s.K2)(T,"bowTieRect"),(0,s.K2)(W,"insertPolygonShape"),(0,s.K2)(I,"card"),(0,s.K2)(_,"choice"),(0,s.K2)(E,"circle"),(0,s.K2)(H,"createLine"),(0,s.K2)(j,"crossedCircle"),(0,s.K2)(z,"generateCirclePoints"),(0,s.K2)(q,"curlyBraceLeft"),(0,s.K2)(O,"generateCirclePoints"),(0,s.K2)(Z,"curlyBraceRight"),(0,s.K2)(Y,"generateCirclePoints"),(0,s.K2)(U,"curlyBraces"),(0,s.K2)(J,"curvedTrapezoid");var V=(0,s.K2)((t,e,a,l,r,i)=>`M${t},${e+i} a${r},${i} 0,0,0 ${a},0 a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l}`,"createCylinderPathD"),Q=(0,s.K2)((t,e,a,l,r,i)=>`M${t},${e+i} M${t+a},${e+i} a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l}`,"createOuterCylinderPathD"),tt=(0,s.K2)((t,e,a,l,r,i)=>`M${t-a/2},${-l/2} a${r},${i} 0,0,0 ${a},0`,"createInnerCylinderPathD");async function te(t,e){let a,{labelStyles:l,nodeStyles:i}=(0,r.GX)(e);e.labelStyle=l;let{shapeSvg:s,bbox:h,label:c}=await d(t,e,y(e)),f=Math.max(h.width+e.padding,e.width??0),p=f/2,m=p/(2.5+f/50),u=Math.max(h.height+m+e.padding,e.height??0),{cssStyles:x}=e;if("handDrawn"===e.look){let t=o.A.svg(s),l=Q(0,0,f,u,p,m),i=tt(0,m,f,u,p,m),n=t.path(l,(0,r.Fr)(e,{})),h=t.path(i,(0,r.Fr)(e,{fill:"none"}));a=s.insert(()=>h,":first-child"),(a=s.insert(()=>n,":first-child")).attr("class","basic label-container"),x&&a.attr("style",x)}else{let t=V(0,0,f,u,p,m);a=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,n.KL)(x)).attr("style",i)}return a.attr("label-offset-y",m),a.attr("transform",`translate(${-f/2}, ${-(u/2+m)})`),g(e,a),c.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)+(e.padding??0)/1.5-(h.y-(h.top??0))})`),e.intersect=function(t){let a=F.rect(e,t),l=a.x-(e.x??0);if(0!=p&&(Math.abs(l)<(e.width??0)/2||Math.abs(l)==(e.width??0)/2&&Math.abs(a.y-(e.y??0))>(e.height??0)/2-m)){let r=m*m*(1-l*l/(p*p));r>0&&(r=Math.sqrt(r)),r=m-r,t.y-(e.y??0)>0&&(r=-r),a.y+=r}return a},s}async function ta(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.GX)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=n.width+e.padding,c=n.height+e.padding,f=.2*c,p=-h/2,m=-c/2-f/2,{cssStyles:u}=e,x=o.A.svg(i),w=(0,r.Fr)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=x.polygon([{x:p,y:m+f},{x:-p,y:m+f},{x:-p,y:-m},{x:p,y:-m},{x:p,y:m},{x:-p,y:m},{x:-p,y:m+f}].map(t=>[t.x,t.y]),w),$=i.insert(()=>b,":first-child");return $.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",l),s.attr("transform",`translate(${p+(e.padding??0)/2-(n.x-(n.left??0))}, ${m+f+(e.padding??0)/2-(n.y-(n.top??0))})`),g(e,$),e.intersect=function(t){return F.rect(e,t)},i}async function tl(t,e){let a,{labelStyles:l,nodeStyles:i}=(0,r.GX)(e);e.labelStyle=l;let{shapeSvg:h,bbox:c,halfPadding:f}=await d(t,e,y(e)),p=c.width/2+f+5,m=c.width/2+f,{cssStyles:u}=e;if("handDrawn"===e.look){let t=o.A.svg(h),l=(0,r.Fr)(e,{roughness:.2,strokeWidth:2.5}),i=(0,r.Fr)(e,{roughness:.2,strokeWidth:1.5}),s=t.circle(0,0,2*p,l),d=t.circle(0,0,2*m,i);(a=h.insert("g",":first-child")).attr("class",(0,n.KL)(e.cssClasses)).attr("style",(0,n.KL)(u)),a.node()?.appendChild(s),a.node()?.appendChild(d)}else{let t=(a=h.insert("g",":first-child")).insert("circle",":first-child"),e=a.insert("circle");a.attr("class","basic label-container").attr("style",i),t.attr("class","outer-circle").attr("style",i).attr("r",p).attr("cx",0).attr("cy",0),e.attr("class","inner-circle").attr("style",i).attr("r",m).attr("cx",0).attr("cy",0)}return g(e,a),e.intersect=function(t){return s.Rm.info("DoubleCircle intersect",e,p,t),F.circle(e,p,t)},h}function tr(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:i}=(0,r.GX)(e);e.label="",e.labelStyle=l;let n=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:h}=e,d=o.A.svg(n),{nodeBorder:c}=a,f=(0,r.Fr)(e,{fillStyle:"solid"});"handDrawn"!==e.look&&(f.roughness=0);let p=d.circle(0,0,14,f),m=n.insert(()=>p,":first-child");return m.selectAll("path").attr("style",`fill: ${c} !important;`),h&&h.length>0&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",h),i&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",i),g(e,m),e.intersect=function(t){return s.Rm.info("filledCircle intersect",e,{radius:7,point:t}),F.circle(e,7,t)},n}async function ti(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.GX)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:h}=await d(t,e,y(e)),c=n.width+(e.padding??0),p=c+n.height,m=c+n.height,u=[{x:0,y:-p},{x:m,y:-p},{x:m/2,y:0}],{cssStyles:x}=e,w=o.A.svg(i),b=(0,r.Fr)(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let $=f(u),k=w.path($,b),M=i.insert(()=>k,":first-child").attr("transform",`translate(${-p/2}, ${p/2})`);return x&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",x),l&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",l),e.width=c,e.height=p,g(e,M),h.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-p/2+(e.padding??0)/2+(n.y-(n.top??0))})`),e.intersect=function(t){return s.Rm.info("Triangle intersect",e,u,t),F.polygon(e,u,t)},i}function tn(t,e,{dir:a,config:{state:l,themeVariables:i}}){let{nodeStyles:n}=(0,r.GX)(e);e.label="";let s=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:h}=e,d=Math.max(70,e?.width??0),c=Math.max(10,e?.height??0);"LR"===a&&(d=Math.max(10,e?.width??0),c=Math.max(70,e?.height??0));let f=-1*d/2,p=-1*c/2,m=o.A.svg(s),u=(0,r.Fr)(e,{stroke:i.lineColor,fill:i.lineColor});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");let x=m.rectangle(f,p,d,c,u),w=s.insert(()=>x,":first-child");h&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",h),n&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",n),g(e,w);let b=l?.padding??0;return e.width&&e.height&&(e.width+=b/2||0,e.height+=b/2||0),e.intersect=function(t){return F.rect(e,t)},s}async function ts(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.GX)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await d(t,e,y(e)),h=Math.max(80,n.width+(e.padding??0)*2,e?.width??0),c=Math.max(50,n.height+(e.padding??0)*2,e?.height??0),p=c/2,{cssStyles:u}=e,x=o.A.svg(i),w=(0,r.Fr)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:-h/2,y:-c/2},{x:h/2-p,y:-c/2},...m(-h/2+p,0,p,50,90,270),{x:h/2-p,y:c/2},{x:-h/2,y:c/2}],$=f(b),k=x.path($,w),M=i.insert(()=>k,":first-child");return M.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",u),l&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",l),g(e,M),e.intersect=function(t){return s.Rm.info("Pill intersect",e,{radius:p,point:t}),F.polygon(e,b,t)},i}(0,s.K2)(te,"cylinder"),(0,s.K2)(ta,"dividedRectangle"),(0,s.K2)(tl,"doublecircle"),(0,s.K2)(tr,"filledCircle"),(0,s.K2)(ti,"flippedTriangle"),(0,s.K2)(tn,"forkJoin"),(0,s.K2)(ts,"halfRoundedRectangle");var th=(0,s.K2)((t,e,a,l,r)=>`M${t+r},${e} L${t+a-r},${e} L${t+a},${e-l/2} L${t+a-r},${e-l} L${t+r},${e-l} L${t},${e-l/2} Z`,"createHexagonPathD");async function to(t,e){let a,{labelStyles:l,nodeStyles:i}=(0,r.GX)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=s.height+e.padding,c=h/4,f=s.width+2*c+e.padding,p=[{x:c,y:0},{x:f-c,y:0},{x:f,y:-h/2},{x:f-c,y:-h},{x:c,y:-h},{x:0,y:-h/2}],{cssStyles:m}=e;if("handDrawn"===e.look){let t=o.A.svg(n),l=(0,r.Fr)(e,{}),i=th(0,0,f,h,c),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-f/2}, ${h/2})`),m&&a.attr("style",m)}else a=W(n,f,h,p);return i&&a.attr("style",i),e.width=f,e.height=h,g(e,a),e.intersect=function(t){return F.polygon(e,p,t)},n}async function td(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.GX)(e);e.label="",e.labelStyle=a;let{shapeSvg:i}=await d(t,e,y(e)),n=Math.max(30,e?.width??0),h=Math.max(30,e?.height??0),{cssStyles:c}=e,p=o.A.svg(i),m=(0,r.Fr)(e,{});"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");let u=[{x:0,y:0},{x:n,y:0},{x:0,y:h},{x:n,y:h}],x=f(u),w=p.path(x,m),b=i.insert(()=>w,":first-child");return b.attr("class","basic label-container"),c&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",c),l&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",l),b.attr("transform",`translate(${-n/2}, ${-h/2})`),g(e,b),e.intersect=function(t){return s.Rm.info("Pill intersect",e,{points:u}),F.polygon(e,u,t)},i}async function tc(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.GX)(e);e.labelStyle=n;let h=Math.max(e.assetHeight??48,e.assetWidth??48);e.width=Math.max(h,l?.wrappingWidth??0);let{shapeSvg:c,bbox:y,label:f}=await d(t,e,"icon-shape default"),p="t"===e.pos,{nodeBorder:m}=a,{stylesMap:u}=(0,r.WW)(e),x=-h/2,w=-h/2,b=8*!!e.label,$=o.A.svg(c),k=(0,r.Fr)(e,{stroke:"none",fill:"none"});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let M=$.rectangle(x,w,h,h,k),S=Math.max(h,y.width),D=h+y.height+b,A=$.rectangle(-S/2,-D/2,S,D,{...k,fill:"transparent",stroke:"none"}),v=c.insert(()=>M,":first-child"),K=c.insert(()=>A);if(e.icon){let t=c.append("g");t.html(`<g>${await (0,i.WY)(e.icon,{height:h,width:h,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,r=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-l/2-n},${p?y.height/2+b/2-r/2-s:-y.height/2-b/2-r/2-s})`),t.attr("style",`color: ${u.get("stroke")??m};`)}return f.attr("transform",`translate(${-y.width/2-(y.x-(y.left??0))},${p?-D/2:D/2-y.height})`),v.attr("transform",`translate(0,${p?y.height/2+b/2:-y.height/2-b/2})`),g(e,K),e.intersect=function(t){if(s.Rm.info("iconSquare intersect",e,t),!e.label)return F.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=p?[{x:a-y.width/2,y:l-r/2},{x:a+y.width/2,y:l-r/2},{x:a+y.width/2,y:l-r/2+y.height+b},{x:a+h/2,y:l-r/2+y.height+b},{x:a+h/2,y:l+r/2},{x:a-h/2,y:l+r/2},{x:a-h/2,y:l-r/2+y.height+b},{x:a-y.width/2,y:l-r/2+y.height+b}]:[{x:a-h/2,y:l-r/2},{x:a+h/2,y:l-r/2},{x:a+h/2,y:l-r/2+h},{x:a+y.width/2,y:l-r/2+h},{x:a+y.width/2/2,y:l+r/2},{x:a-y.width/2,y:l+r/2},{x:a-y.width/2,y:l-r/2+h},{x:a-h/2,y:l-r/2+h}],F.polygon(e,i,t)},c}async function tg(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.GX)(e);e.labelStyle=n;let h=Math.max(e.assetHeight??48,e.assetWidth??48);e.width=Math.max(h,l?.wrappingWidth??0);let{shapeSvg:c,bbox:y,label:f}=await d(t,e,"icon-shape default"),p=8*!!e.label,m="t"===e.pos,{nodeBorder:u,mainBkg:x}=a,{stylesMap:w}=(0,r.WW)(e),b=o.A.svg(c),$=(0,r.Fr)(e,{});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid"),$.stroke=w.get("fill")??x;let k=c.append("g");e.icon&&k.html(`<g>${await (0,i.WY)(e.icon,{height:h,width:h,fallbackPrefix:""})}</g>`);let M=k.node().getBBox(),S=M.width,D=M.height,A=M.x,v=M.y,K=Math.max(S,D)*Math.SQRT2+40,B=b.circle(0,0,K,$),C=Math.max(K,y.width),L=K+y.height+p,N=b.rectangle(-C/2,-L/2,C,L,{...$,fill:"transparent",stroke:"none"}),R=c.insert(()=>B,":first-child"),P=c.insert(()=>N);return k.attr("transform",`translate(${-S/2-A},${m?y.height/2+p/2-D/2-v:-y.height/2-p/2-D/2-v})`),k.attr("style",`color: ${w.get("stroke")??u};`),f.attr("transform",`translate(${-y.width/2-(y.x-(y.left??0))},${m?-L/2:L/2-y.height})`),R.attr("transform",`translate(0,${m?y.height/2+p/2:-y.height/2-p/2})`),g(e,P),e.intersect=function(t){return s.Rm.info("iconSquare intersect",e,t),F.rect(e,t)},c}async function ty(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.GX)(e);e.labelStyle=n;let h=Math.max(e.assetHeight??48,e.assetWidth??48);e.width=Math.max(h,l?.wrappingWidth??0);let{shapeSvg:c,bbox:y,halfPadding:f,label:p}=await d(t,e,"icon-shape default"),m="t"===e.pos,u=h+2*f,x=h+2*f,{nodeBorder:w,mainBkg:b}=a,{stylesMap:k}=(0,r.WW)(e),M=8*!!e.label,S=o.A.svg(c),D=(0,r.Fr)(e,{});"handDrawn"!==e.look&&(D.roughness=0,D.fillStyle="solid"),D.stroke=k.get("fill")??b;let A=S.path($(-x/2,-u/2,x,u,5),D),v=Math.max(x,y.width),K=u+y.height+M,B=S.rectangle(-v/2,-K/2,v,K,{...D,fill:"transparent",stroke:"none"}),C=c.insert(()=>A,":first-child").attr("class","icon-shape2"),L=c.insert(()=>B);if(e.icon){let t=c.append("g");t.html(`<g>${await (0,i.WY)(e.icon,{height:h,width:h,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,r=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-l/2-n},${m?y.height/2+M/2-r/2-s:-y.height/2-M/2-r/2-s})`),t.attr("style",`color: ${k.get("stroke")??w};`)}return p.attr("transform",`translate(${-y.width/2-(y.x-(y.left??0))},${m?-K/2:K/2-y.height})`),C.attr("transform",`translate(0,${m?y.height/2+M/2:-y.height/2-M/2})`),g(e,L),e.intersect=function(t){if(s.Rm.info("iconSquare intersect",e,t),!e.label)return F.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=m?[{x:a-y.width/2,y:l-r/2},{x:a+y.width/2,y:l-r/2},{x:a+y.width/2,y:l-r/2+y.height+M},{x:a+x/2,y:l-r/2+y.height+M},{x:a+x/2,y:l+r/2},{x:a-x/2,y:l+r/2},{x:a-x/2,y:l-r/2+y.height+M},{x:a-y.width/2,y:l-r/2+y.height+M}]:[{x:a-x/2,y:l-r/2},{x:a+x/2,y:l-r/2},{x:a+x/2,y:l-r/2+u},{x:a+y.width/2,y:l-r/2+u},{x:a+y.width/2/2,y:l+r/2},{x:a-y.width/2,y:l+r/2},{x:a-y.width/2,y:l-r/2+u},{x:a-x/2,y:l-r/2+u}],F.polygon(e,i,t)},c}async function tf(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.GX)(e);e.labelStyle=n;let h=Math.max(e.assetHeight??48,e.assetWidth??48);e.width=Math.max(h,l?.wrappingWidth??0);let{shapeSvg:c,bbox:y,halfPadding:f,label:p}=await d(t,e,"icon-shape default"),m="t"===e.pos,u=h+2*f,x=h+2*f,{nodeBorder:w,mainBkg:b}=a,{stylesMap:k}=(0,r.WW)(e),M=8*!!e.label,S=o.A.svg(c),D=(0,r.Fr)(e,{});"handDrawn"!==e.look&&(D.roughness=0,D.fillStyle="solid"),D.stroke=k.get("fill")??b;let A=S.path($(-x/2,-u/2,x,u,.1),D),v=Math.max(x,y.width),K=u+y.height+M,B=S.rectangle(-v/2,-K/2,v,K,{...D,fill:"transparent",stroke:"none"}),C=c.insert(()=>A,":first-child"),L=c.insert(()=>B);if(e.icon){let t=c.append("g");t.html(`<g>${await (0,i.WY)(e.icon,{height:h,width:h,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,r=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-l/2-n},${m?y.height/2+M/2-r/2-s:-y.height/2-M/2-r/2-s})`),t.attr("style",`color: ${k.get("stroke")??w};`)}return p.attr("transform",`translate(${-y.width/2-(y.x-(y.left??0))},${m?-K/2:K/2-y.height})`),C.attr("transform",`translate(0,${m?y.height/2+M/2:-y.height/2-M/2})`),g(e,L),e.intersect=function(t){if(s.Rm.info("iconSquare intersect",e,t),!e.label)return F.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=m?[{x:a-y.width/2,y:l-r/2},{x:a+y.width/2,y:l-r/2},{x:a+y.width/2,y:l-r/2+y.height+M},{x:a+x/2,y:l-r/2+y.height+M},{x:a+x/2,y:l+r/2},{x:a-x/2,y:l+r/2},{x:a-x/2,y:l-r/2+y.height+M},{x:a-y.width/2,y:l-r/2+y.height+M}]:[{x:a-x/2,y:l-r/2},{x:a+x/2,y:l-r/2},{x:a+x/2,y:l-r/2+u},{x:a+y.width/2,y:l-r/2+u},{x:a+y.width/2/2,y:l+r/2},{x:a-y.width/2,y:l+r/2},{x:a-y.width/2,y:l-r/2+u},{x:a-x/2,y:l-r/2+u}],F.polygon(e,i,t)},c}async function tp(t,e,{config:{flowchart:a}}){let l=new Image;l.src=e?.img??"",await l.decode();let i=Number(l.naturalWidth.toString().replace("px","")),n=Number(l.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/n;let{labelStyles:h}=(0,r.GX)(e);e.labelStyle=h;let c=a?.wrappingWidth;e.defaultWidth=a?.wrappingWidth;let y=Math.max(e.label?c??0:0,e?.assetWidth??i),f="on"===e.constraint&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:y,p="on"===e.constraint?f/e.imageAspectRatio:e?.assetHeight??n;e.width=Math.max(f,c??0);let{shapeSvg:m,bbox:u,label:x}=await d(t,e,"image-shape default"),w="t"===e.pos,b=-f/2,$=8*!!e.label,k=o.A.svg(m),M=(0,r.Fr)(e,{});"handDrawn"!==e.look&&(M.roughness=0,M.fillStyle="solid");let S=k.rectangle(b,-p/2,f,p,M),D=Math.max(f,u.width),A=p+u.height+$,v=k.rectangle(-D/2,-A/2,D,A,{...M,fill:"none",stroke:"none"}),K=m.insert(()=>S,":first-child"),B=m.insert(()=>v);if(e.img){let t=m.append("image");t.attr("href",e.img),t.attr("width",f),t.attr("height",p),t.attr("preserveAspectRatio","none"),t.attr("transform",`translate(${-f/2},${w?A/2-p:-A/2})`)}return x.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${w?-p/2-u.height/2-$/2:p/2-u.height/2+$/2})`),K.attr("transform",`translate(0,${w?u.height/2+$/2:-u.height/2-$/2})`),g(e,B),e.intersect=function(t){if(s.Rm.info("iconSquare intersect",e,t),!e.label)return F.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=w?[{x:a-u.width/2,y:l-r/2},{x:a+u.width/2,y:l-r/2},{x:a+u.width/2,y:l-r/2+u.height+$},{x:a+f/2,y:l-r/2+u.height+$},{x:a+f/2,y:l+r/2},{x:a-f/2,y:l+r/2},{x:a-f/2,y:l-r/2+u.height+$},{x:a-u.width/2,y:l-r/2+u.height+$}]:[{x:a-f/2,y:l-r/2},{x:a+f/2,y:l-r/2},{x:a+f/2,y:l-r/2+p},{x:a+u.width/2,y:l-r/2+p},{x:a+u.width/2/2,y:l+r/2},{x:a-u.width/2,y:l+r/2},{x:a-u.width/2,y:l-r/2+p},{x:a-f/2,y:l-r/2+p}],F.polygon(e,i,t)},m}async function tm(t,e){let a,{labelStyles:l,nodeStyles:i}=(0,r.GX)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=Math.max(s.width+(e.padding??0)*2,e?.width??0),c=Math.max(s.height+(e.padding??0)*2,e?.height??0),p=[{x:0,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:-3*c/6,y:-c}],{cssStyles:m}=e;if("handDrawn"===e.look){let t=o.A.svg(n),l=(0,r.Fr)(e,{}),i=f(p),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),m&&a.attr("style",m)}else a=W(n,h,c,p);return i&&a.attr("style",i),e.width=h,e.height=c,g(e,a),e.intersect=function(t){return F.polygon(e,p,t)},n}async function tu(t,e,a){let l,{labelStyles:i,nodeStyles:s}=(0,r.GX)(e);e.labelStyle=i;let{shapeSvg:h,bbox:c}=await d(t,e,y(e)),f=Math.max(c.width+2*a.labelPaddingX,e?.width||0),p=Math.max(c.height+2*a.labelPaddingY,e?.height||0),m=-f/2,u=-p/2,{rx:x,ry:w}=e,{cssStyles:b}=e;if(a?.rx&&a.ry&&(x=a.rx,w=a.ry),"handDrawn"===e.look){let t=o.A.svg(h),a=(0,r.Fr)(e,{}),i=x||w?t.path($(m,u,f,p,x||0),a):t.rectangle(m,u,f,p,a);(l=h.insert(()=>i,":first-child")).attr("class","basic label-container").attr("style",(0,n.KL)(b))}else(l=h.insert("rect",":first-child")).attr("class","basic label-container").attr("style",s).attr("rx",(0,n.KL)(x)).attr("ry",(0,n.KL)(w)).attr("x",m).attr("y",u).attr("width",f).attr("height",p);return g(e,l),e.intersect=function(t){return F.rect(e,t)},h}async function tx(t,e){let{shapeSvg:a,bbox:l,label:r}=await d(t,e,"label"),i=a.insert("rect",":first-child");return i.attr("width",.1).attr("height",.1),a.attr("class","label edgeLabel"),r.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),g(e,i),e.intersect=function(t){return F.rect(e,t)},a}async function tw(t,e){let a,{labelStyles:l,nodeStyles:i}=(0,r.GX)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=Math.max(s.width+(e.padding??0),e?.width??0),c=Math.max(s.height+(e.padding??0),e?.height??0),p=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}],{cssStyles:m}=e;if("handDrawn"===e.look){let t=o.A.svg(n),l=(0,r.Fr)(e,{}),i=f(p),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),m&&a.attr("style",m)}else a=W(n,h,c,p);return i&&a.attr("style",i),e.width=h,e.height=c,g(e,a),e.intersect=function(t){return F.polygon(e,p,t)},n}async function tb(t,e){let a,{labelStyles:l,nodeStyles:i}=(0,r.GX)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await d(t,e,y(e)),h=Math.max(s.width+(e.padding??0),e?.width??0),c=Math.max(s.height+(e.padding??0),e?.height??0),p=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}],{cssStyles:m}=e;if("handDrawn"===e.look){let t=o.A.svg(n),l=(0,r.Fr)(e,{}),i=f(p),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),m&&a.attr("style",m)}else a=W(n,h,c,p);return i&&a.attr("style",i),e.width=h,e.height=c,g(e,a),e.intersect=function(t){return F.polygon(e,p,t)},n}function t$(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.GX)(e);e.label="",e.labelStyle=a;let i=t.insert("g").attr("class",y(e)).attr("id",e.domId??e.id),{cssStyles:n}=e,h=Math.max(35,e?.width??0),d=Math.max(35,e?.height??0),c=[{x:h,y:0},{x:0,y:d+3.5},{x:h-14,y:d+3.5},{x:0,y:2*d},{x:h,y:d-3.5},{x:14,y:d-3.5}],p=o.A.svg(i),m=(0,r.Fr)(e,{});"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");let u=f(c),x=p.path(u,m),w=i.insert(()=>x,":first-child");return n&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",n),l&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",l),w.attr("transform",`translate(-${h/2},${-d})`),g(e,w),e.intersect=function(t){return s.Rm.info("lightningBolt intersect",e,t),F.polygon(e,c,t)},i}(0,s.K2)(to,"hexagon"),(0,s.K2)(td,"hourglass"),(0,s.K2)(tc,"icon"),(0,s.K2)(tg,"iconCircle"),(0,s.K2)(ty,"iconRounded"),(0,s.K2)(tf,"iconSquare"),(0,s.K2)(tp,"imageSquare"),(0,s.K2)(tm,"inv_trapezoid"),(0,s.K2)(tu,"drawRect"),(0,s.K2)(tx,"labelRect"),(0,s.K2)(tw,"lean_left"),(0,s.K2)(tb,"lean_right"),(0,s.K2)(t$,"lightningBolt");var tk=(0,s.K2)((t,e,a,l,r,i,n)=>`M${t},${e+i} a${r},${i} 0,0,0 ${a},0 a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l} M${t},${e+i+n} a${r},${i} 0,0,0 ${a},0`,"createCylinderPathD"),tM=(0,s.K2)((t,e,a,l,r,i,n)=>`M${t},${e+i} M${t+a},${e+i} a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l} M${t},${e+i+n} a${r},${i} 0,0,0 ${a},0`,"createOuterCylinderPathD"),tS=(0,s.K2)((t,e,a,l,r,i)=>`M${t-a/2},${-l/2} a${r},${i} 0,0,0 ${a},0`,"createInnerCylinderPathD");async function tD(t,e){let a,{labelStyles:l,nodeStyles:i}=(0,r.GX)(e);e.labelStyle=l;let{shapeSvg:s,bbox:h,label:c}=await d(t,e,y(e)),f=Math.max(h.width+(e.padding??0),e.width??0),p=f/2,m=p/(2.5+f/50),u=Math.max(h.height+m+(e.padding??0),e.height??0),x=.1*u,{cssStyles:w}=e;if("handDrawn"===e.look){let t=o.A.svg(s),l=tM(0,0,f,u,p,m,x),i=tS(0,m,f,u,p,m),n=(0,r.Fr)(e,{}),h=t.path(l,n),d=t.path(i,n);s.insert(()=>d,":first-child").attr("class","line"),(a=s.insert(()=>h,":first-child")).attr("class","basic label-container"),w&&a.attr("style",w)}else{let t=tk(0,0,f,u,p,m,x);a=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,n.KL)(w)).attr("style",i)}return a.attr("label-offset-y",m),a.attr("transform",`translate(${-f/2}, ${-(u/2+m)})`),g(e,a),c.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)+m-(h.y-(h.top??0))})`),e.intersect=function(t){let a=F.rect(e,t),l=a.x-(e.x??0);if(0!=p&&(Math.abs(l)<(e.width??0)/2||Math.abs(l)==(e.width??0)/2&&Math.abs(a.y-(e.y??0))>(e.height??0)/2-m)){let r=m*m*(1-l*l/(p*p));r>0&&(r=Math.sqrt(r)),r=m-r,t.y-(e.y??0)>0&&(r=-r),a.y+=r}return a},s}async function tA(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.GX)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),f=c/4,m=c+f,{cssStyles:u}=e,x=o.A.svg(i),w=(0,r.Fr)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:-h/2-h/2*.1,y:-m/2},{x:-h/2-h/2*.1,y:m/2},...p(-h/2-h/2*.1,m/2,h/2+h/2*.1,m/2,f,.8),{x:h/2+h/2*.1,y:-m/2},{x:-h/2-h/2*.1,y:-m/2},{x:-h/2,y:-m/2},{x:-h/2,y:m/2*1.1},{x:-h/2,y:-m/2}],$=x.polygon(b.map(t=>[t.x,t.y]),w),k=i.insert(()=>$,":first-child");return k.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),k.attr("transform",`translate(0,${-f/2})`),s.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(n.x-(n.left??0))},${-c/2+(e.padding??0)-f/2-(n.y-(n.top??0))})`),g(e,k),e.intersect=function(t){return F.polygon(e,b,t)},i}async function tv(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.GX)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),p=-h/2,m=-c/2,{cssStyles:u}=e,x=o.A.svg(i),w=(0,r.Fr)(e,{}),b=[{x:p-5,y:m+5},{x:p-5,y:m+c+5},{x:p+h-5,y:m+c+5},{x:p+h-5,y:m+c},{x:p+h,y:m+c},{x:p+h,y:m+c-5},{x:p+h+5,y:m+c-5},{x:p+h+5,y:m-5},{x:p+5,y:m-5},{x:p+5,y:m},{x:p,y:m},{x:p,y:m+5}];"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let $=f(b),k=x.path($,w),M=f([{x:p,y:m+5},{x:p+h-5,y:m+5},{x:p+h-5,y:m+c},{x:p+h,y:m+c},{x:p+h,y:m},{x:p,y:m}]),S=x.path(M,{...w,fill:"none"}),D=i.insert(()=>S,":first-child");return D.insert(()=>k,":first-child"),D.attr("class","basic label-container"),u&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",u),l&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",l),s.attr("transform",`translate(${-(n.width/2)-5-(n.x-(n.left??0))}, ${-(n.height/2)+5-(n.y-(n.top??0))})`),g(e,D),e.intersect=function(t){return F.polygon(e,b,t)},i}async function tK(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.GX)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await d(t,e,y(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),c=Math.max(n.height+(e.padding??0)*2,e?.height??0),m=c/4,u=c+m,x=-h/2,w=-u/2,{cssStyles:b}=e,$=p(x-5,w+u+5,x+h-5,w+u+5,m,.8),k=$?.[$.length-1],M=[{x:x-5,y:w+5},{x:x-5,y:w+u+5},...$,{x:x+h-5,y:k.y-5},{x:x+h,y:k.y-5},{x:x+h,y:k.y-10},{x:x+h+5,y:k.y-10},{x:x+h+5,y:w-5},{x:x+5,y:w-5},{x:x+5,y:w},{x,y:w},{x,y:w+5}],S=[{x,y:w+5},{x:x+h-5,y:w+5},{x:x+h-5,y:k.y-5},{x:x+h,y:k.y-5},{x:x+h,y:w},{x,y:w}],D=o.A.svg(i),A=(0,r.Fr)(e,{});"handDrawn"!==e.look&&(A.roughness=0,A.fillStyle="solid");let v=f(M),K=D.path(v,A),B=f(S),C=D.path(B,A),L=i.insert(()=>K,":first-child");return L.insert(()=>C),L.attr("class","basic label-container"),b&&"handDrawn"!==e.look&&L.selectAll("path").attr("style",b),l&&"handDrawn"!==e.look&&L.selectAll("path").attr("style",l),L.attr("transform",`translate(0,${-m/2})`),s.attr("transform",`translate(${-(n.width/2)-5-(n.x-(n.left??0))}, ${-(n.height/2)+5-m/2-(n.y-(n.top??0))})`),g(e,L),e.intersect=function(t){return F.polygon(e,M,t)},i}async function tB(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:i}=(0,r.GX)(e);e.labelStyle=l,e.useHtmlLabels||(0,s.zj)().flowchart?.htmlLabels!==!1||(e.centerLabel=!0);let{shapeSvg:n,bbox:h,label:c}=await d(t,e,y(e)),f=Math.max(h.width+(e.padding??0)*2,e?.width??0),p=Math.max(h.height+(e.padding??0)*2,e?.height??0),{cssStyles:m}=e,u=o.A.svg(n),x=(0,r.Fr)(e,{fill:a.noteBkgColor,stroke:a.noteBorderColor});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=u.rectangle(-f/2,-p/2,f,p,x),b=n.insert(()=>w,":first-child");return b.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",m),i&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",i),c.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),g(e,b),e.intersect=function(t){return F.rect(e,t)},n}(0,s.K2)(tD,"linedCylinder"),(0,s.K2)(tA,"linedWaveEdgedRect"),(0,s.K2)(tv,"multiRect"),(0,s.K2)(tK,"multiWaveEdgedRectangle"),(0,s.K2)(tB,"note");var tC=(0,s.K2)((t,e,a)=>`M${t+a/2},${e} L${t+a},${e-a/2} L${t+a/2},${e-a} L${t},${e-a/2} Z`,"createDecisionBoxPathD");async function tL(t,e){let a,{labelStyles:l,nodeStyles:i}=(0,r.GX)(e);e.labelStyle=l;let{shapeSvg:n,bbox:h}=await d(t,e,y(e)),c=h.width+e.padding+(h.height+e.padding),f=[{x:c/2,y:0},{x:c,y:-c/2},{x:c/2,y:-c},{x:0,y:-c/2}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=o.A.svg(n),l=(0,r.