54 lines
88 KiB
JavaScript
54 lines
88 KiB
JavaScript
import{a as At,b as Mt}from"./chunk-XODN6PIJ.mjs";import{a as N}from"./chunk-IWDTEBJL.mjs";import{a as Ot,b as ft,d as w,e as D}from"./chunk-D2KP3OBD.mjs";import{c as mt,f as et}from"./chunk-YLHEXJF3.mjs";import{i as xt,o as St,q as X}from"./chunk-Q3CC2MQB.mjs";import{$ as $t,B as Rt,C as Ht,Y,m as nt,s as pt,w as U,z as kt}from"./chunk-3UWU4A3N.mjs";import{b as _,h as z}from"./chunk-MGPAVIPZ.mjs";import{a as x}from"./chunk-VELTKBKT.mjs";var C=x(async(f,t,h)=>{let l,o=t.useHtmlLabels||nt(Y()?.htmlLabels);h?l=h:l="node default";let i=f.insert("g").attr("class",l).attr("id",t.domId||t.id),c=i.insert("g").attr("class","label").attr("style",X(t.labelStyle)),r;t.label===void 0?r="":r=typeof t.label=="string"?t.label:t.label[0];let n=!!t.icon||!!t.img,e=t.labelType==="markdown",s=await et(c,kt(St(r),Y()),{useHtmlLabels:o,width:t.width||Y().flowchart?.wrappingWidth,cssClasses:e?"markdown-node-label":void 0,style:t.labelStyle,addSvgBackground:n,markdown:e},Y()),a=s.getBBox(),p=(t?.padding??0)/2;if(o){let m=s.children[0],g=z(s);await At(m,r),a=m.getBoundingClientRect(),g.attr("width",a.width),g.attr("height",a.height)}return o?c.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):c.attr("transform","translate(0, "+-a.height/2+")"),t.centerLabel&&c.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:i,bbox:a,halfPadding:p,label:c}},"labelHelper"),Dt=x(async(f,t,h)=>{let l=h.useHtmlLabels??U(Y()),o=f.insert("g").attr("class","label").attr("style",h.labelStyle||""),i=await et(o,kt(St(t),Y()),{useHtmlLabels:l,width:h.width||Y()?.flowchart?.wrappingWidth,style:h.labelStyle,addSvgBackground:!!h.icon||!!h.img}),c=i.getBBox(),r=h.padding/2;if(U(Y())){let n=i.children[0],e=z(i);c=n.getBoundingClientRect(),e.attr("width",c.width),e.attr("height",c.height)}return l?o.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"):o.attr("transform","translate(0, "+-c.height/2+")"),h.centerLabel&&o.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:f,bbox:c,halfPadding:r,label:o}},"insertLabel"),$=x((f,t)=>{let h=t.node().getBBox();f.width=h.width,f.height=h.height},"updateNodeBounds");var B=x((f,t)=>(f.look==="handDrawn"?"rough-node":"node")+" "+f.cssClasses+" "+(t||""),"getNodeClasses");function H(f){let t=f.map((h,l)=>`${l===0?"M":"L"}${h.x},${h.y}`);return t.push("Z"),t.join(" ")}x(H,"createPathFromPoints");function it(f,t,h,l,o,i){let c=[],n=h-f,e=l-t,s=n/i,a=2*Math.PI/s,p=t+e/2;for(let m=0;m<=50;m++){let g=m/50,d=f+g*n,u=p+o*Math.sin(a*(d-f));c.push({x:d,y:u})}return c}x(it,"generateFullSineWavePoints");function bt(f,t,h,l,o,i){let c=[],r=o*Math.PI/180,s=(i*Math.PI/180-r)/(l-1);for(let a=0;a<l;a++){let p=r+a*s,m=f+h*Math.cos(p),g=t+h*Math.sin(p);c.push({x:-m,y:-g})}return c}x(bt,"generateCirclePoints");var ss=x((f,t)=>{var h=f.x,l=f.y,o=t.x-h,i=t.y-l,c=f.width/2,r=f.height/2,n,e;return Math.abs(i)*c>Math.abs(o)*r?(i<0&&(r=-r),n=i===0?0:r*o/i,e=r):(o<0&&(c=-c),n=c,e=o===0?0:c*i/o),{x:h+n,y:l+e}},"intersectRect"),gt=ss;var rs=x(async(f,t,h,l=!1,o=!1)=>{let i=t||"";typeof i=="object"&&(i=i[0]);let c=Y(),r=U(c);return await et(f,i,{style:h,isTitle:l,useHtmlLabels:r,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},c)},"createLabel"),wt=rs;var st=x((f,t,h,l,o)=>["M",f+o,t,"H",f+h-o,"A",o,o,0,0,1,f+h,t+o,"V",t+l-o,"A",o,o,0,0,1,f+h-o,t+l,"H",f+o,"A",o,o,0,0,1,f,t+l-o,"V",t+o,"A",o,o,0,0,1,f+o,t,"Z"].join(" "),"createRoundedRectPathD");var Lt=x(async(f,t)=>{_.info("Creating subgraph rect for ",t.id,t);let h=Y(),{themeVariables:l,handDrawnSeed:o}=h,{clusterBkg:i,clusterBorder:c}=l,{labelStyles:r,nodeStyles:n,borderStyles:e,backgroundStyles:s}=w(t),a=f.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),p=U(h),m=a.insert("g").attr("class","cluster-label "),g;t.labelType==="markdown"?g=await et(m,t.label,{style:t.labelStyle,useHtmlLabels:p,isNode:!0,width:t.width}):g=await wt(m,t.label,t.labelStyle||"",!1,!0);let d=g.getBBox();if(U(h)){let k=g.children[0],R=z(g);d=k.getBoundingClientRect(),R.attr("width",d.width),R.attr("height",d.height)}let u=t.width<=d.width+t.padding?d.width+t.padding:t.width;t.width<=d.width+t.padding?t.diff=(u-t.width)/2-t.padding:t.diff=-t.padding;let y=t.height,S=t.x-u/2,P=t.y-y/2;_.trace("Data ",t,JSON.stringify(t));let T;if(t.look==="handDrawn"){let k=N.svg(a),R=D(t,{roughness:.7,fill:i,stroke:c,fillWeight:3,seed:o}),G=k.path(st(S,P,u,y,0),R);T=a.insert(()=>(_.debug("Rough node insert CXC",G),G),":first-child"),T.select("path:nth-child(2)").attr("style",e.join(";")),T.select("path").attr("style",s.join(";").replace("fill","stroke"))}else T=a.insert("rect",":first-child"),T.attr("style",n).attr("rx",t.rx).attr("ry",t.ry).attr("x",S).attr("y",P).attr("width",u).attr("height",y);let{subGraphTitleTopMargin:v}=Mt(h);if(m.attr("transform",`translate(${t.x-d.width/2}, ${t.y-t.height/2+v})`),r){let k=m.select("span");k&&k.attr("style",r)}let M=T.node().getBBox();return t.offsetX=0,t.width=M.width,t.height=M.height,t.offsetY=d.height-t.padding/2,t.intersect=function(k){return gt(t,k)},{cluster:a,labelBBox:d}},"rect"),is=x((f,t)=>{let h=f.insert("g").attr("class","note-cluster").attr("id",t.id),l=h.insert("rect",":first-child"),o=0*t.padding,i=o/2;l.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-i).attr("y",t.y-t.height/2-i).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");let c=l.node().getBBox();return t.width=c.width,t.height=c.height,t.intersect=function(r){return gt(t,r)},{cluster:h,labelBBox:{width:0,height:0}}},"noteGroup"),os=x(async(f,t)=>{let h=Y(),{themeVariables:l,handDrawnSeed:o}=h,{altBackground:i,compositeBackground:c,compositeTitleBackground:r,nodeBorder:n}=l,e=f.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-id",t.id).attr("data-look",t.look),s=e.insert("g",":first-child"),a=e.insert("g").attr("class","cluster-label"),p=e.append("rect"),m=await wt(a,t.label,t.labelStyle,void 0,!0),g=m.getBBox();if(U(h)){let G=m.children[0],V=z(m);g=G.getBoundingClientRect(),V.attr("width",g.width),V.attr("height",g.height)}let d=0*t.padding,u=d/2,y=(t.width<=g.width+t.padding?g.width+t.padding:t.width)+d;t.width<=g.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;let S=t.height+d,P=t.height+d-g.height-6,T=t.x-y/2,v=t.y-S/2;t.width=y;let M=t.y-t.height/2-u+g.height+2,k;if(t.look==="handDrawn"){let G=t.cssClasses.includes("statediagram-cluster-alt"),V=N.svg(e),A=t.rx||t.ry?V.path(st(T,v,y,S,10),{roughness:.7,fill:r,fillStyle:"solid",stroke:n,seed:o}):V.rectangle(T,v,y,S,{seed:o});k=e.insert(()=>A,":first-child");let O=V.rectangle(T,M,y,P,{fill:G?i:c,fillStyle:G?"hachure":"solid",stroke:n,seed:o});k=e.insert(()=>A,":first-child"),p=e.insert(()=>O)}else k=s.insert("rect",":first-child"),k.attr("class","outer").attr("x",T).attr("y",v).attr("width",y).attr("height",S).attr("data-look",t.look),p.attr("class","inner").attr("x",T).attr("y",M).attr("width",y).attr("height",P);a.attr("transform",`translate(${t.x-g.width/2}, ${v+1-(U(h)?0:3)})`);let R=k.node().getBBox();return t.height=R.height,t.offsetX=0,t.offsetY=g.height-t.padding/2,t.labelBBox=g,t.intersect=function(G){return gt(t,G)},{cluster:e,labelBBox:g}},"roundedWithTitle"),as=x(async(f,t)=>{_.info("Creating subgraph rect for ",t.id,t);let h=Y(),{themeVariables:l,handDrawnSeed:o}=h,{clusterBkg:i,clusterBorder:c}=l,{labelStyles:r,nodeStyles:n,borderStyles:e,backgroundStyles:s}=w(t),a=f.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),p=U(h),m=a.insert("g").attr("class","cluster-label "),g=await et(m,t.label,{style:t.labelStyle,useHtmlLabels:p,isNode:!0,width:t.width}),d=g.getBBox();if(U(h)){let k=g.children[0],R=z(g);d=k.getBoundingClientRect(),R.attr("width",d.width),R.attr("height",d.height)}let u=t.width<=d.width+t.padding?d.width+t.padding:t.width;t.width<=d.width+t.padding?t.diff=(u-t.width)/2-t.padding:t.diff=-t.padding;let y=t.height,S=t.x-u/2,P=t.y-y/2;_.trace("Data ",t,JSON.stringify(t));let T;if(t.look==="handDrawn"){let k=N.svg(a),R=D(t,{roughness:.7,fill:i,stroke:c,fillWeight:4,seed:o}),G=k.path(st(S,P,u,y,t.rx),R);T=a.insert(()=>(_.debug("Rough node insert CXC",G),G),":first-child"),T.select("path:nth-child(2)").attr("style",e.join(";")),T.select("path").attr("style",s.join(";").replace("fill","stroke"))}else T=a.insert("rect",":first-child"),T.attr("style",n).attr("rx",t.rx).attr("ry",t.ry).attr("x",S).attr("y",P).attr("width",u).attr("height",y);let{subGraphTitleTopMargin:v}=Mt(h);if(m.attr("transform",`translate(${t.x-d.width/2}, ${t.y-t.height/2+v})`),r){let k=m.select("span");k&&k.attr("style",r)}let M=T.node().getBBox();return t.offsetX=0,t.width=M.width,t.height=M.height,t.offsetY=d.height-t.padding/2,t.intersect=function(k){return gt(t,k)},{cluster:a,labelBBox:d}},"kanbanSection"),ns=x((f,t)=>{let h=Y(),{themeVariables:l,handDrawnSeed:o}=h,{nodeBorder:i}=l,c=f.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-look",t.look),r=c.insert("g",":first-child"),n=0*t.padding,e=t.width+n;t.diff=-t.padding;let s=t.height+n,a=t.x-e/2,p=t.y-s/2;t.width=e;let m;if(t.look==="handDrawn"){let u=N.svg(c).rectangle(a,p,e,s,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:i,seed:o});m=c.insert(()=>u,":first-child")}else m=r.insert("rect",":first-child"),m.attr("class","divider").attr("x",a).attr("y",p).attr("width",e).attr("height",s).attr("data-look",t.look);let g=m.node().getBBox();return t.height=g.height,t.offsetX=0,t.offsetY=0,t.intersect=function(d){return gt(t,d)},{cluster:c,labelBBox:{}}},"divider"),ls=Lt,cs={rect:Lt,squareRect:ls,roundedWithTitle:os,noteGroup:is,divider:ns,kanbanSection:as},Vt=new Map,ar=x(async(f,t)=>{let h=t.shape||"rect",l=await cs[h](f,t);return Vt.set(t.id,l),l},"insertCluster");var nr=x(()=>{Vt=new Map},"clear");function hs(f,t){return f.intersect(t)}x(hs,"intersectNode");var Wt=hs;function ps(f,t,h,l){var o=f.x,i=f.y,c=o-l.x,r=i-l.y,n=Math.sqrt(t*t*r*r+h*h*c*c),e=Math.abs(t*h*c/n);l.x<o&&(e=-e);var s=Math.abs(t*h*r/n);return l.y<i&&(s=-s),{x:o+e,y:i+s}}x(ps,"intersectEllipse");var vt=ps;function ms(f,t,h){return vt(f,t,t,h)}x(ms,"intersectCircle");var It=ms;function fs(f,t,h,l){{let o=t.y-f.y,i=f.x-t.x,c=t.x*f.y-f.x*t.y,r=o*h.x+i*h.y+c,n=o*l.x+i*l.y+c,e=1e-6;if(r!==0&&n!==0&&Ft(r,n))return;let s=l.y-h.y,a=h.x-l.x,p=l.x*h.y-h.x*l.y,m=s*f.x+a*f.y+p,g=s*t.x+a*t.y+p;if(Math.abs(m)<e&&Math.abs(g)<e&&Ft(m,g))return;let d=o*a-s*i;if(d===0)return;let u=Math.abs(d/2),y=i*p-a*c,S=y<0?(y-u)/d:(y+u)/d;y=s*c-o*p;let P=y<0?(y-u)/d:(y+u)/d;return{x:S,y:P}}}x(fs,"intersectLine");function Ft(f,t){return f*t>0}x(Ft,"sameSign");var _t=fs;function gs(f,t,h){let l=f.x,o=f.y,i=[],c=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(s){c=Math.min(c,s.x),r=Math.min(r,s.y)}):(c=Math.min(c,t.x),r=Math.min(r,t.y));let n=l-f.width/2-c,e=o-f.height/2-r;for(let s=0;s<t.length;s++){let a=t[s],p=t[s<t.length-1?s+1:0],m=_t(f,h,{x:n+a.x,y:e+a.y},{x:n+p.x,y:e+p.y});m&&i.push(m)}return i.length?(i.length>1&&i.sort(function(s,a){let p=s.x-h.x,m=s.y-h.y,g=Math.sqrt(p*p+m*m),d=a.x-h.x,u=a.y-h.y,y=Math.sqrt(d*d+u*u);return g<y?-1:g===y?0:1}),i[0]):f}x(gs,"intersectPolygon");var Xt=gs;var b={node:Wt,circle:It,ellipse:vt,polygon:Xt,rect:gt};function qt(f,t){let{labelStyles:h}=w(t);t.labelStyle=h;let l=B(t),o=l;l||(o="anchor");let i=f.insert("g").attr("class",o).attr("id",t.domId||t.id),c=1,{cssStyles:r}=t,n=N.svg(i),e=D(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(e.roughness=0);let s=n.circle(0,0,c*2,e),a=i.insert(()=>s,":first-child");return a.attr("class","anchor").attr("style",X(r)),$(t,a),t.intersect=function(p){return _.info("Circle intersect",t,c,p),b.circle(t,c,p)},i}x(qt,"anchor");function Yt(f,t,h,l,o,i,c){let n=(f+h)/2,e=(t+l)/2,s=Math.atan2(l-t,h-f),a=(h-f)/2,p=(l-t)/2,m=a/o,g=p/i,d=Math.sqrt(m**2+g**2);if(d>1)throw new Error("The given radii are too small to create an arc between the points.");let u=Math.sqrt(1-d**2),y=n+u*i*Math.sin(s)*(c?-1:1),S=e-u*o*Math.cos(s)*(c?-1:1),P=Math.atan2((t-S)/i,(f-y)/o),v=Math.atan2((l-S)/i,(h-y)/o)-P;c&&v<0&&(v+=2*Math.PI),!c&&v>0&&(v-=2*Math.PI);let M=[];for(let k=0;k<20;k++){let R=k/19,G=P+R*v,V=y+o*Math.cos(G),A=S+i*Math.sin(G);M.push({x:V,y:A})}return M}x(Yt,"generateArcPoints");async function zt(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i}=await C(f,t,B(t)),c=i.width+t.padding+20,r=i.height+t.padding,n=r/2,e=n/(2.5+r/50),{cssStyles:s}=t,a=[{x:c/2,y:-r/2},{x:-c/2,y:-r/2},...Yt(-c/2,-r/2,-c/2,r/2,e,n,!1),{x:c/2,y:r/2},...Yt(c/2,r/2,c/2,-r/2,e,n,!0)],p=N.svg(o),m=D(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=H(a),d=p.path(g,m),u=o.insert(()=>d,":first-child");return u.attr("class","basic label-container"),s&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",s),l&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",l),u.attr("transform",`translate(${e/2}, 0)`),$(t,u),t.intersect=function(y){return b.polygon(t,a,y)},o}x(zt,"bowTieRect");function K(f,t,h,l){return f.insert("polygon",":first-child").attr("points",l.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+h/2+")")}x(K,"insertPolygonShape");async function Ut(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i}=await C(f,t,B(t)),c=i.height+t.padding,r=12,n=i.width+t.padding+r,e=0,s=n,a=-c,p=0,m=[{x:e+r,y:a},{x:s,y:a},{x:s,y:p},{x:e,y:p},{x:e,y:a+r},{x:e+r,y:a}],g,{cssStyles:d}=t;if(t.look==="handDrawn"){let u=N.svg(o),y=D(t,{}),S=H(m),P=u.path(S,y);g=o.insert(()=>P,":first-child").attr("transform",`translate(${-n/2}, ${c/2})`),d&&g.attr("style",d)}else g=K(o,n,c,m);return l&&g.attr("style",l),$(t,g),t.intersect=function(u){return b.polygon(t,m,u)},o}x(Ut,"card");function Zt(f,t){let{nodeStyles:h}=w(t);t.label="";let l=f.insert("g").attr("class",B(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,i=Math.max(28,t.width??0),c=[{x:0,y:i/2},{x:i/2,y:0},{x:0,y:-i/2},{x:-i/2,y:0}],r=N.svg(l),n=D(t,{});t.look!=="handDrawn"&&(n.roughness=0,n.fillStyle="solid");let e=H(c),s=r.path(e,n),a=l.insert(()=>s,":first-child");return o&&t.look!=="handDrawn"&&a.selectAll("path").attr("style",o),h&&t.look!=="handDrawn"&&a.selectAll("path").attr("style",h),t.width=28,t.height=28,t.intersect=function(p){return b.polygon(t,c,p)},l}x(Zt,"choice");async function Bt(f,t,h){let{labelStyles:l,nodeStyles:o}=w(t);t.labelStyle=l;let{shapeSvg:i,bbox:c,halfPadding:r}=await C(f,t,B(t)),n=h?.padding??r,e=c.width/2+n,s,{cssStyles:a}=t;if(t.look==="handDrawn"){let p=N.svg(i),m=D(t,{}),g=p.circle(0,0,e*2,m);s=i.insert(()=>g,":first-child"),s.attr("class","basic label-container").attr("style",X(a))}else s=i.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",e).attr("cx",0).attr("cy",0);return $(t,s),t.calcIntersect=function(p,m){let g=p.width/2;return b.circle(p,g,m)},t.intersect=function(p){return _.info("Circle intersect",t,e,p),b.circle(t,e,p)},i}x(Bt,"circle");function ds(f){let t=Math.cos(Math.PI/4),h=Math.sin(Math.PI/4),l=f*2,o={x:l/2*t,y:l/2*h},i={x:-(l/2)*t,y:l/2*h},c={x:-(l/2)*t,y:-(l/2)*h},r={x:l/2*t,y:-(l/2)*h};return`M ${i.x},${i.y} L ${r.x},${r.y}
|
|
M ${o.x},${o.y} L ${c.x},${c.y}`}x(ds,"createLine");function Jt(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h,t.label="";let o=f.insert("g").attr("class",B(t)).attr("id",t.domId??t.id),i=Math.max(30,t?.width??0),{cssStyles:c}=t,r=N.svg(o),n=D(t,{});t.look!=="handDrawn"&&(n.roughness=0,n.fillStyle="solid");let e=r.circle(0,0,i*2,n),s=ds(i),a=r.path(s,n),p=o.insert(()=>e,":first-child");return p.insert(()=>a),c&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",c),l&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",l),$(t,p),t.intersect=function(m){return _.info("crossedCircle intersect",t,{radius:i,point:m}),b.circle(t,i,m)},o}x(Jt,"crossedCircle");function dt(f,t,h,l=100,o=0,i=180){let c=[],r=o*Math.PI/180,s=(i*Math.PI/180-r)/(l-1);for(let a=0;a<l;a++){let p=r+a*s,m=f+h*Math.cos(p),g=t+h*Math.sin(p);c.push({x:-m,y:-g})}return c}x(dt,"generateCirclePoints");async function Kt(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c}=await C(f,t,B(t)),r=i.width+(t.padding??0),n=i.height+(t.padding??0),e=Math.max(5,n*.1),{cssStyles:s}=t,a=[...dt(r/2,-n/2,e,30,-90,0),{x:-r/2-e,y:e},...dt(r/2+e*2,-e,e,20,-180,-270),...dt(r/2+e*2,e,e,20,-90,-180),{x:-r/2-e,y:-n/2},...dt(r/2,n/2,e,20,0,90)],p=[{x:r/2,y:-n/2-e},{x:-r/2,y:-n/2-e},...dt(r/2,-n/2,e,20,-90,0),{x:-r/2-e,y:-e},...dt(r/2+r*.1,-e,e,20,-180,-270),...dt(r/2+r*.1,e,e,20,-90,-180),{x:-r/2-e,y:n/2},...dt(r/2,n/2,e,20,0,90),{x:-r/2,y:n/2+e},{x:r/2,y:n/2+e}],m=N.svg(o),g=D(t,{fill:"none"});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let u=H(a).replace("Z",""),y=m.path(u,g),S=H(p),P=m.path(S,{...g}),T=o.insert("g",":first-child");return T.insert(()=>P,":first-child").attr("stroke-opacity",0),T.insert(()=>y,":first-child"),T.attr("class","text"),s&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",s),l&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",l),T.attr("transform",`translate(${e}, 0)`),c.attr("transform",`translate(${-r/2+e-(i.x-(i.left??0))},${-n/2+(t.padding??0)/2-(i.y-(i.top??0))})`),$(t,T),t.intersect=function(v){return b.polygon(t,p,v)},o}x(Kt,"curlyBraceLeft");function yt(f,t,h,l=100,o=0,i=180){let c=[],r=o*Math.PI/180,s=(i*Math.PI/180-r)/(l-1);for(let a=0;a<l;a++){let p=r+a*s,m=f+h*Math.cos(p),g=t+h*Math.sin(p);c.push({x:m,y:g})}return c}x(yt,"generateCirclePoints");async function Qt(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c}=await C(f,t,B(t)),r=i.width+(t.padding??0),n=i.height+(t.padding??0),e=Math.max(5,n*.1),{cssStyles:s}=t,a=[...yt(r/2,-n/2,e,20,-90,0),{x:r/2+e,y:-e},...yt(r/2+e*2,-e,e,20,-180,-270),...yt(r/2+e*2,e,e,20,-90,-180),{x:r/2+e,y:n/2},...yt(r/2,n/2,e,20,0,90)],p=[{x:-r/2,y:-n/2-e},{x:r/2,y:-n/2-e},...yt(r/2,-n/2,e,20,-90,0),{x:r/2+e,y:-e},...yt(r/2+e*2,-e,e,20,-180,-270),...yt(r/2+e*2,e,e,20,-90,-180),{x:r/2+e,y:n/2},...yt(r/2,n/2,e,20,0,90),{x:r/2,y:n/2+e},{x:-r/2,y:n/2+e}],m=N.svg(o),g=D(t,{fill:"none"});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let u=H(a).replace("Z",""),y=m.path(u,g),S=H(p),P=m.path(S,{...g}),T=o.insert("g",":first-child");return T.insert(()=>P,":first-child").attr("stroke-opacity",0),T.insert(()=>y,":first-child"),T.attr("class","text"),s&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",s),l&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",l),T.attr("transform",`translate(${-e}, 0)`),c.attr("transform",`translate(${-r/2+(t.padding??0)/2-(i.x-(i.left??0))},${-n/2+(t.padding??0)/2-(i.y-(i.top??0))})`),$(t,T),t.intersect=function(v){return b.polygon(t,p,v)},o}x(Qt,"curlyBraceRight");function Q(f,t,h,l=100,o=0,i=180){let c=[],r=o*Math.PI/180,s=(i*Math.PI/180-r)/(l-1);for(let a=0;a<l;a++){let p=r+a*s,m=f+h*Math.cos(p),g=t+h*Math.sin(p);c.push({x:-m,y:-g})}return c}x(Q,"generateCirclePoints");async function te(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c}=await C(f,t,B(t)),r=i.width+(t.padding??0),n=i.height+(t.padding??0),e=Math.max(5,n*.1),{cssStyles:s}=t,a=[...Q(r/2,-n/2,e,30,-90,0),{x:-r/2-e,y:e},...Q(r/2+e*2,-e,e,20,-180,-270),...Q(r/2+e*2,e,e,20,-90,-180),{x:-r/2-e,y:-n/2},...Q(r/2,n/2,e,20,0,90)],p=[...Q(-r/2+e+e/2,-n/2,e,20,-90,-180),{x:r/2-e/2,y:e},...Q(-r/2-e/2,-e,e,20,0,90),...Q(-r/2-e/2,e,e,20,-90,0),{x:r/2-e/2,y:-e},...Q(-r/2+e+e/2,n/2,e,30,-180,-270)],m=[{x:r/2,y:-n/2-e},{x:-r/2,y:-n/2-e},...Q(r/2,-n/2,e,20,-90,0),{x:-r/2-e,y:-e},...Q(r/2+e*2,-e,e,20,-180,-270),...Q(r/2+e*2,e,e,20,-90,-180),{x:-r/2-e,y:n/2},...Q(r/2,n/2,e,20,0,90),{x:-r/2,y:n/2+e},{x:r/2-e-e/2,y:n/2+e},...Q(-r/2+e+e/2,-n/2,e,20,-90,-180),{x:r/2-e/2,y:e},...Q(-r/2-e/2,-e,e,20,0,90),...Q(-r/2-e/2,e,e,20,-90,0),{x:r/2-e/2,y:-e},...Q(-r/2+e+e/2,n/2,e,30,-180,-270)],g=N.svg(o),d=D(t,{fill:"none"});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let y=H(a).replace("Z",""),S=g.path(y,d),T=H(p).replace("Z",""),v=g.path(T,d),M=H(m),k=g.path(M,{...d}),R=o.insert("g",":first-child");return R.insert(()=>k,":first-child").attr("stroke-opacity",0),R.insert(()=>S,":first-child"),R.insert(()=>v,":first-child"),R.attr("class","text"),s&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",s),l&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",l),R.attr("transform",`translate(${e-e/4}, 0)`),c.attr("transform",`translate(${-r/2+(t.padding??0)/2-(i.x-(i.left??0))},${-n/2+(t.padding??0)/2-(i.y-(i.top??0))})`),$(t,R),t.intersect=function(G){return b.polygon(t,m,G)},o}x(te,"curlyBraces");async function ee(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i}=await C(f,t,B(t)),c=80,r=20,n=Math.max(c,(i.width+(t.padding??0)*2)*1.25,t?.width??0),e=Math.max(r,i.height+(t.padding??0)*2,t?.height??0),s=e/2,{cssStyles:a}=t,p=N.svg(o),m=D(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=n,d=e,u=g-s,y=d/4,S=[{x:u,y:0},{x:y,y:0},{x:0,y:d/2},{x:y,y:d},{x:u,y:d},...bt(-u,-d/2,s,50,270,90)],P=H(S),T=p.path(P,m),v=o.insert(()=>T,":first-child");return v.attr("class","basic label-container"),a&&t.look!=="handDrawn"&&v.selectChildren("path").attr("style",a),l&&t.look!=="handDrawn"&&v.selectChildren("path").attr("style",l),v.attr("transform",`translate(${-n/2}, ${-e/2})`),$(t,v),t.intersect=function(M){return b.polygon(t,S,M)},o}x(ee,"curvedTrapezoid");var ys=x((f,t,h,l,o,i)=>[`M${f},${t+i}`,`a${o},${i} 0,0,0 ${h},0`,`a${o},${i} 0,0,0 ${-h},0`,`l0,${l}`,`a${o},${i} 0,0,0 ${h},0`,`l0,${-l}`].join(" "),"createCylinderPathD"),us=x((f,t,h,l,o,i)=>[`M${f},${t+i}`,`M${f+h},${t+i}`,`a${o},${i} 0,0,0 ${-h},0`,`l0,${l}`,`a${o},${i} 0,0,0 ${h},0`,`l0,${-l}`].join(" "),"createOuterCylinderPathD"),xs=x((f,t,h,l,o,i)=>[`M${f-h/2},${-l/2}`,`a${o},${i} 0,0,0 ${h},0`].join(" "),"createInnerCylinderPathD");async function se(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c}=await C(f,t,B(t)),r=Math.max(i.width+t.padding,t.width??0),n=r/2,e=n/(2.5+r/50),s=Math.max(i.height+e+t.padding,t.height??0),a,{cssStyles:p}=t;if(t.look==="handDrawn"){let m=N.svg(o),g=us(0,0,r,s,n,e),d=xs(0,e,r,s,n,e),u=m.path(g,D(t,{})),y=m.path(d,D(t,{fill:"none"}));a=o.insert(()=>y,":first-child"),a=o.insert(()=>u,":first-child"),a.attr("class","basic label-container"),p&&a.attr("style",p)}else{let m=ys(0,0,r,s,n,e);a=o.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",X(p)).attr("style",l)}return a.attr("label-offset-y",e),a.attr("transform",`translate(${-r/2}, ${-(s/2+e)})`),$(t,a),c.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)+(t.padding??0)/1.5-(i.y-(i.top??0))})`),t.intersect=function(m){let g=b.rect(t,m),d=g.x-(t.x??0);if(n!=0&&(Math.abs(d)<(t.width??0)/2||Math.abs(d)==(t.width??0)/2&&Math.abs(g.y-(t.y??0))>(t.height??0)/2-e)){let u=e*e*(1-d*d/(n*n));u>0&&(u=Math.sqrt(u)),u=e-u,m.y-(t.y??0)>0&&(u=-u),g.y+=u}return g},o}x(se,"cylinder");async function re(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c}=await C(f,t,B(t)),r=i.width+t.padding,n=i.height+t.padding,e=n*.2,s=-r/2,a=-n/2-e/2,{cssStyles:p}=t,m=N.svg(o),g=D(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let d=[{x:s,y:a+e},{x:-s,y:a+e},{x:-s,y:-a},{x:s,y:-a},{x:s,y:a},{x:-s,y:a},{x:-s,y:a+e}],u=m.polygon(d.map(S=>[S.x,S.y]),g),y=o.insert(()=>u,":first-child");return y.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",p),l&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",l),c.attr("transform",`translate(${s+(t.padding??0)/2-(i.x-(i.left??0))}, ${a+e+(t.padding??0)/2-(i.y-(i.top??0))})`),$(t,y),t.intersect=function(S){return b.rect(t,S)},o}x(re,"dividedRectangle");async function ie(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,halfPadding:c}=await C(f,t,B(t)),n=i.width/2+c+5,e=i.width/2+c,s,{cssStyles:a}=t;if(t.look==="handDrawn"){let p=N.svg(o),m=D(t,{roughness:.2,strokeWidth:2.5}),g=D(t,{roughness:.2,strokeWidth:1.5}),d=p.circle(0,0,n*2,m),u=p.circle(0,0,e*2,g);s=o.insert("g",":first-child"),s.attr("class",X(t.cssClasses)).attr("style",X(a)),s.node()?.appendChild(d),s.node()?.appendChild(u)}else{s=o.insert("g",":first-child");let p=s.insert("circle",":first-child"),m=s.insert("circle");s.attr("class","basic label-container").attr("style",l),p.attr("class","outer-circle").attr("style",l).attr("r",n).attr("cx",0).attr("cy",0),m.attr("class","inner-circle").attr("style",l).attr("r",e).attr("cx",0).attr("cy",0)}return $(t,s),t.intersect=function(p){return _.info("DoubleCircle intersect",t,n,p),b.circle(t,n,p)},o}x(ie,"doublecircle");function oe(f,t,{config:{themeVariables:h}}){let{labelStyles:l,nodeStyles:o}=w(t);t.label="",t.labelStyle=l;let i=f.insert("g").attr("class",B(t)).attr("id",t.domId??t.id),c=7,{cssStyles:r}=t,n=N.svg(i),{nodeBorder:e}=h,s=D(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(s.roughness=0);let a=n.circle(0,0,c*2,s),p=i.insert(()=>a,":first-child");return p.selectAll("path").attr("style",`fill: ${e} !important;`),r&&r.length>0&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",r),o&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",o),$(t,p),t.intersect=function(m){return _.info("filledCircle intersect",t,{radius:c,point:m}),b.circle(t,c,m)},i}x(oe,"filledCircle");async function ae(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c}=await C(f,t,B(t)),r=i.width+(t.padding??0),n=r+i.height,e=r+i.height,s=[{x:0,y:-n},{x:e,y:-n},{x:e/2,y:0}],{cssStyles:a}=t,p=N.svg(o),m=D(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=H(s),d=p.path(g,m),u=o.insert(()=>d,":first-child").attr("transform",`translate(${-n/2}, ${n/2})`);return a&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",a),l&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",l),t.width=r,t.height=n,$(t,u),c.attr("transform",`translate(${-i.width/2-(i.x-(i.left??0))}, ${-n/2+(t.padding??0)/2+(i.y-(i.top??0))})`),t.intersect=function(y){return _.info("Triangle intersect",t,s,y),b.polygon(t,s,y)},o}x(ae,"flippedTriangle");function ne(f,t,{dir:h,config:{state:l,themeVariables:o}}){let{nodeStyles:i}=w(t);t.label="";let c=f.insert("g").attr("class",B(t)).attr("id",t.domId??t.id),{cssStyles:r}=t,n=Math.max(70,t?.width??0),e=Math.max(10,t?.height??0);h==="LR"&&(n=Math.max(10,t?.width??0),e=Math.max(70,t?.height??0));let s=-1*n/2,a=-1*e/2,p=N.svg(c),m=D(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=p.rectangle(s,a,n,e,m),d=c.insert(()=>g,":first-child");r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),i&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",i),$(t,d);let u=l?.padding??0;return t.width&&t.height&&(t.width+=u/2||0,t.height+=u/2||0),t.intersect=function(y){return b.rect(t,y)},c}x(ne,"forkJoin");async function le(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let o=80,i=50,{shapeSvg:c,bbox:r}=await C(f,t,B(t)),n=Math.max(o,r.width+(t.padding??0)*2,t?.width??0),e=Math.max(i,r.height+(t.padding??0)*2,t?.height??0),s=e/2,{cssStyles:a}=t,p=N.svg(c),m=D(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=[{x:-n/2,y:-e/2},{x:n/2-s,y:-e/2},...bt(-n/2+s,0,s,50,90,270),{x:n/2-s,y:e/2},{x:-n/2,y:e/2}],d=H(g),u=p.path(d,m),y=c.insert(()=>u,":first-child");return y.attr("class","basic label-container"),a&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",a),l&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",l),$(t,y),t.intersect=function(S){return _.info("Pill intersect",t,{radius:s,point:S}),b.polygon(t,g,S)},c}x(le,"halfRoundedRectangle");var Ss=x((f,t,h,l,o)=>[`M${f+o},${t}`,`L${f+h-o},${t}`,`L${f+h},${t-l/2}`,`L${f+h-o},${t-l}`,`L${f+o},${t-l}`,`L${f},${t-l/2}`,"Z"].join(" "),"createHexagonPathD");async function ce(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i}=await C(f,t,B(t)),c=4,r=i.height+t.padding,n=r/c,e=i.width+2*n+t.padding,s=[{x:n,y:0},{x:e-n,y:0},{x:e,y:-r/2},{x:e-n,y:-r},{x:n,y:-r},{x:0,y:-r/2}],a,{cssStyles:p}=t;if(t.look==="handDrawn"){let m=N.svg(o),g=D(t,{}),d=Ss(0,0,e,r,n),u=m.path(d,g);a=o.insert(()=>u,":first-child").attr("transform",`translate(${-e/2}, ${r/2})`),p&&a.attr("style",p)}else a=K(o,e,r,s);return l&&a.attr("style",l),t.width=e,t.height=r,$(t,a),t.intersect=function(m){return b.polygon(t,s,m)},o}x(ce,"hexagon");async function he(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.label="",t.labelStyle=h;let{shapeSvg:o}=await C(f,t,B(t)),i=Math.max(30,t?.width??0),c=Math.max(30,t?.height??0),{cssStyles:r}=t,n=N.svg(o),e=D(t,{});t.look!=="handDrawn"&&(e.roughness=0,e.fillStyle="solid");let s=[{x:0,y:0},{x:i,y:0},{x:0,y:c},{x:i,y:c}],a=H(s),p=n.path(a,e),m=o.insert(()=>p,":first-child");return m.attr("class","basic label-container"),r&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",r),l&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",l),m.attr("transform",`translate(${-i/2}, ${-c/2})`),$(t,m),t.intersect=function(g){return _.info("Pill intersect",t,{points:s}),b.polygon(t,s,g)},o}x(he,"hourglass");async function pe(f,t,{config:{themeVariables:h,flowchart:l}}){let{labelStyles:o}=w(t);t.labelStyle=o;let i=t.assetHeight??48,c=t.assetWidth??48,r=Math.max(i,c),n=l?.wrappingWidth;t.width=Math.max(r,n??0);let{shapeSvg:e,bbox:s,label:a}=await C(f,t,"icon-shape default"),p=t.pos==="t",m=r,g=r,{nodeBorder:d}=h,{stylesMap:u}=ft(t),y=-g/2,S=-m/2,P=t.label?8:0,T=N.svg(e),v=D(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let M=T.rectangle(y,S,g,m,v),k=Math.max(g,s.width),R=m+s.height+P,G=T.rectangle(-k/2,-R/2,k,R,{...v,fill:"transparent",stroke:"none"}),V=e.insert(()=>M,":first-child"),A=e.insert(()=>G);if(t.icon){let O=e.append("g");O.html(`<g>${await mt(t.icon,{height:r,width:r,fallbackPrefix:""})}</g>`);let E=O.node().getBBox(),L=E.width,I=E.height,j=E.x,F=E.y;O.attr("transform",`translate(${-L/2-j},${p?s.height/2+P/2-I/2-F:-s.height/2-P/2-I/2-F})`),O.attr("style",`color: ${u.get("stroke")??d};`)}return a.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))},${p?-R/2:R/2-s.height})`),V.attr("transform",`translate(0,${p?s.height/2+P/2:-s.height/2-P/2})`),$(t,A),t.intersect=function(O){if(_.info("iconSquare intersect",t,O),!t.label)return b.rect(t,O);let E=t.x??0,L=t.y??0,I=t.height??0,j=[];return p?j=[{x:E-s.width/2,y:L-I/2},{x:E+s.width/2,y:L-I/2},{x:E+s.width/2,y:L-I/2+s.height+P},{x:E+g/2,y:L-I/2+s.height+P},{x:E+g/2,y:L+I/2},{x:E-g/2,y:L+I/2},{x:E-g/2,y:L-I/2+s.height+P},{x:E-s.width/2,y:L-I/2+s.height+P}]:j=[{x:E-g/2,y:L-I/2},{x:E+g/2,y:L-I/2},{x:E+g/2,y:L-I/2+m},{x:E+s.width/2,y:L-I/2+m},{x:E+s.width/2/2,y:L+I/2},{x:E-s.width/2,y:L+I/2},{x:E-s.width/2,y:L-I/2+m},{x:E-g/2,y:L-I/2+m}],b.polygon(t,j,O)},e}x(pe,"icon");async function me(f,t,{config:{themeVariables:h,flowchart:l}}){let{labelStyles:o}=w(t);t.labelStyle=o;let i=t.assetHeight??48,c=t.assetWidth??48,r=Math.max(i,c),n=l?.wrappingWidth;t.width=Math.max(r,n??0);let{shapeSvg:e,bbox:s,label:a}=await C(f,t,"icon-shape default"),p=20,m=t.label?8:0,g=t.pos==="t",{nodeBorder:d,mainBkg:u}=h,{stylesMap:y}=ft(t),S=N.svg(e),P=D(t,{});t.look!=="handDrawn"&&(P.roughness=0,P.fillStyle="solid");let T=y.get("fill");P.stroke=T??u;let v=e.append("g");t.icon&&v.html(`<g>${await mt(t.icon,{height:r,width:r,fallbackPrefix:""})}</g>`);let M=v.node().getBBox(),k=M.width,R=M.height,G=M.x,V=M.y,A=Math.max(k,R)*Math.SQRT2+p*2,O=S.circle(0,0,A,P),E=Math.max(A,s.width),L=A+s.height+m,I=S.rectangle(-E/2,-L/2,E,L,{...P,fill:"transparent",stroke:"none"}),j=e.insert(()=>O,":first-child"),F=e.insert(()=>I);return v.attr("transform",`translate(${-k/2-G},${g?s.height/2+m/2-R/2-V:-s.height/2-m/2-R/2-V})`),v.attr("style",`color: ${y.get("stroke")??d};`),a.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))},${g?-L/2:L/2-s.height})`),j.attr("transform",`translate(0,${g?s.height/2+m/2:-s.height/2-m/2})`),$(t,F),t.intersect=function(W){return _.info("iconSquare intersect",t,W),b.rect(t,W)},e}x(me,"iconCircle");async function fe(f,t,{config:{themeVariables:h,flowchart:l}}){let{labelStyles:o}=w(t);t.labelStyle=o;let i=t.assetHeight??48,c=t.assetWidth??48,r=Math.max(i,c),n=l?.wrappingWidth;t.width=Math.max(r,n??0);let{shapeSvg:e,bbox:s,halfPadding:a,label:p}=await C(f,t,"icon-shape default"),m=t.pos==="t",g=r+a*2,d=r+a*2,{nodeBorder:u,mainBkg:y}=h,{stylesMap:S}=ft(t),P=-d/2,T=-g/2,v=t.label?8:0,M=N.svg(e),k=D(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let R=S.get("fill");k.stroke=R??y;let G=M.path(st(P,T,d,g,5),k),V=Math.max(d,s.width),A=g+s.height+v,O=M.rectangle(-V/2,-A/2,V,A,{...k,fill:"transparent",stroke:"none"}),E=e.insert(()=>G,":first-child").attr("class","icon-shape2"),L=e.insert(()=>O);if(t.icon){let I=e.append("g");I.html(`<g>${await mt(t.icon,{height:r,width:r,fallbackPrefix:""})}</g>`);let j=I.node().getBBox(),F=j.width,W=j.height,J=j.x,ot=j.y;I.attr("transform",`translate(${-F/2-J},${m?s.height/2+v/2-W/2-ot:-s.height/2-v/2-W/2-ot})`),I.attr("style",`color: ${S.get("stroke")??u};`)}return p.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))},${m?-A/2:A/2-s.height})`),E.attr("transform",`translate(0,${m?s.height/2+v/2:-s.height/2-v/2})`),$(t,L),t.intersect=function(I){if(_.info("iconSquare intersect",t,I),!t.label)return b.rect(t,I);let j=t.x??0,F=t.y??0,W=t.height??0,J=[];return m?J=[{x:j-s.width/2,y:F-W/2},{x:j+s.width/2,y:F-W/2},{x:j+s.width/2,y:F-W/2+s.height+v},{x:j+d/2,y:F-W/2+s.height+v},{x:j+d/2,y:F+W/2},{x:j-d/2,y:F+W/2},{x:j-d/2,y:F-W/2+s.height+v},{x:j-s.width/2,y:F-W/2+s.height+v}]:J=[{x:j-d/2,y:F-W/2},{x:j+d/2,y:F-W/2},{x:j+d/2,y:F-W/2+g},{x:j+s.width/2,y:F-W/2+g},{x:j+s.width/2/2,y:F+W/2},{x:j-s.width/2,y:F+W/2},{x:j-s.width/2,y:F-W/2+g},{x:j-d/2,y:F-W/2+g}],b.polygon(t,J,I)},e}x(fe,"iconRounded");async function ge(f,t,{config:{themeVariables:h,flowchart:l}}){let{labelStyles:o}=w(t);t.labelStyle=o;let i=t.assetHeight??48,c=t.assetWidth??48,r=Math.max(i,c),n=l?.wrappingWidth;t.width=Math.max(r,n??0);let{shapeSvg:e,bbox:s,halfPadding:a,label:p}=await C(f,t,"icon-shape default"),m=t.pos==="t",g=r+a*2,d=r+a*2,{nodeBorder:u,mainBkg:y}=h,{stylesMap:S}=ft(t),P=-d/2,T=-g/2,v=t.label?8:0,M=N.svg(e),k=D(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let R=S.get("fill");k.stroke=R??y;let G=M.path(st(P,T,d,g,.1),k),V=Math.max(d,s.width),A=g+s.height+v,O=M.rectangle(-V/2,-A/2,V,A,{...k,fill:"transparent",stroke:"none"}),E=e.insert(()=>G,":first-child"),L=e.insert(()=>O);if(t.icon){let I=e.append("g");I.html(`<g>${await mt(t.icon,{height:r,width:r,fallbackPrefix:""})}</g>`);let j=I.node().getBBox(),F=j.width,W=j.height,J=j.x,ot=j.y;I.attr("transform",`translate(${-F/2-J},${m?s.height/2+v/2-W/2-ot:-s.height/2-v/2-W/2-ot})`),I.attr("style",`color: ${S.get("stroke")??u};`)}return p.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))},${m?-A/2:A/2-s.height})`),E.attr("transform",`translate(0,${m?s.height/2+v/2:-s.height/2-v/2})`),$(t,L),t.intersect=function(I){if(_.info("iconSquare intersect",t,I),!t.label)return b.rect(t,I);let j=t.x??0,F=t.y??0,W=t.height??0,J=[];return m?J=[{x:j-s.width/2,y:F-W/2},{x:j+s.width/2,y:F-W/2},{x:j+s.width/2,y:F-W/2+s.height+v},{x:j+d/2,y:F-W/2+s.height+v},{x:j+d/2,y:F+W/2},{x:j-d/2,y:F+W/2},{x:j-d/2,y:F-W/2+s.height+v},{x:j-s.width/2,y:F-W/2+s.height+v}]:J=[{x:j-d/2,y:F-W/2},{x:j+d/2,y:F-W/2},{x:j+d/2,y:F-W/2+g},{x:j+s.width/2,y:F-W/2+g},{x:j+s.width/2/2,y:F+W/2},{x:j-s.width/2,y:F+W/2},{x:j-s.width/2,y:F-W/2+g},{x:j-d/2,y:F-W/2+g}],b.polygon(t,J,I)},e}x(ge,"iconSquare");async function de(f,t,{config:{flowchart:h}}){let l=new Image;l.src=t?.img??"",await l.decode();let o=Number(l.naturalWidth.toString().replace("px","")),i=Number(l.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/i;let{labelStyles:c}=w(t);t.labelStyle=c;let r=h?.wrappingWidth;t.defaultWidth=h?.wrappingWidth;let n=Math.max(t.label?r??0:0,t?.assetWidth??o),e=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:n,s=t.constraint==="on"?e/t.imageAspectRatio:t?.assetHeight??i;t.width=Math.max(e,r??0);let{shapeSvg:a,bbox:p,label:m}=await C(f,t,"image-shape default"),g=t.pos==="t",d=-e/2,u=-s/2,y=t.label?8:0,S=N.svg(a),P=D(t,{});t.look!=="handDrawn"&&(P.roughness=0,P.fillStyle="solid");let T=S.rectangle(d,u,e,s,P),v=Math.max(e,p.width),M=s+p.height+y,k=S.rectangle(-v/2,-M/2,v,M,{...P,fill:"none",stroke:"none"}),R=a.insert(()=>T,":first-child"),G=a.insert(()=>k);if(t.img){let V=a.append("image");V.attr("href",t.img),V.attr("width",e),V.attr("height",s),V.attr("preserveAspectRatio","none"),V.attr("transform",`translate(${-e/2},${g?M/2-s:-M/2})`)}return m.attr("transform",`translate(${-p.width/2-(p.x-(p.left??0))},${g?-s/2-p.height/2-y/2:s/2-p.height/2+y/2})`),R.attr("transform",`translate(0,${g?p.height/2+y/2:-p.height/2-y/2})`),$(t,G),t.intersect=function(V){if(_.info("iconSquare intersect",t,V),!t.label)return b.rect(t,V);let A=t.x??0,O=t.y??0,E=t.height??0,L=[];return g?L=[{x:A-p.width/2,y:O-E/2},{x:A+p.width/2,y:O-E/2},{x:A+p.width/2,y:O-E/2+p.height+y},{x:A+e/2,y:O-E/2+p.height+y},{x:A+e/2,y:O+E/2},{x:A-e/2,y:O+E/2},{x:A-e/2,y:O-E/2+p.height+y},{x:A-p.width/2,y:O-E/2+p.height+y}]:L=[{x:A-e/2,y:O-E/2},{x:A+e/2,y:O-E/2},{x:A+e/2,y:O-E/2+s},{x:A+p.width/2,y:O-E/2+s},{x:A+p.width/2/2,y:O+E/2},{x:A-p.width/2,y:O+E/2},{x:A-p.width/2,y:O-E/2+s},{x:A-e/2,y:O-E/2+s}],b.polygon(t,L,V)},a}x(de,"imageSquare");async function ye(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i}=await C(f,t,B(t)),c=Math.max(i.width+(t.padding??0)*2,t?.width??0),r=Math.max(i.height+(t.padding??0)*2,t?.height??0),n=[{x:0,y:0},{x:c,y:0},{x:c+3*r/6,y:-r},{x:-3*r/6,y:-r}],e,{cssStyles:s}=t;if(t.look==="handDrawn"){let a=N.svg(o),p=D(t,{}),m=H(n),g=a.path(m,p);e=o.insert(()=>g,":first-child").attr("transform",`translate(${-c/2}, ${r/2})`),s&&e.attr("style",s)}else e=K(o,c,r,n);return l&&e.attr("style",l),t.width=c,t.height=r,$(t,e),t.intersect=function(a){return b.polygon(t,n,a)},o}x(ye,"inv_trapezoid");async function lt(f,t,h){let{labelStyles:l,nodeStyles:o}=w(t);t.labelStyle=l;let{shapeSvg:i,bbox:c}=await C(f,t,B(t)),r=Math.max(c.width+h.labelPaddingX*2,t?.width||0),n=Math.max(c.height+h.labelPaddingY*2,t?.height||0),e=-r/2,s=-n/2,a,{rx:p,ry:m}=t,{cssStyles:g}=t;if(h?.rx&&h.ry&&(p=h.rx,m=h.ry),t.look==="handDrawn"){let d=N.svg(i),u=D(t,{}),y=p||m?d.path(st(e,s,r,n,p||0),u):d.rectangle(e,s,r,n,u);a=i.insert(()=>y,":first-child"),a.attr("class","basic label-container").attr("style",X(g))}else a=i.insert("rect",":first-child"),a.attr("class","basic label-container").attr("style",o).attr("rx",X(p)).attr("ry",X(m)).attr("x",e).attr("y",s).attr("width",r).attr("height",n);return $(t,a),t.calcIntersect=function(d,u){return b.rect(d,u)},t.intersect=function(d){return b.rect(t,d)},i}x(lt,"drawRect");async function ue(f,t){let{shapeSvg:h,bbox:l,label:o}=await C(f,t,"label"),i=h.insert("rect",":first-child");return i.attr("width",.1).attr("height",.1),h.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),$(t,i),t.intersect=function(n){return b.rect(t,n)},h}x(ue,"labelRect");async function xe(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i}=await C(f,t,B(t)),c=Math.max(i.width+(t.padding??0),t?.width??0),r=Math.max(i.height+(t.padding??0),t?.height??0),n=[{x:0,y:0},{x:c+3*r/6,y:0},{x:c,y:-r},{x:-(3*r)/6,y:-r}],e,{cssStyles:s}=t;if(t.look==="handDrawn"){let a=N.svg(o),p=D(t,{}),m=H(n),g=a.path(m,p);e=o.insert(()=>g,":first-child").attr("transform",`translate(${-c/2}, ${r/2})`),s&&e.attr("style",s)}else e=K(o,c,r,n);return l&&e.attr("style",l),t.width=c,t.height=r,$(t,e),t.intersect=function(a){return b.polygon(t,n,a)},o}x(xe,"lean_left");async function Se(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i}=await C(f,t,B(t)),c=Math.max(i.width+(t.padding??0),t?.width??0),r=Math.max(i.height+(t.padding??0),t?.height??0),n=[{x:-3*r/6,y:0},{x:c,y:0},{x:c+3*r/6,y:-r},{x:0,y:-r}],e,{cssStyles:s}=t;if(t.look==="handDrawn"){let a=N.svg(o),p=D(t,{}),m=H(n),g=a.path(m,p);e=o.insert(()=>g,":first-child").attr("transform",`translate(${-c/2}, ${r/2})`),s&&e.attr("style",s)}else e=K(o,c,r,n);return l&&e.attr("style",l),t.width=c,t.height=r,$(t,e),t.intersect=function(a){return b.polygon(t,n,a)},o}x(Se,"lean_right");function be(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.label="",t.labelStyle=h;let o=f.insert("g").attr("class",B(t)).attr("id",t.domId??t.id),{cssStyles:i}=t,c=Math.max(35,t?.width??0),r=Math.max(35,t?.height??0),n=7,e=[{x:c,y:0},{x:0,y:r+n/2},{x:c-2*n,y:r+n/2},{x:0,y:2*r},{x:c,y:r-n/2},{x:2*n,y:r-n/2}],s=N.svg(o),a=D(t,{});t.look!=="handDrawn"&&(a.roughness=0,a.fillStyle="solid");let p=H(e),m=s.path(p,a),g=o.insert(()=>m,":first-child");return i&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",i),l&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",l),g.attr("transform",`translate(-${c/2},${-r})`),$(t,g),t.intersect=function(d){return _.info("lightningBolt intersect",t,d),b.polygon(t,e,d)},o}x(be,"lightningBolt");var bs=x((f,t,h,l,o,i,c)=>[`M${f},${t+i}`,`a${o},${i} 0,0,0 ${h},0`,`a${o},${i} 0,0,0 ${-h},0`,`l0,${l}`,`a${o},${i} 0,0,0 ${h},0`,`l0,${-l}`,`M${f},${t+i+c}`,`a${o},${i} 0,0,0 ${h},0`].join(" "),"createCylinderPathD"),ws=x((f,t,h,l,o,i,c)=>[`M${f},${t+i}`,`M${f+h},${t+i}`,`a${o},${i} 0,0,0 ${-h},0`,`l0,${l}`,`a${o},${i} 0,0,0 ${h},0`,`l0,${-l}`,`M${f},${t+i+c}`,`a${o},${i} 0,0,0 ${h},0`].join(" "),"createOuterCylinderPathD"),Ns=x((f,t,h,l,o,i)=>[`M${f-h/2},${-l/2}`,`a${o},${i} 0,0,0 ${h},0`].join(" "),"createInnerCylinderPathD");async function we(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c}=await C(f,t,B(t)),r=Math.max(i.width+(t.padding??0),t.width??0),n=r/2,e=n/(2.5+r/50),s=Math.max(i.height+e+(t.padding??0),t.height??0),a=s*.1,p,{cssStyles:m}=t;if(t.look==="handDrawn"){let g=N.svg(o),d=ws(0,0,r,s,n,e,a),u=Ns(0,e,r,s,n,e),y=D(t,{}),S=g.path(d,y),P=g.path(u,y);o.insert(()=>P,":first-child").attr("class","line"),p=o.insert(()=>S,":first-child"),p.attr("class","basic label-container"),m&&p.attr("style",m)}else{let g=bs(0,0,r,s,n,e,a);p=o.insert("path",":first-child").attr("d",g).attr("class","basic label-container").attr("style",X(m)).attr("style",l)}return p.attr("label-offset-y",e),p.attr("transform",`translate(${-r/2}, ${-(s/2+e)})`),$(t,p),c.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)+e-(i.y-(i.top??0))})`),t.intersect=function(g){let d=b.rect(t,g),u=d.x-(t.x??0);if(n!=0&&(Math.abs(u)<(t.width??0)/2||Math.abs(u)==(t.width??0)/2&&Math.abs(d.y-(t.y??0))>(t.height??0)/2-e)){let y=e*e*(1-u*u/(n*n));y>0&&(y=Math.sqrt(y)),y=e-y,g.y-(t.y??0)>0&&(y=-y),d.y+=y}return d},o}x(we,"linedCylinder");async function Ne(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c}=await C(f,t,B(t)),r=Math.max(i.width+(t.padding??0)*2,t?.width??0),n=Math.max(i.height+(t.padding??0)*2,t?.height??0),e=n/4,s=n+e,{cssStyles:a}=t,p=N.svg(o),m=D(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=[{x:-r/2-r/2*.1,y:-s/2},{x:-r/2-r/2*.1,y:s/2},...it(-r/2-r/2*.1,s/2,r/2+r/2*.1,s/2,e,.8),{x:r/2+r/2*.1,y:-s/2},{x:-r/2-r/2*.1,y:-s/2},{x:-r/2,y:-s/2},{x:-r/2,y:s/2*1.1},{x:-r/2,y:-s/2}],d=p.polygon(g.map(y=>[y.x,y.y]),m),u=o.insert(()=>d,":first-child");return u.attr("class","basic label-container"),a&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",a),l&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",l),u.attr("transform",`translate(0,${-e/2})`),c.attr("transform",`translate(${-r/2+(t.padding??0)+r/2*.1/2-(i.x-(i.left??0))},${-n/2+(t.padding??0)-e/2-(i.y-(i.top??0))})`),$(t,u),t.intersect=function(y){return b.polygon(t,g,y)},o}x(Ne,"linedWaveEdgedRect");async function $e(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c}=await C(f,t,B(t)),r=Math.max(i.width+(t.padding??0)*2,t?.width??0),n=Math.max(i.height+(t.padding??0)*2,t?.height??0),e=5,s=-r/2,a=-n/2,{cssStyles:p}=t,m=N.svg(o),g=D(t,{}),d=[{x:s-e,y:a+e},{x:s-e,y:a+n+e},{x:s+r-e,y:a+n+e},{x:s+r-e,y:a+n},{x:s+r,y:a+n},{x:s+r,y:a+n-e},{x:s+r+e,y:a+n-e},{x:s+r+e,y:a-e},{x:s+e,y:a-e},{x:s+e,y:a},{x:s,y:a},{x:s,y:a+e}],u=[{x:s,y:a+e},{x:s+r-e,y:a+e},{x:s+r-e,y:a+n},{x:s+r,y:a+n},{x:s+r,y:a},{x:s,y:a}];t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let y=H(d),S=m.path(y,g),P=H(u),T=m.path(P,{...g,fill:"none"}),v=o.insert(()=>T,":first-child");return v.insert(()=>S,":first-child"),v.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",p),l&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",l),c.attr("transform",`translate(${-(i.width/2)-e-(i.x-(i.left??0))}, ${-(i.height/2)+e-(i.y-(i.top??0))})`),$(t,v),t.intersect=function(M){return b.polygon(t,d,M)},o}x($e,"multiRect");async function De(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c}=await C(f,t,B(t)),r=Math.max(i.width+(t.padding??0)*2,t?.width??0),n=Math.max(i.height+(t.padding??0)*2,t?.height??0),e=n/4,s=n+e,a=-r/2,p=-s/2,m=5,{cssStyles:g}=t,d=it(a-m,p+s+m,a+r-m,p+s+m,e,.8),u=d?.[d.length-1],y=[{x:a-m,y:p+m},{x:a-m,y:p+s+m},...d,{x:a+r-m,y:u.y-m},{x:a+r,y:u.y-m},{x:a+r,y:u.y-2*m},{x:a+r+m,y:u.y-2*m},{x:a+r+m,y:p-m},{x:a+m,y:p-m},{x:a+m,y:p},{x:a,y:p},{x:a,y:p+m}],S=[{x:a,y:p+m},{x:a+r-m,y:p+m},{x:a+r-m,y:u.y-m},{x:a+r,y:u.y-m},{x:a+r,y:p},{x:a,y:p}],P=N.svg(o),T=D(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let v=H(y),M=P.path(v,T),k=H(S),R=P.path(k,T),G=o.insert(()=>M,":first-child");return G.insert(()=>R),G.attr("class","basic label-container"),g&&t.look!=="handDrawn"&&G.selectAll("path").attr("style",g),l&&t.look!=="handDrawn"&&G.selectAll("path").attr("style",l),G.attr("transform",`translate(0,${-e/2})`),c.attr("transform",`translate(${-(i.width/2)-m-(i.x-(i.left??0))}, ${-(i.height/2)+m-e/2-(i.y-(i.top??0))})`),$(t,G),t.intersect=function(V){return b.polygon(t,y,V)},o}x(De,"multiWaveEdgedRectangle");async function ve(f,t,{config:{themeVariables:h}}){let{labelStyles:l,nodeStyles:o}=w(t);t.labelStyle=l,t.useHtmlLabels||U(pt())||(t.centerLabel=!0);let{shapeSvg:c,bbox:r,label:n}=await C(f,t,B(t)),e=Math.max(r.width+(t.padding??0)*2,t?.width??0),s=Math.max(r.height+(t.padding??0)*2,t?.height??0),a=-e/2,p=-s/2,{cssStyles:m}=t,g=N.svg(c),d=D(t,{fill:h.noteBkgColor,stroke:h.noteBorderColor});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let u=g.rectangle(a,p,e,s,d),y=c.insert(()=>u,":first-child");return y.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",m),o&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",o),n.attr("transform",`translate(${-r.width/2-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),$(t,y),t.intersect=function(S){return b.rect(t,S)},c}x(ve,"note");var $s=x((f,t,h)=>[`M${f+h/2},${t}`,`L${f+h},${t-h/2}`,`L${f+h/2},${t-h}`,`L${f},${t-h/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function Be(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i}=await C(f,t,B(t)),c=i.width+t.padding,r=i.height+t.padding,n=c+r,e=.5,s=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}],a,{cssStyles:p}=t;if(t.look==="handDrawn"){let m=N.svg(o),g=D(t,{}),d=$s(0,0,n),u=m.path(d,g);a=o.insert(()=>u,":first-child").attr("transform",`translate(${-n/2+e}, ${n/2})`),p&&a.attr("style",p)}else a=K(o,n,n,s),a.attr("transform",`translate(${-n/2+e}, ${n/2})`);return l&&a.attr("style",l),$(t,a),t.calcIntersect=function(m,g){let d=m.width,u=[{x:d/2,y:0},{x:d,y:-d/2},{x:d/2,y:-d},{x:0,y:-d/2}],y=b.polygon(m,u,g);return{x:y.x-.5,y:y.y-.5}},t.intersect=function(m){return this.calcIntersect(t,m)},o}x(Be,"question");async function Pe(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c}=await C(f,t,B(t)),r=Math.max(i.width+(t.padding??0),t?.width??0),n=Math.max(i.height+(t.padding??0),t?.height??0),e=-r/2,s=-n/2,a=s/2,p=[{x:e+a,y:s},{x:e,y:0},{x:e+a,y:-s},{x:-e,y:-s},{x:-e,y:s}],{cssStyles:m}=t,g=N.svg(o),d=D(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let u=H(p),y=g.path(u,d),S=o.insert(()=>y,":first-child");return S.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",m),l&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",l),S.attr("transform",`translate(${-a/2},0)`),c.attr("transform",`translate(${-a/2-i.width/2-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),$(t,S),t.intersect=function(P){return b.polygon(t,p,P)},o}x(Pe,"rect_left_inv_arrow");async function Ce(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";let i=f.insert("g").attr("class",o).attr("id",t.domId||t.id),c=i.insert("g"),r=i.insert("g").attr("class","label").attr("style",l),n=t.description,e=t.label,s=await wt(r,e,t.labelStyle,!0,!0),a={width:0,height:0};if(U(Y())){let R=s.children[0],G=z(s);a=R.getBoundingClientRect(),G.attr("width",a.width),G.attr("height",a.height)}_.info("Text 2",n);let p=n||[],m=s.getBBox(),g=await wt(r,Array.isArray(p)?p.join("<br/>"):p,t.labelStyle,!0,!0),d=g.children[0],u=z(g);a=d.getBoundingClientRect(),u.attr("width",a.width),u.attr("height",a.height);let y=(t.padding||0)/2;z(g).attr("transform","translate( "+(a.width>m.width?0:(m.width-a.width)/2)+", "+(m.height+y+5)+")"),z(s).attr("transform","translate( "+(a.width<m.width?0:-(m.width-a.width)/2)+", 0)"),a=r.node().getBBox(),r.attr("transform","translate("+-a.width/2+", "+(-a.height/2-y+3)+")");let S=a.width+(t.padding||0),P=a.height+(t.padding||0),T=-a.width/2-y,v=-a.height/2-y,M,k;if(t.look==="handDrawn"){let R=N.svg(i),G=D(t,{}),V=R.path(st(T,v,S,P,t.rx||0),G),A=R.line(-a.width/2-y,-a.height/2-y+m.height+y,a.width/2+y,-a.height/2-y+m.height+y,G);k=i.insert(()=>(_.debug("Rough node insert CXC",V),A),":first-child"),M=i.insert(()=>(_.debug("Rough node insert CXC",V),V),":first-child")}else M=c.insert("rect",":first-child"),k=c.insert("line"),M.attr("class","outer title-state").attr("style",l).attr("x",-a.width/2-y).attr("y",-a.height/2-y).attr("width",a.width+(t.padding||0)).attr("height",a.height+(t.padding||0)),k.attr("class","divider").attr("x1",-a.width/2-y).attr("x2",a.width/2+y).attr("y1",-a.height/2-y+m.height+y).attr("y2",-a.height/2-y+m.height+y);return $(t,M),t.intersect=function(R){return b.rect(t,R)},i}x(Ce,"rectWithTitle");async function Te(f,t){let h={rx:5,ry:5,classes:"",labelPaddingX:(t?.padding||0)*1,labelPaddingY:(t?.padding||0)*1};return lt(f,t,h)}x(Te,"roundedRect");async function ke(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c}=await C(f,t,B(t)),r=t?.padding??0,n=Math.max(i.width+(t.padding??0)*2,t?.width??0),e=Math.max(i.height+(t.padding??0)*2,t?.height??0),s=-i.width/2-r,a=-i.height/2-r,{cssStyles:p}=t,m=N.svg(o),g=D(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let d=[{x:s,y:a},{x:s+n+8,y:a},{x:s+n+8,y:a+e},{x:s-8,y:a+e},{x:s-8,y:a},{x:s,y:a},{x:s,y:a+e}],u=m.polygon(d.map(S=>[S.x,S.y]),g),y=o.insert(()=>u,":first-child");return y.attr("class","basic label-container").attr("style",X(p)),l&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",l),p&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",l),c.attr("transform",`translate(${-n/2+4+(t.padding??0)-(i.x-(i.left??0))},${-e/2+(t.padding??0)-(i.y-(i.top??0))})`),$(t,y),t.intersect=function(S){return b.rect(t,S)},o}x(ke,"shadedProcess");async function Re(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c}=await C(f,t,B(t)),r=Math.max(i.width+(t.padding??0)*2,t?.width??0),n=Math.max(i.height+(t.padding??0)*2,t?.height??0),e=-r/2,s=-n/2,{cssStyles:a}=t,p=N.svg(o),m=D(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=[{x:e,y:s},{x:e,y:s+n},{x:e+r,y:s+n},{x:e+r,y:s-n/2}],d=H(g),u=p.path(d,m),y=o.insert(()=>u,":first-child");return y.attr("class","basic label-container"),a&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",a),l&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",l),y.attr("transform",`translate(0, ${n/4})`),c.attr("transform",`translate(${-r/2+(t.padding??0)-(i.x-(i.left??0))}, ${-n/4+(t.padding??0)-(i.y-(i.top??0))})`),$(t,y),t.intersect=function(S){return b.polygon(t,g,S)},o}x(Re,"slopedRect");async function Me(f,t){let h={rx:0,ry:0,classes:"",labelPaddingX:t.labelPaddingX??(t?.padding||0)*2,labelPaddingY:(t?.padding||0)*1};return lt(f,t,h)}x(Me,"squareRect");async function Ge(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i}=await C(f,t,B(t)),c=i.height+t.padding,r=i.width+c/4+t.padding,n=c/2,{cssStyles:e}=t,s=N.svg(o),a=D(t,{});t.look!=="handDrawn"&&(a.roughness=0,a.fillStyle="solid");let p=[{x:-r/2+n,y:-c/2},{x:r/2-n,y:-c/2},...bt(-r/2+n,0,n,50,90,270),{x:r/2-n,y:c/2},...bt(r/2-n,0,n,50,270,450)],m=H(p),g=s.path(m,a),d=o.insert(()=>g,":first-child");return d.attr("class","basic label-container outer-path"),e&&t.look!=="handDrawn"&&d.selectChildren("path").attr("style",e),l&&t.look!=="handDrawn"&&d.selectChildren("path").attr("style",l),$(t,d),t.intersect=function(u){return b.polygon(t,p,u)},o}x(Ge,"stadium");async function Ee(f,t){return lt(f,t,{rx:5,ry:5,classes:"flowchart-node"})}x(Ee,"state");function je(f,t,{config:{themeVariables:h}}){let{labelStyles:l,nodeStyles:o}=w(t);t.labelStyle=l;let{cssStyles:i}=t,{lineColor:c,stateBorder:r,nodeBorder:n}=h,e=f.insert("g").attr("class","node default").attr("id",t.domId||t.id),s=N.svg(e),a=D(t,{});t.look!=="handDrawn"&&(a.roughness=0,a.fillStyle="solid");let p=s.circle(0,0,14,{...a,stroke:c,strokeWidth:2}),m=r??n,g=s.circle(0,0,5,{...a,fill:m,stroke:m,strokeWidth:2,fillStyle:"solid"}),d=e.insert(()=>p,":first-child");return d.insert(()=>g),i&&d.selectAll("path").attr("style",i),o&&d.selectAll("path").attr("style",o),$(t,d),t.intersect=function(u){return b.circle(t,7,u)},e}x(je,"stateEnd");function He(f,t,{config:{themeVariables:h}}){let{lineColor:l}=h,o=f.insert("g").attr("class","node default").attr("id",t.domId||t.id),i;if(t.look==="handDrawn"){let r=N.svg(o).circle(0,0,14,Ot(l));i=o.insert(()=>r),i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else i=o.insert("circle",":first-child"),i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return $(t,i),t.intersect=function(c){return b.circle(t,7,c)},o}x(He,"stateStart");async function Ae(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i}=await C(f,t,B(t)),c=(t?.padding||0)/2,r=i.width+t.padding,n=i.height+t.padding,e=-i.width/2-c,s=-i.height/2-c,a=[{x:0,y:0},{x:r,y:0},{x:r,y:-n},{x:0,y:-n},{x:0,y:0},{x:-8,y:0},{x:r+8,y:0},{x:r+8,y:-n},{x:-8,y:-n},{x:-8,y:0}];if(t.look==="handDrawn"){let p=N.svg(o),m=D(t,{}),g=p.rectangle(e-8,s,r+16,n,m),d=p.line(e,s,e,s+n,m),u=p.line(e+r,s,e+r,s+n,m);o.insert(()=>d,":first-child"),o.insert(()=>u,":first-child");let y=o.insert(()=>g,":first-child"),{cssStyles:S}=t;y.attr("class","basic label-container").attr("style",X(S)),$(t,y)}else{let p=K(o,r,n,a);l&&p.attr("style",l),$(t,p)}return t.intersect=function(p){return b.polygon(t,a,p)},o}x(Ae,"subroutine");async function Oe(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i}=await C(f,t,B(t)),c=Math.max(i.width+(t.padding??0)*2,t?.width??0),r=Math.max(i.height+(t.padding??0)*2,t?.height??0),n=-c/2,e=-r/2,s=.2*r,a=.2*r,{cssStyles:p}=t,m=N.svg(o),g=D(t,{}),d=[{x:n-s/2,y:e},{x:n+c+s/2,y:e},{x:n+c+s/2,y:e+r},{x:n-s/2,y:e+r}],u=[{x:n+c-s/2,y:e+r},{x:n+c+s/2,y:e+r},{x:n+c+s/2,y:e+r-a}];t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let y=H(d),S=m.path(y,g),P=H(u),T=m.path(P,{...g,fillStyle:"solid"}),v=o.insert(()=>T,":first-child");return v.insert(()=>S,":first-child"),v.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",p),l&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",l),$(t,v),t.intersect=function(M){return b.polygon(t,d,M)},o}x(Oe,"taggedRect");async function Le(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c}=await C(f,t,B(t)),r=Math.max(i.width+(t.padding??0)*2,t?.width??0),n=Math.max(i.height+(t.padding??0)*2,t?.height??0),e=n/4,s=.2*r,a=.2*n,p=n+e,{cssStyles:m}=t,g=N.svg(o),d=D(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let u=[{x:-r/2-r/2*.1,y:p/2},...it(-r/2-r/2*.1,p/2,r/2+r/2*.1,p/2,e,.8),{x:r/2+r/2*.1,y:-p/2},{x:-r/2-r/2*.1,y:-p/2}],y=-r/2+r/2*.1,S=-p/2-a*.4,P=[{x:y+r-s,y:(S+n)*1.4},{x:y+r,y:S+n-a},{x:y+r,y:(S+n)*.9},...it(y+r,(S+n)*1.3,y+r-s,(S+n)*1.5,-n*.03,.5)],T=H(u),v=g.path(T,d),M=H(P),k=g.path(M,{...d,fillStyle:"solid"}),R=o.insert(()=>k,":first-child");return R.insert(()=>v,":first-child"),R.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",m),l&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",l),R.attr("transform",`translate(0,${-e/2})`),c.attr("transform",`translate(${-r/2+(t.padding??0)-(i.x-(i.left??0))},${-n/2+(t.padding??0)-e/2-(i.y-(i.top??0))})`),$(t,R),t.intersect=function(G){return b.polygon(t,u,G)},o}x(Le,"taggedWaveEdgedRectangle");async function Ve(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i}=await C(f,t,B(t)),c=Math.max(i.width+t.padding,t?.width||0),r=Math.max(i.height+t.padding,t?.height||0),n=-c/2,e=-r/2,s=o.insert("rect",":first-child");return s.attr("class","text").attr("style",l).attr("rx",0).attr("ry",0).attr("x",n).attr("y",e).attr("width",c).attr("height",r),$(t,s),t.intersect=function(a){return b.rect(t,a)},o}x(Ve,"text");var Ds=x((f,t,h,l,o,i)=>`M${f},${t}
|
|
a${o},${i} 0,0,1 0,${-l}
|
|
l${h},0
|
|
a${o},${i} 0,0,1 0,${l}
|
|
M${h},${-l}
|
|
a${o},${i} 0,0,0 0,${l}
|
|
l${-h},0`,"createCylinderPathD"),vs=x((f,t,h,l,o,i)=>[`M${f},${t}`,`M${f+h},${t}`,`a${o},${i} 0,0,0 0,${-l}`,`l${-h},0`,`a${o},${i} 0,0,0 0,${l}`,`l${h},0`].join(" "),"createOuterCylinderPathD"),Bs=x((f,t,h,l,o,i)=>[`M${f+h/2},${-l/2}`,`a${o},${i} 0,0,0 0,${l}`].join(" "),"createInnerCylinderPathD");async function We(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c,halfPadding:r}=await C(f,t,B(t)),n=t.look==="neo"?r*2:r,e=i.height+n,s=e/2,a=s/(2.5+e/50),p=i.width+a+n,{cssStyles:m}=t,g;if(t.look==="handDrawn"){let d=N.svg(o),u=vs(0,0,p,e,a,s),y=Bs(0,0,p,e,a,s),S=d.path(u,D(t,{})),P=d.path(y,D(t,{fill:"none"}));g=o.insert(()=>P,":first-child"),g=o.insert(()=>S,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{let d=Ds(0,0,p,e,a,s);g=o.insert("path",":first-child").attr("d",d).attr("class","basic label-container").attr("style",X(m)).attr("style",l),g.attr("class","basic label-container"),m&&g.selectAll("path").attr("style",m),l&&g.selectAll("path").attr("style",l)}return g.attr("label-offset-x",a),g.attr("transform",`translate(${-p/2}, ${e/2} )`),c.attr("transform",`translate(${-(i.width/2)-a-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),$(t,g),t.intersect=function(d){let u=b.rect(t,d),y=u.y-(t.y??0);if(s!=0&&(Math.abs(y)<(t.height??0)/2||Math.abs(y)==(t.height??0)/2&&Math.abs(u.x-(t.x??0))>(t.width??0)/2-a)){let S=a*a*(1-y*y/(s*s));S!=0&&(S=Math.sqrt(Math.abs(S))),S=a-S,d.x-(t.x??0)>0&&(S=-S),u.x+=S}return u},o}x(We,"tiltedCylinder");async function Ie(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i}=await C(f,t,B(t)),c=i.width+t.padding,r=i.height+t.padding,n=[{x:-3*r/6,y:0},{x:c+3*r/6,y:0},{x:c,y:-r},{x:0,y:-r}],e,{cssStyles:s}=t;if(t.look==="handDrawn"){let a=N.svg(o),p=D(t,{}),m=H(n),g=a.path(m,p);e=o.insert(()=>g,":first-child").attr("transform",`translate(${-c/2}, ${r/2})`),s&&e.attr("style",s)}else e=K(o,c,r,n);return l&&e.attr("style",l),t.width=c,t.height=r,$(t,e),t.intersect=function(a){return b.polygon(t,n,a)},o}x(Ie,"trapezoid");async function Fe(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i}=await C(f,t,B(t)),c=60,r=20,n=Math.max(c,i.width+(t.padding??0)*2,t?.width??0),e=Math.max(r,i.height+(t.padding??0)*2,t?.height??0),{cssStyles:s}=t,a=N.svg(o),p=D(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let m=[{x:-n/2*.8,y:-e/2},{x:n/2*.8,y:-e/2},{x:n/2,y:-e/2*.6},{x:n/2,y:e/2},{x:-n/2,y:e/2},{x:-n/2,y:-e/2*.6}],g=H(m),d=a.path(g,p),u=o.insert(()=>d,":first-child");return u.attr("class","basic label-container"),s&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",s),l&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",l),$(t,u),t.intersect=function(y){return b.polygon(t,m,y)},o}x(Fe,"trapezoidalPentagon");async function _e(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c}=await C(f,t,B(t)),r=t.useHtmlLabels||U(Y()),n=i.width+(t.padding??0),e=n+i.height,s=n+i.height,a=[{x:0,y:0},{x:s,y:0},{x:s/2,y:-e}],{cssStyles:p}=t,m=N.svg(o),g=D(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let d=H(a),u=m.path(d,g),y=o.insert(()=>u,":first-child").attr("transform",`translate(${-e/2}, ${e/2})`);return p&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",p),l&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",l),t.width=n,t.height=e,$(t,y),c.attr("transform",`translate(${-i.width/2-(i.x-(i.left??0))}, ${e/2-(i.height+(t.padding??0)/(r?2:1)-(i.y-(i.top??0)))})`),t.intersect=function(S){return _.info("Triangle intersect",t,a,S),b.polygon(t,a,S)},o}x(_e,"triangle");async function Xe(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c}=await C(f,t,B(t)),r=Math.max(i.width+(t.padding??0)*2,t?.width??0),n=Math.max(i.height+(t.padding??0)*2,t?.height??0),e=n/8,s=n+e,{cssStyles:a}=t,m=70-r,g=m>0?m/2:0,d=N.svg(o),u=D(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let y=[{x:-r/2-g,y:s/2},...it(-r/2-g,s/2,r/2+g,s/2,e,.8),{x:r/2+g,y:-s/2},{x:-r/2-g,y:-s/2}],S=H(y),P=d.path(S,u),T=o.insert(()=>P,":first-child");return T.attr("class","basic label-container"),a&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",a),l&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",l),T.attr("transform",`translate(0,${-e/2})`),c.attr("transform",`translate(${-r/2+(t.padding??0)-(i.x-(i.left??0))},${-n/2+(t.padding??0)-e-(i.y-(i.top??0))})`),$(t,T),t.intersect=function(v){return b.polygon(t,y,v)},o}x(Xe,"waveEdgedRectangle");async function qe(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i}=await C(f,t,B(t)),c=100,r=50,n=Math.max(i.width+(t.padding??0)*2,t?.width??0),e=Math.max(i.height+(t.padding??0)*2,t?.height??0),s=n/e,a=n,p=e;a>p*s?p=a/s:a=p*s,a=Math.max(a,c),p=Math.max(p,r);let m=Math.min(p*.2,p/4),g=p+m*2,{cssStyles:d}=t,u=N.svg(o),y=D(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let S=[{x:-a/2,y:g/2},...it(-a/2,g/2,a/2,g/2,m,1),{x:a/2,y:-g/2},...it(a/2,-g/2,-a/2,-g/2,m,-1)],P=H(S),T=u.path(P,y),v=o.insert(()=>T,":first-child");return v.attr("class","basic label-container"),d&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",d),l&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",l),$(t,v),t.intersect=function(M){return b.polygon(t,S,M)},o}x(qe,"waveRectangle");async function Ye(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,label:c}=await C(f,t,B(t)),r=Math.max(i.width+(t.padding??0)*2,t?.width??0),n=Math.max(i.height+(t.padding??0)*2,t?.height??0),e=5,s=-r/2,a=-n/2,{cssStyles:p}=t,m=N.svg(o),g=D(t,{}),d=[{x:s-e,y:a-e},{x:s-e,y:a+n},{x:s+r,y:a+n},{x:s+r,y:a-e}],u=`M${s-e},${a-e} L${s+r},${a-e} L${s+r},${a+n} L${s-e},${a+n} L${s-e},${a-e}
|
|
M${s-e},${a} L${s+r},${a}
|
|
M${s},${a-e} L${s},${a+n}`;t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let y=m.path(u,g),S=o.insert(()=>y,":first-child");return S.attr("transform",`translate(${e/2}, ${e/2})`),S.attr("class","basic label-container"),p&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",p),l&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",l),c.attr("transform",`translate(${-(i.width/2)+e/2-(i.x-(i.left??0))}, ${-(i.height/2)+e/2-(i.y-(i.top??0))})`),$(t,S),t.intersect=function(P){return b.polygon(t,d,P)},o}x(Ye,"windowPane");async function Gt(f,t){let h=t;if(h.alias&&(t.label=h.alias),t.look==="handDrawn"){let{themeVariables:q}=pt(),{background:Z}=q,tt={...t,id:t.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Z}`]};await Gt(f,tt)}let l=pt();t.useHtmlLabels=l.htmlLabels;let o=l.er?.diagramPadding??10,i=l.er?.entityPadding??6,{cssStyles:c}=t,{labelStyles:r,nodeStyles:n}=w(t);if(h.attributes.length===0&&t.label){let q={rx:0,ry:0,labelPaddingX:o,labelPaddingY:o*1.5,classes:""};xt(t.label,l)+q.labelPaddingX*2<l.er.minEntityWidth&&(t.width=l.er.minEntityWidth);let Z=await lt(f,t,q);if(!nt(l.htmlLabels)){let tt=Z.select("text"),rt=tt.node()?.getBBox();tt.attr("transform",`translate(${-rt.width/2}, 0)`)}return Z}l.htmlLabels||(o*=1.25,i*=1.25);let e=B(t);e||(e="node default");let s=f.insert("g").attr("class",e).attr("id",t.domId||t.id),a=await Nt(s,t.label??"",l,0,0,["name"],r);a.height+=i;let p=0,m=[],g=[],d=0,u=0,y=0,S=0,P=!0,T=!0;for(let q of h.attributes){let Z=await Nt(s,q.type,l,0,p,["attribute-type"],r);d=Math.max(d,Z.width+o);let tt=await Nt(s,q.name,l,0,p,["attribute-name"],r);u=Math.max(u,tt.width+o);let rt=await Nt(s,q.keys.join(),l,0,p,["attribute-keys"],r);y=Math.max(y,rt.width+o);let ut=await Nt(s,q.comment,l,0,p,["attribute-comment"],r);S=Math.max(S,ut.width+o);let ht=Math.max(Z.height,tt.height,rt.height,ut.height)+i;g.push({yOffset:p,rowHeight:ht}),p+=ht}let v=4;y<=o&&(P=!1,y=0,v--),S<=o&&(T=!1,S=0,v--);let M=s.node().getBBox();if(a.width+o*2-(d+u+y+S)>0){let q=a.width+o*2-(d+u+y+S);d+=q/v,u+=q/v,y>0&&(y+=q/v),S>0&&(S+=q/v)}let k=d+u+y+S,R=N.svg(s),G=D(t,{});t.look!=="handDrawn"&&(G.roughness=0,G.fillStyle="solid");let V=0;g.length>0&&(V=g.reduce((q,Z)=>q+(Z?.rowHeight??0),0));let A=Math.max(M.width+o*2,t?.width||0,k),O=Math.max((V??0)+a.height,t?.height||0),E=-A/2,L=-O/2;s.selectAll("g:not(:first-child)").each((q,Z,tt)=>{let rt=z(tt[Z]),ut=rt.attr("transform"),ht=0,jt=0;if(ut){let Tt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ut);Tt&&(ht=parseFloat(Tt[1]),jt=parseFloat(Tt[2]),rt.attr("class").includes("attribute-name")?ht+=d:rt.attr("class").includes("attribute-keys")?ht+=d+u:rt.attr("class").includes("attribute-comment")&&(ht+=d+u+y))}rt.attr("transform",`translate(${E+o/2+ht}, ${jt+L+a.height+i/2})`)}),s.select(".name").attr("transform","translate("+-a.width/2+", "+(L+i/2)+")");let I=R.rectangle(E,L,A,O,G),j=s.insert(()=>I,":first-child").attr("style",c.join("")),{themeVariables:F}=pt(),{rowEven:W,rowOdd:J,nodeBorder:ot}=F;m.push(0);for(let[q,Z]of g.entries()){let rt=(q+1)%2===0&&Z.yOffset!==0,ut=R.rectangle(E,a.height+L+Z?.yOffset,A,Z?.rowHeight,{...G,fill:rt?W:J,stroke:ot});s.insert(()=>ut,"g.label").attr("style",c.join("")).attr("class",`row-rect-${rt?"even":"odd"}`)}let at=R.line(E,a.height+L,A+E,a.height+L,G);s.insert(()=>at).attr("class","divider"),at=R.line(d+E,a.height+L,d+E,O+L,G),s.insert(()=>at).attr("class","divider"),P&&(at=R.line(d+u+E,a.height+L,d+u+E,O+L,G),s.insert(()=>at).attr("class","divider")),T&&(at=R.line(d+u+y+E,a.height+L,d+u+y+E,O+L,G),s.insert(()=>at).attr("class","divider"));for(let q of m)at=R.line(E,a.height+L+q,A+E,a.height+L+q,G),s.insert(()=>at).attr("class","divider");if($(t,j),n&&t.look!=="handDrawn"){let Z=n.split(";")?.filter(tt=>tt.includes("stroke"))?.map(tt=>`${tt}`).join("; ");s.selectAll("path").attr("style",Z??""),s.selectAll(".row-rect-even path").attr("style",n)}return t.intersect=function(q){return b.rect(t,q)},s}x(Gt,"erBox");async function Nt(f,t,h,l=0,o=0,i=[],c=""){let r=f.insert("g").attr("class",`label ${i.join(" ")}`).attr("transform",`translate(${l}, ${o})`).attr("style",c);t!==Rt(t)&&(t=Rt(t),t=t.replaceAll("<","<").replaceAll(">",">"));let n=r.node().appendChild(await et(r,t,{width:xt(t,h)+100,style:c,useHtmlLabels:h.htmlLabels},h));if(t.includes("<")||t.includes(">")){let s=n.children[0];for(s.textContent=s.textContent.replaceAll("<","<").replaceAll(">",">");s.childNodes[0];)s=s.childNodes[0],s.textContent=s.textContent.replaceAll("<","<").replaceAll(">",">")}let e=n.getBBox();if(nt(h.htmlLabels)){let s=n.children[0];s.style.textAlign="start";let a=z(n);e=s.getBoundingClientRect(),a.attr("width",e.width),a.attr("height",e.height)}return e}x(Nt,"addText");async function ze(f,t,h,l,o=h.class.padding??12){let i=l?0:3,c=f.insert("g").attr("class",B(t)).attr("id",t.domId||t.id),r=null,n=null,e=null,s=null,a=0,p=0,m=0;if(r=c.insert("g").attr("class","annotation-group text"),t.annotations.length>0){let S=t.annotations[0];await Pt(r,{text:`\xAB${S}\xBB`},0),a=r.node().getBBox().height}n=c.insert("g").attr("class","label-group text"),await Pt(n,t,0,["font-weight: bolder"]);let g=n.node().getBBox();p=g.height,e=c.insert("g").attr("class","members-group text");let d=0;for(let S of t.members){let P=await Pt(e,S,d,[S.parseClassifier()]);d+=P+i}m=e.node().getBBox().height,m<=0&&(m=o/2),s=c.insert("g").attr("class","methods-group text");let u=0;for(let S of t.methods){let P=await Pt(s,S,u,[S.parseClassifier()]);u+=P+i}let y=c.node().getBBox();if(r!==null){let S=r.node().getBBox();r.attr("transform",`translate(${-S.width/2})`)}return n.attr("transform",`translate(${-g.width/2}, ${a})`),y=c.node().getBBox(),e.attr("transform",`translate(0, ${a+p+o*2})`),y=c.node().getBBox(),s.attr("transform",`translate(0, ${a+p+(m?m+o*4:o*2)})`),y=c.node().getBBox(),{shapeSvg:c,bbox:y}}x(ze,"textHelper");async function Pt(f,t,h,l=[]){let o=f.insert("g").attr("class","label").attr("style",l.join("; ")),i=pt(),c="useHtmlLabels"in t?t.useHtmlLabels:nt(i.htmlLabels)??!0,r="";"text"in t?r=t.text:r=t.label,!c&&r.startsWith("\\")&&(r=r.substring(1)),Ht(r)&&(c=!0);let n=await et(o,$t(St(r)),{width:xt(r,i)+50,classes:"markdown-node-label",useHtmlLabels:c},i),e,s=1;if(c){let a=n.children[0],p=z(n);s=a.innerHTML.split("<br>").length,a.innerHTML.includes("</math>")&&(s+=a.innerHTML.split("<mrow>").length-1);let m=a.getElementsByTagName("img");if(m){let g=r.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...m].map(d=>new Promise(u=>{function y(){if(d.style.display="flex",d.style.flexDirection="column",g){let S=i.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,T=parseInt(S,10)*5+"px";d.style.minWidth=T,d.style.maxWidth=T}else d.style.width="100%";u(d)}x(y,"setupImage"),setTimeout(()=>{d.complete&&y()}),d.addEventListener("error",y),d.addEventListener("load",y)})))}e=a.getBoundingClientRect(),p.attr("width",e.width),p.attr("height",e.height)}else{l.includes("font-weight: bolder")&&z(n).selectAll("tspan").attr("font-weight",""),s=n.children.length;let a=n.children[0];(n.textContent===""||n.textContent.includes(">"))&&(a.textContent=r[0]+r.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),r[1]===" "&&(a.textContent=a.textContent[0]+" "+a.textContent.substring(1))),a.textContent==="undefined"&&(a.textContent=""),e=n.getBBox()}return o.attr("transform","translate(0,"+(-e.height/(2*s)+h)+")"),e.height}x(Pt,"addText");async function Ue(f,t){let h=Y(),l=h.class.padding??12,o=l,i=t.useHtmlLabels??nt(h.htmlLabels)??!0,c=t;c.annotations=c.annotations??[],c.members=c.members??[],c.methods=c.methods??[];let{shapeSvg:r,bbox:n}=await ze(f,t,h,i,o),{labelStyles:e,nodeStyles:s}=w(t);t.labelStyle=e,t.cssStyles=c.styles||"";let a=c.styles?.join(";")||s||"";t.cssStyles||(t.cssStyles=a.replaceAll("!important","").split(";"));let p=c.members.length===0&&c.methods.length===0&&!h.class?.hideEmptyMembersBox,m=N.svg(r),g=D(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let d=n.width,u=n.height;c.members.length===0&&c.methods.length===0?u+=o:c.members.length>0&&c.methods.length===0&&(u+=o*2);let y=-d/2,S=-u/2,P=m.rectangle(y-l,S-l-(p?l:c.members.length===0&&c.methods.length===0?-l/2:0),d+2*l,u+2*l+(p?l*2:c.members.length===0&&c.methods.length===0?-l:0),g),T=r.insert(()=>P,":first-child");T.attr("class","basic label-container");let v=T.node().getBBox();r.selectAll(".text").each((G,V,A)=>{let O=z(A[V]),E=O.attr("transform"),L=0;if(E){let W=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(E);W&&(L=parseFloat(W[2]))}let I=L+S+l-(p?l:c.members.length===0&&c.methods.length===0?-l/2:0);i||(I-=4);let j=y;(O.attr("class").includes("label-group")||O.attr("class").includes("annotation-group"))&&(j=-O.node()?.getBBox().width/2||0,r.selectAll("text").each(function(F,W,J){window.getComputedStyle(J[W]).textAnchor==="middle"&&(j=0)})),O.attr("transform",`translate(${j}, ${I})`)});let M=r.select(".annotation-group").node().getBBox().height-(p?l/2:0)||0,k=r.select(".label-group").node().getBBox().height-(p?l/2:0)||0,R=r.select(".members-group").node().getBBox().height-(p?l/2:0)||0;if(c.members.length>0||c.methods.length>0||p){let G=m.line(v.x,M+k+S+l,v.x+v.width,M+k+S+l,g);r.insert(()=>G).attr("class","divider").attr("style",a)}if(p||c.members.length>0||c.methods.length>0){let G=m.line(v.x,M+k+R+S+o*2+l,v.x+v.width,M+k+R+S+l+o*2,g);r.insert(()=>G).attr("class","divider").attr("style",a)}if(c.look!=="handDrawn"&&r.selectAll("path").attr("style",a),T.select(":nth-child(2)").attr("style",a),r.selectAll(".divider").select("path").attr("style",a),t.labelStyle?r.selectAll("span").attr("style",t.labelStyle):r.selectAll("span").attr("style",a),!i){let G=RegExp(/color\s*:\s*([^;]*)/),V=G.exec(a);if(V){let A=V[0].replace("color","fill");r.selectAll("tspan").attr("style",A)}else if(e){let A=G.exec(e);if(A){let O=A[0].replace("color","fill");r.selectAll("tspan").attr("style",O)}}}return $(t,T),t.intersect=function(G){return b.rect(t,G)},r}x(Ue,"classBox");async function Ze(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let o=t,i=t,c=20,r=20,n="verifyMethod"in t,e=B(t),s=f.insert("g").attr("class",e).attr("id",t.domId??t.id),a;n?a=await ct(s,`<<${o.type}>>`,0,t.labelStyle):a=await ct(s,"<<Element>>",0,t.labelStyle);let p=a,m=await ct(s,o.name,p,t.labelStyle+"; font-weight: bold;");if(p+=m+r,n){let M=await ct(s,`${o.requirementId?`ID: ${o.requirementId}`:""}`,p,t.labelStyle);p+=M;let k=await ct(s,`${o.text?`Text: ${o.text}`:""}`,p,t.labelStyle);p+=k;let R=await ct(s,`${o.risk?`Risk: ${o.risk}`:""}`,p,t.labelStyle);p+=R,await ct(s,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,p,t.labelStyle)}else{let M=await ct(s,`${i.type?`Type: ${i.type}`:""}`,p,t.labelStyle);p+=M,await ct(s,`${i.docRef?`Doc Ref: ${i.docRef}`:""}`,p,t.labelStyle)}let g=(s.node()?.getBBox().width??200)+c,d=(s.node()?.getBBox().height??200)+c,u=-g/2,y=-d/2,S=N.svg(s),P=D(t,{});t.look!=="handDrawn"&&(P.roughness=0,P.fillStyle="solid");let T=S.rectangle(u,y,g,d,P),v=s.insert(()=>T,":first-child");if(v.attr("class","basic label-container").attr("style",l),s.selectAll(".label").each((M,k,R)=>{let G=z(R[k]),V=G.attr("transform"),A=0,O=0;if(V){let j=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(V);j&&(A=parseFloat(j[1]),O=parseFloat(j[2]))}let E=O-d/2,L=u+c/2;(k===0||k===1)&&(L=A),G.attr("transform",`translate(${L}, ${E+c})`)}),p>a+m+r){let M=S.line(u,y+a+m+r,u+g,y+a+m+r,P);s.insert(()=>M).attr("style",l)}return $(t,v),t.intersect=function(M){return b.rect(t,M)},s}x(Ze,"requirementBox");async function ct(f,t,h,l=""){if(t==="")return 0;let o=f.insert("g").attr("class","label").attr("style",l),i=Y(),c=i.htmlLabels??!0,r=await et(o,$t(St(t)),{width:xt(t,i)+50,classes:"markdown-node-label",useHtmlLabels:c,style:l},i),n;if(c){let e=r.children[0],s=z(r);n=e.getBoundingClientRect(),s.attr("width",n.width),s.attr("height",n.height)}else{let e=r.children[0];for(let s of e.children)s.textContent=s.textContent.replaceAll(">",">").replaceAll("<","<"),l&&s.setAttribute("style",l);n=r.getBBox(),n.height+=6}return o.attr("transform",`translate(${-n.width/2},${-n.height/2+h})`),n.height}x(ct,"addText");var Ps=x(f=>{switch(f){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Je(f,t,{config:h}){let{labelStyles:l,nodeStyles:o}=w(t);t.labelStyle=l||"";let i=10,c=t.width;t.width=(t.width??200)-10;let{shapeSvg:r,bbox:n,label:e}=await C(f,t,B(t)),s=t.padding||10,a="",p;"ticket"in t&&t.ticket&&h?.kanban?.ticketBaseUrl&&(a=h?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),p=r.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",a).attr("target","_blank"));let m={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},g,d;p?{label:g,bbox:d}=await Dt(p,"ticket"in t&&t.ticket||"",m):{label:g,bbox:d}=await Dt(r,"ticket"in t&&t.ticket||"",m);let{label:u,bbox:y}=await Dt(r,"assigned"in t&&t.assigned||"",m);t.width=c;let S=10,P=t?.width||0,T=Math.max(d.height,y.height)/2,v=Math.max(n.height+S*2,t?.height||0)+T,M=-P/2,k=-v/2;e.attr("transform","translate("+(s-P/2)+", "+(-T-n.height/2)+")"),g.attr("transform","translate("+(s-P/2)+", "+(-T+n.height/2)+")"),u.attr("transform","translate("+(s+P/2-y.width-2*i)+", "+(-T+n.height/2)+")");let R,{rx:G,ry:V}=t,{cssStyles:A}=t;if(t.look==="handDrawn"){let O=N.svg(r),E=D(t,{}),L=G||V?O.path(st(M,k,P,v,G||0),E):O.rectangle(M,k,P,v,E);R=r.insert(()=>L,":first-child"),R.attr("class","basic label-container").attr("style",A||null)}else{R=r.insert("rect",":first-child"),R.attr("class","basic label-container __APA__").attr("style",o).attr("rx",G??5).attr("ry",V??5).attr("x",M).attr("y",k).attr("width",P).attr("height",v);let O="priority"in t&&t.priority;if(O){let E=r.append("line"),L=M+2,I=k+Math.floor((G??0)/2),j=k+v-Math.floor((G??0)/2);E.attr("x1",L).attr("y1",I).attr("x2",L).attr("y2",j).attr("stroke-width","4").attr("stroke",Ps(O))}}return $(t,R),t.height=v,t.intersect=function(O){return b.rect(t,O)},r}x(Je,"kanbanItem");async function Ke(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,halfPadding:c,label:r}=await C(f,t,B(t)),n=i.width+10*c,e=i.height+8*c,s=.15*n,{cssStyles:a}=t,p=i.width+20,m=i.height+20,g=Math.max(n,p),d=Math.max(e,m);r.attr("transform",`translate(${-i.width/2}, ${-i.height/2})`);let u,y=`M0 0
|
|
a${s},${s} 1 0,0 ${g*.25},${-1*d*.1}
|
|
a${s},${s} 1 0,0 ${g*.25},0
|
|
a${s},${s} 1 0,0 ${g*.25},0
|
|
a${s},${s} 1 0,0 ${g*.25},${d*.1}
|
|
|
|
a${s},${s} 1 0,0 ${g*.15},${d*.33}
|
|
a${s*.8},${s*.8} 1 0,0 0,${d*.34}
|
|
a${s},${s} 1 0,0 ${-1*g*.15},${d*.33}
|
|
|
|
a${s},${s} 1 0,0 ${-1*g*.25},${d*.15}
|
|
a${s},${s} 1 0,0 ${-1*g*.25},0
|
|
a${s},${s} 1 0,0 ${-1*g*.25},0
|
|
a${s},${s} 1 0,0 ${-1*g*.25},${-1*d*.15}
|
|
|
|
a${s},${s} 1 0,0 ${-1*g*.1},${-1*d*.33}
|
|
a${s*.8},${s*.8} 1 0,0 0,${-1*d*.34}
|
|
a${s},${s} 1 0,0 ${g*.1},${-1*d*.33}
|
|
H0 V0 Z`;if(t.look==="handDrawn"){let S=N.svg(o),P=D(t,{}),T=S.path(y,P);u=o.insert(()=>T,":first-child"),u.attr("class","basic label-container").attr("style",X(a))}else u=o.insert("path",":first-child").attr("class","basic label-container").attr("style",l).attr("d",y);return u.attr("transform",`translate(${-g/2}, ${-d/2})`),$(t,u),t.calcIntersect=function(S,P){return b.rect(S,P)},t.intersect=function(S){return _.info("Bang intersect",t,S),b.rect(t,S)},o}x(Ke,"bang");async function Qe(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,halfPadding:c,label:r}=await C(f,t,B(t)),n=i.width+2*c,e=i.height+2*c,s=.15*n,a=.25*n,p=.35*n,m=.2*n,{cssStyles:g}=t,d,u=`M0 0
|
|
a${s},${s} 0 0,1 ${n*.25},${-1*n*.1}
|
|
a${p},${p} 1 0,1 ${n*.4},${-1*n*.1}
|
|
a${a},${a} 1 0,1 ${n*.35},${n*.2}
|
|
|
|
a${s},${s} 1 0,1 ${n*.15},${e*.35}
|
|
a${m},${m} 1 0,1 ${-1*n*.15},${e*.65}
|
|
|
|
a${a},${s} 1 0,1 ${-1*n*.25},${n*.15}
|
|
a${p},${p} 1 0,1 ${-1*n*.5},0
|
|
a${s},${s} 1 0,1 ${-1*n*.25},${-1*n*.15}
|
|
|
|
a${s},${s} 1 0,1 ${-1*n*.1},${-1*e*.35}
|
|
a${m},${m} 1 0,1 ${n*.1},${-1*e*.65}
|
|
H0 V0 Z`;if(t.look==="handDrawn"){let y=N.svg(o),S=D(t,{}),P=y.path(u,S);d=o.insert(()=>P,":first-child"),d.attr("class","basic label-container").attr("style",X(g))}else d=o.insert("path",":first-child").attr("class","basic label-container").attr("style",l).attr("d",u);return r.attr("transform",`translate(${-i.width/2}, ${-i.height/2})`),d.attr("transform",`translate(${-n/2}, ${-e/2})`),$(t,d),t.calcIntersect=function(y,S){return b.rect(y,S)},t.intersect=function(y){return _.info("Cloud intersect",t,y),b.rect(t,y)},o}x(Qe,"cloud");async function ts(f,t){let{labelStyles:h,nodeStyles:l}=w(t);t.labelStyle=h;let{shapeSvg:o,bbox:i,halfPadding:c,label:r}=await C(f,t,B(t)),n=i.width+8*c,e=i.height+2*c,s=5,a=`
|
|
M${-n/2} ${e/2-s}
|
|
v${-e+2*s}
|
|
q0,-${s} ${s},-${s}
|
|
h${n-2*s}
|
|
q${s},0 ${s},${s}
|
|
v${e-2*s}
|
|
q0,${s} -${s},${s}
|
|
h${-n+2*s}
|
|
q-${s},0 -${s},-${s}
|
|
Z
|
|
`,p=o.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("style",l).attr("d",a);return o.append("line").attr("class","node-line-").attr("x1",-n/2).attr("y1",e/2).attr("x2",n/2).attr("y2",e/2),r.attr("transform",`translate(${-i.width/2}, ${-i.height/2})`),o.append(()=>r.node()),$(t,p),t.calcIntersect=function(m,g){return b.rect(m,g)},t.intersect=function(m){return b.rect(t,m)},o}x(ts,"defaultMindmapNode");async function es(f,t){let h={padding:t.padding??0};return Bt(f,t,h)}x(es,"mindmapCircle");var Cs=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Me},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Te},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Ge},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Ae},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:se},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Bt},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Ke},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Qe},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Be},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:ce},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Se},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:xe},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Ie},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:ye},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:ie},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Ve},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Ut},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:ke},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:He},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:je},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:ne},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:he},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Kt},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Qt},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:te},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:be},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Xe},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:le},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:We},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:we},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:ee},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:re},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:_e},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Ye},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:oe},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Fe},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:ae},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Re},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:De},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:$e},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:zt},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Jt},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Le},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Oe},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:qe},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Pe},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Ne}],Ts=x(()=>{let t=[...Object.entries({state:Ee,choice:Zt,note:ve,rectWithTitle:Ce,labelRect:ue,iconSquare:ge,iconCircle:me,icon:pe,iconRounded:fe,imageSquare:de,anchor:qt,kanbanItem:Je,mindmapCircle:es,defaultMindmapNode:ts,classBox:Ue,erBox:Gt,requirementBox:Ze}),...Cs.flatMap(h=>[h.shortName,..."aliases"in h?h.aliases:[],..."internalAliases"in h?h.internalAliases:[]].map(o=>[o,h.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Et=Ts();function ff(f){return f in Et}x(ff,"isValidShape");var Ct=new Map;async function xf(f,t,h){let l,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");let i=t.shape?Et[t.shape]:void 0;if(!i)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let c;h.config.securityLevel==="sandbox"?c="_top":t.linkTarget&&(c=t.linkTarget||"_blank"),l=f.insert("svg:a").attr("xlink:href",t.link).attr("target",c??null),o=await i(l,t,h)}else o=await i(f,t,h),l=o;return t.tooltip&&o.attr("title",t.tooltip),Ct.set(t.id,l),t.haveCallback&&l.attr("class",l.attr("class")+" clickable"),l}x(xf,"insertNode");var Sf=x((f,t)=>{Ct.set(t.id,f)},"setNodeElem"),bf=x(()=>{Ct.clear()},"clear"),wf=x(f=>{let t=Ct.get(f.id);_.trace("Transforming node",f.diff,f,"translate("+(f.x-f.width/2-5)+", "+f.width/2+")");let h=8,l=f.diff||0;return f.clusterNode?t.attr("transform","translate("+(f.x+l-f.width/2)+", "+(f.y-f.height/2-h)+")"):t.attr("transform","translate("+f.x+", "+f.y+")"),l},"positionNode");export{C as a,$ as b,wt as c,ff as d,ar as e,nr as f,xf as g,Sf as h,bf as i,wf as j};
|