UNPKG

mermaid

Version:

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

63 lines • 124 kB
import{a as k}from"./chunk-JENJ2NYI.mjs";import{a as ve,b as ut,d as D,e as v}from"./chunk-J3HIBH47.mjs";import{g as ct}from"./chunk-PNVTB6QF.mjs";import{c as _t,e as it}from"./chunk-QMVAV2W2.mjs";import{b as Ne,c as $e,d as De,e as lt}from"./chunk-JMS3MFCX.mjs";import{k as At,o as Pe,s as Nt,u as q}from"./chunk-3A3SYRXV.mjs";import{C as ft,F as Wt,H as ie,I as we,da as U,ga as qt,j as Se,r as mt,y as kt}from"./chunk-OI4SXON4.mjs";import{b as X,h as J}from"./chunk-NXZFCOWJ.mjs";import{a as b}from"./chunk-V3YWWTDH.mjs";var qr=1,Zr=3;async function Zt(i){let t=i.getElementsByTagName("img");if(!t||t.length===0)return;let r=!ke(i);await Promise.all([...t].map(n=>new Promise(c=>{function l(){if(n.style.display="flex",n.style.flexDirection="column",r){let f=U().fontSize?U().fontSize:window.getComputedStyle(document.body).fontSize,o=5,[h=Se.fontSize]=Pe(f),a=h*o+"px";n.style.minWidth=a,n.style.maxWidth=a}else n.style.width="100%";c(n)}b(l,"setupImage"),setTimeout(()=>{n.complete&&l()}),n.addEventListener("error",l),n.addEventListener("load",l)})))}b(Zt,"configureLabelImages");function ke(i){return i.nodeType===Zr?i.textContent?.trim()!=="":i.nodeType!==qr||i.tagName.toLowerCase()==="img"?!1:[...i.childNodes].some(ke)}b(ke,"hasTextBesidesImages");var Te=3,zr=32,Ge=b(async(i,t,r)=>{let n=U(),c=i.insert("g").attr("class",r??"node default").attr("id",t.domId||t.id),l=c.insert("g").attr("class","label").attr("style",q(t.labelStyle)),o=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(y=>({text:y,cssClass:"c4-descr"}))].filter(y=>y.text),h=t.width?Math.max(t.width-2*(t.padding??0),zr):U().flowchart?.wrappingWidth??200,e=n.c4?.wrap??!0?h:Number.POSITIVE_INFINITY,s=await Promise.all(o.map(async y=>{let x=l.append("g").attr("class",y.cssClass),S=await it(x,Wt(Nt(y.text??""),n),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:e,style:t.labelStyle},n);return J(S).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),J(S).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:x,box:x.node().getBBox()}})),p=Math.max(...s.map(({box:y})=>y.width),0),m=0;for(let{el:y,box:x}of s)y.attr("transform",`translate(${p/2-x.x-x.width/2}, ${m-x.y})`),m+=x.height+Te;let d=s.length>0?m-Te:0;l.insert("rect",":first-child"),l.attr("transform",`translate(${-p/2}, ${-d/2})`);let g=l.node().getBBox(),u=(t.padding??0)/2;return{shapeSvg:c,bbox:g,halfPadding:u,label:l}},"c4LabelHelper");var Me=b((i,t)=>{let{x:r,y:n,width:c,height:l}=i;return c>=t?i:"left"in i?{x:r,y:n,width:t,height:l,top:n,left:r,bottom:n+l,right:r+t,toJSON:b(()=>({}),"toJSON")}:{x:r-(t-c)/2,y:n,width:t,height:l}},"withMinWidth"),G=b(async(i,t,r,{ignoreMinWidth:n=!1}={})=>{if(t.stereotype!==void 0)return Ge(i,t,r);let c,l=t.useHtmlLabels||mt(U()?.htmlLabels);r?c=r:c="node default";let f=i.insert("g").attr("class",c).attr("id",t.domId||t.id),o=f.insert("g").attr("class","label").attr("style",q(t.labelStyle)),h;t.label===void 0?h="":h=typeof t.label=="string"?t.label:t.label[0];let a=!!t.icon||!!t.img,e=t.labelType==="markdown",s=h&&!t.width&&!n?t.minWidth??0:0,p=await it(o,Wt(Nt(h),U()),{useHtmlLabels:l,width:t.width||t.wrappingWidth||U().flowchart?.wrappingWidth,minWidth:s,classes:e?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:a,markdown:e},U()),m=(t?.padding??0)/2,d;if(l){let g=p.children[0],u=J(p);await Zt(g),d=await _t.measure(()=>g.getBoundingClientRect()),d=Me(d,s),u.attr("width",d.width),u.attr("height",d.height)}else d=await _t.measure(()=>p.getBBox()),d=Me(d,s);return l?o.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):o.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:f,bbox:d,halfPadding:m,label:o}},"labelHelper"),dt=b(async(i,t,r)=>{let n=r.useHtmlLabels??ft(U()),c=i.insert("g").attr("class","label").attr("style",r.labelStyle||""),l=await it(c,Wt(Nt(t),U()),{useHtmlLabels:n,width:r.width||U()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),f=r.padding/2,o;if(ft(U())){let h=l.children[0],a=J(l);o=await _t.measure(()=>h.getBoundingClientRect()),a.attr("width",o.width),a.attr("height",o.height)}else o=await _t.measure(()=>l.getBBox());return n?c.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"):c.attr("transform","translate(0, "+-o.height/2+")"),r.centerLabel&&c.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:i,bbox:o,halfPadding:f,label:c}},"insertLabel"),P=b((i,t,r)=>{if(r){i.width=r.width,i.height=r.height;return}let n=t.node().getBBox();i.width=n.width,i.height=n.height},"updateNodeBounds");var T=b((i,t)=>(i.look==="handDrawn"?"rough-node":"node")+" "+i.cssClasses+" "+(t||""),"getNodeClasses");function _(i){let t=i.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}b(_,"createPathFromPoints");function ht(i,t,r,n,c,l){let f=[],h=r-i,a=n-t,e=h/l,s=2*Math.PI/e,p=t+a/2;for(let m=0;m<=50;m++){let d=m/50,g=i+d*h,u=p+c*Math.sin(s*(g-i));f.push({x:g,y:u})}return f}b(ht,"generateFullSineWavePoints");function nt(i,t,r,n,c,l){let f=[],o=c*Math.PI/180,e=(l*Math.PI/180-o)/(n-1);for(let s=0;s<n;s++){let p=o+s*e,m=i+r*Math.cos(p),d=t+r*Math.sin(p);f.push({x:-m,y:-d})}return f}b(nt,"generateCirclePoints");function ne(i){let t=Array.from(i.childNodes).filter(h=>h.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=t.map(h=>h.getAttribute("d")).filter(h=>h!==null).join(" ");r.setAttribute("d",n);let c=t.find(h=>h.getAttribute("fill")!=="none"),l=t.find(h=>h.getAttribute("stroke")!=="none"),f=b((h,a)=>h?.getAttribute(a)??void 0,"getAttr");if(c){let h={fill:f(c,"fill"),"fill-opacity":f(c,"fill-opacity")??"1"};Object.entries(h).forEach(([a,e])=>{e&&r.setAttribute(a,e)})}if(l){let h={stroke:f(l,"stroke"),"stroke-width":f(l,"stroke-width")??"1","stroke-opacity":f(l,"stroke-opacity")??"1"};Object.entries(h).forEach(([a,e])=>{e&&r.setAttribute(a,e)})}let o=document.createElementNS("http://www.w3.org/2000/svg","g");return o.appendChild(r),o}b(ne,"mergePaths");var Ee=Symbol("lineIntersectionOrigin"),ua=b((i,t)=>({...i,[Ee]:t}),"withLineIntersectionOrigin"),It=b((i,t)=>i?.[Ee]??t,"getLineIntersectionOrigin");function Jr(i,t,r,n){{let c=t.y-i.y,l=i.x-t.x,f=t.x*i.y-i.x*t.y,o=c*r.x+l*r.y+f,h=c*n.x+l*n.y+f,a=1e-6;if(o!==0&&h!==0&&Be(o,h))return;let e=n.y-r.y,s=r.x-n.x,p=n.x*r.y-r.x*n.y,m=e*i.x+s*i.y+p,d=e*t.x+s*t.y+p;if(Math.abs(m)<a&&Math.abs(d)<a&&Be(m,d))return;let g=c*s-e*l;if(g===0)return;let u=(l*p-s*f)/g,y=(e*f-c*p)/g;return{x:u,y}}}b(Jr,"intersectLine");function Be(i,t){return i*t>0}b(Be,"sameSign");var Ce=Jr;function Kr(i,t,r){let n=i.x,c=i.y,l=It(r,i),f=[],o=Number.POSITIVE_INFINITY,h=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(s){o=Math.min(o,s.x),h=Math.min(h,s.y)}):(o=Math.min(o,t.x),h=Math.min(h,t.y));let a=n-i.width/2-o,e=c-i.height/2-h;for(let s=0;s<t.length;s++){let p=t[s],m=t[s<t.length-1?s+1:0],d=Ce(l,r,{x:a+p.x,y:e+p.y},{x:a+m.x,y:e+m.y});d&&f.push(d)}return f.length?(f.length>1&&f.sort(function(s,p){let m=s.x-r.x,d=s.y-r.y,g=Math.sqrt(m*m+d*d),u=p.x-r.x,y=p.y-r.y,x=Math.sqrt(u*u+y*y);return g<x?-1:g===x?0:1}),f[0]):i}b(Kr,"intersectPolygon");var zt=Kr;var Qr=b((i,t)=>{if(It(t,i)!==i)return zt(i,[{x:0,y:0},{x:i.width,y:0},{x:i.width,y:i.height},{x:0,y:i.height}],t);var r=i.x,n=i.y,c=t.x-r,l=t.y-n,f=i.width/2,o=i.height/2,h,a;return Math.abs(l)*f>Math.abs(c)*o?(l<0&&(o=-o),h=l===0?0:o*c/l,a=o):(c<0&&(f=-f),h=f,a=c===0?0:f*l/c),{x:r+h,y:n+a}},"intersectRect"),Ae=Qr;function to(i,t){return i.intersect(t)}b(to,"intersectNode");var Re=to;function eo(i,t,r,n){var c=i.x,l=i.y;let f=It(n,i);if(f!==i){let p=f.x-c,m=f.y-l,d=n.x-f.x,g=n.y-f.y,u=t*t,y=r*r,x=d*d/u+g*g/y,S=2*p*d/u+2*m*g/y,w=p*p/u+m*m/y-1,$=S*S-4*x*w;if(x>0&&$>=0){let E=Math.sqrt($),M=[(-S-E)/(2*x),(-S+E)/(2*x)].filter(B=>B>=0&&B<=1).sort((B,L)=>L-B);if(M.length){let B=M[0];return{x:f.x+B*d,y:f.y+B*g}}}}var o=c-n.x,h=l-n.y,a=Math.sqrt(t*t*h*h+r*r*o*o),e=Math.abs(t*r*o/a);n.x<c&&(e=-e);var s=Math.abs(t*r*h/a);return n.y<l&&(s=-s),{x:c+e,y:l+s}}b(eo,"intersectEllipse");var Jt=eo;function so(i,t,r){return Jt(i,t,t,r)}b(so,"intersectCircle");var He=so;var N={node:Re,circle:He,ellipse:Jt,polygon:zt,rect:Ae};var tt=b((i,t,r,n,c)=>["M",i+c,t,"H",i+r-c,"A",c,c,0,0,1,i+r,t+c,"V",t+n-c,"A",c,c,0,0,1,i+r-c,t+n,"H",i+c,"A",c,c,0,0,1,i,t+n-c,"V",t+c,"A",c,c,0,0,1,i+c,t,"Z"].join(" "),"createRoundedRectPathD");var ro=b(async(i,t,r,n=!1,c=!1)=>{let l=t||"";typeof l=="object"&&(l=l[0]);let f=U(),o=ft(f);return await it(i,l,{style:r,isTitle:n,useHtmlLabels:o,markdown:!1,isNode:c,width:Number.POSITIVE_INFINITY},f)},"createLabel"),le=ro;function je(i,t){let{labelStyles:r}=D(t);t.labelStyle=r;let n=T(t),c=n;n||(c="anchor");let l=i.insert("g").attr("class",c).attr("id",t.domId||t.id),f=1,{cssStyles:o}=t,h=k.svg(l),a=v(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(a.roughness=0);let e=h.circle(0,0,f*2,a),s=l.insert(()=>e,":first-child");return s.attr("class","anchor").attr("style",q(o)),P(t,s),t.intersect=function(p){return X.info("Circle intersect",t,f,p),N.circle(t,f,p)},l}b(je,"anchor");function Ie(i,t,r,n,c,l,f){let h=(i+r)/2,a=(t+n)/2,e=Math.atan2(n-t,r-i),s=(r-i)/2,p=(n-t)/2,m=s/c,d=p/l,g=Math.sqrt(m**2+d**2);if(g>1)throw new Error("The given radii are too small to create an arc between the points.");let u=Math.sqrt(1-g**2),y=h+u*l*Math.sin(e)*(f?-1:1),x=a-u*c*Math.cos(e)*(f?-1:1),S=Math.atan2((t-x)/l,(i-y)/c),$=Math.atan2((n-x)/l,(r-y)/c)-S;f&&$<0&&($+=2*Math.PI),!f&&$>0&&($-=2*Math.PI);let E=[];for(let M=0;M<20;M++){let B=M/19,L=S+B*$,R=y+c*Math.cos(L),A=x+l*Math.sin(L);E.push({x:R,y:A})}return E}b(Ie,"generateArcPoints");function oo(i,t,r){let[n,c]=[t,r].sort((l,f)=>f-l);return c*(1-Math.sqrt(1-(i/n/2)**2))}b(oo,"calculateArcSagitta");async function Oe(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,f=t.look==="neo"?12:c,o=b(L=>L+f,"calcTotalHeight"),h=b(L=>{let R=L/2;return[R/(2.5+L/50),R]},"calcEllipseRadius"),{shapeSvg:a,bbox:e}=await G(i,t,T(t)),s=o(t?.height?t?.height:e.height),[p,m]=h(s),d=oo(s,p,m),u=(t?.width?t?.width:e.width)+l*2+d-d,y=s,{cssStyles:x}=t,S=[{x:u/2,y:-y/2},{x:-u/2,y:-y/2},...Ie(-u/2,-y/2,-u/2,y/2,p,m,!1),{x:u/2,y:y/2},...Ie(u/2,y/2,u/2,-y/2,p,m,!0)],w=k.svg(a),$=v(t,{});t.look!=="handDrawn"&&($.roughness=0,$.fillStyle="solid");let E=_(S),M=w.path(E,$),B=a.insert(()=>M,":first-child");return B.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",x),n&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",n),B.attr("transform",`translate(${p/2}, 0)`),P(t,B),t.intersect=function(L){return N.polygon(t,S,L)},a}b(Oe,"bowTieRect");async function Le(i,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let{shapeSvg:l,bbox:f,label:o}=await G(i,t,T(t)),h=r?.nodeBorder??r?.lineColor??"currentColor",a=t.padding??12,e=Math.max(f.width+a*2,t.width??0,80),s=Math.max(Math.min(e*.08,12),5),p=Math.max(f.height+a*2+s,t.height??0),m=-p/2+s,d=p/2,g=e*.72,u=[`M${-e/2},${m}`,`L${-g/2},${d}`,`A${g/2},${s} 0 0 0 ${g/2},${d}`,`L${e/2},${m}`,`A${e/2},${s} 0 0 0 ${-e/2},${m}`,"Z"].join(" "),{cssStyles:y}=t,x=l.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let B=k.svg(l).path(u,v(t,{}));x.node()?.appendChild(B),y&&x.attr("style",y)}else x.append("path").attr("d",u).attr("style",c);x.append("ellipse").attr("cx",0).attr("cy",m).attr("rx",e/2).attr("ry",s).attr("style",`fill:none;stroke:${h};stroke-width:1px`),P(t,x);let S=m+(d-m)/2;o.attr("transform",`translate(${-(f.width/2)-(f.x-(f.left??0))}, ${S-f.height/2-(f.y-(f.top??0))})`);let w=12,$=b((M,B,L)=>Array.from({length:w+1},(R,A)=>{let j=Math.PI-A*Math.PI/w;return{x:M*Math.cos(j),y:B+L*s*Math.sin(j)}}),"arc"),E=[...$(e/2,m,-1),...$(g/2,d,1).reverse()];return t.intersect=function(M){return N.polygon(t,E,M)},l}b(Le,"bucket");var ce=20,he=8,ao=80,io=8;function no(i){let{themeVariables:t}=U(),r=t.clusterBkg,n=t.clusterBorder;return i==="flow"?{rx:10,fill:"none",stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:"flow-collapsed"}:{rx:io,fill:r,stroke:n,cssClass:"collapsed-group"}}b(no,"getCollapsedStyle");async function Ve(i,t){let r=no(t.metadata?.containerType),{fill:n,stroke:c}=r,{nodeStyles:l}=D(t),{shapeSvg:f,bbox:o}=await G(i,t,T(t)),{theme:h,themeVariables:a}=U();ct(f,t.colorIndex,h,a.borderColorArray);let e=t.padding??8,s=o.height,p=Math.max(o.width+e*2,ao,t?.width??0),m=Math.max(s+he+ce+e*2,t?.height??0),d=-p/2,g=-m/2,u=-(he+ce)/2,y=f.select(".label");y&&(t.useHtmlLabels??ft(U())?y.attr("transform",`translate(${-o.width/2}, ${-o.height/2+u})`):y.attr("transform",`translate(0, ${-o.height/2+u})`));let x;if(t.look==="handDrawn"){let M=k.svg(f),B=v(t,{fill:n,stroke:c,...r.strokeWidth===void 0?{}:{strokeWidth:r.strokeWidth},...n==="none"?{fillWeight:0}:{fillStyle:"solid"}}),L=M.path(tt(d,g,p,m,r.rx),B);x=f.insert(()=>L,":first-child"),x.attr("class","basic label-container "+r.cssClass).attr("style",q(t.cssStyles))}else x=f.insert("rect",":first-child"),x.attr("class","basic label-container "+r.cssClass).attr("style",l).attr("rx",r.rx).attr("ry",r.rx).attr("x",d).attr("y",g).attr("width",p).attr("height",m).attr("fill",n).attr("stroke",c),r.strokeWidth!==void 0&&x.attr("stroke-width",r.strokeWidth+"px");let S=g+e+s+he;f.append("line").attr("class","collapsed-separator").attr("x1",d+8).attr("y1",S).attr("x2",d+p-8).attr("y2",S).attr("stroke",c).attr("stroke-dasharray","3, 3");let w=S+ce/2,$=2.5,E=10;for(let M=-1;M<=1;M++)f.append("circle").attr("class","collapsed-indicator").attr("cx",M*E).attr("cy",w).attr("r",$).attr("fill",c);return P(t,x),t.calcIntersect=function(M,B){return N.rect(M,B)},t.intersect=function(M){return N.rect(t,M)},f}b(Ve,"collapsedGroup");function et(i,t,r,n){return i.insert("polygon",":first-child").attr("points",n.map(function(c){return c.x+","+c.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}b(et,"insertPolygonShape");var lo=["right","left","up","down"],pe="point",co=b(i=>{let t=new Set;for(let r of i)switch(r){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(r);break}return t},"expandAndDeduplicateDirections"),ho=b(i=>lo.filter(t=>i.has(t)).join("|")||pe,"getDirectionKey"),We={"right|left|up|down":b(({height:i,midpoint:t,padding:r,width:n})=>[{x:0,y:0},{x:t,y:0},{x:n/2,y:2*r},{x:n-t,y:0},{x:n,y:0},{x:n,y:-i/3},{x:n+2*r,y:-i/2},{x:n,y:-2*i/3},{x:n,y:-i},{x:n-t,y:-i},{x:n/2,y:-i-2*r},{x:t,y:-i},{x:0,y:-i},{x:0,y:-2*i/3},{x:-2*r,y:-i/2},{x:0,y:-i/3}],"right|left|up|down"),"right|left|up":b(({height:i,midpoint:t,width:r})=>[{x:t,y:0},{x:r-t,y:0},{x:r,y:-i/2},{x:r-t,y:-i},{x:t,y:-i},{x:0,y:-i/2}],"right|left|up"),"right|left|down":b(({height:i,midpoint:t,width:r})=>[{x:0,y:0},{x:t,y:-i},{x:r-t,y:-i},{x:r,y:0}],"right|left|down"),"right|up|down":b(({height:i,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:r,y:-i+t},{x:0,y:-i}],"right|up|down"),"left|up|down":b(({height:i,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:0,y:-i+t},{x:r,y:-i}],"left|up|down"),"right|left":b(({height:i,midpoint:t,padding:r,width:n})=>[{x:t,y:0},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:0},{x:n,y:-i/2},{x:n-t,y:-i},{x:n-t,y:-i+r},{x:t,y:-i+r},{x:t,y:-i},{x:0,y:-i/2}],"right|left"),"up|down":b(({height:i,midpoint:t,padding:r,width:n})=>[{x:n/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-i+r},{x:0,y:-i+r},{x:n/2,y:-i},{x:n,y:-i+r},{x:n-t,y:-i+r},{x:n-t,y:-r},{x:n,y:-r}],"up|down"),"right|up":b(({height:i,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:0,y:-i}],"right|up"),"right|down":b(({height:i,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-i}],"right|down"),"left|up":b(({height:i,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:r,y:-i}],"left|up"),"left|down":b(({height:i,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-i}],"left|down"),right:b(({height:i,midpoint:t,padding:r,width:n})=>[{x:t,y:-r},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:0},{x:n,y:-i/2},{x:n-t,y:-i},{x:n-t,y:-i+r},{x:t,y:-i+r},{x:t,y:-i+r}],"right"),left:b(({height:i,midpoint:t,padding:r,width:n})=>[{x:t,y:0},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:-i+r},{x:t,y:-i+r},{x:t,y:-i},{x:0,y:-i/2}],"left"),up:b(({height:i,midpoint:t,padding:r,width:n})=>[{x:t,y:-r},{x:t,y:-i+r},{x:0,y:-i+r},{x:n/2,y:-i},{x:n,y:-i+r},{x:n-t,y:-i+r},{x:n-t,y:-r}],"up"),down:b(({height:i,midpoint:t,padding:r,width:n})=>[{x:n/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-i+r},{x:n-t,y:-i+r},{x:n-t,y:-r},{x:n,y:-r}],"down"),[pe]:()=>[{x:0,y:0}]},po=b((i,t,r,n)=>{let c=co(i),l=(r.padding??0)/2,f=t.height+4*l,o=f/2,h=n??t.width+2*o+2*l,a=ho(c);return(We[a]??We[pe])({height:f,midpoint:o,padding:l,width:h})},"getArrowPoints");async function _e(i,t){let r=t,{shapeSvg:n,bbox:c}=await G(i,r,T(r)),l=r.padding??0,f=c.height+2*l,o=f/2,h=c.width+2*o+l,a=r.width??0,s=r.positioned&&(r.widthInColumns??1)>1&&a>h?a:h,p=po(r.directions??[],c,r,s),m=et(n,s,f,p);return m.attr("style",r.style??null),P(r,m),r.intersect=function(d){return N.polygon(r,p,d)},n}b(_e,"block_arrow");async function Ye(i,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let{shapeSvg:l,bbox:f,label:o}=await G(i,t,T(t)),h=r?.nodeBorder??r?.lineColor??"currentColor",a=t.padding??12,e=18,s=12,p=Math.max(f.width+a*2,t.width??0,90),m=Math.max(f.height+a*2+e,t.height??0),d=-m/2,{cssStyles:g}=t,u=l.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let S=k.svg(l).path(tt(-p/2,d,p,m,s),v(t,{}));u.node()?.appendChild(S),g&&u.attr("style",g)}else u.append("rect").attr("x",-p/2).attr("y",d).attr("width",p).attr("height",m).attr("rx",s).attr("ry",s).attr("style",c);u.append("line").attr("x1",-p/2).attr("y1",d+e).attr("x2",p/2).attr("y2",d+e).attr("style",`stroke:${h};stroke-width:1px`);for(let x=0;x<3;x++)u.append("circle").attr("cx",-p/2+12+x*9).attr("cy",d+e/2).attr("r",2.5).attr("style",`fill:${h};stroke:none`);u.append("rect").attr("class","browser-address-bar").attr("x",-p/2+44).attr("y",d+4).attr("width",Math.max(p-56,10)).attr("height",e-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${h};stroke-width:1px;opacity:0.6`),P(t,u);let y=d+e+(m-e)/2;return o.attr("transform",`translate(${-(f.width/2)-(f.x-(f.left??0))}, ${y-f.height/2-(f.y-(f.top??0))})`),t.intersect=function(x){return N.rect(t,x)},l}b(Ye,"browser");var Kt=12;async function Fe(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?28:c,f=t.look==="neo"?24:c,{shapeSvg:o,bbox:h}=await G(i,t,T(t)),a=(t?.width??h.width)+(t.look==="neo"?l*2:l+Kt),e=(t?.height??h.height)+(t.look==="neo"?f*2:f),s=0,p=a,m=-e,d=0,g=[{x:s+Kt,y:m},{x:p,y:m},{x:p,y:d},{x:s,y:d},{x:s,y:m+Kt},{x:s+Kt,y:m}],u,{cssStyles:y}=t;if(t.look==="handDrawn"){let x=k.svg(o),S=v(t,{}),w=_(g),$=x.path(w,S);u=o.insert(()=>$,":first-child").attr("transform",`translate(${-a/2}, ${e/2})`),y&&u.attr("style",y)}else u=et(o,a,e,g);return n&&u.attr("style",n),P(t,u),t.intersect=function(x){return N.polygon(t,g,x)},o}b(Fe,"card");function Xe(i,t){let{nodeStyles:r}=D(t);t.label="";let n=i.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),{cssStyles:c}=t,l=Math.max(28,t.width??0),f=[{x:0,y:l/2},{x:l/2,y:0},{x:0,y:-l/2},{x:-l/2,y:0}],o=k.svg(n),h=v(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let a=_(f),e=o.path(a,h),s=n.insert(()=>e,":first-child");return c&&t.look!=="handDrawn"&&s.selectAll("path").attr("style",c),r&&t.look!=="handDrawn"&&s.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(p){return N.polygon(t,f,p)},n}b(Xe,"choice");async function Qt(i,t,r){let{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let{shapeSvg:l,bbox:f,halfPadding:o}=await G(i,t,T(t),{ignoreMinWidth:!0}),h=16,a=r?.padding??o,e=Math.sqrt(f.width**2+f.height**2)/2,s=t.look==="neo"?e+h:e+a,p,{cssStyles:m}=t;if(t.look==="handDrawn"){let d=k.svg(l),g=v(t,{}),u=d.circle(0,0,s*2,g);p=l.insert(()=>u,":first-child"),p.attr("class","basic label-container").attr("style",q(m))}else p=l.insert("circle",":first-child").attr("class","basic label-container").attr("style",c).attr("r",s).attr("cx",0).attr("cy",0);return P(t,p),t.calcIntersect=function(d,g){let u=d.width/2;return N.circle(d,u,g)},t.intersect=function(d){return X.info("Circle intersect",t,s,d),N.circle(t,s,d)},l}b(Qt,"circle");async function Ue(i,t){let r=t,n=["node",r.cssClasses,r.class].filter(Boolean).join(" "),{shapeSvg:c,bbox:l,halfPadding:f}=await G(i,r,n),o=c.insert("rect",":first-child"),h=r.padding??0,a=r.positioned?r.width??0:l.width+h,e=r.positioned?r.height??0:l.height+h,s=r.positioned?-a/2:-l.width/2-f,p=r.positioned?-e/2:-l.height/2-f;return o.attr("class","basic cluster composite label-container").attr("style",r.style??null).attr("rx",r.rx??null).attr("ry",r.ry??null).attr("x",s).attr("y",p).attr("width",a).attr("height",e),P(r,o),r.intersect=function(m){return N.rect(r,m)},c}b(Ue,"composite");async function qe(i,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let{shapeSvg:l,bbox:f,label:o}=await G(i,t,T(t)),h=r?.nodeBorder??r?.lineColor??"currentColor",a=t.padding??12,e=20,s=12,p=Math.max(f.width+a*2,t.width??0,90),m=Math.max(f.height+a*2+e,t.height??0),d=-m/2,{cssStyles:g}=t,u=l.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let S=k.svg(l).path(tt(-p/2,d,p,m,s),v(t,{}));u.node()?.appendChild(S),g&&u.attr("style",g)}else u.append("rect").attr("x",-p/2).attr("y",d).attr("width",p).attr("height",m).attr("rx",s).attr("ry",s).attr("style",c);u.append("text").attr("x",-p/2+12).attr("y",d+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${h}`).text(">_"),P(t,u);let y=d+e+(m-e)/2;return o.attr("transform",`translate(${-(f.width/2)-(f.x-(f.left??0))}, ${y-f.height/2-(f.y-(f.top??0))})`),t.intersect=function(x){return N.rect(t,x)},l}b(qe,"consoleWindow");function mo(i){let t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=i*2,c={x:n/2*t,y:n/2*r},l={x:-(n/2)*t,y:n/2*r},f={x:-(n/2)*t,y:-(n/2)*r},o={x:n/2*t,y:-(n/2)*r};return`M ${l.x},${l.y} L ${o.x},${o.y}
                   M ${c.x},${c.y} L ${f.x},${f.y}`}b(mo,"createLine");function Ze(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r,t.label="";let c=i.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),l=Math.max(30,t?.width??0),{cssStyles:f}=t,o=k.svg(c),h=v(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let a=o.circle(0,0,l*2,h),e=mo(l),s=o.path(e,h),p=c.insert(()=>a,":first-child");return p.insert(()=>s),p.attr("class","outer-path"),f&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",n),P(t,p),t.intersect=function(m){return X.info("crossedCircle intersect",t,{radius:l,point:m}),N.circle(t,l,m)},c}b(Ze,"crossedCircle");function Tt(i,t,r,n=100,c=0,l=180){let f=[],o=c*Math.PI/180,e=(l*Math.PI/180-o)/(n-1);for(let s=0;s<n;s++){let p=o+s*e,m=i+r*Math.cos(p),d=t+r*Math.sin(p);f.push({x:-m,y:-d})}return f}b(Tt,"generateCirclePoints");async function ze(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:f}=await G(i,t,T(t)),o=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,a=l.width+o,e=l.height+h,s=Math.max(5,e*.1),{cssStyles:p}=t,m=[...Tt(a/2,-e/2,s,30,-90,0),{x:-a/2-s,y:s},...Tt(a/2+s*2,-s,s,20,-180,-270),...Tt(a/2+s*2,s,s,20,-90,-180),{x:-a/2-s,y:-e/2},...Tt(a/2,e/2,s,20,0,90)],d=[{x:a/2,y:-e/2-s},{x:-a/2,y:-e/2-s},...Tt(a/2,-e/2,s,20,-90,0),{x:-a/2-s,y:-s},...Tt(a/2+a*.1,-s,s,20,-180,-270),...Tt(a/2+a*.1,s,s,20,-90,-180),{x:-a/2-s,y:e/2},...Tt(a/2,e/2,s,20,0,90),{x:-a/2,y:e/2+s},{x:a/2,y:e/2+s}],g=k.svg(c),u=v(t,{fill:"none"});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let x=_(m).replace("Z",""),S=g.path(x,u),w=_(d),$=g.path(w,{...u}),E=c.insert("g",":first-child");return E.insert(()=>$,":first-child").attr("stroke-opacity",0),E.insert(()=>S,":first-child"),E.attr("class","text"),p&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${s}, 0)`),f.attr("transform",`translate(${-a/2+s-(l.x-(l.left??0))},${-l.height/2-(l.y-(l.top??0))})`),P(t,E),t.intersect=function(M){return N.polygon(t,d,M)},c}b(ze,"curlyBraceLeft");function Gt(i,t,r,n=100,c=0,l=180){let f=[],o=c*Math.PI/180,e=(l*Math.PI/180-o)/(n-1);for(let s=0;s<n;s++){let p=o+s*e,m=i+r*Math.cos(p),d=t+r*Math.sin(p);f.push({x:m,y:d})}return f}b(Gt,"generateCirclePoints");async function Je(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:f}=await G(i,t,T(t)),o=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,a=l.width+(t.look==="neo"?o*2:o),e=l.height+(t.look==="neo"?h*2:h),s=Math.max(5,e*.1),{cssStyles:p}=t,m=[...Gt(a/2,-e/2,s,20,-90,0),{x:a/2+s,y:-s},...Gt(a/2+s*2,-s,s,20,-180,-270),...Gt(a/2+s*2,s,s,20,-90,-180),{x:a/2+s,y:e/2},...Gt(a/2,e/2,s,20,0,90)],d=[{x:-a/2,y:-e/2-s},{x:a/2,y:-e/2-s},...Gt(a/2,-e/2,s,20,-90,0),{x:a/2+s,y:-s},...Gt(a/2+s*2,-s,s,20,-180,-270),...Gt(a/2+s*2,s,s,20,-90,-180),{x:a/2+s,y:e/2},...Gt(a/2,e/2,s,20,0,90),{x:a/2,y:e/2+s},{x:-a/2,y:e/2+s}],g=k.svg(c),u=v(t,{fill:"none"});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let x=_(m).replace("Z",""),S=g.path(x,u),w=_(d),$=g.path(w,{...u}),E=c.insert("g",":first-child");return E.insert(()=>$,":first-child").attr("stroke-opacity",0),E.insert(()=>S,":first-child"),E.attr("class","text"),p&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",n),E.attr("transform",`translate(${-s}, 0)`),f.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))},${-l.height/2-(l.y-(l.top??0))})`),P(t,E),t.intersect=function(M){return N.polygon(t,d,M)},c}b(Je,"curlyBraceRight");function st(i,t,r,n=100,c=0,l=180){let f=[],o=c*Math.PI/180,e=(l*Math.PI/180-o)/(n-1);for(let s=0;s<n;s++){let p=o+s*e,m=i+r*Math.cos(p),d=t+r*Math.sin(p);f.push({x:-m,y:-d})}return f}b(st,"generateCirclePoints");async function Ke(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:f}=await G(i,t,T(t)),o=t.look==="neo"?18:t.padding??0,h=t.look==="neo"?12:t.padding??0,a=l.width+(t.look==="neo"?o*2:o),e=l.height+(t.look==="neo"?h*2:h),s=Math.max(5,e*.1),{cssStyles:p}=t,m=[...st(a/2,-e/2,s,30,-90,0),{x:-a/2-s,y:s},...st(a/2+s*2,-s,s,20,-180,-270),...st(a/2+s*2,s,s,20,-90,-180),{x:-a/2-s,y:-e/2},...st(a/2,e/2,s,20,0,90)],d=[...st(-a/2+s+s/2,-e/2,s,20,-90,-180),{x:a/2-s/2,y:s},...st(-a/2-s/2,-s,s,20,0,90),...st(-a/2-s/2,s,s,20,-90,0),{x:a/2-s/2,y:-s},...st(-a/2+s+s/2,e/2,s,30,-180,-270)],g=[{x:a/2,y:-e/2-s},{x:-a/2,y:-e/2-s},...st(a/2,-e/2,s,20,-90,0),{x:-a/2-s,y:-s},...st(a/2+s*2,-s,s,20,-180,-270),...st(a/2+s*2,s,s,20,-90,-180),{x:-a/2-s,y:e/2},...st(a/2,e/2,s,20,0,90),{x:-a/2,y:e/2+s},{x:a/2-s-s/2,y:e/2+s},...st(-a/2+s+s/2,-e/2,s,20,-90,-180),{x:a/2-s/2,y:s},...st(-a/2-s/2,-s,s,20,0,90),...st(-a/2-s/2,s,s,20,-90,0),{x:a/2-s/2,y:-s},...st(-a/2+s+s/2,e/2,s,30,-180,-270)],u=k.svg(c),y=v(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let S=_(m).replace("Z",""),w=u.path(S,y),E=_(d).replace("Z",""),M=u.path(E,y),B=_(g),L=u.path(B,{...y}),R=c.insert("g",":first-child");return R.insert(()=>L,":first-child").attr("stroke-opacity",0),R.insert(()=>w,":first-child"),R.insert(()=>M,":first-child"),R.attr("class","text"),p&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",n),R.attr("transform",`translate(${s-s/4}, 0)`),f.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))},${-l.height/2-(l.y-(l.top??0))})`),P(t,R),t.intersect=function(A){return N.polygon(t,g,A)},c}b(Ke,"curlyBraces");async function Qe(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,f=t.look==="neo"?12:c,o=20,h=5,{shapeSvg:a,bbox:e}=await G(i,t,T(t)),s=Math.max(h,e.height+f*2,t?.height??0),p=s/2,m=p-Math.sqrt(Math.max(0,p**2-(e.height/2)**2)),d=Math.max(s/4,m),g=Math.max(o,e.width+l*2+d*2,(e.width+l*2)*1.25,t?.width??0),{cssStyles:u}=t,y=k.svg(a),x=v(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let S=g,w=s,$=S-p,E=w/4,M=[{x:$,y:0},{x:E,y:0},{x:0,y:w/2},{x:E,y:w},{x:$,y:w},...nt(-$,-w/2,p,50,270,90)],B=_(M),L=y.path(B,x),R=a.insert(()=>L,":first-child");return R.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&R.selectChildren("path").attr("style",u),n&&t.look!=="handDrawn"&&R.selectChildren("path").attr("style",n),R.attr("transform",`translate(${-g/2}, ${-s/2})`),P(t,R),t.intersect=function(A){return N.polygon(t,M,A)},a}b(Qe,"curvedTrapezoid");async function ts(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:f}=await G(i,t,T(t)),o=t.padding??20,h=Math.max(l.width+o*2,t.width??0,100),a=Math.min(Math.max(h*.23,16),56),e=a*.27,s=Math.max(l.height+o*2,t.height?t.height-(2*a-e):0),p=Math.min(h*.177,s*.45),m=s+2*a-e,d=-m/2,g=d+2*a-e,u=c.insert("g",":first-child").attr("class","basic label-container"),{cssStyles:y}=t;if(t.look==="handDrawn"){let B=k.svg(c),L=v(t,{}),R=B.path(tt(-h/2,g,h,s,p),L),A=B.circle(0,d+a,a*2,L);u.insert(()=>A,":first-child"),u.insert(()=>R,":first-child"),y&&u.attr("style",y)}else u.append("rect").attr("x",-h/2).attr("y",g).attr("width",h).attr("height",s).attr("rx",p).attr("ry",p).attr("style",n),u.append("circle").attr("cx",0).attr("cy",d+a).attr("r",a).attr("style",n);P(t,u);let x=g+s/2;f.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${x-l.height/2-(l.y-(l.top??0))})`);let S=d+a,w=Math.asin(Math.min(1,(g-S)/a))*180/Math.PI,M=[...nt(0,-S,a,24,180+w,-w),...nt(-(-h/2+p),-(g+p),p,12,90,0),...nt(-(-h/2+p),-(m/2-p),p,12,360,270),...nt(-(h/2-p),-(m/2-p),p,12,270,180),...nt(-(h/2-p),-(g+p),p,12,180,90)];return t.intersect=function(B){return N.polygon(t,M,B)},c}b(ts,"person");var fo=b((i,t,r,n,c,l)=>[`M${i},${t+l}`,`a${c},${l} 0,0,0 ${r},0`,`a${c},${l} 0,0,0 ${-r},0`,`l0,${n}`,`a${c},${l} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),go=b((i,t,r,n,c,l)=>[`M${i},${t+l}`,`M${i+r},${t+l}`,`a${c},${l} 0,0,0 ${-r},0`,`l0,${n}`,`a${c},${l} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),yo=b((i,t,r,n,c,l)=>[`M${i-r/2},${-n/2}`,`a${c},${l} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),es=8,ss=8;async function rs(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?24:c,f=t.look==="neo"?24:c,o=t.width??0;if(t.width&&(t.width=t.width-f,t.width<ss&&(t.width=ss)),t.height){let x=o/2/(2.5+o/50);t.height=t.height-l-x*3,t.height<es&&(t.height=es)}let{shapeSvg:h,bbox:a,label:e}=await G(i,t,T(t)),s=Math.max(t.width??0,a.width)+f,p=s/2,m=p/(2.5+s/50),d=Math.max(t.height??0,a.height)+l+m,g,{cssStyles:u}=t;if(t.look==="handDrawn"){let y=k.svg(h),x=go(0,0,s,d,p,m),S=yo(0,m,s,d,p,m),w=v(t,{}),$=y.path(x,w),E=y.path(S,v(t,{fill:"none"}));g=h.insert(()=>E,":first-child"),g=h.insert(()=>$,":first-child"),g.attr("class","basic label-container"),u&&g.attr("style",u)}else{let y=fo(0,0,s,d,p,m);g=h.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",q(u)).attr("style",n)}return g.attr("label-offset-y",m),g.attr("transform",`translate(${-s/2}, ${-(d/2+m)})`),P(t,g),e.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+(t.padding??0)/1.5-(a.y-(a.top??0))})`),t.intersect=function(y){let x=N.rect(t,y),S=x.x-(t.x??0);if(p!=0&&(Math.abs(S)<(t.width??0)/2||Math.abs(S)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-m)){let w=m*m*(1-S*S/(p*p));w>0&&(w=Math.sqrt(w)),w=m-w,y.y-(t.y??0)>0&&(w=-w),x.y+=w}return x},h}b(rs,"cylinder");async function gt(i,t,r){let{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let{shapeSvg:l,bbox:f}=await G(i,t,T(t)),o=Math.max(f.width+r.labelPaddingX*2,t?.width||0),h=Math.max(f.height+r.labelPaddingY*2,t?.height||0),a=-o/2,e=-h/2,s,{rx:p,ry:m}=t,{cssStyles:d}=t;if(r?.rx&&r.ry&&(p=r.rx,m=r.ry),t.look==="handDrawn"){let g=k.svg(l),u=v(t,{}),y=p||m?g.path(tt(a,e,o,h,p||0),u):g.rectangle(a,e,o,h,u);s=l.insert(()=>y,":first-child"),s.attr("class","basic label-container").attr("style",q(d))}else s=l.insert("rect",":first-child"),s.attr("class","basic label-container").attr("style",c).attr("rx",q(p)).attr("ry",q(m)).attr("x",a).attr("y",e).attr("width",o).attr("height",h);return P(t,s,t.look==="handDrawn"?void 0:{width:o,height:h}),t.calcIntersect=function(g,u){return N.rect(g,u)},t.intersect=function(g){return N.rect(t,g)},l}b(gt,"drawRect");async function os(i,t){let{cssClasses:r,labelPaddingX:n,labelPaddingY:c,padding:l,width:f,height:o}=t,h={rx:0,ry:0,classes:r??"",labelPaddingX:n??(l??0)*2,labelPaddingY:c??l??0},a=await gt(i,t,h);if(t.look==="handDrawn"){let m=k.svg(a),d=v(t,{}),g=a.select(".basic.label-container > path:nth-child(2)"),u=g.node();if(!u)return a;let y=null;if(u instanceof SVGGraphicsElement)y=u.getBBox();else return a;return a.insert(()=>m.line(y.x,y.y,y.x+y.width,y.y,d),".basic.label-container g.label"),a.insert(()=>m.line(y.x,y.y+y.height,y.x+y.width,y.y+y.height,d),".basic.label-container g.label"),g.remove(),a}let e=a.select(".basic.label-container"),s=(Number(e.attr("width"))||f)??0,p=(Number(e.attr("height"))||o)??0;return s>0&&p>0&&e.attr("stroke-dasharray",`${s} ${p}`),a}b(os,"datastore");async function as(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.look==="neo"?16:t.padding??0,l=t.look==="neo"?16:t.padding??0,{shapeSvg:f,bbox:o,label:h}=await G(i,t,T(t)),a=o.width+c,e=o.height+l,s=e*.2,p=-a/2,m=-e/2-s/2,{cssStyles:d}=t,g=k.svg(f),u=v(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let y=[{x:p,y:m+s},{x:-p,y:m+s},{x:-p,y:-m},{x:p,y:-m},{x:p,y:m},{x:-p,y:m},{x:-p,y:m+s}],x=g.polygon(y.map(w=>[w.x,w.y]),u),S=f.insert(()=>x,":first-child");return S.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",d),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),h.attr("transform",`translate(${p+(t.padding??0)/2-(o.x-(o.left??0))}, ${m+s+(t.padding??0)/2-(o.y-(o.top??0))})`),P(t,S),t.intersect=function(w){return N.rect(t,w)},f}b(as,"dividedRectangle");async function is(i,t){let{labelStyles:r,nodeStyles:n}=D(t),c=t.look==="neo"?12:5;t.labelStyle=r;let l=t.padding??0,f=t.look==="neo"?16:l,{shapeSvg:o,bbox:h}=await G(i,t,T(t),{ignoreMinWidth:!0}),a=Math.sqrt(h.width**2+h.height**2)/2,e=(t?.width?t?.width/2:a)+(f??0),s=e+c,p,{cssStyles:m}=t;if(t.look==="handDrawn"){let d=k.svg(o),g=v(t,{roughness:.2,strokeWidth:2.5}),u=v(t,{roughness:.2,strokeWidth:1.5}),y=d.circle(0,0,s*2,g),x=d.circle(0,0,e*2,u);p=o.insert("g",":first-child"),p.attr("class",q(t.cssClasses)).attr("style",q(m)),p.node()?.appendChild(y),p.node()?.appendChild(x)}else{p=o.insert("g",":first-child");let d=p.insert("circle",":first-child"),g=p.insert("circle");p.attr("class","basic label-container").attr("style",n),d.attr("class","outer-circle").attr("style",n).attr("r",s).attr("cx",0).attr("cy",0),g.attr("class","inner-circle").attr("style",n).attr("r",e).attr("cx",0).attr("cy",0)}return P(t,p),t.intersect=function(d){return X.info("DoubleCircle intersect",t,s,d),N.circle(t,s,d)},o}b(is,"doublecircle");async function ns(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,halfPadding:f}=await G(i,t,T(t)),{theme:o,themeVariables:h}=U();ct(c,t.colorIndex,o,h.borderColorArray);let a=f??10,e=l.width/2+a*2,s=l.height/2+a*2,p,{cssStyles:m}=t;if(t.look==="handDrawn"){let d=k.svg(c),g=v(t,{}),u=d.ellipse(0,0,e*2,s*2,g);p=c.insert(()=>u,":first-child"),p.attr("class","basic label-container"),m&&p.attr("style",m)}else p=c.insert("ellipse",":first-child").attr("class","basic label-container").attr("style",n).attr("rx",e).attr("ry",s).attr("cx",0).attr("cy",0);return t.width=e*2,t.height=s*2,P(t,p),t.calcIntersect=function(d,g){let u=d.width/2,y=d.height/2;return N.ellipse(d,u,y,g)},t.intersect=function(d){return N.ellipse(t,e,s,d)},c}b(ns,"usecaseEllipse");function ls(i,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:c}=D(t);t.label="",t.labelStyle=n;let l=i.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),f=7,{cssStyles:o}=t,h=k.svg(l),{nodeBorder:a}=r,e=v(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(e.roughness=0);let s=h.circle(0,0,f*2,e),p=l.insert(()=>s,":first-child");return p.selectAll("path").attr("style",`fill: ${a} !important;`),o&&o.length>0&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",o),c&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",c),P(t,p),t.intersect=function(m){return X.info("filledCircle intersect",t,{radius:f,point:m}),N.circle(t,f,m)},l}b(ls,"filledCircle");var cs=10,hs=10;async function ps(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?c*2:c;(t.width||t.height)&&(t.height=t?.height??0,t.height<cs&&(t.height=cs),t.width=(t?.width??0)-l-l/2,t.width<hs&&(t.width=hs));let{shapeSvg:f,bbox:o,label:h}=await G(i,t,T(t)),a=(t?.width?t?.width:o.width)+(l??0),e=t?.height?t?.height:a+o.height,s=e,p=[{x:0,y:-e},{x:s,y:-e},{x:s/2,y:0}],{cssStyles:m}=t,d=k.svg(f),g=v(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let u=_(p),y=d.path(u,g),x=f.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${e/2})`).attr("class","outer-path");return m&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",m),n&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),t.width=a,t.height=e,P(t,x),h.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-e/2+(t.padding??0)/2+(o.y-(o.top??0))})`),t.intersect=function(S){return X.info("Triangle intersect",t,p,S),N.polygon(t,p,S)},f}b(ps,"flippedTriangle");async function ms(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:f}=await G(i,t,T(t)),o=t.padding??12,h=Math.max(l.width+o*2,t.width??0,90),a=l.height+o*2,e=Math.max(Math.min(a*.16,14),8),s=Math.max(a+e,t.height??0),p=s-e,m=Math.max(h*.38,28),d=-s/2,g=[{x:-h/2,y:d},{x:-h/2+m,y:d},{x:-h/2+m,y:d+e},{x:h/2,y:d+e},{x:h/2,y:s/2},{x:-h/2,y:s/2}],u=[`M${g[0].x},${g[0].y}`,...g.slice(1).map(w=>`L${w.x},${w.y}`),"Z"].join(" "),{cssStyles:y}=t,x;if(t.look==="handDrawn"){let $=k.svg(c).path(u,v(t,{}));x=c.insert(()=>$,":first-child").attr("class","basic label-container"),y&&x.attr("style",y)}else x=c.insert("path",":first-child").attr("d",u).attr("class","basic label-container").attr("style",n);t.look==="handDrawn"?P(t,x):P(t,x,{width:h,height:s});let S=d+e+p/2;return f.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${S-l.height/2-(l.y-(l.top??0))})`),t.intersect=function(w){return N.polygon(t,g,w)},c}b(ms,"folder");function fs(i,t,{dir:r,config:{state:n,themeVariables:c}}){let{nodeStyles:l}=D(t);t.label="";let f=i.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,h=Math.max(70,t?.width??0),a=Math.max(10,t?.height??0);(r==="LR"||r==="RL")&&(h=Math.max(10,t?.width??0),a=Math.max(70,t?.height??0));let e=-1*h/2,s=-1*a/2,p=k.svg(f),m=v(t,{stroke:c.lineColor,fill:c.lineColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let d=p.rectangle(e,s,h,a,m),g=f.insert(()=>d,":first-child");o&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",o),l&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",l),P(t,g);let u=n?.padding??0;return t.width&&t.height&&(t.width+=u/2||0,t.height+=u/2||0),t.intersect=function(y){return N.rect(t,y)},f}b(fs,"forkJoin");async function ds(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=15,l=10,f=t.look==="neo"?16:t.padding??0,o=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-o*2,t.height<l&&(t.height=l),t.width=(t?.width??0)-f*2,t.width<c&&(t.width=c));let{shapeSvg:h,bbox:a}=await G(i,t,T(t)),e=(t?.height?t?.height:Math.max(l,a.height))+o*2,s=e/2,p=s-Math.sqrt(Math.max(0,s**2-(a.height/2)**2)),m=(t?.width?t?.width:Math.max(c,a.width)+p*2)+f*2,{cssStyles:d}=t,g=k.svg(h),u=v(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let y=[{x:-m/2,y:-e/2},{x:m/2-s,y:-e/2},...nt(-m/2+s,0,s,50,90,270),{x:m/2-s,y:e/2},{x:-m/2,y:e/2}],x=_(y),S=g.path(x,u),w=h.insert(()=>S,":first-child");return w.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",d),n&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",n),P(t,w),t.intersect=function($){return X.info("Pill intersect",t,{radius:s,point:$}),N.polygon(t,y,$)},h}b(ds,"halfRoundedRectangle");var uo=b((i,t,r,n,c)=>[`M${i+c},${t}`,`L${i+r-c},${t}`,`L${i+r},${t-n/2}`,`L${i+r-c},${t-n}`,`L${i+c},${t-n}`,`L${i},${t-n/2}`,"Z"].join(" "),"createHexagonPathD");async function gs(i,t){let{labelStyles:r,nodeStyles:n}=D(t),c=t.look==="neo"?3.5:4;t.labelStyle=r;let l=t.padding??0,f=70,o=32,h=t.look==="neo"?f:l,a=t.look==="neo"?o:l;if(t.width||t.height){let S=(t.height??0)/c;t.width=(t?.width??0)-2*S-a,t.height=(t.height??0)-h}let{shapeSvg:e,bbox:s}=await G(i,t,T(t)),p=(t?.height?t?.height:s.height)+h,m=p/c,d=(t?.width?t?.width:s.width)+2*m+a,g=[{x:m,y:0},{x:d-m,y:0},{x:d,y:-p/2},{x:d-m,y:-p},{x:m,y:-p},{x:0,y:-p/2}],u,{cssStyles:y}=t;if(t.look==="handDrawn"){let x=k.svg(e),S=v(t,{}),w=uo(0,0,d,p,m),$=x.path(w,S);u=e.insert(()=>$,":first-child").attr("transform",`translate(${-d/2}, ${p/2})`),y&&u.attr("style",y)}else u=et(e,d,p,g);return n&&u.attr("style",n),t.width=d,t.height=p,P(t,u),t.intersect=function(x){return N.polygon(t,g,x)},e}b(gs,"hexagon");async function ys(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.label="",t.labelStyle=r;let{shapeSvg:c}=await G(i,t,T(t)),l=Math.max(30,t?.width??0),f=Math.max(30,t?.height??0),{cssStyles:o}=t,h=k.svg(c),a=v(t,{});t.look!=="handDrawn"&&(a.roughness=0,a.fillStyle="solid");let e=[{x:0,y:0},{x:l,y:0},{x:0,y:f},{x:l,y:f}],s=_(e),p=h.path(s,a),m=c.insert(()=>p,":first-child");return m.attr("class","basic label-container outer-path"),o&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",o),n&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",n),m.attr("transform",`translate(${-l/2}, ${-f/2})`),P(t,m),t.intersect=function(d){return X.info("Pill intersect",t,{points:e}),N.polygon(t,e,d)},c}b(ys,"hourglass");async function us(i,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:c}=D(t);t.labelStyle=c;let l=t.assetHeight??48,f=t.assetWidth??48,o=Math.max(l,f),h=n?.wrappingWidth;t.width=Math.max(o,h??0);let{shapeSvg:a,bbox:e,label:s}=await G(i,t,"icon-shape default"),p=t.pos==="t",m=o,d=o,{nodeBorder:g}=r,{stylesMap:u}=ut(t),y=-d/2,x=-m/2,S=t.label?8:0,w=k.svg(a),$=v(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&($.roughness=0,$.fillStyle="solid");let E=w.rectangle(y,x,d,m,$),M=Math.max(d,e.width),B=m+e.height+S,L=w.rectangle(-M/2,-B/2,M,B,{...$,fill:"transparent",stroke:"none"}),R=a.insert(()=>E,":first-child"),A=a.insert(()=>L);if(t.icon){let j=a.append("g");j.html(`<g>${await lt(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);let C=j.node().getBBox(),I=C.width,O=C.height,H=C.x,V=C.y;j.attr("transform",`translate(${-I/2-H},${p?e.height/2+S/2-O/2-V:-e.height/2-S/2-O/2-V})`),j.attr("style",`color: ${u.get("stroke")??g};`)}return s.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${p?-B/2:B/2-e.height})`),R.attr("transform",`translate(0,${p?e.height/2+S/2:-e.height/2-S/2})`),P(t,A),t.intersect=function(j){if(X.info("iconSquare intersect",t,j),!t.label)return N.rect(t,j);let C=t.x??0,I=t.y??0,O=t.height??0,H=[];return p?H=[{x:C-e.width/2,y:I-O/2},{x:C+e.width/2,y:I-O/2},{x:C+e.width/2,y:I-O/2+e.height+S},{x:C+d/2,y:I-O/2+e.height+S},{x:C+d/2,y:I+O/2},{x:C-d/2,y:I+O/2},{x:C-d/2,y:I-O/2+e.height+S},{x:C-e.width/2,y:I-O/2+e.height+S}]:H=[{x:C-d/2,y:I-O/2},{x:C+d/2,y:I-O/2},{x:C+d/2,y:I-O/2+m},{x:C+e.width/2,y:I-O/2+m},{x:C+e.width/2/2,y:I+O/2},{x:C-e.width/2,y:I+O/2},{x:C-e.width/2,y:I-O/2+m},{x:C-d/2,y:I-O/2+m}],N.polygon(t,H,j)},a}b(us,"icon");async function bs(i,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:c}=D(t);t.labelStyle=c;let l=t.assetHeight??48,f=t.assetWidth??48,o=Math.max(l,f),h=n?.wrappingWidth;t.width=Math.max(o,h??0);let{shapeSvg:a,bbox:e,label:s}=await G(i,t,"icon-shape default"),p=20,m=t.label?8:0,d=t.pos==="t",{nodeBorder:g,mainBkg:u}=r,{stylesMap:y}=ut(t),x=k.svg(a),S=v(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let w=y.get("fill");S.stroke=w??u;let $=a.append("g");t.icon&&$.html(`<g>${await lt(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);let E=$.node().getBBox(),M=E.width,B=E.height,L=E.x,R=E.y,A=Math.max(M,B)*Math.SQRT2+p*2,j=x.circle(0,0,A,S),C=Math.max(A,e.width),I=A+e.height+m,O=x.rectangle(-C/2,-I/2,C,I,{...S,fill:"transparent",stroke:"none"}),H=a.insert(()=>j,":first-child"),V=a.insert(()=>O);return $.attr("transform",`translate(${-M/2-L},${d?e.height/2+m/2-B/2-R:-e.height/2-m/2-B/2-R})`),$.attr("style",`color: ${y.get("stroke")??g};`),s.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${d?-I/2:I/2-e.height})`),H.attr("transform",`translate(0,${d?e.height/2+m/2:-e.height/2-m/2})`),P(t,V),t.intersect=function(W){return X.info("iconSquare intersect",t,W),N.rect(t,W)},a}b(bs,"iconCircle");async function xs(i,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:c}=D(t);t.labelStyle=c;let l=t.assetHeight??48,f=t.assetWidth??48,o=Math.max(l,f),h=n?.wrappingWidth;t.width=Math.max(o,h??0);let{shapeSvg:a,bbox:e,halfPadding:s,label:p}=await G(i,t,"icon-shape default"),m=t.pos==="t",d=o+s*2,g=o+s*2,{nodeBorder:u,mainBkg:y}=r,{stylesMap:x}=ut(t),S=-g/2,w=-d/2,$=t.label?8:0,E=k.svg(a),M=v(t,{});t.look!=="handDrawn"&&(M.roughness=0,M.fillStyle="solid");let B=x.get("fill");M.stroke=B??y;let L=E.path(tt(S,w,g,d,5),M),R=Math.max(g,e.width),A=d+e.height+$,j=E.rectangle(-R/2,-A/2,R,A,{...M,fill:"transparent",stroke:"none"}),C=a.insert(()=>L,":first-child").attr("class","icon-shape2"),I=a.insert(()=>j);if(t.icon){let O=a.append("g");O.html(`<g>${await lt(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);let H=O.node().getBBox(),V=H.width,W=H.height,F=H.x,z=H.y;O.attr("transform",`translate(${-V/2-F},${m?e.height/2+$/2-W/2-z:-e.height/2-$/2-W/2-z})`),O.attr("style",`color: ${x.get("stroke")??u};`)}return p.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${m?-A/2:A/2-e.height})`),C.attr("transform",`translate(0,${m?e.height/2+$/2:-e.height/2-$/2})`),P(t,I),t.intersect=function(O){if(X.info("iconSquare intersect",t,O),!t.label)return N.rect(t,O);let H=t.x??0,V=t.y??0,W=t.height??0,F=[];return m?F=[{x:H-e.width/2,y:V-W/2},{x:H+e.width/2,y:V-W/2},{x:H+e.width/2,y:V-W/2+e.height+$},{x:H+g/2,y:V-W/2+e.height+$},{x:H+g/2,y:V+W/2},{x:H-g/2,y:V+W/2},{x:H-g/2,y:V-W/2+e.height+$},{x:H-e.width/2,y:V-W/2+e.height+$}]:F=[{x:H-g/2,y:V-W/2},{x:H+g/2,y:V-W/2},{x:H+g/2,y:V-W/2+d},{x:H+e.width/2,y:V-W/2+d},{x:H+e.width/2/2,y:V+W/2},{x:H-e.width/2,y:V+W/2},{x:H-e.width/2,y:V-W/2+d},{x:H-g/2,y:V-W/2+d}],N.polygon(t,F,O)},a}b(xs,"iconRounded");async function Ss(i,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:c}=D(t);t.labelStyle=c;let l=t.assetHeight??48,f=t.assetWidth??48,o=Math.max(l,f),h=n?.wrappingWidth;t.width=Math.max(o,h??0);let{shapeSvg:a,bbox:e,halfPadding:s,label:p}=await G(i,t,"icon-shape default"),m=t.pos==="t",d=o+s*2,g=o+s*2,{nodeBorder:u,mainBkg:y}=r,{stylesMap:x}=ut(t),S=-g/2,w=-d/2,$=t.label?8:0,E=k.svg(a),M=v(t,{});t.look!=="handDrawn"&&(M.roughness=0,M.fillStyle="solid");let B=x.get("fill");M.stroke=B??y;let L=E.path(tt(S,w,g,d,.1),M),R=Math.max(g,e.width),A=d+e.height+$,j=E.rectangle(-R/2,-A/2,R,A,{...M,fill:"transparent",stroke:"none"}),C=a.insert(()=>L,":first-child"),I=a.insert(()=>j);if(t.icon){let O=a.append("g");O.html(`<g>${await lt(t.icon,{height:o,width:o,fallbackPrefix:""})}</g>`);let H=O.node().getBBox(),V=H.width,W=H.height,F=H.x,z=H.y;O.attr("transform",`translate(${-V/2-F},${m?e.height/2+$/2-W/2-z:-e.height/2-$/2-W/2-z})`),O.attr("style",`color: ${x.get("stroke")??u};`)}return p.attr("transform",`translate(${-e.width/2-(e.x-(e.left??0))},${m?-A/2:A/2-e.height})`),C.attr("transform",`translate(0,${m?e.height/2+$/2:-e.height/2-$/2})`),P(t,I),t.intersect=function(O){if(X.info("iconSquare intersect",t,O),!t.label)return N.rect(t,O);let H=t.x??0,V=t.y??0,W=t.height??0,F=[];return m?F=[{x:H-e.width/2,y:V-W/2},{x:H+e.width/2,y:V-W/2},{x:H+e.width/2,y:V-W/2+e.height+$},{x:H+g/2,y:V-W/2+e.height+$},{x:H+g/2,y:V+W/2},{x:H-g/2,y:V+W/2},{x:H-g/2,y:V-W/2+e.height+$},{x:H-e.width/2,y:V-W/2+e.height+$}]:F=[{x:H-g/2,y:V-W/2},{x:H+g/2,y:V-W/2},{x:H+g/2,y:V-W/2+d},{x:H+e.width/2,y:V-W/2+d},{x:H+e.width/2/2,y:V+W/2},{x:H-e.width/2,y:V+W/2},{x:H-e.width/2,y:V-W/2+d},{x:H-g/2,y:V-W/2+d}],N.polygon(t,F,O)},a}b(Ss,"iconSquare");async function ws(i,t,{config:{flowchart:r}}){let n=new Image;n.src=t?.img??"",await n.decode();let c=Number(n.naturalWidth.toString().replace("px","")),l=Number(n.naturalHeight.toString().replace("px",""));t.imageAspectRatio=c/l;let{labelStyles:f}=D(t);t.labelStyle=f;let o=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;let h=Math.max(t.label?o??0:0,t?.assetWidth??c),a=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:h,e=t.constraint==="on"?a/t.imageAspectRatio:t?.assetHeight??l;t.width=Math.max(a,o??0);let{shapeSvg:s,bbox:p,label:m}=await G(i,t,"image-shape default"),d=t.pos==="t",g=-a/2,u=-e/2,y=t.label?8:0,x=k.svg(s),S=v(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let w=x.rectangle(g,u,a,e,S),$=Math.max(a,p.width),E=e+p.height+y,M=x.rectangle(-$/2,-E/2,$,E,{...S,fill:"none",stroke:"none"}),B=s.insert(()=>w,":first-child"),L=s.insert(()=>M);if(t.img){let R=s.append("image");R.attr("href",t.img),R.attr("width",a),R.attr("height",e),R.attr("preserveAspectRatio","none"),R.attr("transform",`translate(${-a/2},${d?E/2-e:-E/2})`)}return m.attr("transform",`translate(${-p.width/2-(p.x-(p.left??0))},${d?-e/2-p.height/2-y/2:e/2-p.height/2+y/2})`),B.attr("transform",`translate(0,${d?p.height/2+y/2:-p.height/2-y/2})`),P(t,L),t.intersect=function(R){if(X.info("iconSquare intersect",t,R),!t.label)return N.rect(t,R);let A=t.x??0,j=t.y??0,C=t.height??0,I=[];return d?I=[{x:A-p.width/2,y:j-C/2},{x:A+p.width/2,y:j-C/2},{x:A+p.width/2,y:j-C/2+p.height+y},{x:A+a/2,y:j-C/2+p.height+y},{x:A+a/2,y:j+C/2},{x:A-a/2,y:j+C/2},{x:A-a/2,y:j-C/2+p.height+y},{x:A-p.width/2,y:j-C/2+p.height+y}]:I=[{x:A-a/2,y:j-C/2},{x:A+a/2,y:j-C/2},{x:A+a/2,y:j-C/2+e},{x:A+p.width/2,y:j-C/2+e},{x:A+p.width/2/2,y:j+C/2},{x:A-p.width/2,y:j+C/2},{x:A-p.width/2,y:j-C/2+e},{x:A-a/2,y:j-C/2+e}],N.polygon(t,I,R)},s}b(ws,"imageSquare");async function Ns(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=c,f=t.look==="neo"?c*2:c,{shapeSvg:o,bbox:h}=await G(i,t,T(t)),a=Math.max(h.height+l*2,t.height??0),e=Math.max(h.width+f*2,(t.width??0)-a),s=[{x:0,y:0},{x:e,y:0},{x:e+3*a/6,y:-a},{x:-3*a/6,y:-a}],p,{cssStyles:m}=t;if(t.look==="handDrawn"){let d=k.svg(o),g=v(t,{}),u=_(s),y=d.path(u,g);p=o.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${a/2})`),m&&p.attr("style",m)}else p=et(o,e,a,s);return n&&p.attr("style",n),t.width=e,t.height=a,P(t,p),t.intersect=function(d){return N.polygon(t,s,d)},o}b(Ns,"inv_trapezoid");async function $s(i,t){let{shapeSvg:r,bbox:n,label:c}=await G(i,t,"label"),l=r.insert("rect",":first-child");return l.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),c.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),P(t,l),t.intersect=function(h){return N.rect(t,h)},r}b($s,"labelRect");async function Ds(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=c,f=t.look==="neo"?c*2:c,{shapeSvg:o,bbox:h}=await G(i,t,T(t)),a=Math.max(h.height+l,t.height??0),e=Math.max(h.width+f,(t.width??0)-a),s=[{x:0,y:0},{x:e+3*a/6,y:0},{x:e,y:-a},{x:-(3*a)/6,y:-a}],p,{cssStyles:m}=t;if(t.look==="handDrawn"){let d=k.svg(o),g=v(t,{}),u=_(s),y=d.path(u,g);p=o.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${a/2})`),m&&p.attr("style",m)}else p=et(o,e,a,s);return n&&p.attr("style",n),t.width=e,t.height=a,P(t,p),t.intersect=function(d){return N.polygon(t,s,d)},o}b(Ds,"lean_left");async function Ps(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=c,f=t.look==="neo"?c*2:c,{shapeSvg:o,bbox:h}=await G(i,t,T(t)),a=Math.max(h.height+l,t.height??0),e=Math.max(h.width+f,(t.width??0)-a),s=[{x:-3*a/6,y:0},{x:e,y:0},{x:e+3*a/6,y:-a},{x:0,y:-a}],p,{cssStyles:m}=t;if(t.look==="handDrawn"){let d=k.svg(o),g=v(t,{}),u=_(s),y=d.path(u,g);p=o.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${a/2})`),m&&p.attr("style",m)}else p=et(o,e,a,s);return n&&p.attr("style",n),t.width=e,t.height=a,P(t,p),t.intersect=function(d){return N.polygon(t,s,d)},o}b(Ps,"lean_right");function vs(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.label="",t.labelStyle=r;let c=i.insert("g").attr("class",T(t)).attr("id",t.domId??t.id),{cssStyles:l}=t,f=Math.max(35,t?.width??0),o=Math.max(35,t?.height??0),h=7,a=[{x:f,y:0},{x:0,y:o+h/2},{x:f-2*h,y:o+h/2},{x:0,y:2*o},{x:f,y:o-h/2},{x:2*h,y:o-h/2}],e=k.svg(c),s=v(t,{});t.look!=="handDrawn"&&(s.roughness=0,s.fillStyle="solid");let p=_(a),m=e.path(p,s),d=c.insert(()=>m,":first-child");return d.attr("class","outer-path"),l&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",l),n&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",n),d.attr("transform",`translate(-${f/2},${-o})`),P(t,d),t.intersect=function(g){return X.info("lightningBolt intersect",t,g),N.polygon(t,a,g)},c}b(vs,"lightningBolt");var bo=b((i,t,r,n,c,l,f)=>[`M${i},${t+l}`,`a${c},${l} 0,0,0 ${r},0`,`a${c},${l} 0,0,0 ${-r},0`,`l0,${n}`,`a${c},${l} 0,0,0 ${r},0`,`l0,${-n}`,`M${i},${t+l+f}`,`a${c},${l} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),xo=b((i,t,r,n,c,l,f)=>[`M${i},${t+l}`,`M${i+r},${t+l}`,`a${c},${l} 0,0,0 ${-r},0`,`l0,${n}`,`a${c},${l} 0,0,0 ${r},0`,`l0,${-n}`,`M${i},${t+l+f}`,`a${c},${l} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),So=b((i,t,r,n,c,l)=>[`M${i-r/2},${-n/2}`,`a${c},${l} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),ks=10,Ts=10;async function Gs(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,f=t.look==="neo"?24:c;if(t.width||t.height){let y=t.width??0;t.width=(t.width??0)-l,t.width<Ts&&(t.width=Ts);let S=y/2/(2.5+y/50);t.height=(t.height??0)-f-S*3,t.height<ks&&(t.height=ks)}let{shapeSvg:o,bbox:h,label:a}=await G(i,t,T(t)),e=(t?.width?t?.width:h.width)+l*2,s=e/2,p=s/(2.5+e/50),m=(t?.height?t?.height:h.height)+p+f*2,d=m*.1,g,{cssStyles:u}=t;if(t.look==="handDrawn"){let y=k.svg(o),x=xo(0,0,e,m,s,p,d),S=So(0,p,e,m,s,p),w=v(t,{}),$=y.path(x,w),E=y.path(S,w);o.insert(()=>E,":first-child").attr("class","line"),g=o.insert(()=>$,":first-child"),g.attr("class","basic label-container"),u&&g.attr("style",u)}else{let y=bo(0,0,e,m,s,p,d);g=o.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",q(u)).attr("style",n)}return g.attr("label-offset-y",p),g.attr("transform",`translate(${-e/2}, ${-(m/2+p)})`),P(t,g),a.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)+p-(h.y-(h.top??0))})`),t.intersect=function(y){let x=N.rect(t,y),S=x.x-(t.x??0);if(s!=0&&(Math.abs(S)<(t.width??0)/2||Math.abs(S)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-p)){let w=p*p*(1-S*S/(s*s));w>0&&(w=Math.sqrt(w)),w=p-w,y.y-(t.y??0)>0&&(w=-w),x.y+=w}return x},o}b(Gs,"linedCylinder");async function Ms(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,f=t.look==="neo"?12:c;if(t.width||t.height){let w=t.width;t.width=(w??0)*10/11-l*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-f*2,t.height<10&&(t.height=10)}let{shapeSvg:o,bbox:h,label:a}=await G(i,t,T(t)),e=(t?.width?t?.width:h.width)+(l??0)*2,s=(t?.height?t?.height:h.height)+(f??0)*2,p=t.look==="neo"?s/4:s/8,m=s+p,{cssStyles:d}=t,g=k.svg(o),u=v(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let y=[{x:-e/2-e/2*.1,y:-m/2},{x:-e/2-e/2*.1,y:m/2},...ht(-e/2-e/2*.1,m/2,e/2+e/2*.1,m/2,p,.8),{x:e/2+e/2*.1,y:-m/2},{x:-e/2-e/2*.1,y:-m/2},{x:-e/2,y:-m/2},{x:-e/2,y:m/2*1.1},{x:-e/2,y:-m/2}],x=g.polygon(y.map(w=>[w.x,w.y]),u),S=o.insert(()=>x,":first-child");return S.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",d),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(0,${-p/2})`),a.attr("transform",`translate(${-e/2+(t.padding??0)+e/2*.1/2-(h.x-(h.left??0))},${-s/2+(t.padding??0)-p-(h.y-(h.top??0))})`),P(t,S),t.intersect=function(w){return N.polygon(t,y,w)},o}b(Ms,"linedWaveEdgedRect");var wo=56,me=72,Es=8,Bs=2,No=8,$o={normal:"usecase-actor-shape usecase-actor-normal",hollow:"usecase-actor-hollow",awesome:"usecase-actor-awesome",icon:"usecase-actor-icon"},Cs=Math.PI/3,As=.6,fe=b((i,t)=>{let r=t*As,n=t*Math.sqrt(1-As**2),c=Math.cos(Cs),l=-Math.sin(Cs),f=r*-l,o=i+r*c,h=n*c,a=n*l;return`M ${f-h} ${o-a} L ${f+h} ${o+a}`},"businessMarkerPathForCircle"),Do={normal:fe(-24,12),hollow:fe(-23,9),awesome:fe(-21,13),icon:"M 12 -8 L 26 -26"},Rs=b((i,t,r)=>{let n=(t.x??0)-(t.left??0),c=(t.y??0)-(t.top??0);i.attr("transform",`translate(${-t.width/2-n},${r-t.height/2-c})`)},"positionLabel"),Yt=b((i,t,r,n,c=!1)=>{if(t.look==="handDrawn"){let o=k.svg(i).path(r,v(t,c?{fill:"none"}:{}));return i.insert(()=>o,":first-child").attr("class",n)}let l=i.append("path").attr("class",n).attr("d",r);return c&&l.attr("fill","none"),l},"appendActorPath"),Hs=b((i,t,r,n,c,l,f=!1)=>{if(t.look==="handDrawn"){let a=k.svg(i).circle(r,n,c*2,v(t,f?{fill:"none"}:{}));return i.insert(()=>a,":first-child").attr("class",l)}let o=i.append("circle").attr("class",l).attr("cx",r).attr("cy",n).attr("r",c);return f&&o.attr("fill","none"),o},"appendActorCircle"),Po=b((i,t,r)=>{t.business&&i.append("path").attr("class","usecase-business-marker usecase-actor-business-marker").attr("d",Do[r]).attr("fill","none").attr("style","stroke: inherit !important; stroke-width: inherit !important")},"appendBusinessActorMarker");async function Rt(i,t,r,n){let{labelStyles:c,nodeStyles:l}=D(t);t.labelStyle=c;let f=r==="icon"||t.stereotype!==void 0?{...t,icon:r==="icon"?void 0:t.icon,stereotype:void 0}:t,{shapeSvg:o,bbox:h,label:a}=await G(i,f,T(t,`usecase-actor-variant usecase-actor-${r}`)),e=t.accessibleName??t.label;e&&o.attr("role","img").attr("aria-label",e),a.attr("class","label actor-label usecase-actor-label");let{theme:s,themeVariables:p}=U();ct(o,t.colorIndex,s,p.borderColorArray);let m,d;if(t.stereotype){let B=await dt(o,`\xAB${t.stereotype}\xBB`,{labelStyle:c,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});m=B.label.attr("class","label usecase-stereotype"),d=B.bbox}let g=o.append("g").attr("class",`usecase-actor-glyph ${$o[r]}`).attr("style",l||null);await n(g,t),Po(g,t,r);let u=t.padding??No,y=d?.height??0,x=me+Es+h.height+(d?y+Bs:0),S=Math.max(wo,h.width,d?.width??0)+u*2,w=x+u*2,$=-x/2;g.attr("transform",`translate(0,${$+me/2})`);let E=$+me+Es;m&&d&&(E+=y/2,Rs(m,d,E),E+=y/2+Bs),Rs(a,h,E+h.height/2);let M=o.insert("rect",":first-child").attr("class","usecase-actor-outline").attr("x",-S/2).attr("y",-w/2).attr("width",S).attr("height",w).attr("opacity",0).attr("aria-hidden","true");return P(t,M),t.intersect=B=>N.rect(t,B),o}b(Rt,"renderUsecaseActor");var vo=["M 0 -12","C 6.627 -12 12 -17.373 12 -24","C 12 -30.627 6.627 -36 0 -36","C -6.627 -36 -12 -30.627 -12 -24","C -12 -17.373 -6.627 -12 0 -12 Z","M 0 -12 V 8","M -17 -5 H 17","M 0 8 L -15 28","M 0 8 L 15 28"].join(" ");async function js(i,t){return Rt(i,t,"normal",(r,n)=>{Yt(r,n,vo,"usecase-actor-stick")})}b(js,"usecaseActor");var ko=["M 0 -34","C 7.18 -34 13 -28.18 13 -21","C 13 -13.82 7.18 -8 0 -8","C -7.18 -8 -13 -13.82 -13 -21","C -13 -28.18 -7.18 -34 0 -34 Z","M -24 25","C -24 7 -14 -3 0 -3","C 14 -3 24 7 24 25","C 24 28 21 30 18 30","H -18","C -21 30 -24 28 -24 25 Z"].join(" ");async function Is(i,t){return Rt(i,t,"awesome",(r,n)=>{Yt(r,n,ko,"usecase-actor-awesome-silhouette")})}b(Is,"usecaseActorAwesome");var To=["M -22 -10","H 22","V 0","H 6","L 22 17","L 13 28","L 0 13","L -13 28","L -22 17","L -6 0","H -22","Z"].join(" ");async function Os(i,t){return Rt(i,t,"hollow",(r,n)=>{Hs(r,n,0,-23,9,"usecase-actor-hollow-head",!0),Yt(r,n,To,"usecase-actor-hollow-body",!0)})}b(Os,"usecaseActorHollow");var Ot=52,Ls=42,Vs=-2,Go=b(async(i,t)=>{let r=-Ot/2,n=Vs-Ot/2;if(t.look==="handDrawn"){let e=k.svg(i).rectangle(r,n,Ot,Ot,v(t,{}));i.insert(()=>e,":first-child").attr("class","usecase-actor-icon-frame")}else i.append("rect").attr("class","usecase-actor-icon-frame").attr("x",r).attr("y",n).attr("width",Ot).attr("height",Ot).attr("rx",4).attr("ry",4);let c=t.icon??"",l=await De(c.includes(":")?c:`fa:${c}`),f=await lt(c,{height:Ls,width:Ls,fallbackPrefix:"fa"}),o=i.append("g").attr("class",`usecase-actor-icon-symbol${l?"":" usecase-actor-icon-fallback"}`).attr("aria-hidden","true").html(`<g>${f}</g>`),h=o.node()?.getBBox();h&&o.attr("transform",`translate(${-h.width/2-h.x},${Vs-h.height/2-h.y})`)},"drawIconActor");async function Ws(i,t){return Rt(i,t,"icon",Go)}b(Ws,"usecaseActorIcon");var _s=b((i,t,r)=>{let n=(t.x??0)-(t.left??0),c=(t.y??0)-(t.top??0);i.attr("transform",`translate(${-t.width/2-n},${r-t.height/2-c})`)},"positionLabel");async function Ys(i,t){let r=t,{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let l=r.stereotype?{...t,stereotype:void 0}:t,{shapeSvg:f,bbox:o,halfPadding:h,label:a}=await G(i,l,T(t,"usecase-business-shape"));a.attr("class","label usecase-label");let{theme:e,themeVariables:s}=U();ct(f,t.colorIndex,e,s.borderColorArray);let p,m;if(r.stereotype){let C=await dt(f,`\xAB${r.stereotype}\xBB`,{labelStyle:n,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});p=C.label.attr("class","label usecase-stereotype"),m=C.bbox}let d=m?2:0,g=o.height+(m?.height??0)+d,u=Math.max(o.width,m?.width??0),y=h??10,x=u/2+y*2,S=g/2+y*2,w=Math.min(Math.max(y/5,1),y/2),$=u/2+w,E=x-w,M=$/x,B=E/x,L=S*Math.sqrt(Math.max(0,1-M*M)),R=-S*Math.sqrt(Math.max(0,1-B*B));p&&m&&_s(p,m,-g/2+m.height/2),_s(a,o,g/2-o.height/2);let A;if(t.look==="handDrawn"){let I=k.svg(f).ellipse(0,0,x*2,S*2,v(t,{}));A=f.insert(()=>I,":first-child").attr("class","basic label-container usecase-business-ellipse")}else A=f.insert("ellipse",":first-child").attr("class","basic label-container usecase-business-ellipse").attr("style",c).attr("rx",x).attr("ry",S).attr("cx",0).attr("cy",0);f.append("path").attr("class","usecase-business-marker").attr("d",`M ${$} ${L} L ${E} ${R}`).attr("fill","none").attr("style",c||null);let j=r.accessibleName??r.label;return j&&f.attr("role","img").attr("aria-label",j),P(t,A),t.calcIntersect=(C,I)=>N.ellipse(C,C.width/2,C.height/2,I),t.intersect=C=>N.ellipse(t,x,S,C),f}b(Ys,"usecaseBusiness");var de=8,Fs=4,Mo=1,ge=b((i,t,r,n)=>{let c=(t.x??0)-(t.left??0),l=(t.y??0)-(t.top??0);i.attr("transform",`translate(${r-t.width/2-c},${n-t.height/2-l})`)},"positionLabel"),Eo=b(i=>{let t=Number.parseFloat(i??"");return Number.isFinite(t)&&t>=0?t:Mo},"numericStrokeWidth");async function Xs(i,t){let r=t,{labelStyles:n,nodeStyles:c}=D(t),{stylesMap:l}=ut(t);t.labelStyle=n;let{shapeSvg:f,bbox:o,label:h}=await G(i,t,T(t,"usecase-json-table"));f.attr("role","img"),r.accessibleName&&f.attr("aria-label",r.accessibleName),h.attr("class","label usecase-json-title");let a=f.append("g").attr("class","usecase-json-table-grid"),e=[];for(let C of r.jsonRows??[]){let I=await dt(a,C.key,{labelStyle:n,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0}),O=await dt(a,C.value,{labelStyle:n,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0});e.push({key:{label:I.label.attr("class","label usecase-json-key"),bbox:I.bbox},value:{label:O.label.attr("class","label usecase-json-value"),bbox:O.bbox}})}let s=Math.max(0,...e.map(({key:C})=>C.bbox.width))+de*2,p=Math.max(0,...e.map(({value:C})=>C.bbox.width))+de*2,m=o.width+de*2,d=Math.max(m,s+p),g=p+Math.max(0,d-s-p),u=o.height+Fs*2,y=e.map(({key:C,value:I})=>Math.max(C.bbox.height,I.bbox.height)+Fs*2),x=u+y.reduce((C,I)=>C+I,0),S=Eo(l.get("stroke-width")),w=d+S*2,$=x+S*2,E=-d/2,M=-x/2,B=t.look==="handDrawn"?k.svg(f):void 0,L=B?v(t,{}):void 0,R=b((C,I,O,H,V,W)=>{if(B&&L){let F=B.rectangle(O,H,V,W,L);return C.insert(()=>F,":first-child").attr("class",I)}return C.insert("rect",":first-child").attr("class",I).attr("x",O).attr("y",H).attr("width",V).attr("height",W).attr("style",c)},"insertCell"),A=R(f,"label-container usecase-json-border",-w/2,-$/2,w,$);R(a,"usecase-json-cell usecase-json-title-cell",E,M,d,u),a.node()?.append(h.node()),ge(h,o,0,M+u/2);let j=M+u;return e.forEach(({key:C,value:I},O)=>{let H=y[O],V=a.append("g").attr("class","usecase-json-row").attr("data-row-index",O).attr("transform",`translate(0,${j})`);R(V,"usecase-json-cell usecase-json-key-cell",E,0,s,H),R(V,"usecase-json-cell usecase-json-value-cell",E+s,0,g,H),V.node()?.append(C.label.node(),I.label.node()),ge(C.label,C.bbox,E+s/2,H/2),ge(I.label,I.bbox,E+s+g/2,H/2),j+=H}),P(t,A),t.intersect=C=>N.rect(t,C),f}b(Xs,"usecaseJsonTable");async function Us(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,f=t.look==="neo"?12:c,o=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-l*2-2*o,10),t.height=Math.max((t?.height??0)-f*2-2*o,10));let{shapeSvg:h,bbox:a,label:e}=await G(i,t,T(t)),s=(t?.width?t?.width:a.width)+l*2+2*o,p=(t?.height?t?.height:a.height)+f*2+2*o,m=s-2*o,d=p-2*o,g=-m/2,u=-d/2,{cssStyles:y}=t,x=k.svg(h),S=v(t,{}),w=[{x:g-o,y:u+o},{x:g-o,y:u+d+o},{x:g+m-o,y:u+d+o},{x:g+m-o,y:u+d},{x:g+m,y:u+d},{x:g+m,y:u+d-o},{x:g+m+o,y:u+d-o},{x:g+m+o,y:u-o},{x:g+o,y:u-o},{x:g+o,y:u},{x:g,y:u},{x:g,y:u+o}],$=[{x:g,y:u+o},{x:g+m-o,y:u+o},{x:g+m-o,y:u+d},{x:g+m,y:u+d},{x:g+m,y:u},{x:g,y:u}];t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let E=_(w),M=x.path(E,S),B=_($),L=x.path(B,S);t.look!=="handDrawn"&&(M=ne(M),L=ne(L));let R=h.insert("g",":first-child");return R.insert(()=>M),R.insert(()=>L),R.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",y),n&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",n),e.attr("transform",`translate(${-(a.width/2)-o-(a.x-(a.left??0))}, ${-(a.height/2)+o-(a.y-(a.top??0))})`),P(t,R),t.intersect=function(A){return N.polygon(t,w,A)},h}b(Us,"multiRect");async function qs(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:f}=await G(i,t,T(t)),o=t.padding??0,h=t.look==="neo"?16:o,a=t.look==="neo"?12:o,e=!0;(t.width||t.height)&&(e=!1,t.width=(t?.width??0)-h*2,t.height=(t?.height??0)-a*3);let s=Math.max(l.width,t?.width??0)+h*2,p=Math.max(l.height,t?.height??0)+a*3,m=t.look==="neo"?p/4:p/8,d=p+(e?m/2:-m/2),g=-s/2,u=-d/2,y=10,{cssStyles:x}=t,S=ht(g-y,u+d+y,g+s-y,u+d+y,m,.8),w=S?.[S.length-1],$=[{x:g-y,y:u+y},{x:g-y,y:u+d+y},...S,{x:g+s-y,y:w.y-y},{x:g+s,y:w.y-y},{x:g+s,y:w.y-2*y},{x:g+s+y,y:w.y-2*y},{x:g+s+y,y:u-y},{x:g+y,y:u-y},{x:g+y,y:u},{x:g,y:u},{x:g,y:u+y}],E=[{x:g,y:u+y},{x:g+s-y,y:u+y},{x:g+s-y,y:w.y-y},{x:g+s,y:w.y-y},{x:g+s,y:u},{x:g,y:u}],M=k.svg(c),B=v(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");let L=_($),R=M.path(L,B),A=_(E),j=M.path(A,B),C=c.insert(()=>R,":first-child");return C.insert(()=>j),C.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",x),n&&t.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(0,${-m/2})`),f.attr("transform",`translate(${-(l.width/2)-y-(l.x-(l.left??0))}, ${-(l.height/2)+y-m-(l.y-(l.top??0))})`),P(t,C),t.intersect=function(I){return N.polygon(t,$,I)},c}b(qs,"multiWaveEdgedRectangle");async function Zs(i,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n,t.useHtmlLabels||ft(kt())||(t.centerLabel=!0);let{shapeSvg:f,bbox:o,label:h}=await G(i,t,T(t)),a=Math.max(o.width+(t.padding??0)*2,t?.width??0),e=Math.max(o.height+(t.padding??0)*2,t?.height??0),s=-a/2,p=-e/2,{cssStyles:m}=t,d=k.svg(f),g=v(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let u=d.rectangle(s,p,a,e,g),y=f.insert(()=>u,":first-child");return y.attr("class","basic label-container outer-path"),h.attr("class","label noteLabel"),m&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",m),c&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",c),h.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),P(t,y),t.intersect=function(x){return N.rect(t,x)},f}b(Zs,"note");var Bo=b((i,t,r)=>[`M${i+r/2},${t}`,`L${i+r},${t-r/2}`,`L${i+r/2},${t-r}`,`L${i},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function zs(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l}=await G(i,t,T(t)),f=l.width+(t.padding??0),o=l.height+(t.padding??0),h=f+o,a=.5,e=[{x:h/2,y:0},{x:h,y:-h/2},{x:h/2,y:-h},{x:0,y:-h/2}],s,{cssStyles:p}=t;if(t.look==="handDrawn"){let m=k.svg(c),d=v(t,{}),g=Bo(0,0,h),u=m.path(g,d);s=c.insert(()=>u,":first-child").attr("transform",`translate(${-h/2+a}, ${h/2})`),p&&s.attr("style",p)}else s=et(c,h,h,e),s.attr("transform",`translate(${-h/2+a}, ${h/2})`);return n&&s.attr("style",n),P(t,s),t.calcIntersect=function(m,d){let g=m.width,u=[{x:g/2,y:0},{x:g,y:-g/2},{x:g/2,y:-g},{x:0,y:-g/2}];return N.polygon(m,u,d)},t.intersect=function(m){return this.calcIntersect(t,m)},c}b(zs,"question");async function Js(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?21:c??0,f=t.look==="neo"?12:c??0,{shapeSvg:o,bbox:h,label:a}=await G(i,t,T(t)),e=h.width+(t.look==="neo"?l*2:l),s=Math.max(h.height+(t.look==="neo"?f*2:f),t.height??0),p=s/4,d=-Math.max(e,(t.width??0)-p)/2,g=-s/2,u=g/2,y=[{x:d+u,y:g},{x:d,y:0},{x:d+u,y:-g},{x:-d,y:-g},{x:-d,y:g}],{cssStyles:x}=t,S=k.svg(o),w=v(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let $=_(y),E=S.path($,w),M=o.insert(()=>E,":first-child");return M.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",x),n&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",n),M.attr("transform",`translate(${-u/2},0)`),a.attr("transform",`translate(${-u/2-h.width/2-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),P(t,M),t.intersect=function(B){return N.polygon(t,y,B)},o}b(Js,"rect_left_inv_arrow");async function Ks(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c;t.cssClasses?c="node "+t.cssClasses:c="node default";let l=i.insert("g").attr("class",c).attr("id",t.domId||t.id),f=l.insert("g"),o=l.insert("g").attr("class","label").attr("style",n),h=t.description,a=t.label,e=await le(o,a,t.labelStyle,!0,!0),s={width:0,height:0};if(ft(U())){let B=e.children[0],L=J(e);s=B.getBoundingClientRect(),L.attr("width",s.width),L.attr("height",s.height)}X.info("Text 2",h);let p=h||[],m=e.getBBox(),d=await le(o,Array.isArray(p)?p.join("<br/>"):p,t.labelStyle,!0,!0),g=d.children[0],u=J(d);s=g.getBoundingClientRect(),u.attr("width",s.width),u.attr("height",s.height);let y=(t.padding||0)/2;J(d).attr("transform","translate( "+(s.width>m.width?0:(m.width-s.width)/2)+", "+(m.height+y+5)+")"),J(e).attr("transform","translate( "+(s.width<m.width?0:-(m.width-s.width)/2)+", 0)"),s=o.node().getBBox(),o.attr("transform","translate("+-s.width/2+", "+(-s.height/2-y+3)+")");let x=s.width+(t.padding||0),S=s.height+(t.padding||0),w=-s.width/2-y,$=-s.height/2-y,E,M;if(t.look==="handDrawn"){let B=k.svg(l),L=v(t,{}),R=B.path(tt(w,$,x,S,t.rx||0),L),A=B.line(-s.width/2-y,-s.height/2-y+m.height+y,s.width/2+y,-s.height/2-y+m.height+y,L);M=l.insert(()=>(X.debug("Rough node insert CXC",R),A),":first-child"),E=l.insert(()=>(X.debug("Rough node insert CXC",R),R),":first-child")}else E=f.insert("rect",":first-child"),M=f.insert("line"),E.attr("class","outer title-state").attr("style",n).attr("x",-s.width/2-y).attr("y",-s.height/2-y).attr("width",s.width+(t.padding||0)).attr("height",s.height+(t.padding||0)),M.attr("class","divider").attr("x1",-s.width/2-y).attr("x2",s.width/2+y).attr("y1",-s.height/2-y+m.height+y).attr("y2",-s.height/2-y+m.height+y);return P(t,E),t.intersect=function(B){return N.rect(t,B)},l}b(Ks,"rectWithTitle");async function Qs(i,t,{config:{themeVariables:r}}){let n=r?.radius??5,c={rx:n,ry:n,classes:"",labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return gt(i,t,c)}b(Qs,"roundedRect");var Ht=8;async function tr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.look==="neo"?16:t.padding??0,l=t.look==="neo"?12:t.padding??0,{shapeSvg:f,bbox:o,label:h}=await G(i,t,T(t)),a=(t?.width??o.width)+c*2+(t.look==="neo"?Ht:Ht*2),e=(t?.height??o.height)+l*2,s=a-Ht,p=e,m=Ht-a/2,d=-e/2,{cssStyles:g}=t,u=k.svg(f),y=v(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let x=[{x:m,y:d},{x:m+s,y:d},{x:m+s,y:d+p},{x:m-Ht,y:d+p},{x:m-Ht,y:d},{x:m,y:d},{x:m,y:d+p}],S=u.polygon(x.map($=>[$.x,$.y]),y),w=f.insert(()=>S,":first-child");return w.attr("class","basic label-container outer-path").attr("style",q(g)),n&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",n),g&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",n),h.attr("transform",`translate(${Ht/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),P(t,w),t.intersect=function($){return N.rect(t,$)},f}b(tr,"shadedProcess");async function er(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,f=t.look==="neo"?12:c;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-l*2,10),t.height=Math.max((t?.height??0)/1.5-f*2,10));let{shapeSvg:o,bbox:h,label:a}=await G(i,t,T(t)),e=(t?.width?t?.width:h.width)+l*2,s=((t?.height?t?.height:h.height)+f*2)*1.5,p=e,m=s/1.5,d=-p/2,g=-m/2,{cssStyles:u}=t,y=k.svg(o),x=v(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let S=[{x:d,y:g},{x:d,y:g+m},{x:d+p,y:g+m},{x:d+p,y:g-m/2}],w=_(S),$=y.path(w,x),E=o.insert(()=>$,":first-child");return E.attr("class","basic label-container  outer-path"),u&&t.look!=="handDrawn"&&E.selectChildren("path").attr("style",u),n&&t.look!=="handDrawn"&&E.selectChildren("path").attr("style",n),E.attr("transform",`translate(0, ${m/4})`),a.attr("transform",`translate(${-p/2+(t.padding??0)-(h.x-(h.left??0))}, ${-m/4+(t.padding??0)-(h.y-(h.top??0))})`),P(t,E),t.intersect=function(M){return N.polygon(t,S,M)},o}b(er,"slopedRect");async function sr(i,t){let r=t.padding??0,n=t.look==="neo"?16:r*2,c=t.look==="neo"?12:r,l={rx:0,ry:0,classes:"",labelPaddingX:t.labelPaddingX??n,labelPaddingY:c},f=await gt(i,t,l);if(t.colorIndex!==void 0){let{theme:o,themeVariables:h}=U();ct(f,t.colorIndex,o,h.borderColorArray)}return f}b(sr,"squareRect");var ye=50,Co=b((i,t,r)=>{let n=i.height+r,c=n*Math.cos(Math.PI/(2*(ye-1))),l=Math.sqrt(Math.max(0,c**2-i.height**2));return{w:Math.max(i.width+n/4+t,1.5*n+(n-c),i.width+t+n-l),h:n}},"stadiumDimensions");async function rr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?40:c,f=t.look==="neo"?24:c,{shapeSvg:o,bbox:h}=await G(i,t,T(t)),{w:a,h:e}=Co(h,l,f),s=e/2,{cssStyles:p}=t,m=k.svg(o),d=v(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let g=[{x:-a/2+s,y:-e/2},{x:a/2-s,y:-e/2},...nt(-a/2+s,0,s,ye,90,270),{x:a/2-s,y:e/2},...nt(a/2-s,0,s,ye,270,450)],u=_(g),y=m.path(u,d),x=o.insert(()=>y,":first-child");return x.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),P(t,x),t.intersect=function(S){return N.polygon(t,g,S)},o}b(rr,"stadium");async function or(i,t){let r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5,classes:"flowchart-node"};return gt(i,t,r)}b(or,"state");function ar(i,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let{cssStyles:l}=t,{lineColor:f,stateBorder:o,nodeBorder:h,nodeShadow:a}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);let e=i.insert("g").attr("class","node default").attr("id",t.domId??t.id),s=k.svg(e),p=v(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let m=s.circle(0,0,t.width,{...p,stroke:f,strokeWidth:2}),d=o??h,g=(t.width??0)*5/14,u=s.circle(0,0,g,{...p,fill:d,stroke:d,strokeWidth:2,fillStyle:"solid"}),y=e.insert(()=>m,":first-child");if(y.insert(()=>u),t.look!=="handDrawn"&&y.attr("class","outer-path"),l&&y.selectAll("path").attr("style",l),c&&y.selectAll("path").attr("style",c),t.width<25&&a&&t.look!=="handDrawn"){let x=i.node()?.ownerSVGElement?.id??"",S=x?`${x}-drop-shadow-small`:"drop-shadow-small";y.attr("style",`filter:url(#${S})`)}return P(t,y),t.intersect=function(x){return N.circle(t,(t.width??0)/2,x)},e}b(ar,"stateEnd");function ir(i,t,{config:{themeVariables:r}}){let{lineColor:n,nodeShadow:c}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);let l=i.insert("g").attr("class","node default").attr("id",t.domId||t.id),f;if(t.look==="handDrawn"){let h=k.svg(l).circle(0,0,t.width,ve(n));f=l.insert(()=>h),f.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else f=l.insert("circle",":first-child"),f.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&c&&t.look!=="handDrawn"){let o=i.node()?.ownerSVGElement?.id??"",h=o?`${o}-drop-shadow-small`:"drop-shadow-small";f.attr("style",`filter:url(#${h})`)}return P(t,f),t.intersect=function(o){return N.circle(t,(t.width??7)/2,o)},l}b(ir,"stateStart");var Lt=8;async function nr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t?.padding??8,l=t.look==="neo"?28:c,f=t.look==="neo"?12:c,{shapeSvg:o,bbox:h}=await G(i,t,T(t)),a=Math.max(h.width+2*Lt+l,t.width??0),e=Math.max(h.height+f,t.height??0),s=a-2*Lt,p=e,m=-a/2,d=-e/2,g=[{x:0,y:0},{x:s,y:0},{x:s,y:-p},{x:0,y:-p},{x:0,y:0},{x:-8,y:0},{x:s+8,y:0},{x:s+8,y:-p},{x:-8,y:-p},{x:-8,y:0}];if(t.look==="handDrawn"){let u=k.svg(o),y=v(t,{}),x=u.rectangle(m,d,s+16,p,y),S=u.line(m+Lt,d,m+Lt,d+p,y),w=u.line(m+Lt+s,d,m+Lt+s,d+p,y);o.insert(()=>S,":first-child"),o.insert(()=>w,":first-child");let $=o.insert(()=>x,":first-child"),{cssStyles:E}=t;$.attr("class","basic label-container").attr("style",q(E)),P(t,$)}else{let u=et(o,s,p,g);n&&u.attr("style",n),P(t,u)}return t.intersect=function(u){return N.polygon(t,g,u)},o}b(nr,"subroutine");var ue=.2;async function lr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,f=t.look==="neo"?12:c;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-f*2,10),t.width=Math.max((t?.width??0)-l*2-ue*(t.height+f*2),10));let{shapeSvg:o,bbox:h}=await G(i,t,T(t)),a=(t?.height?t?.height:h.height)+f*2,e=ue*a,s=ue*a,m=(t?.width?t?.width:h.width)+l*2+e-e,d=a,g=-m/2,u=-d/2,{cssStyles:y}=t,x=k.svg(o),S=v(t,{}),w=[{x:g-e/2,y:u},{x:g+m+e/2,y:u},{x:g+m+e/2,y:u+d},{x:g-e/2,y:u+d}],$=[{x:g+m-e/2,y:u+d},{x:g+m+e/2,y:u+d},{x:g+m+e/2,y:u+d-s}];t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");let E=_(w),M=x.path(E,S),B=_($),L=x.path(B,{...S,fillStyle:"solid"}),R=o.insert(()=>L,":first-child");return R.insert(()=>M,":first-child"),R.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",y),n&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",n),P(t,R),t.intersect=function(A){return N.polygon(t,w,A)},o}b(lr,"taggedRect");async function cr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:f}=await G(i,t,T(t)),o=Math.max(l.width+(t.padding??0)*2,t?.width??0),h=Math.max(l.height+(t.padding??0)*2,t?.height??0),a=h/8,e=.2*o,s=.2*h,p=h+a,{cssStyles:m}=t,d=k.svg(c),g=v(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let u=[{x:-o/2-o/2*.1,y:p/2},...ht(-o/2-o/2*.1,p/2,o/2+o/2*.1,p/2,a,.8),{x:o/2+o/2*.1,y:-p/2},{x:-o/2-o/2*.1,y:-p/2}],y=-o/2+o/2*.1,x=-p/2-s*.4,S=[{x:y+o-e,y:(x+h)*1.3},{x:y+o,y:x+h-s},{x:y+o,y:(x+h)*.9},...ht(y+o,(x+h)*1.25,y+o-e,(x+h)*1.3,-h*.02,.5)],w=_(u),$=d.path(w,g),E=_(S),M=d.path(E,{...g,fillStyle:"solid"}),B=c.insert(()=>M,":first-child");return B.insert(()=>$,":first-child"),B.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",n),B.attr("transform",`translate(0,${-a/2})`),f.attr("transform",`translate(${-o/2+(t.padding??0)-(l.x-(l.left??0))},${-h/2+(t.padding??0)-a/2-(l.y-(l.top??0))})`),P(t,B),t.intersect=function(L){return N.polygon(t,u,L)},c}b(cr,"taggedWaveEdgedRectangle");async function hr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l}=await G(i,t,T(t)),f=Math.max(l.width+(t.padding??0),t?.width||0),o=Math.max(l.height+(t.padding??0),t?.height||0),h=-f/2,a=-o/2,e=c.insert("rect",":first-child");return e.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",h).attr("y",a).attr("width",f).attr("height",o),P(t,e),t.intersect=function(s){return N.rect(t,s)},c}b(hr,"text");var Ao=b((i,t,r,n,c,l)=>`M${i},${t}
    a${c},${l} 0,0,1 0,${-n}
    l${r},0
    a${c},${l} 0,0,1 0,${n}
    M${r},${-n}
    a${c},${l} 0,0,0 0,${n}
    l${-r},0`,"createCylinderPathD"),Ro=b((i,t,r,n,c,l)=>[`M${i},${t}`,`M${i+r},${t}`,`a${c},${l} 0,0,0 0,${-n}`,`l${-r},0`,`a${c},${l} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),Ho=b((i,t,r,n,c,l)=>[`M${i+r/2},${-n/2}`,`a${c},${l} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),pr=5,mr=10;async function fr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?12:c/2,f=t.height??0;if(t.height&&(t.height=t.height-l,t.height<pr&&(t.height=pr)),t.width){let y=f/2/(2.5+f/50);t.width=t.width-l-y*3,t.width<mr&&(t.width=mr)}let{shapeSvg:o,bbox:h,label:a}=await G(i,t,T(t)),e=Math.max(t.height??0,h.height)+l,s=e/2,p=s/(2.5+e/50),m=Math.max(t.width??0,h.width)+p+l,{cssStyles:d}=t,g;if(t.look==="handDrawn"){let u=k.svg(o),y=Ro(0,0,m,e,p,s),x=Ho(0,0,m,e,p,s),S=u.path(y,v(t,{})),w=u.path(x,v(t,{fill:"none"}));g=o.insert(()=>w,":first-child"),g=o.insert(()=>S,":first-child"),g.attr("class","basic label-container"),d&&g.attr("style",d)}else{let u=Ao(0,0,m,e,p,s);g=o.insert("path",":first-child").attr("d",u).attr("class","basic label-container").attr("style",q(d)).attr("style",n),g.attr("class","basic label-container outer-path"),d&&g.selectAll("path").attr("style",d),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",p),g.attr("transform",`translate(${-m/2}, ${e/2} )`),a.attr("transform",`translate(${-(h.width/2)-p-(h.x-(h.left??0))}, ${-(h.height/2)-(h.y-(h.top??0))})`),P(t,g),t.intersect=function(u){let y=N.rect(t,u),x=y.y-(t.y??0);if(s!=0&&(Math.abs(x)<(t.height??0)/2||Math.abs(x)==(t.height??0)/2&&Math.abs(y.x-(t.x??0))>(t.width??0)/2-p)){let S=p*p*(1-x*x/(s*s));S!=0&&(S=Math.sqrt(Math.abs(S))),S=p-S,u.x-(t.x??0)>0&&(S=-S),y.x+=S}return y},o}b(fr,"tiltedCylinder");async function dr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=(t.look==="neo",c),f=t.look==="neo"?c*2:c,{shapeSvg:o,bbox:h}=await G(i,t,T(t)),a=Math.max(h.height+l,t.height??0),e=Math.max(h.width+f,(t.width??0)-a),s=[{x:-3*a/6,y:0},{x:e+3*a/6,y:0},{x:e,y:-a},{x:0,y:-a}],p,{cssStyles:m}=t;if(t.look==="handDrawn"){let d=k.svg(o),g=v(t,{}),u=_(s),y=d.path(u,g);p=o.insert(()=>y,":first-child").attr("transform",`translate(${-e/2}, ${a/2})`),m&&p.attr("style",m)}else p=et(o,e,a,s);return n&&p.attr("style",n),t.width=e,t.height=a,P(t,p),t.intersect=function(d){return N.polygon(t,s,d)},o}b(dr,"trapezoid");async function gr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,f=t.look==="neo"?12:c,o=15,h=5;(t.width||t.height)&&(t.height=(t.height??0)-f*2,t.height<h&&(t.height=h),t.width=(t.width??0)-l*2,t.width<o&&(t.width=o));let{shapeSvg:a,bbox:e}=await G(i,t,T(t)),s=(t?.width?t?.width:e.width)+l*2,p=(t?.height?t?.height:e.height)+f*2,{cssStyles:m}=t,d=k.svg(a),g=v(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let u=[{x:-s/2*.8,y:-p/2},{x:s/2*.8,y:-p/2},{x:s/2,y:-p/2*.6},{x:s/2,y:p/2},{x:-s/2,y:p/2},{x:-s/2,y:-p/2*.6}],y=_(u),x=d.path(y,g),S=a.insert(()=>x,":first-child");return S.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",m),n&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),P(t,S),t.intersect=function(w){return N.polygon(t,u,w)},a}b(gr,"trapezoidalPentagon");var yr=10,ur=10;async function br(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?c*2:c;(t.width||t.height)&&(t.width=((t?.width??0)-l)/2,t.width<ur&&(t.width=ur),t.height=t?.height??0,t.height<yr&&(t.height=yr));let{shapeSvg:f,bbox:o,label:h}=await G(i,t,T(t)),a=mt(U().flowchart?.htmlLabels),e=(t?.width?t?.width:o.width)+l,s=t?.height?t?.height:e+o.height,p=s,m=[{x:0,y:0},{x:p,y:0},{x:p/2,y:-s}],{cssStyles:d}=t,g=k.svg(f),u=v(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let y=_(m),x=g.path(y,u),S=f.insert(()=>x,":first-child").attr("transform",`translate(${-s/2}, ${s/2})`).attr("class","outer-path");return d&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",d),n&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),t.width=e,t.height=s,P(t,S),h.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${s/2-(o.height+(t.padding??0)/(a?2:1)-(o.y-(o.top??0)))})`),t.intersect=function(w){return X.info("Triangle intersect",t,m,w),N.polygon(t,m,w)},f}b(br,"triangle");async function xr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,f=t.look==="neo"?12:c,o=!0;(t.width||t.height)&&(o=!1,t.width=(t?.width??0)-l*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-f*2,t.height<10&&(t.height=10));let{shapeSvg:h,bbox:a,label:e}=await G(i,t,T(t)),s=(t?.width?t?.width:a.width)+(l??0)*2,p=(t?.height?t?.height:a.height)+(f??0)*2,m=t.look==="neo"?p/4:p/8,d=p+(o?m:-m),{cssStyles:g}=t,y=14-s,x=y>0?y/2:0,S=k.svg(h),w=v(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let $=[{x:-s/2-x,y:d/2},...ht(-s/2-x,d/2,s/2+x,d/2,m,.8),{x:s/2+x,y:-d/2},{x:-s/2-x,y:-d/2}],E=_($),M=S.path(E,w),B=h.insert(()=>M,":first-child");return B.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",g),n&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",n),B.attr("transform",`translate(0,${-m/2})`),e.attr("transform",`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-p/2+(t.padding??0)-m-(a.y-(a.top??0))})`),P(t,B),t.intersect=function(L){return N.polygon(t,$,L)},h}b(xr,"waveEdgedRectangle");async function Sr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.padding??0,l=t.look==="neo"?16:c,f=t.look==="neo"?20:c;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let w=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-f-w*(20/9)),t.width=t.width-l*2}let{shapeSvg:o,bbox:h}=await G(i,t,T(t)),a=(t?.width?t?.width:h.width)+l*2,e=(t?.height?t?.height:h.height)+f,s=e/8,p=e+s*2,{cssStyles:m}=t,d=k.svg(o),g=v(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let u=[{x:-a/2,y:p/2},...ht(-a/2,p/2,a/2,p/2,s,1),{x:a/2,y:-p/2},...ht(a/2,-p/2,-a/2,-p/2,s,-1)],y=_(u),x=d.path(y,g),S=o.insert(()=>x,":first-child");return S.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),P(t,S),t.intersect=function(w){return N.polygon(t,u,w)},o}b(Sr,"waveRectangle");var K=10;async function wr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t.look==="neo"?16:t.padding??0,l=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-c*2-K,10),t.height=Math.max((t?.height??0)-l*2-K,10));let{shapeSvg:f,bbox:o,label:h}=await G(i,t,T(t)),a=(t?.width?t?.width:o.width)+c*2+K,e=(t?.height?t?.height:o.height)+l*2+K,s=a-K,p=e-K,m=-s/2,d=-p/2,{cssStyles:g}=t,u=k.svg(f),y=v(t,{}),x=[{x:m-K,y:d-K},{x:m-K,y:d+p},{x:m+s,y:d+p},{x:m+s,y:d-K}],S=`M${m-K},${d-K} L${m+s},${d-K} L${m+s},${d+p} L${m-K},${d+p} L${m-K},${d-K}
                M${m-K},${d} L${m+s},${d}
                M${m},${d-K} L${m},${d+p}`;t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let w=u.path(S,y),$=f.insert(()=>w,":first-child");return $.attr("transform",`translate(${K/2}, ${K/2})`),$.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",g),n&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",n),h.attr("transform",`translate(${-(o.width/2)+K/2-(o.x-(o.left??0))}, ${-(o.height/2)+K/2-(o.y-(o.top??0))})`),P(t,$),t.intersect=function(E){return N.polygon(t,x,E)},f}b(wr,"windowPane");var Nr=new Set(["redux-color","redux-dark-color"]),jo=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function be(i,t){let r=t;r.alias&&(t.label=r.alias);let{theme:n,themeVariables:c}=kt(),{rowEven:l,rowOdd:f,nodeBorder:o,borderColorArray:h}=c;if(t.look==="handDrawn"){let{themeVariables:Y}=kt(),{background:Z}=Y,Q={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Z}`]};await be(i,Q)}let a=kt();t.useHtmlLabels=a.htmlLabels;let e=a.er?.diagramPadding??10,s=a.er?.entityPadding??6,{cssStyles:p}=t,{labelStyles:m,nodeStyles:d}=D(t);if(r.attributes.length===0&&t.label){let Y={rx:0,ry:0,labelPaddingX:e,labelPaddingY:e*1.5,classes:""};At(t.label,a)+Y.labelPaddingX*2<a.er.minEntityWidth&&(t.width=a.er.minEntityWidth);let Z=await gt(i,t,Y);if(n!=null&&Nr.has(n)){let Q=r.colorIndex??0;Z.attr("data-color-id",`color-${Q%h.length}`)}if(!mt(a.htmlLabels)){let Q=Z.select("text"),at=Q.node()?.getBBox();Q.attr("transform",`translate(${-at.width/2}, 0)`)}return Z}a.htmlLabels||(e*=1.25,s*=1.25);let g=T(t);g||(g="node default");let u=i.insert("g").attr("class",g).attr("id",t.domId||t.id),y=await Ft(u,t.label??"",a,0,0,["name"],m);y.height+=s;let x=0,S=[],w=[],$=0,E=0,M=0,B=0,L=!0,R=!0;for(let Y of r.attributes){let Z=await Ft(u,Y.type,a,0,x,["attribute-type"],m);$=Math.max($,Z.width+e);let Q=await Ft(u,Y.name,a,0,x,["attribute-name"],m);E=Math.max(E,Q.width+e);let at=await Ft(u,Y.keys.join(),a,0,x,["attribute-keys"],m);M=Math.max(M,at.width+e);let Ct=await Ft(u,Y.comment,a,0,x,["attribute-comment"],m);B=Math.max(B,Ct.width+e);let vt=Math.max(Z.height,Q.height,at.height,Ct.height)+s;w.push({yOffset:x,rowHeight:vt}),x+=vt}let A=4;M<=e&&(L=!1,M=0,A--),B<=e&&(R=!1,B=0,A--);let j=u.node().getBBox();if(y.width+e*2-($+E+M+B)>0){let Y=y.width+e*2-($+E+M+B);$+=Y/A,E+=Y/A,M>0&&(M+=Y/A),B>0&&(B+=Y/A)}let C=$+E+M+B,I=k.svg(u),O=v(t,{});t.look!=="handDrawn"&&(O.roughness=0,O.fillStyle="solid");let H=0;w.length>0&&(H=w.reduce((Y,Z)=>Y+(Z?.rowHeight??0),0));let V=Math.max(j.width+e*2,t?.width||0,C),W=Math.max((H??0)+y.height,t?.height||0),F=-V/2,z=-W/2;if(u.selectAll("g:not(:first-child)").each((Y,Z,Q)=>{let at=J(Q[Z]),Ct=at.attr("transform"),vt=0,xe=0;if(Ct){let ae=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Ct);ae&&(vt=parseFloat(ae[1]),xe=parseFloat(ae[2]),at.attr("class").includes("attribute-name")?vt+=$:at.attr("class").includes("attribute-keys")?vt+=$+E:at.attr("class").includes("attribute-comment")&&(vt+=$+E+M))}at.attr("transform",`translate(${F+e/2+vt}, ${xe+z+y.height+s/2})`)}),u.select(".name").attr("transform","translate("+-y.width/2+", "+(z+s/2)+")"),n!=null&&Nr.has(n)){let Y=r.colorIndex??0;u.attr("data-color-id",`color-${Y%h.length}`)}let yt=I.rectangle(F,z,V,W,O),Pt=u.insert(()=>yt,":first-child").attr("class","outer-path").attr("style",p.join(""));S.push(0);for(let[Y,Z]of w.entries()){let at=(Y+1)%2===0&&Z.yOffset!==0,Ct=I.rectangle(F,y.height+z+Z?.yOffset,V,Z?.rowHeight,{...O,fill:at?l:f,stroke:o});u.insert(()=>Ct,"g.label").attr("style",p.join("")).attr("class",`row-rect-${at?"even":"odd"}`)}let wt=1e-4,rt=Xt(F,y.height+z,V+F,y.height+z,wt),ot=I.polygon(rt.map(Y=>[Y.x,Y.y]),O);if(u.insert(()=>ot).attr("class","divider"),rt=Xt($+F,y.height+z,$+F,W+z,wt),ot=I.polygon(rt.map(Y=>[Y.x,Y.y]),O),u.insert(()=>ot).attr("class","divider"),L){let Y=$+E+F;rt=Xt(Y,y.height+z,Y,W+z,wt),ot=I.polygon(rt.map(Z=>[Z.x,Z.y]),O),u.insert(()=>ot).attr("class","divider")}if(R){let Y=$+E+M+F;rt=Xt(Y,y.height+z,Y,W+z,wt),ot=I.polygon(rt.map(Z=>[Z.x,Z.y]),O),u.insert(()=>ot).attr("class","divider")}for(let Y of S){let Z=y.height+z+Y;rt=Xt(F,Z,V+F,Z,wt),ot=I.polygon(rt.map(Q=>[Q.x,Q.y]),O),u.insert(()=>ot).attr("class","divider")}if(P(t,Pt),d&&t.look!=="handDrawn")if(n!=null&&jo.has(n))u.selectAll("path").attr("style",d);else{let Z=d.split(";")?.filter(Q=>Q.includes("stroke"))?.map(Q=>`${Q}`).join("; ");u.selectAll("path").attr("style",Z??""),u.selectAll(".row-rect-even path").attr("style",d)}return t.intersect=function(Y){return N.rect(t,Y)},u}b(be,"erBox");async function Ft(i,t,r,n=0,c=0,l=[],f=""){let o=i.insert("g").attr("class",`label ${l.join(" ")}`).attr("transform",`translate(${n}, ${c})`).attr("style",f);t!==ie(t)&&(t=ie(t),t=t.replaceAll("<","&lt;").replaceAll(">","&gt;"));let h=o.node().appendChild(await it(o,t,{width:At(t,r)+100,style:f,useHtmlLabels:r.htmlLabels},r));if(t.includes("&lt;")||t.includes("&gt;")){let e=h.children[0];for(e.textContent=e.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let a=h.getBBox();if(mt(r.htmlLabels)){let e=h.children[0];e.style.textAlign="start";let s=J(h);a=e.getBoundingClientRect(),s.attr("width",a.width),s.attr("height",a.height)}return a}b(Ft,"addText");function Xt(i,t,r,n,c){return i===r?[{x:i-c/2,y:t},{x:i+c/2,y:t},{x:r+c/2,y:n},{x:r-c/2,y:n}]:[{x:i,y:t-c/2},{x:i,y:t+c/2},{x:r,y:n+c/2},{x:r,y:n-c/2}]}b(Xt,"lineToPolygon");async function $r(i,t,r,n,c=r.class.padding??12){let l=n?0:3,f=i.insert("g").attr("class",T(t)).attr("id",t.domId||t.id),o=null,h=null,a=null,e=null,s=0,p=0,m=0;if(o=f.insert("g").attr("class","annotation-group text"),t.annotations.length>0){let x=t.annotations[0];await te(o,{text:`\xAB${x}\xBB`},0),s=o.node().getBBox().height}h=f.insert("g").attr("class","label-group text"),await te(h,t,0,["font-weight: bolder"]);let d=h.node().getBBox();p=d.height,a=f.insert("g").attr("class","members-group text");let g=0;for(let x of t.members){let S=await te(a,x,g,[x.parseClassifier()]);g+=S+l}m=a.node().getBBox().height,m<=0&&(m=c/2),e=f.insert("g").attr("class","methods-group text");let u=0;for(let x of t.methods){let S=await te(e,x,u,[x.parseClassifier()]);u+=S+l}let y=f.node().getBBox();if(o!==null){let x=o.node().getBBox();o.attr("transform",`translate(${-x.width/2})`)}return h.attr("transform",`translate(${-d.width/2}, ${s})`),y=f.node().getBBox(),a.attr("transform",`translate(0, ${s+p+c*2})`),y=f.node().getBBox(),e.attr("transform",`translate(0, ${s+p+(m?m+c*4:c*2)})`),y=f.node().getBBox(),{shapeSvg:f,bbox:y}}b($r,"textHelper");async function te(i,t,r,n=[]){let c=i.insert("g").attr("class","label").attr("style",n.join("; ")),l=kt(),f="useHtmlLabels"in t?t.useHtmlLabels:mt(l.htmlLabels)??!0,o="";"text"in t?o=t.text:o=t.label,!f&&o.startsWith("\\")&&(o=o.substring(1)),we(o)&&(f=!0);let h=await it(c,qt(Nt(o)),{width:At(o,l)+50,classes:"markdown-node-label",useHtmlLabels:f},l),a,e=1;if(f){let s=h.children[0],p=J(h);e=s.innerHTML.split("<br>").length,s.innerHTML.includes("</math>")&&(e+=s.innerHTML.split("<mrow>").length-1),await Zt(s),a=s.getBoundingClientRect(),p.attr("width",a.width),p.attr("height",a.height)}else{n.includes("font-weight: bolder")&&J(h).selectAll("tspan").attr("font-weight",""),e=h.children.length;let s=h.children[0];(h.textContent===""||h.textContent.includes("&gt"))&&(s.textContent=o[0]+o.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim(),o[1]===" "&&(s.textContent=s.textContent[0]+" "+s.textContent.substring(1))),s.textContent==="undefined"&&(s.textContent=""),a=h.getBBox()}return c.attr("transform","translate(0,"+(-a.height/(2*e)+r)+")"),a.height}b(te,"addText");async function Dr(i,t){let r=U(),{theme:n,themeVariables:c}=r,{useGradient:l,borderColorArray:f}=c,o=r.class.padding??12,h=o,a=t.useHtmlLabels??mt(r.htmlLabels)??!0,e=t;e.annotations=e.annotations??[],e.members=e.members??[],e.methods=e.methods??[];let{shapeSvg:s,bbox:p}=await $r(i,t,r,a,h);ct(s,t.colorIndex,n,f);let{labelStyles:m,nodeStyles:d}=D(t);t.labelStyle=m,t.cssStyles=e.styles||"";let g=e.styles?.join(";")||d||"";t.cssStyles||(t.cssStyles=g.replaceAll("!important","").split(";"));let u=e.members.length===0&&e.methods.length===0&&!r.class?.hideEmptyMembersBox,y=k.svg(s),x=v(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let S=Math.max(t.width??0,p.width),w=Math.max(t.height??0,p.height),$=(t.height??0)>p.height;e.members.length===0&&e.methods.length===0?w+=h:e.members.length>0&&e.methods.length===0&&(w+=h*2);let E=-S/2,M=-w/2,B=u?o*2:e.members.length===0&&e.methods.length===0?-o:0;$&&(B=o*2);let L=y.rectangle(E-o,M-o-(u?o:e.members.length===0&&e.methods.length===0?-o/2:0),S+2*o,w+2*o+B,x),R=s.insert(()=>L,":first-child");R.attr("class","basic label-container outer-path");let A=R.node().getBBox(),j=s.select(".annotation-group").node().getBBox().height-(u?o/2:0)||0,C=s.select(".label-group").node().getBBox().height-(u?o/2:0)||0,I=s.select(".members-group").node().getBBox().height-(u?o/2:0)||0,O=(j+C+M+o-(M-o-(u?o:e.members.length===0&&e.methods.length===0?-o/2:0)))/2;if(s.selectAll(".text").each((H,V,W)=>{let F=J(W[V]),z=F.attr("transform"),yt=0;if(z){let ot=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);ot&&(yt=parseFloat(ot[2]))}let Pt=yt+M+o-(u?o:e.members.length===0&&e.methods.length===0?-o/2:0);if(F.attr("class").includes("methods-group")){let rt=Math.max(I,h/2);$?Pt=Math.max(O,j+C+rt+M+h*2+o)+h*2:Pt=j+C+rt+M+h*4+o}e.members.length===0&&e.methods.length===0&&r.class?.hideEmptyMembersBox&&(e.annotations.length>0?Pt=yt-h:Pt=yt),a||(Pt-=4);let wt=E;(F.attr("class").includes("label-group")||F.attr("class").includes("annotation-group"))&&(wt=-F.node()?.getBBox().width/2||0,s.selectAll("text").each(function(rt,ot,Y){window.getComputedStyle(Y[ot]).textAnchor==="middle"&&(wt=0)})),F.attr("transform",`translate(${wt}, ${Pt})`)}),e.members.length>0||e.methods.length>0||u){let H=j+C+M+o,V=y.line(A.x,H,A.x+A.width,H+.001,x);s.insert(()=>V).attr("class",`divider${t.look==="neo"&&!l?" neo-line":""}`).attr("style",g)}if(u||e.members.length>0||e.methods.length>0){let H=j+C+I+M+h*2+o,V=y.line(A.x,$?Math.max(O,H):H,A.x+A.width,($?Math.max(O,H):H)+.001,x);s.insert(()=>V).attr("class",`divider${t.look==="neo"&&!l?" neo-line":""}`).attr("style",g)}if(e.look!=="handDrawn"&&s.selectAll("path").attr("style",g),R.select(":nth-child(2)").attr("style",g),s.selectAll(".divider").select("path").attr("style",g),t.labelStyle?s.selectAll("span").attr("style",t.labelStyle):s.selectAll("span").attr("style",g),!a){let H=RegExp(/color\s*:\s*([^;]*)/),V=H.exec(g);if(V){let W=V[0].replace("color","fill");s.selectAll("tspan").attr("style",W)}else if(m){let W=H.exec(m);if(W){let F=W[0].replace("color","fill");s.selectAll("tspan").attr("style",F)}}}return P(t,R),t.intersect=function(H){return N.rect(t,H)},s}b(Dr,"classBox");async function Pr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let c=t,l=t,f=20,o=20,h="verifyMethod"in t,a=T(t),e=U(),{themeVariables:s}=e,{borderColorArray:p,requirementEdgeLabelBackground:m}=s,d=e.layout==="elk"?"start":"center",g=i.insert("g").attr("class",a).attr("id",t.domId??t.id),u;h?u=await $t(g,`&lt;&lt;${c.type}&gt;&gt;`,0,t.labelStyle):u=await $t(g,"&lt;&lt;Element&gt;&gt;",0,t.labelStyle);let y=u,x=await $t(g,c.name,y,t.labelStyle+"; font-weight: bold;");if(y+=x+o,h){let A=await $t(g,`${c.requirementId?`ID: ${c.requirementId}`:""}`,y,t.labelStyle,d);y+=A;let j=await $t(g,`${c.text?`Text: ${c.text}`:""}`,y,t.labelStyle,d);y+=j;let C=await $t(g,`${c.risk?`Risk: ${c.risk}`:""}`,y,t.labelStyle,d);y+=C,await $t(g,`${c.verifyMethod?`Verification: ${c.verifyMethod}`:""}`,y,t.labelStyle,d)}else{let A=await $t(g,`${l.type?`Type: ${l.type}`:""}`,y,t.labelStyle,d);y+=A,await $t(g,`${l.docRef?`Doc Ref: ${l.docRef}`:""}`,y,t.labelStyle,d)}let S=(g.node()?.getBBox().width??200)+f,w=(g.node()?.getBBox().height??200)+f,$=-S/2,E=-w/2,M=k.svg(g),B=v(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");let L=M.rectangle($,E,S,w,B),R=g.insert(()=>L,":first-child");if(R.attr("class","basic label-container outer-path").attr("style",n),p?.length){let A=t.colorIndex??0;g.attr("data-color-id",`color-${A%p.length}`)}if(g.selectAll(".label").each((A,j,C)=>{let I=J(C[j]),O=I.attr("transform"),H=0,V=0;if(O){let yt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(O);yt&&(H=parseFloat(yt[1]),V=parseFloat(yt[2]))}let W=V-w/2,F=$+f/2;(j===0||j===1)&&(F=H),I.attr("transform",`translate(${F}, ${W+f})`)}),y>u+x+o){let A=E+u+x+o,j;if(t.look==="neo"){let O=[[$,A],[$+S,A],[$+S,A+.001],[$,A+.001]];j=M.polygon(O,B)}else j=M.line($,A,$+S,A,B);g.insert(()=>j).attr("class","divider")}return P(t,R),t.intersect=function(A){return N.rect(t,A)},n&&t.look!=="handDrawn"&&(m||p?.length)&&g.selectAll("path").attr("style",n),g}b(Pr,"requirementBox");async function $t(i,t,r,n="",c="center"){if(t==="")return 0;let l=i.insert("g").attr("class","label").attr("style",n),f=U(),o=f.htmlLabels??!0,h=await it(l,qt(Nt(t)),{width:At(t,f)+50,classes:"markdown-node-label",useHtmlLabels:o,style:n},f),a;if(o){let e=h.children[0],s=J(h);c==="start"&&J(e).style("text-align","left"),a=e.getBoundingClientRect(),s.attr("width",a.width),s.attr("height",a.height)}else{let e=h.children[0];for(let s of e.children)n&&s.setAttribute("style",n);if(c==="start"){e.setAttribute("text-anchor","start");for(let s of e.children)s.setAttribute("text-anchor","start")}a=h.getBBox(),a.height+=6}return l.attr("transform",`translate(${-a.width/2},${-a.height/2+r})`),a.height}b($t,"addText");var Io=b(i=>{switch(i){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 vr(i,t,{config:r}){let{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n||"";let l=10,f=t.width;t.width=(t.width??200)-10;let{shapeSvg:o,bbox:h,label:a}=await G(i,t,T(t)),e=t.padding||10,s="",p;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(s=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),p=o.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",s).attr("target","_blank"));let m={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},d,g;p?{label:d,bbox:g}=await dt(p,"ticket"in t&&t.ticket||"",m):{label:d,bbox:g}=await dt(o,"ticket"in t&&t.ticket||"",m);let{label:u,bbox:y}=await dt(o,"assigned"in t&&t.assigned||"",m);t.width=f;let x=10,S=t?.width||0,w=Math.max(g.height,y.height)/2,$=Math.max(h.height+x*2,t?.height||0)+w,E=-S/2,M=-$/2;a.attr("transform","translate("+(e-S/2)+", "+(-w-h.height/2)+")"),d.attr("transform","translate("+(e-S/2)+", "+(-w+h.height/2)+")"),u.attr("transform","translate("+(e+S/2-y.width-2*l)+", "+(-w+h.height/2)+")");let B,{rx:L,ry:R}=t,{cssStyles:A}=t;if(t.look==="handDrawn"){let j=k.svg(o),C=v(t,{}),I=L||R?j.path(tt(E,M,S,$,L||0),C):j.rectangle(E,M,S,$,C);B=o.insert(()=>I,":first-child"),B.attr("class","basic label-container").attr("style",A||null)}else{B=o.insert("rect",":first-child"),B.attr("class","basic label-container __APA__").attr("style",c).attr("rx",L??5).attr("ry",R??5).attr("x",E).attr("y",M).attr("width",S).attr("height",$);let j="priority"in t&&t.priority;if(j){let C=o.append("line"),I=E+2,O=M+Math.floor((L??0)/2),H=M+$-Math.floor((L??0)/2);C.attr("x1",I).attr("y1",O).attr("x2",I).attr("y2",H).attr("stroke-width","4").attr("stroke",Io(j))}}return P(t,B),t.height=$,t.intersect=function(j){return N.rect(t,j)},o}b(vr,"kanbanItem");async function kr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,halfPadding:f,label:o}=await G(i,t,T(t)),h=l.width+10*f,a=l.height+8*f,e=.15*h,{cssStyles:s}=t,p=l.width+20,m=l.height+20,d=Math.max(h,p),g=Math.max(a,m);o.attr("transform",`translate(${-l.width/2}, ${-l.height/2})`);let u,y=`M0 0 
    a${e},${e} 1 0,0 ${d*.25},${-1*g*.1}
    a${e},${e} 1 0,0 ${d*.25},0
    a${e},${e} 1 0,0 ${d*.25},0
    a${e},${e} 1 0,0 ${d*.25},${g*.1}

    a${e},${e} 1 0,0 ${d*.15},${g*.33}
    a${e*.8},${e*.8} 1 0,0 0,${g*.34}
    a${e},${e} 1 0,0 ${-1*d*.15},${g*.33}

    a${e},${e} 1 0,0 ${-1*d*.25},${g*.15}
    a${e},${e} 1 0,0 ${-1*d*.25},0
    a${e},${e} 1 0,0 ${-1*d*.25},0
    a${e},${e} 1 0,0 ${-1*d*.25},${-1*g*.15}

    a${e},${e} 1 0,0 ${-1*d*.1},${-1*g*.33}
    a${e*.8},${e*.8} 1 0,0 0,${-1*g*.34}
    a${e},${e} 1 0,0 ${d*.1},${-1*g*.33}
  H0 V0 Z`;if(t.look==="handDrawn"){let x=k.svg(c),S=v(t,{}),w=x.path(y,S);u=c.insert(()=>w,":first-child"),u.attr("class","basic label-container").attr("style",q(s))}else u=c.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",y);return u.attr("transform",`translate(${-d/2}, ${-g/2})`),P(t,u),t.calcIntersect=function(x,S){return N.rect(x,S)},t.intersect=function(x){return X.info("Bang intersect",t,x),N.rect(t,x)},c}b(kr,"bang");async function Tr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,halfPadding:f,label:o}=await G(i,t,T(t)),h=l.width+2*f,a=l.height+2*f,e=.15*h,s=.25*h,p=.35*h,m=.2*h,{cssStyles:d}=t,g,u=`M0 0 
    a${e},${e} 0 0,1 ${h*.25},${-1*h*.1}
    a${p},${p} 1 0,1 ${h*.4},${-1*h*.1}
    a${s},${s} 1 0,1 ${h*.35},${h*.2}

    a${e},${e} 1 0,1 ${h*.15},${a*.35}
    a${m},${m} 1 0,1 ${-1*h*.15},${a*.65}

    a${s},${e} 1 0,1 ${-1*h*.25},${h*.15}
    a${p},${p} 1 0,1 ${-1*h*.5},0
    a${e},${e} 1 0,1 ${-1*h*.25},${-1*h*.15}

    a${e},${e} 1 0,1 ${-1*h*.1},${-1*a*.35}
    a${m},${m} 1 0,1 ${h*.1},${-1*a*.65}
  H0 V0 Z`;if(t.look==="handDrawn"){let y=k.svg(c),x=v(t,{}),S=y.path(u,x);g=c.insert(()=>S,":first-child"),g.attr("class","basic label-container").attr("style",q(d))}else g=c.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",u);return o.attr("transform",`translate(${-l.width/2}, ${-l.height/2})`),g.attr("transform",`translate(${-h/2}, ${-a/2})`),P(t,g),t.calcIntersect=function(y,x){return N.rect(y,x)},t.intersect=function(y){return X.info("Cloud intersect",t,y),N.rect(t,y)},c}b(Tr,"cloud");async function Gr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,halfPadding:f,label:o}=await G(i,t,T(t)),h=l.width+8*f,a=l.height+2*f,e=5,s=t.look==="neo"?`
    M${-h/2} ${a/2-e}
    v${-a+2*e}
    q0,-${e} ${e},-${e}
    h${h-2*e}
    q${e},0 ${e},${e}
    v${a-e}
    H${-h/2}
    Z
  `:`
    M${-h/2} ${a/2-e}
    v${-a+2*e}
    q0,-${e} ${e},-${e}
    h${h-2*e}
    q${e},0 ${e},${e}
    v${a-2*e}
    q0,${e} ${-e},${e}
    h${-(h-2*e)}
    q${-e},0 ${-e},${-e}
    Z
  `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);let p=c.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",n).attr("d",s);return c.append("line").attr("class","node-line-").attr("x1",-h/2).attr("y1",a/2).attr("x2",h/2).attr("y2",a/2),o.attr("transform",`translate(${-l.width/2}, ${-l.height/2})`),c.append(()=>o.node()),P(t,p),t.calcIntersect=function(m,d){return N.rect(m,d)},t.intersect=function(m){return N.rect(t,m)},c}b(Gr,"defaultMindmapNode");async function Mr(i,t){let r={padding:t.padding??0};return Qt(i,t,r)}b(Mr,"mindmapCircle");var jt=36,Mt=50,Br=100,Cr=80,pt=6,Dt=16,Oo="bpmn",Ar={start:{rings:1,strokeWidth:1.6},intermediate:{rings:2,strokeWidth:1.4},boundary:{rings:2,strokeWidth:1.4},end:{rings:1,strokeWidth:3.4}},Er;async function Lo(){return Er??=import("./bpmnIcons-YJSSVMIT.mjs").then(({bpmnIcons:i})=>{$e(i.prefix)||Ne([{name:i.prefix,icons:i}])}),Er}b(Lo,"ensureBpmnIcons");function Rr(i){let t=i.metadata?.dataDirection;return t==="input"||t==="output"?t:void 0}b(Rr,"dataDirectionOf");function Hr(i){return i.metadata?.isCollection===!0}b(Hr,"isCollectionData");async function se(i,t){return await Lo(),lt(i,{height:t,width:t,fallbackPrefix:Oo})}b(se,"glyphSvg");var bt=b((i,t,r)=>{let n=(t.x??0)-(t.left??0),c=(t.y??0)-(t.top??0);i.attr("transform",`translate(${-t.width/2-n},${r-t.height/2-c})`)},"positionLabelBelow"),re=b(async(i,t,r)=>{if(!t)return;let n=i.append("g").attr("class","bpmn-glyph");n.html(`<g>${await se(t,r)}</g>`),n.attr("transform",`translate(${-r/2}, ${-r/2})`)},"appendGlyph"),xt=b((i,t,r,n,c)=>{c&&(t.metadata={...t.metadata??{},drawnExtent:c});let l=i.insert("rect",":first-child").attr("class","bpmn-bounds").attr("x",-r/2).attr("y",-n/2).attr("width",r).attr("height",n).attr("opacity",0).attr("aria-hidden","true");return P(t,l),l},"reserveBounds"),Vo=8,ee=b((i,t,r)=>Math.min(Math.max(i,t),r),"clamp"),Et=b((i,t,r,n,c)=>{let l=i.x??0,f=i.y??0,o=t/2,h=r/2,a=n.x-l,e=n.y-f,s=c??(Math.abs(a)*h>Math.abs(e)*o?a>=0?"right":"left":e>=0?"bottom":"top"),p=b(m=>Math.max(0,m-Math.min(Vo,m/2)),"reach");return s==="left"||s==="right"?{x:l+(s==="right"?o:-o),y:ee(n.y,f-p(h),f+p(h))}:{x:ee(n.x,l-p(o),l+p(o)),y:f+(s==="bottom"?h:-h)}},"faceProjectIntersect"),jr=b((i,t,r)=>{let n=i.x??0,c=i.y??0,l=t/2,f=r.x-n,o=r.y-c,h=l*.85;if(Math.abs(o)>=Math.abs(f)){let e=ee(f,-h,h);return{x:n+e,y:c+Math.sign(o||1)*Math.sqrt(l*l-e*e)}}let a=ee(o,-h,h);return{x:n+Math.sign(f||1)*Math.sqrt(l*l-a*a),y:c+a}},"ringIntersect"),Ir=b((i,t,r,n)=>{let c=i.x??0,l=i.y??0,f=t/2,o=r/2,h=n.x-c,a=n.y-l;return Math.abs(h)*o>Math.abs(a)*f?{x:c+Math.sign(h)*f,y:l}:{x:c,y:l+Math.sign(a||1)*o}},"faceCentreIntersect");async function Bt(i,t,r){let n=t,{labelStyles:c,nodeStyles:l}=D(t);t.labelStyle=c;let{rings:f,strokeWidth:o}=Ar[r],h=jt/2,{shapeSvg:a,bbox:e,label:s}=await G(i,t,T(t,`bpmn-event bpmn-event-${r}`)),p=a.insert("g",":first-child").attr("class","bpmn-event-body");p.attr("style",l);for(let y=0;y<f;y++)p.append("circle").attr("class",y===0?"bpmn-event-ring":"bpmn-event-ring bpmn-event-ring-inner").attr("r",h-y*3).style("stroke-width",`${o}px`);await re(p,n.icon,Dt);let m=e.height>0&&!!t.label,d=m?pt+e.height:0,g=jt+2*d,u=Math.max(jt,m?e.width:0);return m&&bt(s,e,h+pt+e.height/2),xt(a,t,u,g,{width:jt,height:jt}),t.intersect=function(y){return jr(t,jt,y)},a}b(Bt,"renderBpmnEvent");async function Or(i,t){return Bt(i,t,"start")}b(Or,"bpmnStart");async function Lr(i,t){return Bt(i,t,"intermediate")}b(Lr,"bpmnIntermediate");async function Vr(i,t){return Bt(i,t,"boundary")}b(Vr,"bpmnBoundary");async function Wr(i,t){return Bt(i,t,"end")}b(Wr,"bpmnEnd");async function _r(i,t){let r=t,{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let l=Mt/2,{shapeSvg:f,bbox:o,label:h}=await G(i,t,T(t,"bpmn-gateway")),a=f.insert("g",":first-child").attr("class","bpmn-gateway-body");a.append("polygon").attr("class","bpmn-gateway-diamond").attr("points",`0,${-l} ${l},0 0,${l} ${-l},0`).attr("style",c),await re(a,r.icon,Dt+2);let e=o.height>0&&!!t.label,s=e?pt+o.height:0,p=Mt+2*s,m=Math.max(Mt,e?o.width:0);return e&&bt(h,o,l+pt+o.height/2),xt(f,t,m,p,{width:Mt,height:Mt}),t.intersect=function(d){return Ir(t,Mt,Mt,d)},f}b(_r,"bpmnGateway");async function Yr(i,t){let r=t,{labelStyles:n,nodeStyles:c}=D(t);t.labelStyle=n;let{shapeSvg:l,bbox:f,label:o}=await G(i,t,T(t,"bpmn-activity")),h=r.markers??[],a=r.icon,e=a?Dt+6:10,s=h.length>0?Dt+4:10,p=Math.max(Br,f.width+16),m=Math.max(Cr,f.height+e+s),d=l.insert("g",":first-child").attr("class","bpmn-activity-body");if(d.append("rect").attr("class","bpmn-activity-rect").attr("x",-p/2).attr("y",-m/2).attr("width",p).attr("height",m).attr("rx",10).attr("ry",10).attr("style",c),a){let g=d.append("g").attr("class","bpmn-activity-icon");g.html(`<g>${await se(a,Dt)}</g>`),g.attr("transform",`translate(${-p/2+6}, ${-m/2+6})`)}if(h.length>0){let g=d.append("g").attr("class","bpmn-activity-markers"),u=Dt-2,y=h.length*u;for(let[x,S]of h.entries()){let w=g.append("g");w.html(`<g>${await se(S,u)}</g>`),w.attr("transform",`translate(${-y/2+x*u}, 0)`)}g.attr("transform",`translate(0, ${m/2-u-3})`)}if(f.height>0){let g=-m/2+e,u=m/2-s;bt(o,f,(g+u)/2)}return P(t,d),t.intersect=function(g){return Et(t,p,m,g)},l}b(Yr,"bpmnActivity");var Ut=36,Vt=50,oe=10;async function Fr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:f}=await G(i,t,T(t,"bpmn-data-object")),o=c.insert("g",":first-child").attr("class","bpmn-data-body"),h=-Ut/2,a=-Vt/2,e=Ut/2,s=Vt/2;o.append("path").attr("class","bpmn-data-page").attr("d",`M${h},${a} H${e-oe} L${e},${a+oe} V${s} H${h} Z`).attr("style",n),o.append("path").attr("class","bpmn-data-fold").attr("d",`M${e-oe},${a} V${a+oe} H${e}`);let p=Rr(t);p&&o.append("path").attr("class",`bpmn-data-arrow bpmn-data-arrow-${p}`).attr("d",`M${h+4},${a+9} h7 v-3 l5,4.5 -5,4.5 v-3 h-7 Z`),Hr(t)&&o.append("path").attr("class","bpmn-data-collection").attr("d",`M-4,${s-11} v9 M0,${s-11} v9 M4,${s-11} v9`);let m=l.height>0&&!!t.label,d=m?pt+l.height:0,g=Vt+2*d,u=Math.max(Ut,m?l.width:0);return m&&bt(f,l,Vt/2+pt+l.height/2),xt(c,t,u,g,{width:Ut,height:Vt}),t.intersect=function(y){return Et(t,Ut,Vt,y)},c}b(Fr,"bpmnDataObject");var St=50;async function Xr(i,t){let{labelStyles:r,nodeStyles:n}=D(t);t.labelStyle=r;let{shapeSvg:c,bbox:l,label:f}=await G(i,t,T(t,"bpmn-data-store")),o=c.insert("g",":first-child").attr("class","bpmn-data-body"),h=St/2,a=6;o.append("path").attr("class","bpmn-store-body").attr("d",`M${-h},${-h+a} a${h},${a} 0 0 1 ${St},0 V${h-a} a${h},${a} 0 0 1 ${-St},0 Z`).attr("style",n);for(let d of[0,5,10])o.append("path").attr("class","bpmn-store-rings").attr("d",`M${-h},${-h+a+d} a${h},${a} 0 0 0 ${St},0`);let e=l.height>0&&!!t.label,s=e?pt+l.height:0,p=St+2*s,m=Math.max(St,e?l.width:0);return e&&bt(f,l,h+pt+l.height/2),xt(c,t,m,p,{width:St,height:St}),t.intersect=function(d){return Et(t,St,St,d)},c}b(Xr,"bpmnDataStore");async function Ur(i,t){let{labelStyles:r}=D(t);t.labelStyle=r,t.wrappingWidth=160;let{shapeSvg:n,bbox:c,label:l}=await G(i,t,T(t,"bpmn-annotation")),f=8,o=Math.max(28,c.height+f*2),h=c.width+f*2+6,a=t.metadata?.attachFace==="right"?"right":"left";n.insert("g",":first-child").attr("class","bpmn-annotation-body").append("path").attr("class","bpmn-annotation-bracket").attr("d",a==="right"?`M${h/2-6},${-o/2} h6 V${o/2} h-6`:`M${-h/2+6},${-o/2} h-6 V${o/2} h6`);let s=a==="right"?-h/2+f:-h/2+f+6;return l.attr("transform",`translate(${s-(c.x??0)+(c.left??0)},${-c.height/2-((c.y??0)-(c.top??0))})`),xt(n,t,h,o),t.intersect=function(p){return Et(t,h,o,p,a)},n}b(Ur,"bpmnAnnotation");var Wo=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:sr},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Qs},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:rr},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:nr},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:rs},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:os},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:ms},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:Le},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:qe},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:Ye},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:ts},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Qt},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:kr},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Tr},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:zs},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:gs},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Ps},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Ds},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:dr},{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:Ns},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:is},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:hr},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Fe},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:tr},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:ir},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:ar},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:fs},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:ys},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:ze},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Je},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Ke},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:vs},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:xr},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:ds},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:fr},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Gs},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Qe},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:as},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:br},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:wr},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:ls},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:gr},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:ps},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:er},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:qs},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Us},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Oe},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Ze},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:cr},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:lr},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Sr},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Js},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Ms}],_o=b(()=>{let t=[...Object.entries({state:or,choice:Xe,note:Zs,composite:Ue,rectWithTitle:Ks,labelRect:$s,block_arrow:_e,collapsedGroup:Ve,iconSquare:Ss,iconCircle:bs,icon:us,iconRounded:xs,imageSquare:ws,anchor:je,kanbanItem:vr,mindmapCircle:Mr,defaultMindmapNode:Gr,classBox:Dr,erBox:be,requirementBox:Pr,usecaseActor:js,usecaseActorHollow:Os,usecaseActorAwesome:Is,usecaseActorIcon:Ws,usecaseBusiness:Ys,usecaseEllipse:ns,usecaseJsonTable:Xs,"bpmn-start":Or,"bpmn-intermediate":Lr,"bpmn-boundary":Vr,"bpmn-end":Wr,"bpmn-gateway":_r,"bpmn-activity":Yr,"bpmn-data":Fr,"bpmn-data-store":Xr,"bpmn-annotation":Ur}),...Wo.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(c=>[c,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Yo=_o();function q2(i){return i in Yo}b(q2,"isValidShape");export{G as a,P as b,ua as c,Ae as d,N as e,tt as f,le as g,Yo as h,q2 as i};