@asyncapi/studio
Version:
One place that allows you to develop an AsyncAPI document, validate it, convert it to the latest version, preview the documentation and visualize the events flow.
2 lines • 92 kB
JavaScript
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5868],{36455:function(t,e,a){a.d(e,{C1:function(){return c},Lf:function(){return eh},XO:function(){return w},Yn:function(){return eo},ZH:function(){return C},aH:function(){return ec},dW:function(){return en},gU:function(){return ed},jr:function(){return y},us:function(){return v}});var l=a(15542),r=a(23647),i=a(58859),n=a(44828),s=a(76541),h=a(61452),o=a(33433),d=a(10851),c=(0,h.eW)(async(t,e,a)=>{let r,h;let d=e.useHtmlLabels||(0,s.ku)(s.nV()?.htmlLabels);r=a||"node default";let c=t.insert("g").attr("class",r).attr("id",e.domId||e.id),g=c.insert("g").attr("class","label").attr("style",(0,n.R7)(e.labelStyle));h=void 0===e.label?"":"string"==typeof e.label?e.label:e.label[0];let y=!!e.icon||!!e.img,f="markdown"===e.labelType,u=await (0,i.rw)(g,(0,s.oO)((0,n.SH)(h),(0,s.nV)()),{useHtmlLabels:d,width:e.width||s.nV().flowchart?.wrappingWidth,cssClasses:f?"markdown-node-label":void 0,style:e.labelStyle,addSvgBackground:y,markdown:f},(0,s.nV)()),p=u.getBBox(),m=(e?.padding??0)/2;if(d){let t=u.children[0],e=(0,o.Ys)(u);await (0,l.i)(t,h),p=t.getBoundingClientRect(),e.attr("width",p.width),e.attr("height",p.height)}return d?g.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):g.attr("transform","translate(0, "+-p.height/2+")"),e.centerLabel&&g.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),g.insert("rect",":first-child"),{shapeSvg:c,bbox:p,halfPadding:m,label:g}},"labelHelper"),g=(0,h.eW)(async(t,e,a)=>{let l=a.useHtmlLabels??(0,s._X)((0,s.nV)()),r=t.insert("g").attr("class","label").attr("style",a.labelStyle||""),h=await (0,i.rw)(r,(0,s.oO)((0,n.SH)(e),(0,s.nV)()),{useHtmlLabels:l,width:a.width||s.nV()?.flowchart?.wrappingWidth,style:a.labelStyle,addSvgBackground:!!a.icon||!!a.img}),d=h.getBBox(),c=a.padding/2;if((0,s._X)((0,s.nV)())){let t=h.children[0],e=(0,o.Ys)(h);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"),y=(0,h.eW)((t,e)=>{let a=e.node().getBBox();t.width=a.width,t.height=a.height},"updateNodeBounds"),f=(0,h.eW)((t,e)=>("handDrawn"===t.look?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function u(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,h.eW)(u,"createPathFromPoints"),(0,h.eW)(p,"generateFullSineWavePoints"),(0,h.eW)(m,"generateCirclePoints");var x=(0,h.eW)((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"),w=(0,h.eW)(async(t,e,a,l=!1,r=!1)=>{let n=e||"";"object"==typeof n&&(n=n[0]);let h=(0,s.nV)(),o=(0,s._X)(h);return await (0,i.rw)(t,n,{style:a,isTitle:l,useHtmlLabels:o,markdown:!1,isNode:r,width:Number.POSITIVE_INFINITY},h)},"createLabel"),$=(0,h.eW)((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"),b=(0,h.eW)(async(t,e)=>{let a,n;h.cM.info("Creating subgraph rect for ",e.id,e);let c=(0,s.nV)(),{themeVariables:g,handDrawnSeed:y}=c,{clusterBkg:f,clusterBorder:u}=g,{labelStyles:p,nodeStyles:m,borderStyles:b,backgroundStyles:k}=(0,r.UG)(e),M=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),S=(0,s._X)(c),D=M.insert("g").attr("class","cluster-label "),W=(a="markdown"===e.labelType?await (0,i.rw)(D,e.label,{style:e.labelStyle,useHtmlLabels:S,isNode:!0,width:e.width}):await w(D,e.label,e.labelStyle||"",!1,!0)).getBBox();if((0,s._X)(c)){let t=a.children[0],e=(0,o.Ys)(a);W=t.getBoundingClientRect(),e.attr("width",W.width),e.attr("height",W.height)}let v=e.width<=W.width+e.padding?W.width+e.padding:e.width;e.width<=W.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;let C=e.height,B=e.x-v/2,N=e.y-C/2;if(h.cM.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){let t=d.Z.svg(M),a=(0,r._q)(e,{roughness:.7,fill:f,stroke:u,fillWeight:3,seed:y}),l=t.path($(B,N,v,C,0),a);(n=M.insert(()=>(h.cM.debug("Rough node insert CXC",l),l),":first-child")).select("path:nth-child(2)").attr("style",b.join(";")),n.select("path").attr("style",k.join(";").replace("fill","stroke"))}else(n=M.insert("rect",":first-child")).attr("style",m).attr("rx",e.rx).attr("ry",e.ry).attr("x",B).attr("y",N).attr("width",v).attr("height",C);let{subGraphTitleTopMargin:A}=(0,l.L)(c);if(D.attr("transform",`translate(${e.x-W.width/2}, ${e.y-e.height/2+A})`),p){let t=D.select("span");t&&t.attr("style",p)}let _=n.node().getBBox();return e.offsetX=0,e.width=_.width,e.height=_.height,e.offsetY=W.height-e.padding/2,e.intersect=function(t){return x(e,t)},{cluster:M,labelBBox:W}},"rect"),k=(0,h.eW)((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 x(e,t)},{cluster:a,labelBBox:{width:0,height:0}}},"noteGroup"),M=(0,h.eW)(async(t,e)=>{let a;let l=(0,s.nV)(),{themeVariables:r,handDrawnSeed:i}=l,{altBackground:n,compositeBackground:h,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"),u=y.insert("g").attr("class","cluster-label"),p=y.append("rect"),m=await w(u,e.label,e.labelStyle,void 0,!0),b=m.getBBox();if((0,s._X)(l)){let t=m.children[0],e=(0,o.Ys)(m);b=t.getBoundingClientRect(),e.attr("width",b.width),e.attr("height",b.height)}let k=0*e.padding,M=(e.width<=b.width+e.padding?b.width+e.padding:e.width)+k;e.width<=b.width+e.padding?e.diff=(M-e.width)/2-e.padding:e.diff=-e.padding;let S=e.height+k,D=e.height+k-b.height-6,W=e.x-M/2,v=e.y-S/2;e.width=M;let C=e.y-e.height/2-k/2+b.height+2;if("handDrawn"===e.look){let t=e.cssClasses.includes("statediagram-cluster-alt"),l=d.Z.svg(y),r=e.rx||e.ry?l.path($(W,v,M,S,10),{roughness:.7,fill:c,fillStyle:"solid",stroke:g,seed:i}):l.rectangle(W,v,M,S,{seed:i});a=y.insert(()=>r,":first-child");let s=l.rectangle(W,C,M,D,{fill:t?n:h,fillStyle:t?"hachure":"solid",stroke:g,seed:i});a=y.insert(()=>r,":first-child"),p=y.insert(()=>s)}else(a=f.insert("rect",":first-child")).attr("class","outer").attr("x",W).attr("y",v).attr("width",M).attr("height",S).attr("data-look",e.look),p.attr("class","inner").attr("x",W).attr("y",C).attr("width",M).attr("height",D);u.attr("transform",`translate(${e.x-b.width/2}, ${v+1-((0,s._X)(l)?0:3)})`);let B=a.node().getBBox();return e.height=B.height,e.offsetX=0,e.offsetY=b.height-e.padding/2,e.labelBBox=b,e.intersect=function(t){return x(e,t)},{cluster:y,labelBBox:b}},"roundedWithTitle"),S=(0,h.eW)(async(t,e)=>{let a;h.cM.info("Creating subgraph rect for ",e.id,e);let n=(0,s.nV)(),{themeVariables:c,handDrawnSeed:g}=n,{clusterBkg:y,clusterBorder:f}=c,{labelStyles:u,nodeStyles:p,borderStyles:m,backgroundStyles:w}=(0,r.UG)(e),b=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),k=(0,s._X)(n),M=b.insert("g").attr("class","cluster-label "),S=await (0,i.rw)(M,e.label,{style:e.labelStyle,useHtmlLabels:k,isNode:!0,width:e.width}),D=S.getBBox();if((0,s._X)(n)){let t=S.children[0],e=(0,o.Ys)(S);D=t.getBoundingClientRect(),e.attr("width",D.width),e.attr("height",D.height)}let W=e.width<=D.width+e.padding?D.width+e.padding:e.width;e.width<=D.width+e.padding?e.diff=(W-e.width)/2-e.padding:e.diff=-e.padding;let v=e.height,C=e.x-W/2,B=e.y-v/2;if(h.cM.trace("Data ",e,JSON.stringify(e)),"handDrawn"===e.look){let t=d.Z.svg(b),l=(0,r._q)(e,{roughness:.7,fill:y,stroke:f,fillWeight:4,seed:g}),i=t.path($(C,B,W,v,e.rx),l);(a=b.insert(()=>(h.cM.debug("Rough node insert CXC",i),i),":first-child")).select("path:nth-child(2)").attr("style",m.join(";")),a.select("path").attr("style",w.join(";").replace("fill","stroke"))}else(a=b.insert("rect",":first-child")).attr("style",p).attr("rx",e.rx).attr("ry",e.ry).attr("x",C).attr("y",B).attr("width",W).attr("height",v);let{subGraphTitleTopMargin:N}=(0,l.L)(n);if(M.attr("transform",`translate(${e.x-D.width/2}, ${e.y-e.height/2+N})`),u){let t=M.select("span");t&&t.attr("style",u)}let A=a.node().getBBox();return e.offsetX=0,e.width=A.width,e.height=A.height,e.offsetY=D.height-e.padding/2,e.intersect=function(t){return x(e,t)},{cluster:b,labelBBox:D}},"kanbanSection"),D={rect:b,squareRect:b,roundedWithTitle:M,noteGroup:k,divider:(0,h.eW)((t,e)=>{let a;let{themeVariables:l,handDrawnSeed:r}=(0,s.nV)(),{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"),o=0*e.padding,c=e.width+o;e.diff=-e.padding;let g=e.height+o,y=e.x-c/2,f=e.y-g/2;if(e.width=c,"handDrawn"===e.look){let t=d.Z.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);let u=a.node().getBBox();return e.height=u.height,e.offsetX=0,e.offsetY=0,e.intersect=function(t){return x(e,t)},{cluster:n,labelBBox:{}}},"divider"),kanbanSection:S},W=new Map,v=(0,h.eW)(async(t,e)=>{let a=e.shape||"rect",l=await D[a](t,e);return W.set(e.id,l),l},"insertCluster"),C=(0,h.eW)(()=>{W=new Map},"clear");function B(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 N(t,e,a){return B(t,e,e,a)}function A(t,e,a,l){{let r=e.y-t.y,i=t.x-e.x,n=e.x*t.y-t.x*e.y,s=r*a.x+i*a.y+n,h=r*l.x+i*l.y+n;if(0!==s&&0!==h&&_(s,h))return;let o=l.y-a.y,d=a.x-l.x,c=l.x*a.y-a.x*l.y,g=o*t.x+d*t.y+c,y=o*e.x+d*e.y+c;if(1e-6>Math.abs(g)&&1e-6>Math.abs(y)&&_(g,y))return;let f=r*d-o*i;if(0===f)return;let u=Math.abs(f/2),p=i*c-d*n;return{x:p<0?(p-u)/f:(p+u)/f,y:(p=o*n-r*c)<0?(p-u)/f:(p+u)/f}}}function _(t,e){return t*e>0}function R(t,e,a){let l=t.x,r=t.y,i=[],n=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;"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=A(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?0:1}),i[0]):t}(0,h.eW)(function(t,e){return t.intersect(e)},"intersectNode"),(0,h.eW)(B,"intersectEllipse"),(0,h.eW)(N,"intersectCircle"),(0,h.eW)(A,"intersectLine"),(0,h.eW)(_,"sameSign"),(0,h.eW)(R,"intersectPolygon");var q={circle:N,polygon:R,rect:x};function P(t,e){let{labelStyles:a}=(0,r.UG)(e);e.labelStyle=a;let l=f(e),i=l;l||(i="anchor");let s=t.insert("g").attr("class",i).attr("id",e.domId||e.id),{cssStyles:o}=e,c=d.Z.svg(s),g=(0,r._q)(e,{fill:"black",stroke:"none",fillStyle:"solid"});"handDrawn"!==e.look&&(g.roughness=0);let u=c.circle(0,0,2,g),p=s.insert(()=>u,":first-child");return p.attr("class","anchor").attr("style",(0,n.R7)(o)),y(e,p),e.intersect=function(t){return h.cM.info("Circle intersect",e,1,t),q.circle(e,1,t)},s}function L(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 Z(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await c(t,e,f(e)),s=n.width+e.padding+20,h=n.height+e.padding,o=h/2,g=o/(2.5+h/50),{cssStyles:p}=e,m=[{x:s/2,y:-h/2},{x:-s/2,y:-h/2},...L(-s/2,-h/2,-s/2,h/2,g,o,!1),{x:s/2,y:h/2},...L(s/2,h/2,s/2,-h/2,g,o,!0)],x=d.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let $=u(m),b=x.path($,w),k=i.insert(()=>b,":first-child");return k.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",p),l&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",l),k.attr("transform",`translate(${g/2}, 0)`),y(e,k),e.intersect=function(t){return q.polygon(e,m,t)},i}function U(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;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await c(t,e,f(e)),h=s.height+e.padding,o=s.width+e.padding+12,g=-h,p=[{x:12,y:g},{x:o,y:g},{x:o,y:0},{x:0,y:0},{x:0,y:g+12},{x:12,y:g}],{cssStyles:m}=e;if("handDrawn"===e.look){let t=d.Z.svg(n),l=(0,r._q)(e,{}),i=u(p),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-o/2}, ${h/2})`),m&&a.attr("style",m)}else a=U(n,o,h,p);return i&&a.attr("style",i),y(e,a),e.intersect=function(t){return q.polygon(e,p,t)},n}function G(t,e){let{nodeStyles:a}=(0,r.UG)(e);e.label="";let l=t.insert("g").attr("class",f(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=d.Z.svg(l),o=(0,r._q)(e,{});"handDrawn"!==e.look&&(o.roughness=0,o.fillStyle="solid");let c=u(s),g=h.path(c,o),y=l.insert(()=>g,":first-child");return i&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",i),a&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",a),e.width=28,e.height=28,e.intersect=function(t){return q.polygon(e,s,t)},l}async function T(t,e,a){let l;let{labelStyles:i,nodeStyles:s}=(0,r.UG)(e);e.labelStyle=i;let{shapeSvg:o,bbox:g,halfPadding:u}=await c(t,e,f(e)),p=a?.padding??u,m=g.width/2+p,{cssStyles:x}=e;if("handDrawn"===e.look){let t=d.Z.svg(o),a=(0,r._q)(e,{}),i=t.circle(0,0,2*m,a);(l=o.insert(()=>i,":first-child")).attr("class","basic label-container").attr("style",(0,n.R7)(x))}else l=o.insert("circle",":first-child").attr("class","basic label-container").attr("style",s).attr("r",m).attr("cx",0).attr("cy",0);return y(e,l),e.calcIntersect=function(t,e){let a=t.width/2;return q.circle(t,a,e)},e.intersect=function(t){return h.cM.info("Circle intersect",e,m,t),q.circle(e,m,t)},o}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 E(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a,e.label="";let i=t.insert("g").attr("class",f(e)).attr("id",e.domId??e.id),n=Math.max(30,e?.width??0),{cssStyles:s}=e,o=d.Z.svg(i),c=(0,r._q)(e,{});"handDrawn"!==e.look&&(c.roughness=0,c.fillStyle="solid");let g=o.circle(0,0,2*n,c),u=H(n),p=o.path(u,c),m=i.insert(()=>g,":first-child");return m.insert(()=>p),s&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",s),l&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",l),y(e,m),e.intersect=function(t){return h.cM.info("crossedCircle intersect",e,{radius:n,point:t}),q.circle(e,n,t)},i}function V(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 X(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await c(t,e,f(e)),h=n.width+(e.padding??0),o=n.height+(e.padding??0),g=Math.max(5,.1*o),{cssStyles:p}=e,m=[...V(h/2,-o/2,g,30,-90,0),{x:-h/2-g,y:g},...V(h/2+2*g,-g,g,20,-180,-270),...V(h/2+2*g,g,g,20,-90,-180),{x:-h/2-g,y:-o/2},...V(h/2,o/2,g,20,0,90)],x=[{x:h/2,y:-o/2-g},{x:-h/2,y:-o/2-g},...V(h/2,-o/2,g,20,-90,0),{x:-h/2-g,y:-g},...V(h/2+.1*h,-g,g,20,-180,-270),...V(h/2+.1*h,g,g,20,-90,-180),{x:-h/2-g,y:o/2},...V(h/2,o/2,g,20,0,90),{x:-h/2,y:o/2+g},{x:h/2,y:o/2+g}],w=d.Z.svg(i),$=(0,r._q)(e,{fill:"none"});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let b=u(m).replace("Z",""),k=w.path(b,$),M=u(x),S=w.path(M,{...$}),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"),p&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",p),l&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",l),D.attr("transform",`translate(${g}, 0)`),s.attr("transform",`translate(${-h/2+g-(n.x-(n.left??0))},${-o/2+(e.padding??0)/2-(n.y-(n.top??0))})`),y(e,D),e.intersect=function(t){return q.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 O(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await c(t,e,f(e)),h=n.width+(e.padding??0),o=n.height+(e.padding??0),g=Math.max(5,.1*o),{cssStyles:p}=e,m=[...Y(h/2,-o/2,g,20,-90,0),{x:h/2+g,y:-g},...Y(h/2+2*g,-g,g,20,-180,-270),...Y(h/2+2*g,g,g,20,-90,-180),{x:h/2+g,y:o/2},...Y(h/2,o/2,g,20,0,90)],x=[{x:-h/2,y:-o/2-g},{x:h/2,y:-o/2-g},...Y(h/2,-o/2,g,20,-90,0),{x:h/2+g,y:-g},...Y(h/2+2*g,-g,g,20,-180,-270),...Y(h/2+2*g,g,g,20,-90,-180),{x:h/2+g,y:o/2},...Y(h/2,o/2,g,20,0,90),{x:h/2,y:o/2+g},{x:-h/2,y:o/2+g}],w=d.Z.svg(i),$=(0,r._q)(e,{fill:"none"});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let b=u(m).replace("Z",""),k=w.path(b,$),M=u(x),S=w.path(M,{...$}),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"),p&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",p),l&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",l),D.attr("transform",`translate(${-g}, 0)`),s.attr("transform",`translate(${-h/2+(e.padding??0)/2-(n.x-(n.left??0))},${-o/2+(e.padding??0)/2-(n.y-(n.top??0))})`),y(e,D),e.intersect=function(t){return q.polygon(e,x,t)},i}function j(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 F(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await c(t,e,f(e)),h=n.width+(e.padding??0),o=n.height+(e.padding??0),g=Math.max(5,.1*o),{cssStyles:p}=e,m=[...j(h/2,-o/2,g,30,-90,0),{x:-h/2-g,y:g},...j(h/2+2*g,-g,g,20,-180,-270),...j(h/2+2*g,g,g,20,-90,-180),{x:-h/2-g,y:-o/2},...j(h/2,o/2,g,20,0,90)],x=[...j(-h/2+g+g/2,-o/2,g,20,-90,-180),{x:h/2-g/2,y:g},...j(-h/2-g/2,-g,g,20,0,90),...j(-h/2-g/2,g,g,20,-90,0),{x:h/2-g/2,y:-g},...j(-h/2+g+g/2,o/2,g,30,-180,-270)],w=[{x:h/2,y:-o/2-g},{x:-h/2,y:-o/2-g},...j(h/2,-o/2,g,20,-90,0),{x:-h/2-g,y:-g},...j(h/2+2*g,-g,g,20,-180,-270),...j(h/2+2*g,g,g,20,-90,-180),{x:-h/2-g,y:o/2},...j(h/2,o/2,g,20,0,90),{x:-h/2,y:o/2+g},{x:h/2-g-g/2,y:o/2+g},...j(-h/2+g+g/2,-o/2,g,20,-90,-180),{x:h/2-g/2,y:g},...j(-h/2-g/2,-g,g,20,0,90),...j(-h/2-g/2,g,g,20,-90,0),{x:h/2-g/2,y:-g},...j(-h/2+g+g/2,o/2,g,30,-180,-270)],$=d.Z.svg(i),b=(0,r._q)(e,{fill:"none"});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let k=u(m).replace("Z",""),M=$.path(k,b),S=u(x).replace("Z",""),D=$.path(S,b),W=u(w),v=$.path(W,{...b}),C=i.insert("g",":first-child");return C.insert(()=>v,":first-child").attr("stroke-opacity",0),C.insert(()=>M,":first-child"),C.insert(()=>D,":first-child"),C.attr("class","text"),p&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",p),l&&"handDrawn"!==e.look&&C.selectAll("path").attr("style",l),C.attr("transform",`translate(${g-g/4}, 0)`),s.attr("transform",`translate(${-h/2+(e.padding??0)/2-(n.x-(n.left??0))},${-o/2+(e.padding??0)/2-(n.y-(n.top??0))})`),y(e,C),e.intersect=function(t){return q.polygon(e,w,t)},i}async function z(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await c(t,e,f(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),o=h/2,{cssStyles:g}=e,p=d.Z.svg(i),x=(0,r._q)(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=s-o,$=h/4,b=[{x:w,y:0},{x:$,y:0},{x:0,y:h/2},{x:$,y:h},{x:w,y:h},...m(-w,-h/2,o,50,270,90)],k=u(b),M=p.path(k,x),S=i.insert(()=>M,":first-child");return S.attr("class","basic label-container"),g&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",g),l&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",l),S.attr("transform",`translate(${-s/2}, ${-h/2})`),y(e,S),e.intersect=function(t){return q.polygon(e,b,t)},i}(0,h.eW)(P,"anchor"),(0,h.eW)(L,"generateArcPoints"),(0,h.eW)(Z,"bowTieRect"),(0,h.eW)(U,"insertPolygonShape"),(0,h.eW)(I,"card"),(0,h.eW)(G,"choice"),(0,h.eW)(T,"circle"),(0,h.eW)(H,"createLine"),(0,h.eW)(E,"crossedCircle"),(0,h.eW)(V,"generateCirclePoints"),(0,h.eW)(X,"curlyBraceLeft"),(0,h.eW)(Y,"generateCirclePoints"),(0,h.eW)(O,"curlyBraceRight"),(0,h.eW)(j,"generateCirclePoints"),(0,h.eW)(F,"curlyBraces"),(0,h.eW)(z,"curvedTrapezoid");var J=(0,h.eW)((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"),K=(0,h.eW)((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"),Q=(0,h.eW)((t,e,a,l,r,i)=>`M${t-a/2},${-l/2} a${r},${i} 0,0,0 ${a},0`,"createInnerCylinderPathD");async function tt(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:s,bbox:h,label:o}=await c(t,e,f(e)),g=Math.max(h.width+e.padding,e.width??0),u=g/2,p=u/(2.5+g/50),m=Math.max(h.height+p+e.padding,e.height??0),{cssStyles:x}=e;if("handDrawn"===e.look){let t=d.Z.svg(s),l=K(0,0,g,m,u,p),i=Q(0,p,g,m,u,p),n=t.path(l,(0,r._q)(e,{})),h=t.path(i,(0,r._q)(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=J(0,0,g,m,u,p);a=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,n.R7)(x)).attr("style",i)}return a.attr("label-offset-y",p),a.attr("transform",`translate(${-g/2}, ${-(m/2+p)})`),y(e,a),o.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=q.rect(e,t),l=a.x-(e.x??0);if(0!=u&&(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-p)){let r=p*p*(1-l*l/(u*u));r>0&&(r=Math.sqrt(r)),r=p-r,t.y-(e.y??0)>0&&(r=-r),a.y+=r}return a},s}async function te(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await c(t,e,f(e)),h=n.width+e.padding,o=n.height+e.padding,g=.2*o,u=-h/2,p=-o/2-g/2,{cssStyles:m}=e,x=d.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let $=x.polygon([{x:u,y:p+g},{x:-u,y:p+g},{x:-u,y:-p},{x:u,y:-p},{x:u,y:p},{x:-u,y:p},{x:-u,y:p+g}].map(t=>[t.x,t.y]),w),b=i.insert(()=>$,":first-child");return b.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",m),l&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",l),s.attr("transform",`translate(${u+(e.padding??0)/2-(n.x-(n.left??0))}, ${p+g+(e.padding??0)/2-(n.y-(n.top??0))})`),y(e,b),e.intersect=function(t){return q.rect(e,t)},i}async function ta(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:s,bbox:o,halfPadding:g}=await c(t,e,f(e)),u=o.width/2+g+5,p=o.width/2+g,{cssStyles:m}=e;if("handDrawn"===e.look){let t=d.Z.svg(s),l=(0,r._q)(e,{roughness:.2,strokeWidth:2.5}),i=(0,r._q)(e,{roughness:.2,strokeWidth:1.5}),h=t.circle(0,0,2*u,l),o=t.circle(0,0,2*p,i);(a=s.insert("g",":first-child")).attr("class",(0,n.R7)(e.cssClasses)).attr("style",(0,n.R7)(m)),a.node()?.appendChild(h),a.node()?.appendChild(o)}else{let t=(a=s.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",u).attr("cx",0).attr("cy",0),e.attr("class","inner-circle").attr("style",i).attr("r",p).attr("cx",0).attr("cy",0)}return y(e,a),e.intersect=function(t){return h.cM.info("DoubleCircle intersect",e,u,t),q.circle(e,u,t)},s}function tl(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.label="",e.labelStyle=l;let n=t.insert("g").attr("class",f(e)).attr("id",e.domId??e.id),{cssStyles:s}=e,o=d.Z.svg(n),{nodeBorder:c}=a,g=(0,r._q)(e,{fillStyle:"solid"});"handDrawn"!==e.look&&(g.roughness=0);let u=o.circle(0,0,14,g),p=n.insert(()=>u,":first-child");return p.selectAll("path").attr("style",`fill: ${c} !important;`),s&&s.length>0&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",s),i&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",i),y(e,p),e.intersect=function(t){return h.cM.info("filledCircle intersect",e,{radius:7,point:t}),q.circle(e,7,t)},n}async function tr(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await c(t,e,f(e)),o=n.width+(e.padding??0),g=o+n.height,p=o+n.height,m=[{x:0,y:-g},{x:p,y:-g},{x:p/2,y:0}],{cssStyles:x}=e,w=d.Z.svg(i),$=(0,r._q)(e,{});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let b=u(m),k=w.path(b,$),M=i.insert(()=>k,":first-child").attr("transform",`translate(${-g/2}, ${g/2})`);return x&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",x),l&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",l),e.width=o,e.height=g,y(e,M),s.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-g/2+(e.padding??0)/2+(n.y-(n.top??0))})`),e.intersect=function(t){return h.cM.info("Triangle intersect",e,m,t),q.polygon(e,m,t)},i}function ti(t,e,{dir:a,config:{state:l,themeVariables:i}}){let{nodeStyles:n}=(0,r.UG)(e);e.label="";let s=t.insert("g").attr("class",f(e)).attr("id",e.domId??e.id),{cssStyles:h}=e,o=Math.max(70,e?.width??0),c=Math.max(10,e?.height??0);"LR"===a&&(o=Math.max(10,e?.width??0),c=Math.max(70,e?.height??0));let g=-1*o/2,u=-1*c/2,p=d.Z.svg(s),m=(0,r._q)(e,{stroke:i.lineColor,fill:i.lineColor});"handDrawn"!==e.look&&(m.roughness=0,m.fillStyle="solid");let x=p.rectangle(g,u,o,c,m),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),y(e,w);let $=l?.padding??0;return e.width&&e.height&&(e.width+=$/2||0,e.height+=$/2||0),e.intersect=function(t){return q.rect(e,t)},s}async function tn(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n}=await c(t,e,f(e)),s=Math.max(80,n.width+(e.padding??0)*2,e?.width??0),o=Math.max(50,n.height+(e.padding??0)*2,e?.height??0),g=o/2,{cssStyles:p}=e,x=d.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let $=[{x:-s/2,y:-o/2},{x:s/2-g,y:-o/2},...m(-s/2+g,0,g,50,90,270),{x:s/2-g,y:o/2},{x:-s/2,y:o/2}],b=u($),k=x.path(b,w),M=i.insert(()=>k,":first-child");return M.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",p),l&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",l),y(e,M),e.intersect=function(t){return h.cM.info("Pill intersect",e,{radius:g,point:t}),q.polygon(e,$,t)},i}(0,h.eW)(tt,"cylinder"),(0,h.eW)(te,"dividedRectangle"),(0,h.eW)(ta,"doublecircle"),(0,h.eW)(tl,"filledCircle"),(0,h.eW)(tr,"flippedTriangle"),(0,h.eW)(ti,"forkJoin"),(0,h.eW)(tn,"halfRoundedRectangle");var ts=(0,h.eW)((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 th(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await c(t,e,f(e)),h=s.height+e.padding,o=h/4,g=s.width+2*o+e.padding,u=[{x:o,y:0},{x:g-o,y:0},{x:g,y:-h/2},{x:g-o,y:-h},{x:o,y:-h},{x:0,y:-h/2}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=d.Z.svg(n),l=(0,r._q)(e,{}),i=ts(0,0,g,h,o),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-g/2}, ${h/2})`),p&&a.attr("style",p)}else a=U(n,g,h,u);return i&&a.attr("style",i),e.width=g,e.height=h,y(e,a),e.intersect=function(t){return q.polygon(e,u,t)},n}async function to(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.label="",e.labelStyle=a;let{shapeSvg:i}=await c(t,e,f(e)),n=Math.max(30,e?.width??0),s=Math.max(30,e?.height??0),{cssStyles:o}=e,g=d.Z.svg(i),p=(0,r._q)(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");let m=[{x:0,y:0},{x:n,y:0},{x:0,y:s},{x:n,y:s}],x=u(m),w=g.path(x,p),$=i.insert(()=>w,":first-child");return $.attr("class","basic label-container"),o&&"handDrawn"!==e.look&&$.selectChildren("path").attr("style",o),l&&"handDrawn"!==e.look&&$.selectChildren("path").attr("style",l),$.attr("transform",`translate(${-n/2}, ${-s/2})`),y(e,$),e.intersect=function(t){return h.cM.info("Pill intersect",e,{points:m}),q.polygon(e,m,t)},i}async function td(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.UG)(e);e.labelStyle=n;let s=Math.max(e.assetHeight??48,e.assetWidth??48),o=l?.wrappingWidth;e.width=Math.max(s,o??0);let{shapeSvg:g,bbox:f,label:u}=await c(t,e,"icon-shape default"),p="t"===e.pos,{nodeBorder:m}=a,{stylesMap:x}=(0,r.dT)(e),w=-s/2,$=-s/2,b=e.label?8:0,k=d.Z.svg(g),M=(0,r._q)(e,{stroke:"none",fill:"none"});"handDrawn"!==e.look&&(M.roughness=0,M.fillStyle="solid");let S=k.rectangle(w,$,s,s,M),D=Math.max(s,f.width),W=s+f.height+b,v=k.rectangle(-D/2,-W/2,D,W,{...M,fill:"transparent",stroke:"none"}),C=g.insert(()=>S,":first-child"),B=g.insert(()=>v);if(e.icon){let t=g.append("g");t.html(`<g>${await (0,i.s4)(e.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,r=a.height,n=a.x,h=a.y;t.attr("transform",`translate(${-l/2-n},${p?f.height/2+b/2-r/2-h:-f.height/2-b/2-r/2-h})`),t.attr("style",`color: ${x.get("stroke")??m};`)}return u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${p?-W/2:W/2-f.height})`),C.attr("transform",`translate(0,${p?f.height/2+b/2:-f.height/2-b/2})`),y(e,B),e.intersect=function(t){if(h.cM.info("iconSquare intersect",e,t),!e.label)return q.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=p?[{x:a-f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2+f.height+b},{x:a+s/2,y:l-r/2+f.height+b},{x:a+s/2,y:l+r/2},{x:a-s/2,y:l+r/2},{x:a-s/2,y:l-r/2+f.height+b},{x:a-f.width/2,y:l-r/2+f.height+b}]:[{x:a-s/2,y:l-r/2},{x:a+s/2,y:l-r/2},{x:a+s/2,y:l-r/2+s},{x:a+f.width/2,y:l-r/2+s},{x:a+f.width/2/2,y:l+r/2},{x:a-f.width/2,y:l+r/2},{x:a-f.width/2,y:l-r/2+s},{x:a-s/2,y:l-r/2+s}],q.polygon(e,i,t)},g}async function tc(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.UG)(e);e.labelStyle=n;let s=Math.max(e.assetHeight??48,e.assetWidth??48),o=l?.wrappingWidth;e.width=Math.max(s,o??0);let{shapeSvg:g,bbox:f,label:u}=await c(t,e,"icon-shape default"),p=e.label?8:0,m="t"===e.pos,{nodeBorder:x,mainBkg:w}=a,{stylesMap:$}=(0,r.dT)(e),b=d.Z.svg(g),k=(0,r._q)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let M=$.get("fill");k.stroke=M??w;let S=g.append("g");e.icon&&S.html(`<g>${await (0,i.s4)(e.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);let D=S.node().getBBox(),W=D.width,v=D.height,C=D.x,B=D.y,N=Math.max(W,v)*Math.SQRT2+40,A=b.circle(0,0,N,k),_=Math.max(N,f.width),R=N+f.height+p,P=b.rectangle(-_/2,-R/2,_,R,{...k,fill:"transparent",stroke:"none"}),L=g.insert(()=>A,":first-child"),Z=g.insert(()=>P);return S.attr("transform",`translate(${-W/2-C},${m?f.height/2+p/2-v/2-B:-f.height/2-p/2-v/2-B})`),S.attr("style",`color: ${$.get("stroke")??x};`),u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-R/2:R/2-f.height})`),L.attr("transform",`translate(0,${m?f.height/2+p/2:-f.height/2-p/2})`),y(e,Z),e.intersect=function(t){return h.cM.info("iconSquare intersect",e,t),q.rect(e,t)},g}async function tg(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.UG)(e);e.labelStyle=n;let s=Math.max(e.assetHeight??48,e.assetWidth??48),o=l?.wrappingWidth;e.width=Math.max(s,o??0);let{shapeSvg:g,bbox:f,halfPadding:u,label:p}=await c(t,e,"icon-shape default"),m="t"===e.pos,x=s+2*u,w=s+2*u,{nodeBorder:b,mainBkg:k}=a,{stylesMap:M}=(0,r.dT)(e),S=e.label?8:0,D=d.Z.svg(g),W=(0,r._q)(e,{});"handDrawn"!==e.look&&(W.roughness=0,W.fillStyle="solid");let v=M.get("fill");W.stroke=v??k;let C=D.path($(-w/2,-x/2,w,x,5),W),B=Math.max(w,f.width),N=x+f.height+S,A=D.rectangle(-B/2,-N/2,B,N,{...W,fill:"transparent",stroke:"none"}),_=g.insert(()=>C,":first-child").attr("class","icon-shape2"),R=g.insert(()=>A);if(e.icon){let t=g.append("g");t.html(`<g>${await (0,i.s4)(e.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,r=a.height,n=a.x,h=a.y;t.attr("transform",`translate(${-l/2-n},${m?f.height/2+S/2-r/2-h:-f.height/2-S/2-r/2-h})`),t.attr("style",`color: ${M.get("stroke")??b};`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-N/2:N/2-f.height})`),_.attr("transform",`translate(0,${m?f.height/2+S/2:-f.height/2-S/2})`),y(e,R),e.intersect=function(t){if(h.cM.info("iconSquare intersect",e,t),!e.label)return q.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=m?[{x:a-f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2+f.height+S},{x:a+w/2,y:l-r/2+f.height+S},{x:a+w/2,y:l+r/2},{x:a-w/2,y:l+r/2},{x:a-w/2,y:l-r/2+f.height+S},{x:a-f.width/2,y:l-r/2+f.height+S}]:[{x:a-w/2,y:l-r/2},{x:a+w/2,y:l-r/2},{x:a+w/2,y:l-r/2+x},{x:a+f.width/2,y:l-r/2+x},{x:a+f.width/2/2,y:l+r/2},{x:a-f.width/2,y:l+r/2},{x:a-f.width/2,y:l-r/2+x},{x:a-w/2,y:l-r/2+x}],q.polygon(e,i,t)},g}async function ty(t,e,{config:{themeVariables:a,flowchart:l}}){let{labelStyles:n}=(0,r.UG)(e);e.labelStyle=n;let s=Math.max(e.assetHeight??48,e.assetWidth??48),o=l?.wrappingWidth;e.width=Math.max(s,o??0);let{shapeSvg:g,bbox:f,halfPadding:u,label:p}=await c(t,e,"icon-shape default"),m="t"===e.pos,x=s+2*u,w=s+2*u,{nodeBorder:b,mainBkg:k}=a,{stylesMap:M}=(0,r.dT)(e),S=e.label?8:0,D=d.Z.svg(g),W=(0,r._q)(e,{});"handDrawn"!==e.look&&(W.roughness=0,W.fillStyle="solid");let v=M.get("fill");W.stroke=v??k;let C=D.path($(-w/2,-x/2,w,x,.1),W),B=Math.max(w,f.width),N=x+f.height+S,A=D.rectangle(-B/2,-N/2,B,N,{...W,fill:"transparent",stroke:"none"}),_=g.insert(()=>C,":first-child"),R=g.insert(()=>A);if(e.icon){let t=g.append("g");t.html(`<g>${await (0,i.s4)(e.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),l=a.width,r=a.height,n=a.x,h=a.y;t.attr("transform",`translate(${-l/2-n},${m?f.height/2+S/2-r/2-h:-f.height/2-S/2-r/2-h})`),t.attr("style",`color: ${M.get("stroke")??b};`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-N/2:N/2-f.height})`),_.attr("transform",`translate(0,${m?f.height/2+S/2:-f.height/2-S/2})`),y(e,R),e.intersect=function(t){if(h.cM.info("iconSquare intersect",e,t),!e.label)return q.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=m?[{x:a-f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2},{x:a+f.width/2,y:l-r/2+f.height+S},{x:a+w/2,y:l-r/2+f.height+S},{x:a+w/2,y:l+r/2},{x:a-w/2,y:l+r/2},{x:a-w/2,y:l-r/2+f.height+S},{x:a-f.width/2,y:l-r/2+f.height+S}]:[{x:a-w/2,y:l-r/2},{x:a+w/2,y:l-r/2},{x:a+w/2,y:l-r/2+x},{x:a+f.width/2,y:l-r/2+x},{x:a+f.width/2/2,y:l+r/2},{x:a-f.width/2,y:l+r/2},{x:a-f.width/2,y:l-r/2+x},{x:a-w/2,y:l-r/2+x}],q.polygon(e,i,t)},g}async function tf(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:s}=(0,r.UG)(e);e.labelStyle=s;let o=a?.wrappingWidth;e.defaultWidth=a?.wrappingWidth;let g=Math.max(e.label?o??0:0,e?.assetWidth??i),f="on"===e.constraint&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:g,u="on"===e.constraint?f/e.imageAspectRatio:e?.assetHeight??n;e.width=Math.max(f,o??0);let{shapeSvg:p,bbox:m,label:x}=await c(t,e,"image-shape default"),w="t"===e.pos,$=-f/2,b=e.label?8:0,k=d.Z.svg(p),M=(0,r._q)(e,{});"handDrawn"!==e.look&&(M.roughness=0,M.fillStyle="solid");let S=k.rectangle($,-u/2,f,u,M),D=Math.max(f,m.width),W=u+m.height+b,v=k.rectangle(-D/2,-W/2,D,W,{...M,fill:"none",stroke:"none"}),C=p.insert(()=>S,":first-child"),B=p.insert(()=>v);if(e.img){let t=p.append("image");t.attr("href",e.img),t.attr("width",f),t.attr("height",u),t.attr("preserveAspectRatio","none"),t.attr("transform",`translate(${-f/2},${w?W/2-u:-W/2})`)}return x.attr("transform",`translate(${-m.width/2-(m.x-(m.left??0))},${w?-u/2-m.height/2-b/2:u/2-m.height/2+b/2})`),C.attr("transform",`translate(0,${w?m.height/2+b/2:-m.height/2-b/2})`),y(e,B),e.intersect=function(t){if(h.cM.info("iconSquare intersect",e,t),!e.label)return q.rect(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return i=w?[{x:a-m.width/2,y:l-r/2},{x:a+m.width/2,y:l-r/2},{x:a+m.width/2,y:l-r/2+m.height+b},{x:a+f/2,y:l-r/2+m.height+b},{x:a+f/2,y:l+r/2},{x:a-f/2,y:l+r/2},{x:a-f/2,y:l-r/2+m.height+b},{x:a-m.width/2,y:l-r/2+m.height+b}]:[{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},{x:a+m.width/2,y:l-r/2+u},{x:a+m.width/2/2,y:l+r/2},{x:a-m.width/2,y:l+r/2},{x:a-m.width/2,y:l-r/2+u},{x:a-f/2,y:l-r/2+u}],q.polygon(e,i,t)},p}async function tu(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await c(t,e,f(e)),h=Math.max(s.width+(e.padding??0)*2,e?.width??0),o=Math.max(s.height+(e.padding??0)*2,e?.height??0),g=[{x:0,y:0},{x:h,y:0},{x:h+3*o/6,y:-o},{x:-3*o/6,y:-o}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=d.Z.svg(n),l=(0,r._q)(e,{}),i=u(g),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${o/2})`),p&&a.attr("style",p)}else a=U(n,h,o,g);return i&&a.attr("style",i),e.width=h,e.height=o,y(e,a),e.intersect=function(t){return q.polygon(e,g,t)},n}async function tp(t,e,a){let l;let{labelStyles:i,nodeStyles:s}=(0,r.UG)(e);e.labelStyle=i;let{shapeSvg:h,bbox:o}=await c(t,e,f(e)),g=Math.max(o.width+2*a.labelPaddingX,e?.width||0),u=Math.max(o.height+2*a.labelPaddingY,e?.height||0),p=-g/2,m=-u/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=d.Z.svg(h),a=(0,r._q)(e,{}),i=x||w?t.path($(p,m,g,u,x||0),a):t.rectangle(p,m,g,u,a);(l=h.insert(()=>i,":first-child")).attr("class","basic label-container").attr("style",(0,n.R7)(b))}else(l=h.insert("rect",":first-child")).attr("class","basic label-container").attr("style",s).attr("rx",(0,n.R7)(x)).attr("ry",(0,n.R7)(w)).attr("x",p).attr("y",m).attr("width",g).attr("height",u);return y(e,l),e.calcIntersect=function(t,e){return q.rect(t,e)},e.intersect=function(t){return q.rect(e,t)},h}async function tm(t,e){let{shapeSvg:a,bbox:l,label:r}=await c(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))})`),y(e,i),e.intersect=function(t){return q.rect(e,t)},a}async function tx(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await c(t,e,f(e)),h=Math.max(s.width+(e.padding??0),e?.width??0),o=Math.max(s.height+(e.padding??0),e?.height??0),g=[{x:0,y:0},{x:h+3*o/6,y:0},{x:h,y:-o},{x:-(3*o)/6,y:-o}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=d.Z.svg(n),l=(0,r._q)(e,{}),i=u(g),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${o/2})`),p&&a.attr("style",p)}else a=U(n,h,o,g);return i&&a.attr("style",i),e.width=h,e.height=o,y(e,a),e.intersect=function(t){return q.polygon(e,g,t)},n}async function tw(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await c(t,e,f(e)),h=Math.max(s.width+(e.padding??0),e?.width??0),o=Math.max(s.height+(e.padding??0),e?.height??0),g=[{x:-3*o/6,y:0},{x:h,y:0},{x:h+3*o/6,y:-o},{x:0,y:-o}],{cssStyles:p}=e;if("handDrawn"===e.look){let t=d.Z.svg(n),l=(0,r._q)(e,{}),i=u(g),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2}, ${o/2})`),p&&a.attr("style",p)}else a=U(n,h,o,g);return i&&a.attr("style",i),e.width=h,e.height=o,y(e,a),e.intersect=function(t){return q.polygon(e,g,t)},n}function t$(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.label="",e.labelStyle=a;let i=t.insert("g").attr("class",f(e)).attr("id",e.domId??e.id),{cssStyles:n}=e,s=Math.max(35,e?.width??0),o=Math.max(35,e?.height??0),c=[{x:s,y:0},{x:0,y:o+3.5},{x:s-14,y:o+3.5},{x:0,y:2*o},{x:s,y:o-3.5},{x:14,y:o-3.5}],g=d.Z.svg(i),p=(0,r._q)(e,{});"handDrawn"!==e.look&&(p.roughness=0,p.fillStyle="solid");let m=u(c),x=g.path(m,p),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(-${s/2},${-o})`),y(e,w),e.intersect=function(t){return h.cM.info("lightningBolt intersect",e,t),q.polygon(e,c,t)},i}(0,h.eW)(th,"hexagon"),(0,h.eW)(to,"hourglass"),(0,h.eW)(td,"icon"),(0,h.eW)(tc,"iconCircle"),(0,h.eW)(tg,"iconRounded"),(0,h.eW)(ty,"iconSquare"),(0,h.eW)(tf,"imageSquare"),(0,h.eW)(tu,"inv_trapezoid"),(0,h.eW)(tp,"drawRect"),(0,h.eW)(tm,"labelRect"),(0,h.eW)(tx,"lean_left"),(0,h.eW)(tw,"lean_right"),(0,h.eW)(t$,"lightningBolt");var tb=(0,h.eW)((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"),tk=(0,h.eW)((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"),tM=(0,h.eW)((t,e,a,l,r,i)=>`M${t-a/2},${-l/2} a${r},${i} 0,0,0 ${a},0`,"createInnerCylinderPathD");async function tS(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:s,bbox:h,label:o}=await c(t,e,f(e)),g=Math.max(h.width+(e.padding??0),e.width??0),u=g/2,p=u/(2.5+g/50),m=Math.max(h.height+p+(e.padding??0),e.height??0),x=.1*m,{cssStyles:w}=e;if("handDrawn"===e.look){let t=d.Z.svg(s),l=tk(0,0,g,m,u,p,x),i=tM(0,p,g,m,u,p),n=(0,r._q)(e,{}),h=t.path(l,n),o=t.path(i,n);s.insert(()=>o,":first-child").attr("class","line"),(a=s.insert(()=>h,":first-child")).attr("class","basic label-container"),w&&a.attr("style",w)}else{let t=tb(0,0,g,m,u,p,x);a=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,n.R7)(w)).attr("style",i)}return a.attr("label-offset-y",p),a.attr("transform",`translate(${-g/2}, ${-(m/2+p)})`),y(e,a),o.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)+p-(h.y-(h.top??0))})`),e.intersect=function(t){let a=q.rect(e,t),l=a.x-(e.x??0);if(0!=u&&(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-p)){let r=p*p*(1-l*l/(u*u));r>0&&(r=Math.sqrt(r)),r=p-r,t.y-(e.y??0)>0&&(r=-r),a.y+=r}return a},s}async function tD(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await c(t,e,f(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),o=Math.max(n.height+(e.padding??0)*2,e?.height??0),g=o/4,u=o+g,{cssStyles:m}=e,x=d.Z.svg(i),w=(0,r._q)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let $=[{x:-h/2-h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:u/2},...p(-h/2-h/2*.1,u/2,h/2+h/2*.1,u/2,g,.8),{x:h/2+h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:-u/2},{x:-h/2,y:-u/2},{x:-h/2,y:u/2*1.1},{x:-h/2,y:-u/2}],b=x.polygon($.map(t=>[t.x,t.y]),w),k=i.insert(()=>b,":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(0,${-g/2})`),s.attr("transform",`translate(${-h/2+(e.padding??0)+h/2*.1/2-(n.x-(n.left??0))},${-o/2+(e.padding??0)-g/2-(n.y-(n.top??0))})`),y(e,k),e.intersect=function(t){return q.polygon(e,$,t)},i}async function tW(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await c(t,e,f(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),o=Math.max(n.height+(e.padding??0)*2,e?.height??0),g=-h/2,p=-o/2,{cssStyles:m}=e,x=d.Z.svg(i),w=(0,r._q)(e,{}),$=[{x:g-5,y:p+5},{x:g-5,y:p+o+5},{x:g+h-5,y:p+o+5},{x:g+h-5,y:p+o},{x:g+h,y:p+o},{x:g+h,y:p+o-5},{x:g+h+5,y:p+o-5},{x:g+h+5,y:p-5},{x:g+5,y:p-5},{x:g+5,y:p},{x:g,y:p},{x:g,y:p+5}];"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=u($),k=x.path(b,w),M=u([{x:g,y:p+5},{x:g+h-5,y:p+5},{x:g+h-5,y:p+o},{x:g+h,y:p+o},{x:g+h,y:p},{x:g,y:p}]),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"),m&&"handDrawn"!==e.look&&D.selectAll("path").attr("style",m),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))})`),y(e,D),e.intersect=function(t){return q.polygon(e,$,t)},i}async function tv(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await c(t,e,f(e)),h=Math.max(n.width+(e.padding??0)*2,e?.width??0),o=Math.max(n.height+(e.padding??0)*2,e?.height??0),g=o/4,m=o+g,x=-h/2,w=-m/2,{cssStyles:$}=e,b=p(x-5,w+m+5,x+h-5,w+m+5,g,.8),k=b?.[b.length-1],M=[{x:x-5,y:w+5},{x:x-5,y:w+m+5},...b,{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=d.Z.svg(i),W=(0,r._q)(e,{});"handDrawn"!==e.look&&(W.roughness=0,W.fillStyle="solid");let v=u(M),C=D.path(v,W),B=u(S),N=D.path(B,W),A=i.insert(()=>C,":first-child");return A.insert(()=>N),A.attr("class","basic label-container"),$&&"handDrawn"!==e.look&&A.selectAll("path").attr("style",$),l&&"handDrawn"!==e.look&&A.selectAll("path").attr("style",l),A.attr("transform",`translate(0,${-g/2})`),s.attr("transform",`translate(${-(n.width/2)-5-(n.x-(n.left??0))}, ${-(n.height/2)+5-g/2-(n.y-(n.top??0))})`),y(e,A),e.intersect=function(t){return q.polygon(e,M,t)},i}async function tC(t,e,{config:{themeVariables:a}}){let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l,e.useHtmlLabels||(0,s._X)((0,s.iE)())||(e.centerLabel=!0);let{shapeSvg:n,bbox:h,label:o}=await c(t,e,f(e)),g=Math.max(h.width+(e.padding??0)*2,e?.width??0),u=Math.max(h.height+(e.padding??0)*2,e?.height??0),{cssStyles:p}=e,m=d.Z.svg(n),x=(0,r._q)(e,{fill:a.noteBkgColor,stroke:a.noteBorderColor});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=m.rectangle(-g/2,-u/2,g,u,x),$=n.insert(()=>w,":first-child");return $.attr("class","basic label-container"),p&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",p),i&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",i),o.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),y(e,$),e.intersect=function(t){return q.rect(e,t)},n}(0,h.eW)(tS,"linedCylinder"),(0,h.eW)(tD,"linedWaveEdgedRect"),(0,h.eW)(tW,"multiRect"),(0,h.eW)(tv,"multiWaveEdgedRectangle"),(0,h.eW)(tC,"note");var tB=(0,h.eW)((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 tN(t,e){let a;let{labelStyles:l,nodeStyles:i}=(0,r.UG)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await c(t,e,f(e)),h=s.width+e.padding+(s.height+e.padding),o=[{x:h/2,y:0},{x:h,y:-h/2},{x:h/2,y:-h},{x:0,y:-h/2}],{cssStyles:g}=e;if("handDrawn"===e.look){let t=d.Z.svg(n),l=(0,r._q)(e,{}),i=tB(0,0,h),s=t.path(i,l);a=n.insert(()=>s,":first-child").attr("transform",`translate(${-h/2+.5}, ${h/2})`),g&&a.attr("style",g)}else(a=U(n,h,h,o)).attr("transform",`translate(${-h/2+.5}, ${h/2})`);return i&&a.attr("style",i),y(e,a),e.calcIntersect=function(t,e){let a=t.width,l=q.polygon(t,[{x:a/2,y:0},{x:a,y:-a/2},{x:a/2,y:-a},{x:0,y:-a/2}],e);return{x:l.x-.5,y:l.y-.5}},e.intersect=function(t){return this.calcIntersect(e,t)},n}async function tA(t,e){let{labelStyles:a,nodeStyles:l}=(0,r.UG)(e);e.labelStyle=a;let{shapeSvg:i,bbox:n,label:s}=await c(t,e,f(e)),h=Math.max(n.width+(e.padding??0),e?.width??0),o=Math.max(n.height+(e.padding??0),e?.height??0),g=-h/2,p=-o/2,m=p/2,x=[{x:g+m,y:p},{x:g,y:0},{x:g+m,y:-p},{x:-g,y:-p},{x:-g,y:p}],{cssStyles:w}=e,$=d.Z.svg(i),b=(0,r._q)(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let k=u(x),M=$.path(k,b),S=i.insert(()=>M,":first-child");return S.attr("class","basic label-container"),w&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",w),l&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",l),S.attr("transform",`translate(${-m/2},0)`),s.attr("transform",`translate(${-m/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),y(e,S),e.intersect=function(t){return q.polygon(e,x,t)},i}async function t_(t,e){let a,l,i;let{labelStyles:n,nodeStyles:c}=(0,r.UG)(e);e.labelStyle=n,a=e.cssClasses?"node "+e.c