https://hix.ai/cdn/_next/static/chunks/3yhpy_djg4qk6.js?dpl=caeb3f7576cede78962678e87458b3b879430978
1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,10488,t=>{"use strict";var e=t.i(266022),a=t.i(277030),l=(0,a.__name)(t=>{let{handDrawnSeed:a}=(0,e.getConfig2)();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:a}},"solidStateFill"),r=(0,a.__name)(t=>{let e=i([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),i=(0,a.__name)(t=>{let e=new Map;return t.forEach(t=>{let[a,l]=t.split(":");e.set(a.trim(),l?.trim())}),e},"styles2Map"),n=(0,a.__name)(t=>"color"===t||"font-size"===t||"font-family"===t||"font-weight"===t||"font-style"===t||"text-decoration"===t||"text-align"===t||"text-transform"===t||"line-height"===t||"letter-spacing"===t||"word-spacing"===t||"text-shadow"===t||"text-overflow"===t||"white-space"===t||"word-wrap"===t||"word-break"===t||"overflow-wrap"===t||"hyphens"===t,"isLabelStyle"),s=(0,a.__name)(t=>{let{stylesArray:e}=r(t),a=[],l=[],i=[],s=[];return e.forEach(t=>{let e=t[0];n(e)?a.push(t.join(":")+" !important"):(l.push(t.join(":")+" !important"),e.includes("stroke")&&i.push(t.join(":")+" !important"),"fill"===e&&s.push(t.join(":")+" !important"))}),{labelStyles:a.join(";"),nodeStyles:l.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:s}},"styles2String"),h=(0,a.__name)((t,a)=>{let{themeVariables:l,handDrawnSeed:i}=(0,e.getConfig2)(),{nodeBorder:n,mainBkg:s}=l,{stylesMap:h}=r(t);return Object.assign({roughness:.7,fill:h.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:h.get("stroke")||n,seed:i,strokeWidth:h.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:o(h.get("stroke-dasharray"))},a)},"userNodeOverrides"),o=(0,a.__name)(t=>{if(!t)return[0,0];let e=t.trim().split(/\s+/).map(Number);if(1===e.length){let t=isNaN(e[0])?0:e[0];return[t,t]}return[isNaN(e[0])?0:e[0],isNaN(e[1])?0:e[1]]},"getStrokeDashArray");t.s(["compileStyles",0,r,"isLabelStyle",0,n,"solidStateFill",0,l,"styles2String",0,s,"userNodeOverrides",0,h])},888661,t=>{"use strict";var e=t.i(52616),a=t.i(10488),l=t.i(573997),r=t.i(471305),i=t.i(266022),n=t.i(277030);t.i(112057);var s=t.i(30834),h=t.i(535309),o=(0,n.__name)(async(t,e,a)=>{let h,o=e.useHtmlLabels||(0,i.evaluate)((0,i.getConfig2)()?.htmlLabels),d=t.insert("g").attr("class",a||"node default").attr("id",e.domId||e.id),c=d.insert("g").attr("class","label").attr("style",(0,r.handleUndefinedAttr)(e.labelStyle));h=void 0===e.label?"":"string"==typeof e.label?e.label:e.label[0];let g=await (0,l.createText)(c,(0,i.sanitizeText)((0,r.decodeEntities)(h),(0,i.getConfig2)()),{useHtmlLabels:o,width:e.width||(0,i.getConfig2)().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:e.labelStyle,addSvgBackground:!!e.icon||!!e.img}),u=g.getBBox(),f=(e?.padding??0)/2;if(o){let t=g.children[0],e=(0,s.select)(g),a=t.getElementsByTagName("img");if(a){let t=""===h.replace(/<img[^>]*>/g,"").trim();await Promise.all([...a].map(e=>new Promise(a=>{function l(){if(e.style.display="flex",e.style.flexDirection="column",t){let t=(0,i.getConfig2)().fontSize?(0,i.getConfig2)().fontSize:window.getComputedStyle(document.body).fontSize,[a=i.defaultConfig_default.fontSize]=(0,r.parseFontSize)(t),l=5*a+"px";e.style.minWidth=l,e.style.maxWidth=l}else e.style.width="100%";a(e)}(0,n.__name)(l,"setupImage"),setTimeout(()=>{e.complete&&l()}),e.addEventListener("error",l),e.addEventListener("load",l)})))}u=t.getBoundingClientRect(),e.attr("width",u.width),e.attr("height",u.height)}return o?c.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"):c.attr("transform","translate(0, "+-u.height/2+")"),e.centerLabel&&c.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:d,bbox:u,halfPadding:f,label:c}},"labelHelper"),d=(0,n.__name)(async(t,e,a)=>{let n=a.useHtmlLabels||(0,i.evaluate)((0,i.getConfig2)()?.flowchart?.htmlLabels),h=t.insert("g").attr("class","label").attr("style",a.labelStyle||""),o=await (0,l.createText)(h,(0,i.sanitizeText)((0,r.decodeEntities)(e),(0,i.getConfig2)()),{useHtmlLabels:n,width:a.width||(0,i.getConfig2)()?.flowchart?.wrappingWidth,style:a.labelStyle,addSvgBackgroun
1d:!!a.icon||!!a.img}),d=o.getBBox(),c=a.padding/2;if((0,i.evaluate)((0,i.getConfig2)()?.flowchart?.htmlLabels)){let t=o.children[0],e=(0,s.select)(o);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}return n?h.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):h.attr("transform","translate(0, "+-d.height/2+")"),a.centerLabel&&h.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),h.insert("rect",":first-child"),{shapeSvg:t,bbox:d,halfPadding:c,label:h}},"insertLabel"),c=(0,n.__name)((t,e)=>{let a=e.node().getBBox();t.width=a.width,t.height=a.height},"updateNodeBounds"),g=(0,n.__name)((t,e)=>("handDrawn"===t.look?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function u(t){let e=t.map((t,e)=>`${0===e?"M":"L"}${t.x},${t.y}`);return e.push("Z"),e.join(" ")}function f(t,e,a,l,r,i){let n=[],s=a-t,h=2*Math.PI/(s/i),o=e+(l-e)/2;for(let e=0;e<=50;e++){let a=t+e/50*s,l=o+r*Math.sin(h*(a-t));n.push({x:a,y:l})}return n}function p(t,e,a,l,r,i){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}(0,n.__name)(u,"createPathFromPoints"),(0,n.__name)(f,"generateFullSineWavePoints"),(0,n.__name)(p,"generateCirclePoints");var y=(0,n.__name)((t,e)=>{var a,l,r=t.x,i=t.y,n=e.x-r,s=e.y-i,h=t.width/2,o=t.height/2;return Math.abs(s)*h>Math.abs(n)*o?(s<0&&(o=-o),a=0===s?0:o*n/s,l=o):(n<0&&(h=-h),a=h,l=0===n?0:h*s/n),{x:r+a,y:i+l}},"intersectRect");function m(t,e){e&&t.attr("style",e)}async function x(t){let e=(0,s.select)(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),a=e.append("xhtml:div"),l=(0,i.getConfig2)(),r=t.label;t.label&&(0,i.hasKatex)(t.label)&&(r=await (0,i.renderKatexSanitized)(t.label.replace(i.common_default.lineBreakRegex,"\n"),l));let n='<span class="'+(t.isNode?"nodeLabel":"edgeLabel")+'" '+(t.labelStyle?'style="'+t.labelStyle+'"':"")+">"+r+"</span>";return a.html((0,i.sanitizeText)(n,l)),m(a,t.labelStyle),a.style("display","inline-block"),a.style("padding-right","1px"),a.style("white-space","nowrap"),a.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}(0,n.__name)(m,"applyStyle"),(0,n.__name)(x,"addHtmlLabel");var w=(0,n.__name)(async(t,e,a,l)=>{let s=t||"";if("object"==typeof s&&(s=s[0]),(0,i.evaluate)((0,i.getConfig2)().flowchart.htmlLabels)){s=s.replace(/\\n|\n/g,"<br />"),n.log.info("vertexText"+s);let t={isNode:l,label:(0,r.decodeEntities)(s).replace(/fa[blrs]?:fa-[\w-]+/g,t=>`<i class='${t.replace(":"," ")}'></i>`),labelStyle:e?e.replace("fill:","color:"):e};return await x(t)}{let t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("style",e.replace("color:","fill:"));for(let e of"string"==typeof s?s.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(s)?s:[]){let l=document.createElementNS("http://www.w3.org/2000/svg","tspan");l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),l.setAttribute("dy","1em"),l.setAttribute("x","0"),a?l.setAttribute("class","title-row"):l.setAttribute("class","row"),l.textContent=e.trim(),t.appendChild(l)}return t}},"createLabel"),b=(0,n.__name)((t,e,a,l,r)=>["M",t+r,e,"H",t+a-r,"A",r,r,"0 0 1",t+a,e+r,"V",e+l-r,"A",r,r,"0 0 1",t+a-r,e+l,"H",t+r,"A",r,r,"0 0 1",t,e+l-r,"V",e+r,"A",r,r,"0 0 1",t+r,e,"Z"].join(" "),"createRoundedRectPathD"),k=(0,n.__name)(async(t,r)=>{let o;n.log.info("Creating subgraph rect for ",r.id,r);let d=(0,i.getConfig2)(),{themeVariables:c,handDrawnSeed:g}=d,{clusterBkg:u,clusterBorder:f}=c,{labelStyles:p,nodeStyles:m,borderStyles:x,backgroundStyles:w}=(0,a.styles2String)(r),k=t.insert("g").attr("class","cluster "+r.cssClasses).attr("id",r.id).attr("data-look",r.look),$=(0,i.evaluate)(d.flowchart.htmlLabels),M=k.insert("g").attr("class","cluster-label "),S=await (0,l.createText)(M,r.label,{style:r.labelStyle,useHtmlLabels:$,isNode:!0}),_=S.getBBox();if((0,i.evaluate)(d.flowchart.htmlLabels)){let t=S.children[0],e=(0,s.select)(S);_=t.getBoundingClientRect(),e.attr("width",_.width),e.attr("height",_.height)}let v=r.width<=_.width+r.padding?_.width+r.padding:r.width;r.width<=_.width+r.padding?r.diff=(v-r.width)/2-r.padding:r.diff=-r.padding;let D=r.height,N=r.x-v/2,C=r.y-D/2;if(n.log.trace("Data ",r,JSON.stringify(r)),"handDrawn"===r.look){let t=h.default.svg(k),e=(0,a.userNodeOverrides)(r,{roughness:.7,fill:u,stroke:f,fillWeight:3,seed:g}),l=t.path(b(N,C,v,D,0),e);(o=k.insert(()=>(n.log.debug("Rough node insert CXC",l),l),":first-child")).select("path:nth-child(2)").attr("style",x.join(";")),o.select("path").attr("style",w.join(";").replace("fill","stroke"))}else(o=k.insert("rect",":first-child")).attr("style",m).attr("rx",r.rx).attr("ry",r.ry).attr("x",N).attr("y",C).attr("width",v).attr("height",D);let{subGraphTitleTopMargin:A}=(0,e.getSubGraphTitleMargins)(d);if(M.attr("transform",`translate(${r.x-_.width/2}, ${r.y-r.height/2+A})`),p){let t=M.select("span");t&&t.attr("style",p)}let P=o.node().getBBox();return r.offsetX=0,r.width=P.width,r.height=P.height,r.offsetY=_.height-r.padding/2,r.intersect=function(t){return y(r,t)},{cluster:k,labelBBox:_}},"rect"),$=(0,n.__name)((t,e)=>{let a=t.insert("g").attr("class","note-cluster").attr("id",e.id),l=a.insert("rect",":first-child"),r=0*e.padding,i=r/2;l.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-i).attr("y",e.y-e.he
1ight/2-i).attr("width",e.width+r).attr("height",e.height+r).attr("fill","none");let n=l.node().getBBox();return e.width=n.width,e.height=n.height,e.intersect=function(t){return y(e,t)},{cluster:a,labelBBox:{width:0,height:0}}},"noteGroup"),M=(0,n.__name)(async(t,e)=>{let a,l=(0,i.getConfig2)(),{themeVariables:r,handDrawnSeed:n}=l,{altBackground:o,compositeBackground:d,compositeTitleBackground:c,nodeBorder:g}=r,u=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),f=u.insert("g",":first-child"),p=u.insert("g").attr("class","cluster-label"),m=u.append("rect"),x=p.node().appendChild(await w(e.label,e.labelStyle,void 0,!0)),k=x.getBBox();if((0,i.evaluate)(l.flowchart.htmlLabels)){let t=x.children[0],e=(0,s.select)(x);k=t.getBoundingClientRect(),e.attr("width",k.width),e.attr("height",k.height)}let $=0*e.padding,M=(e.width<=k.width+e.padding?k.width+e.padding:e.width)+$;e.width<=k.width+e.padding?e.diff=(M-e.width)/2-e.padding:e.diff=-e.padding;let S=e.height+$,_=e.height+$-k.height-6,v=e.x-M/2,D=e.y-S/2;e.width=M;let N=e.y-e.height/2-$/2+k.height+2;if("handDrawn"===e.look){let t=e.cssClasses.includes("statediagram-cluster-alt"),l=h.default.svg(u),r=e.rx||e.ry?l.path(b(v,D,M,S,10),{roughness:.7,fill:c,fillStyle:"solid",stroke:g,seed:n}):l.rectangle(v,D,M,S,{seed:n});a=u.insert(()=>r,":first-child");let i=l.rectangle(v,N,M,_,{fill:t?o:d,fillStyle:t?"hachure":"solid",stroke:g,seed:n});a=u.insert(()=>r,":first-child"),m=u.insert(()=>i)}else(a=f.insert("rect",":first-child")).attr("class","outer").attr("x",v).attr("y",D).attr("width",M).attr("height",S).attr("data-look",e.look),m.attr("class","inner").attr("x",v).attr("y",N).attr("width",M).attr("height",_);return p.attr("transform",`translate(${e.x-k.width/2}, ${D+1-3*!(0,i.evaluate)(l.flowchart.htmlLabels)})`),e.height=a.node().getBBox().height,e.offsetX=0,e.offsetY=k.height-e.padding/2,e.labelBBox=k,e.intersect=function(t){return y(e,t)},{cluster:u,labelBBox:k}},"roundedWithTitle"),S=(0,n.__name)(async(t,r)=>{let o;n.log.info("Creating subgraph rect for ",r.id,r);let d=(0,i.getConfig2)(),{themeVariables:c,handDrawnSeed:g}=d,{clusterBkg:u,clusterBorder:f}=c,{labelStyles:p,nodeStyles:m,borderStyles:x,backgroundStyles:w}=(0,a.styles2String)(r),k=t.insert("g").attr("class","cluster "+r.cssClasses).attr("id",r.id).attr("data-look",r.look),$=(0,i.evaluate)(d.flowchart.htmlLabels),M=k.insert("g").attr("class","cluster-label "),S=await (0,l.createText)(M,r.label,{style:r.labelStyle,useHtmlLabels:$,isNode:!0,width:r.width}),_=S.getBBox();if((0,i.evaluate)(d.flowchart.htmlLabels)){let t=S.children[0],e=(0,s.select)(S);_=t.getBoundingClientRect(),e.attr("width",_.width),e.attr("height",_.height)}let v=r.width<=_.width+r.padding?_.width+r.padding:r.width;r.width<=_.width+r.padding?r.diff=(v-r.width)/2-r.padding:r.diff=-r.padding;let D=r.height,N=r.x-v/2,C=r.y-D/2;if(n.log.trace("Data ",r,JSON.stringify(r)),"handDrawn"===r.look){let t=h.default.svg(k),e=(0,a.userNodeOverrides)(r,{roughness:.7,fill:u,stroke:f,fillWeight:4,seed:g}),l=t.path(b(N,C,v,D,r.rx),e);(o=k.insert(()=>(n.log.debug("Rough node insert CXC",l),l),":first-child")).select("path:nth-child(2)").attr("style",x.join(";")),o.select("path").attr("style",w.join(";").replace("fill","stroke"))}else(o=k.insert("rect",":first-child")).attr("style",m).attr("rx",r.rx).attr("ry",r.ry).attr("x",N).attr("y",C).attr("width",v).attr("height",D);let{subGraphTitleTopMargin:A}=(0,e.getSubGraphTitleMargins)(d);if(M.attr("transform",`translate(${r.x-_.width/2}, ${r.y-r.height/2+A})`),p){let t=M.select("span");t&&t.attr("style",p)}let P=o.node().getBBox();return r.offsetX=0,r.width=P.width,r.height=P.height,r.offsetY=_.height-r.padding/2,r.intersect=function(t){return y(r,t)},{cluster:k,labelBBox:_}},"kanbanSection"),_={rect:k,squareRect:k,roundedWithTitle:M,noteGroup:$,divider:(0,n.__name)((t,e)=>{let a,{themeVariables:l,handDrawnSeed:r}=(0,i.getConfig2)(),{nodeBorder:n}=l,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),o=s.insert("g",":first-child"),d=0*e.padding,c=e.width+d;e.diff=-e.padding;let g=e.height+d,u=e.x-c/2,f=e.y-g/2;if(e.width=c,"handDrawn"===e.look){let t=h.default.svg(s).rectangle(u,f,c,g,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:n,seed:r});a=s.insert(()=>t,":first-child")}else(a=o.insert("rect",":first-child")).attr("class","divider").attr("x",u).attr("y",f).attr("width",c).attr("height",g).attr("data-look",e.look);return e.height=a.node().getBBox().height,e.offsetX=0,e.offsetY=0,e.intersect=function(t){return y(e,t)},{cluster:s,labelBBox:{}}}
1,"divider"),kanbanSection:S},v=new Map,D=(0,n.__name)(async(t,e)=>{let a=e.shape||"rect",l=await _[a](t,e);return v.set(e.id,l),l},"insertCluster"),N=(0,n.__name)(()=>{v=new Map},"clear");function C(t,e,a,l){var r=t.x,i=t.y,n=r-l.x,s=i-l.y,h=Math.sqrt(e*e*s*s+a*a*n*n),o=Math.abs(e*a*n/h);l.x<r&&(o=-o);var d=Math.abs(e*a*s/h);return l.y<i&&(d=-d),{x:r+o,y:i+d}}function A(t,e,a){return C(t,e,e,a)}function P(t,e,a,l){{let r=e.y-t.y,i=t.x-e.x,n=e.x*t.y-t.x*e.y,s=r*a.x+i*a.y+n,h=r*l.x+i*l.y+n;if(0!==s&&0!==h&&O(s,h))return;let o=l.y-a.y,d=a.x-l.x,c=l.x*a.y-a.x*l.y,g=o*t.x+d*t.y+c,u=o*e.x+d*e.y+c;if(1e-6>Math.abs(g)&&1e-6>Math.abs(u)&&O(g,u))return;let f=r*d-o*i;if(0===f)return;let p=Math.abs(f/2),y=i*c-d*n;return{x:y<0?(y-p)/f:(y+p)/f,y:(y=o*n-r*c)<0?(y-p)/f:(y+p)/f}}}function O(t,e){return t*e>0}function B(t,e,a){let l=t.x,r=t.y,i=[],n=1/0,s=1/0;"function"==typeof e.forEach?e.forEach(function(t){n=Math.min(n,t.x),s=Math.min(s,t.y)}):(n=Math.min(n,e.x),s=Math.min(s,e.y));let h=l-t.width/2-n,o=r-t.height/2-s;for(let l=0;l<e.length;l++){let r=e[l],n=e[l<e.length-1?l+1:0],s=P(t,a,{x:h+r.x,y:o+r.y},{x:h+n.x,y:o+n.y});s&&i.push(s)}return i.length?(i.length>1&&i.sort(function(t,e){let l=t.x-a.x,r=t.y-a.y,i=Math.sqrt(l*l+r*r),n=e.x-a.x,s=e.y-a.y,h=Math.sqrt(n*n+s*s);return i<h?-1:+(i!==h)}),i[0]):t}(0,n.__name)(function(t,e){return t.intersect(e)},"intersectNode"),(0,n.__name)(C,"intersectEllipse"),(0,n.__name)(A,"intersectCircle"),(0,n.__name)(P,"intersectLine"),(0,n.__name)(O,"sameSign"),(0,n.__name)(B,"intersectPolygon");function L(t,e){let{labelStyles:l}=(0,a.styles2String)(e);e.labelStyle=l;let i=g(e),s=i;i||(s="anchor");let o=t.insert("g").attr("class",s).attr("id",e.domId||e.id),{cssStyles:d}=e,u=h.default.svg(o),f=(0,a.userNodeOverrides)(e,{fill:"black",stroke:"none",fillStyle:"solid"});"handDrawn"!==e.look&&(f.roughness=0);let p=u.circle(0,0,2,f),y=o.insert(()=>p,":first-child");return y.attr("class","anchor").attr("style",(0,r.handleUndefinedAttr)(d)),c(e,y),e.intersect=function(t){return n.log.info("Circle intersect",e,1,t),A(e,1,t)},o}function T(t,e,a,l,r,i,n){let s=Math.atan2(l-e,a-t),h=Math.sqrt(((a-t)/2/r)**2+((l-e)/2/i)**2);if(h>1)throw Error("The given radii are too small to create an arc between the points.");let o=Math.sqrt(1-h**2),d=(t+a)/2+o*i*Math.sin(s)*(n?-1:1),c=(e+l)/2-o*r*Math.cos(s)*(n?-1:1),g=Math.atan2((e-c)/i,(t-d)/r),u=Math.atan2((l-c)/i,(a-d)/r)-g;n&&u<0&&(u+=2*Math.PI),!n&&u>0&&(u-=2*Math.PI);let f=[];for(let t=0;t<20;t++){let e=g+t/19*u,a=d+r*Math.cos(e),l=c+i*Math.sin(e);f.push({x:a,y:l})}return f}async function R(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await o(t,e,g(e)),s=n.width+e.padding+20,d=n.height+e.padding,f=d/2,p=f/(2.5+d/50),{cssStyles:y}=e,m=[{x:s/2,y:-d/2},{x:-s/2,y:-d/2},...T(-s/2,-d/2,-s/2,d/2,p,f,!1),{x:s/2,y:d/2},...T(s/2,d/2,s/2,-d/2,p,f,!0)],x=h.default.svg(i),w=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=u(m),k=x.path(b,w),$=i.insert(()=>k,":first-child");return $.attr("class","basic label-container"),y&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",y),r&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",r),$.attr("transform",`translate(${p/2}, 0)`),c(e,$),e.intersect=function(t){return B(e,m,t)},i}function I(t,e,a,l){return t.insert("polygon",":first-child").attr("points",l.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+a/2+")")}async function W(t,e){let l,{labelStyles:r,nodeStyles:i}=(0,a.styles2String)(e);e.labelStyle=r;let{shapeSvg:n,bbox:s}=await o(t,e,g(e)),d=s.height+e.padding,f=s.width+e.padding+12,p=-d,y=[{x:12,y:p},{x:f,y:p},{x:f,y:0},{x:0,y:0},{x:0,y:p+12},{x:12,y:p}],{cssStyles:m}=e;
1if("handDrawn"===e.look){let t=h.default.svg(n),r=(0,a.userNodeOverrides)(e,{}),i=u(y),s=t.path(i,r);l=n.insert(()=>s,":first-child").attr("transform",`translate(${-f/2}, ${d/2})`),m&&l.attr("style",m)}else l=I(n,f,d,y);return i&&l.attr("style",i),c(e,l),e.intersect=function(t){return B(e,y,t)},n}function E(t,e){let{nodeStyles:l}=(0,a.styles2String)(e);e.label="";let r=t.insert("g").attr("class",g(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,n=Math.max(28,e.width??0),s=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}],o=h.default.svg(r),d=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(d.roughness=0,d.fillStyle="solid");let c=u(s),f=o.path(c,d),p=r.insert(()=>f,":first-child");return i&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",i),l&&"handDrawn"!==e.look&&p.selectAll("path").attr("style",l),e.width=28,e.height=28,e.intersect=function(t){return B(e,s,t)},r}async function z(t,e,l){let i,{labelStyles:s,nodeStyles:d}=(0,a.styles2String)(e);e.labelStyle=s;let{shapeSvg:u,bbox:f,halfPadding:p}=await o(t,e,g(e)),y=l?.padding??p,m=f.width/2+y,{cssStyles:x}=e;if("handDrawn"===e.look){let t=h.default.svg(u),l=(0,a.userNodeOverrides)(e,{}),n=t.circle(0,0,2*m,l);(i=u.insert(()=>n,":first-child")).attr("class","basic label-container").attr("style",(0,r.handleUndefinedAttr)(x))}else i=u.insert("circle",":first-child").attr("class","basic label-container").attr("style",d).attr("r",m).attr("cx",0).attr("cy",0);return c(e,i),e.calcIntersect=function(t,e){let a=t.width/2;return A(t,a,e)},e.intersect=function(t){return n.log.info("Circle intersect",e,m,t),A(e,m,t)},u}function j(t){let e=Math.cos(Math.PI/4),a=Math.sin(Math.PI/4),l=2*t,r={x:l/2*e,y:l/2*a},i={x:-(l/2)*e,y:l/2*a},n={x:-(l/2)*e,y:-(l/2)*a},s={x:l/2*e,y:-(l/2)*a};return`M ${i.x},${i.y} L ${s.x},${s.y} 2 M ${r.x},${r.y} L ${n.x},${n.y}`}function q(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l,e.label="";let i=t.insert("g").attr("class",g(e)).attr("id",e.domId??e.id),s=Math.max(30,e?.width??0),{cssStyles:o}=e,d=h.default.svg(i),u=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(u.roughness=0,u.fillStyle="solid");let f=d.circle(0,0,2*s,u),p=j(s),y=d.path(p,u),m=i.insert(()=>f,":first-child");return m.insert(()=>y),o&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",o),r&&"handDrawn"!==e.look&&m.selectAll("path").attr("style",r),c(e,m),e.intersect=function(t){return n.log.info("crossedCircle intersect",e,{radius:s,point:t}),A(e,s,t)},i}function H(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}async function F(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n,label:s}=await o(t,e,g(e)),d=n.width+(e.padding??0),f=n.height+(e.padding??0),p=Math.max(5,.1*f),{cssStyles:y}=e,m=[...H(d/2,-f/2,p,30,-90,0),{x:-d/2-p,y:p},...H(d/2+2*p,-p,p,20,-180,-270),...H(d/2+2*p,p,p,20,-90,-180),{x:-d/2-p,y:-f/2},...H(d/2,f/2,p,20,0,90)],x=[{x:d/2,y:-f/2-p},{x:-d/2,y:-f/2-p}
2,...H(d/2,-f/2,p,20,-90,0),{x:-d/2-p,y:-p},...H(d/2+.1*d,-p,p,20,-180,-270),...H(d/2+.1*d,p,p,20,-90,-180),{x:-d/2-p,y:f/2},...H(d/2,f/2,p,20,0,90),{x:-d/2,y:f/2+p},{x:d/2,y:f/2+p}],w=h.default.svg(i),b=(0,a.userNodeOverrides)(e,{fill:"none"});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let k=u(m).replace("Z",""),$=w.path(k,b),M=u(x),S=w.path(M,{...b}),_=i.insert("g",":first-child");return _.insert(()=>S,":first-child").attr("stroke-opacity",0),_.insert(()=>$,":first-child"),_.attr("class","text"),y&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",y),r&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",r),_.attr("transform",`translate(${p}, 0)`),s.attr("transform",`translate(${-d/2+p-(n.x-(n.left??0))},${-f/2+(e.padding??0)/2-(n.y-(n.top??0))})`),c(e,_),e.intersect=function(t){return B(e,x,t)},i}function G(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:i,y:o})}return n}async function V(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n,label:s}=await o(t,e,g(e)),d=n.width+(e.padding??0),f=n.height+(e.padding??0),p=Math.max(5,.1*f),{cssStyles:y}
2=e,m=[...G(d/2,-f/2,p,20,-90,0),{x:d/2+p,y:-p},...G(d/2+2*p,-p,p,20,-180,-270),...G(d/2+2*p,p,p,20,-90,-180),{x:d/2+p,y:f/2},...G(d/2,f/2,p,20,0,90)],x=[{x:-d/2,y:-f/2-p},{x:d/2,y:-f/2-p},...G(d/2,-f/2,p,20,-90,0),{x:d/2+p,y:-p},...G(d/2+2*p,-p,p,20,-180,-270),...G(d/2+2*p,p,p,20,-90,-180),{x:d/2+p,y:f/2},...G(d/2,f/2,p,20,0,90),{x:d/2,y:f/2+p},{x:-d/2,y:f/2+p}],w=h.default.svg(i),b=(0,a.userNodeOverrides)(e,{fill:"none"});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let k=u(m).replace("Z",""),$=w.path(k,b),M=u(x),S=w.path(M,{...b}),_=i.insert("g",":first-child");return _.insert(()=>S,":first-child").attr("stroke-opacity",0),_.insert(()=>$,":first-child"),_.attr("class","text"),y&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",y),r&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",r),_.attr("transform",`translate(${-p}, 0)`),s.attr("transform",`translate(${-d/2+(e.padding??0)/2-(n.x-(n.left??0))},${-f/2+(e.padding??0)/2-(n.y-(n.top??0))})`),c(e,_),e.intersect=function(t){return B(e,x,t)},i}function U(t,e,a,l=100,r=0,i=180){let n=[],s=r*Math.PI/180,h=(i*Math.PI/180-s)/(l-1);for(let r=0;r<l;r++){let l=s+r*h,i=t+a*Math.cos(l),o=e+a*Math.sin(l);n.push({x:-i,y:-o})}return n}async function Z(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n,label:s}=await o(t,e,g(e)),d=n.width+(e.padding??0),f=n.height+(e.padding??0),p=Math.max(5,.1*f),{cssStyles:y}=e,m=[...U(d/2,-f/2,p,30,-90,0),{x:-d/2-p,y:p},...U(d/2+2*p,-p,p,20,-180,-270),...U(d/2+2*p,p,p,20,-90,-180),{x:-d/2-p,y:-f/2},...U(d/2,f/2,p,20,0,90)],x=[...U(-d/2+p+p/2,-f/2,p,20,-90,-180),{x:d/2-p/2,y:p},...U(-d/2-p/2,-p,p,20,0,90),...U(-d/2-p/2,p,p,20,-90,0),{x:d/2-p/2,y:-p},...U(-d/2+p+p/2,f/2,p,30,-180,-270)],w=[{x:d/2,y:-f/2-p},{x:-d/2,y:-f/2-p}
2,...U(d/2,-f/2,p,20,-90,0),{x:-d/2-p,y:-p},...U(d/2+2*p,-p,p,20,-180,-270),...U(d/2+2*p,p,p,20,-90,-180),{x:-d/2-p,y:f/2},...U(d/2,f/2,p,20,0,90),{x:-d/2,y:f/2+p},{x:d/2-p-p/2,y:f/2+p},...U(-d/2+p+p/2,-f/2,p,20,-90,-180),{x:d/2-p/2,y:p},...U(-d/2-p/2,-p,p,20,0,90),...U(-d/2-p/2,p,p,20,-90,0),{x:d/2-p/2,y:-p},...U(-d/2+p+p/2,f/2,p,30,-180,-270)],b=h.default.svg(i),k=(0,a.userNodeOverrides)(e,{fill:"none"});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let $=u(m).replace("Z",""),M=b.path($,k),S=u(x).replace("Z",""),_=b.path(S,k),v=u(w),D=b.path(v,{...k}),N=i.insert("g",":first-child");return N.insert(()=>D,":first-child").attr("stroke-opacity",0),N.insert(()=>M,":first-child"),N.insert(()=>_,":first-child"),N.attr("class","text"),y&&"handDrawn"!==e.look&&N.selectAll("path").attr("style",y),r&&"handDrawn"!==e.look&&N.selectAll("path").attr("style",r),N.attr("transform",`translate(${p-p/4}, 0)`),s.attr("transform",`translate(${-d/2+(e.padding??0)/2-(n.x-(n.left??0))},${-f/2+(e.padding??0)/2-(n.y-(n.top??0))})`),c(e,N),e.intersect=function(t){return B(e,w,t)},i}async function X(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await o(t,e,g(e)),s=Math.max(80,(n.width+(e.padding??0)*2)*1.25,e?.width??0),d=Math.max(20,n.height+(e.padding??0)*2,e?.height??0),f=d/2,{cssStyles:y}=e,m=h.default.svg(i),x=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=s-f,b=d/4,k=[{x:w,y:0},{x:b,y:0},{x:0,y:d/2},{x:b,y:d},{x:w,y:d},...p(-w,-d/2,f,50,270,90)],$=u(k),M=m.path($,x),S=i.insert(()=>M,":first-child");return S.attr("class","basic label-container"),y&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",y),r&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",r),S.attr("transform",`translate(${-s/2}, ${-d/2})`),c(e,S),e.intersect=function(t){return B(e,k,t)},i}(0,n.__name)(L,"anchor"),(0,n.__name)(T,"generateArcPoints"),(0,n.__name)(R,"bowTieRect"),(0,n.__name)(I,"insertPolygonShape"),(0,n.__name)(W,"card"),(0,n.__name)(E,"choice"),(0,n.__name)(z,"circle"),(0,n.__name)(j,"createLine"),(0,n.__name)(q,"crossedCircle"),(0,n.__name)(H,"generateCirclePoints"),(0,n.__name)(F,"curlyBraceLeft"),(0,n.__name)(G,"generateCirclePoints"),(0,n.__name)(V,"curlyBraceRight"),(0,n.__name)(U,"generateCirclePoints"),(0,n.__name)(Z,"curlyBraces"),(0,n.__name)(X,"curvedTrapezoid");var Q=(0,n.__name)((t,e,a,l,r,i)=>`M${t},${e+i} a${r},${i} 0,0,0 ${a},0 a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l}`,"createCylinderPathD"),J=(0,n.__name)((t,e,a,l,r,i)=>`M${t},${e+i} M${t+a},${e+i} a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l}`,"createOuterCylinderPathD"),Y=(0,n.__name)((t,e,a,l,r,i)=>`M${t-a/2},${-l/2} a${r},${i} 0,0,0 ${a},0`,"createInnerCylinderPathD");async function K(t,e){let l,{labelStyles:i,nodeStyles:n}=(0,a.styles2String)(e);e.labelStyle=i;let{shapeSvg:s,bbox:d,label:u}=await o(t,e,g(e)),f=Math.max(d.width+e.padding,e.width??0),p=f/2,m=p/(2.5+f/50),x=Math.max(d.height+m+e.padding,e.height??0),{cssStyles:w}=e;if("handDrawn"===e.look){let t=h.default.svg(s),r=J(0,0,f,x,p,m),i=Y(0,m,f,x,p,m),n=t.path(r,(0,a.userNodeOverrides)(e,{})),o=t.path(i,(0,a.userNodeOverrides)(e,{fill:"none"}));l=s.insert(()=>o,":first-child"),(l=s.insert(()=>n,":first-child")).attr("class","basic label-container"),w&&l.attr("style",w)}else{let t=Q(0,0,f,x,p,m);l=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,r.handleUndefinedAttr)(w)).attr("style",n)}return l.attr("label-offset-y",m),l.attr("transform",`translate(${-f/2}, ${-(x/2+m)})`),c(e,l),u.attr("transform",`translate(${-(d.width/2)-(d.x-(d.left??0))}, ${-(d.height/2)+(e.padding??0)/1.5-(d.y-(d.top??0))})`),e.intersect=function(t){let a=y(e,t),l=a.x-(e.x??0);if(0!=p&&(Math.abs(l)<(e.width??0)/2||Math.abs(l)==(e.width??0)/2&&Math.abs(a.y-(e.y??0))>(e.height??0)/2-m)){let r=m*m*(1-l*l/(p*p));r>0&&(r=Math.sqrt(r)),r=m-r,t.y-(e.y??0)>0&&(r=-r),a.y+=r}return a},s}async function tt(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n,label:s}
2=await o(t,e,g(e)),d=n.width+e.padding,u=n.height+e.padding,f=.2*u,p=-d/2,m=-u/2-f/2,{cssStyles:x}=e,w=h.default.svg(i),b=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let k=w.polygon([{x:p,y:m+f},{x:-p,y:m+f},{x:-p,y:-m},{x:p,y:-m},{x:p,y:m},{x:-p,y:m},{x:-p,y:m+f}].map(t=>[t.x,t.y]),b),$=i.insert(()=>k,":first-child");return $.attr("class","basic label-container"),x&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",x),r&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",r),s.attr("transform",`translate(${p+(e.padding??0)/2-(n.x-(n.left??0))}, ${m+f+(e.padding??0)/2-(n.y-(n.top??0))})`),c(e,$),e.intersect=function(t){return y(e,t)},i}async function te(t,e){let l,{labelStyles:i,nodeStyles:s}=(0,a.styles2String)(e);e.labelStyle=i;let{shapeSvg:d,bbox:u,halfPadding:f}=await o(t,e,g(e)),p=u.width/2+f+5,y=u.width/2+f,{cssStyles:m}=e;if("handDrawn"===e.look){let t=h.default.svg(d),i=(0,a.userNodeOverrides)(e,{roughness:.2,strokeWidth:2.5}),n=(0,a.userNodeOverrides)(e,{roughness:.2,strokeWidth:1.5}),s=t.circle(0,0,2*p,i),o=t.circle(0,0,2*y,n);(l=d.insert("g",":first-child")).attr("class",(0,r.handleUndefinedAttr)(e.cssClasses)).attr("style",(0,r.handleUndefinedAttr)(m)),l.node()?.appendChild(s),l.node()?.appendChild(o)}else{let t=(l=d.insert("g",":first-child")).insert("circle",":first-child"),e=l.insert("circle");l.attr("class","basic label-container").attr("style",s),t.attr("class","outer-circle").attr("style",s).attr("r",p).attr("cx",0).attr("cy",0),e.attr("class","inner-circle").attr("style",s).attr("r",y).attr("cx",0).attr("cy",0)}return c(e,l),e.intersect=function(t){return n.log.info("DoubleCircle intersect",e,p,t),A(e,p,t)},d}function ta(t,e,{config:{themeVariables:l}}){let{labelStyles:r,nodeStyles:i}=(0,a.styles2String)(e);e.label="",e.labelStyle=r;let s=t.insert("g").attr("class",g(e)).attr("id",e.domId??e.id),{cssStyles:o}=e,d=h.default.svg(s),{nodeBorder:u}=l,f=(0,a.userNodeOverrides)(e,{fillStyle:"solid"});"handDrawn"!==e.look&&(f.roughness=0);let p=d.circle(0,0,14,f),y=s.insert(()=>p,":first-child");return y.selectAll("path").attr("style",`fill: ${u} !important;`),o&&o.length>0&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",o),i&&"handDrawn"!==e.look&&y.selectAll("path").attr("style",i),c(e,y),e.intersect=function(t){return n.log.info("filledCircle intersect",e,{radius:7,point:t}),A(e,7,t)},s}async function tl(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:s,label:d}=await o(t,e,g(e)),f=s.width+(e.padding??0),p=f+s.height,y=f+s.height,m=[{x:0,y:-p},{x:y,y:-p},{x:y/2,y:0}],{cssStyles:x}=e,w=h.default.svg(i),b=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let k=u(m),$=w.path(k,b),M=i.insert(()=>$,":first-child").attr("transform",`translate(${-p/2}, ${p/2})`);return x&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",x),r&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",r),e.width=f,e.height=p,c(e,M),d.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-p/2+(e.padding??0)/2+(s.y-(s.top??0))})`),e.intersect=function(t){return n.log.info("Triangle intersect",e,m,t),B(e,m,t)},i}function tr(t,e,{dir:l,config:{state:r,themeVariables:i}}){let{nodeStyles:n}=(0,a.styles2String)(e);e.label="";let s=t.insert("g").attr("class",g(e)).attr("id",e.domId??e.id),{cssStyles:o}=e,d=Math.max(70,e?.width??0),u=Math.max(10,e?.height??0);"LR"===l&&(d=Math.max(10,e?.width??0),u=Math.max(70,e?.height??0));let f=-1*d/2,p=-1*u/2,m=h.default.svg(s),x=(0,a.userNodeOverrides)(e,{stroke:i.lineColor,fill:i.lineColor});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=m.rectangle(f,p,d,u,x),b=s.insert(()=>w,":first-child");o&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",o),n&&"handDrawn"!==e.look&&b.selectAll("path").attr("style",n),c(e,b);let k=r?.padding??0;return e.width&&e.height&&(e.width+=k/2||0,e.height+=k/2||0),e.intersect=function(t){return y(e,t)},s}async function ti(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:s}=await o(t,e,g(e)),d=Math.max(80,s.width+(e.padding??0)*2,e?.width??0),f=Math.max(50,s.height+(e.padding??0)*2,e?.height??0),y=f/2,{cssStyles:m}=e,x=h.default.svg(i),w=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:-d/2,y:-f/2},{x:d/2-y,y:-f/2},...p(-d/2+y,0,y,50,90,270),{x:d/2-y,y:f/2},{x:-d/2,y:f/2}],k=u(b),$=x.path(k,w),M=i.insert(()=>$,":first-child");return M.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",m),r&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",r),c(e,M),e.intersect=function(t){return n.log.info("Pill intersect",e,{radius:y,point:t}),B(e,b,t)},i}async function tn(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await o(t,e,g(e)),s=n.height+(e.padding??0),d=n.width+(e.padding??0)*2.5,{cssStyles:f}=e,p=h.default.svg(i),y=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(y.roughness=0,y.fillStyle="solid");let m=d/2,x=m/6,w=s/2,b=(m+=x)-w/2,k=[{x:-b,y:-w},{x:0,y:-w},{x:b,y:-w},{x:m,y:0},{x:b,y:w},{x:0,y:w},{x:-b,y:w},{x:-m,y:0}],$=u(k),M=p.path($,y),S=i.insert(()=>M,":first-child");return S.attr("class","basic label-container"),f&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",f),r&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",r),e.width=d,e.height=s,c(e,S),e.intersect=function(t){return B(e,k,t)},i}async function ts(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.label="",e.labelStyle=l;let{shapeSvg:i}=await o(t,e,g(e)),s=Math.max(30,e?.width??0),d=Math.max(30,e?.height??0),{cssStyles:f}=e,p=h.default.svg(i),y=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(y.roughness=0,y.fillStyle="solid");let m=[{x:0,y:0},{x:s,y:0},{x:0,y:d},{x:s,y:d}],x=u(m),w=p.path(x,y),b=i.insert(()=>w,":first-child");return b.attr("class","basic label-container"),f&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",f),r&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",r),b.attr("transform",`translate(${-s/2}, ${-d/2})`),c(e,b),e.intersect=function(t){return n.log.info("Pill intersect",e,{points:m}),B(e,m,t)},i}async function th(t,e,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:s}=(0,a.styles2String)(e);e.labelStyle=s;let d=Math.max(e.assetHeight??48,e.assetWidth??48);e.width=Math.max(d,i?.wrappingWidth??0);let{shapeSvg:g,bbox:u,label:f}=await o(t,e,"icon-shape default"),p="t"===e.pos,{nodeBorder:m}=r,{stylesMap:x}=(0,a.compileStyles)(e),w=-d/2,b=-d/2,k=8*!!e.label,$=h.default.svg(g),M=(0,a.userNodeOverrides)(e,{stroke:"none",fill:"none"});"handDrawn"!==e.look&&(M.roughness=0,M.fillStyle="solid");
2let S=$.rectangle(w,b,d,d,M),_=Math.max(d,u.width),v=d+u.height+k,D=$.rectangle(-_/2,-v/2,_,v,{...M,fill:"transparent",stroke:"none"}),N=g.insert(()=>S,":first-child"),C=g.insert(()=>D);if(e.icon){let t=g.append("g");t.html(`<g>${await (0,l.getIconSVG)(e.icon,{height:d,width:d,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),r=a.width,i=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-r/2-n},${p?u.height/2+k/2-i/2-s:-u.height/2-k/2-i/2-s})`),t.attr("style",`color: ${x.get("stroke")??m};`)}return f.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${p?-v/2:v/2-u.height})`),N.attr("transform",`translate(0,${p?u.height/2+k/2:-u.height/2-k/2})`),c(e,C),e.intersect=function(t){if(n.log.info("iconSquare intersect",e,t),!e.label)return y(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return B(e,i=p?[{x:a-u.width/2,y:l-r/2},{x:a+u.width/2,y:l-r/2},{x:a+u.width/2,y:l-r/2+u.height+k},{x:a+d/2,y:l-r/2+u.height+k},{x:a+d/2,y:l+r/2},{x:a-d/2,y:l+r/2},{x:a-d/2,y:l-r/2+u.height+k},{x:a-u.width/2,y:l-r/2+u.height+k}]:[{x:a-d/2,y:l-r/2},{x:a+d/2,y:l-r/2},{x:a+d/2,y:l-r/2+d},{x:a+u.width/2,y:l-r/2+d},{x:a+u.width/2/2,y:l+r/2},{x:a-u.width/2,y:l+r/2},{x:a-u.width/2,y:l-r/2+d},{x:a-d/2,y:l-r/2+d}],t)},g}async function to(t,e,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:s}=(0,a.styles2String)(e);e.labelStyle=s;let d=Math.max(e.assetHeight??48,e.assetWidth??48);e.width=Math.max(d,i?.wrappingWidth??0);let{shapeSvg:g,bbox:u,label:f}=await o(t,e,"icon-shape default"),p=8*!!e.label,m="t"===e.pos,{nodeBorder:x,mainBkg:w}=r,{stylesMap:b}=(0,a.compileStyles)(e),k=h.default.svg(g),$=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid"),$.stroke=b.get("fill")??w;let M=g.append("g");e.icon&&M.html(`<g>${await (0,l.getIconSVG)(e.icon,{height:d,width:d,fallbackPrefix:""})}</g>`);let S=M.node().getBBox(),_=S.width,v=S.height,D=S.x,N=S.y,C=Math.max(_,v)*Math.SQRT2+40,A=k.circle(0,0,C,$),P=Math.max(C,u.width),O=C+u.height+p,B=k.rectangle(-P/2,-O/2,P,O,{...$,fill:"transparent",stroke:"none"}),L=g.insert(()=>A,":first-child"),T=g.insert(()=>B);return M.attr("transform",`translate(${-_/2-D},${m?u.height/2+p/2-v/2-N:-u.height/2-p/2-v/2-N})`),M.attr("style",`color: ${b.get("stroke")??x};`),f.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${m?-O/2:O/2-u.height})`),L.attr("transform",`translate(0,${m?u.height/2+p/2:-u.height/2-p/2})`),c(e,T),e.intersect=function(t){return n.log.info("iconSquare intersect",e,t),y(e,t)},g}async function td(t,e,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:s}=(0,a.styles2String)(e);e.labelStyle=s;let d=Math.max(e.assetHeight??48,e.assetWidth??48);e.width=Math.max(d,i?.wrappingWidth??0);let{shapeSvg:g,bbox:u,halfPadding:f,label:p}=await o(t,e,"icon-shape default"),m="t"===e.pos,x=d+2*f,w=d+2*f,{nodeBorder:k,mainBkg:$}=r,{stylesMap:M}=(0,a.compileStyles)(e),S=8*!!e.label,_=h.default.svg(g),v=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(v.roughness=0,v.fillStyle="solid"),v.stroke=M.get("fill")??$;let D=_.path(b(-w/2,-x/2,w,x,5),v),N=Math.max(w,u.width),C=x+u.height+S,A=_.rectangle(-N/2,-C/2,N,C,{...v,fill:"transparent",stroke:"none"}),P=g.insert(()=>D,":first-child").attr("class","icon-shape2"),O=g.insert(()=>A);if(e.icon){let t=g.append("g");t.html(`<g>${await (0,l.getIconSVG)(e.icon,{height:d,width:d,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),r=a.width,i=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-r/2-n},${m?u.height/2+S/2-i/2-s:-u.height/2-S/2-i/2-s})`),t.attr("style",`color: ${M.get("stroke")??k};`)}return p.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${m?-C/2:C/2-u.height})`),P.attr("transform",`translate(0,${m?u.height/2+S/2:-u.height/2-S/2})`),c(e,O),e.intersect=function(t){if(n.log.info("iconSquare intersect",e,t),!e.label)return y(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return B(e,i=m?[{x:a-u.width/2,y:l-r/2},{x:a+u.width/2,y:l-r/2},{x:a+u.width/2,y:l-r/2+u.height+S},{x:a+w/2,y:l-r/2+u.height+S},{x:a+w/2,y:l+r/2},{x:a-w/2,y:l+r/2},{x:a-w/2,y:l-r/2+u.height+S},{x:a-u.width/2,y:l-r/2+u.height+S}]:[{x:a-w/2,y:l-r/2},{x:a+w/2,y:l-r/2},{x:a+w/2,y:l-r/2+x},{x:a+u.width/2,y:l-r/2+x},{x:a+u.width/2/2,y:l+r/2},{x:a-u.width/2,y:l+r/2},{x:a-u.width/2,y:l-r/2+x},{x:a-w/2,y:l-r/2+x}],t)},g}async function tc(t,e,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:s}=(0,a.styles2String)(e);e.labelStyle=s;let d=Math.max(e.assetHeight??48,e.assetWidth??48);e.width=Math.max(d,i?.wrappingWidth??0);let{shapeSvg:g,bbox:u,halfPadding:f,label:p}=await o(t,e,"icon-shape default"),m="t"===e.pos,x=d+2*f,w=d+2*f,{nodeBorder:k,mainBkg:$}=r,{stylesMap:M}=(0,a.compileStyles)(e),S=8*!!e.label,_=h.default.svg(g),v=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(v.roughness=0,v.fillStyle="solid"),v.stroke=M.get("fill")??$;let D=_.path(b(-w/2,-x/2,w,x,.1),v),N=Math.max(w,u.width),C=x+u.height+S,A=_.rectangle(-N/2,-C/2,N,C,{...v,fill:"transparent",stroke:"none"}),P=g.insert(()=>D,":first-child"),O=g.insert(()=>A);if(e.icon){let t=g.append("g");t.html(`<g>${await (0,l.getIconSVG)(e.icon,{height:d,width:d,fallbackPrefix:""})}</g>`);let a=t.node().getBBox(),r=a.width,i=a.height,n=a.x,s=a.y;t.attr("transform",`translate(${-r/2-n},${m?u.height/2+S/2-i/2-s:-u.height/2-S/2-i/2-s})`),t.attr("style",`color: ${M.get("stroke")??k};`)}return p.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${m?-C/2:C/2-u.height})`),P.attr("transform",`translate(0,${m?u.height/2+S/2:-u.height/2-S/2})`),c(e,O),e.intersect=function(t){if(n.log.info("iconSquare intersect",e,t),!e.label)return y(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return B(e,i=m?[{x:a-u.width/2,y:l-r/2},{x:a+u.width/2,y:l-r/2},{x:a+u.width/2,y:l-r/2+u.height+S},{x:a+w/2,y:l-r/2+u.height+S},{x:a+w/2,y:l+r/2},{x:a-w/2,y:l+r/2},{x:a-w/2,y:l-r/2+u.height+S},{x:a-u.width/2,y:l-r/2+u.height+S}]:[{x:a-w/2,y:l-r/2},{x:a+w/2,y:l-r/2},{x:a+w/2,y:l-r/2+x},{x:a+u.width/2,y:l-r/2+x},{x:a+u.width/2/2,y:l+r/2},{x:a-u.width/2,y:l+r/2},{x:a-u.width/2,y:l-r/2+x},{x:a-w/2,y:l-r/2+x}],t)},g}async function tg(t,e,{config:{flowchart:l}}
2){let r=new Image;r.src=e?.img??"",await r.decode();let i=Number(r.naturalWidth.toString().replace("px","")),s=Number(r.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/s;let{labelStyles:d}=(0,a.styles2String)(e);e.labelStyle=d;let g=l?.wrappingWidth;e.defaultWidth=l?.wrappingWidth;let u=Math.max(e.label?g??0:0,e?.assetWidth??i),f="on"===e.constraint&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:u,p="on"===e.constraint?f/e.imageAspectRatio:e?.assetHeight??s;e.width=Math.max(f,g??0);let{shapeSvg:m,bbox:x,label:w}=await o(t,e,"image-shape default"),b="t"===e.pos,k=-f/2,$=8*!!e.label,M=h.default.svg(m),S=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(S.roughness=0,S.fillStyle="solid");let _=M.rectangle(k,-p/2,f,p,S),v=Math.max(f,x.width),D=p+x.height+$,N=M.rectangle(-v/2,-D/2,v,D,{...S,fill:"none",stroke:"none"}),C=m.insert(()=>_,":first-child"),A=m.insert(()=>N);if(e.img){let t=m.append("image");t.attr("href",e.img),t.attr("width",f),t.attr("height",p),t.attr("preserveAspectRatio","none"),t.attr("transform",`translate(${-f/2},${b?D/2-p:-D/2})`)}return w.attr("transform",`translate(${-x.width/2-(x.x-(x.left??0))},${b?-p/2-x.height/2-$/2:p/2-x.height/2+$/2})`),C.attr("transform",`translate(0,${b?x.height/2+$/2:-x.height/2-$/2})`),c(e,A),e.intersect=function(t){if(n.log.info("iconSquare intersect",e,t),!e.label)return y(e,t);let a=e.x??0,l=e.y??0,r=e.height??0,i=[];return B(e,i=b?[{x:a-x.width/2,y:l-r/2},{x:a+x.width/2,y:l-r/2},{x:a+x.width/2,y:l-r/2+x.height+$},{x:a+f/2,y:l-r/2+x.height+$},{x:a+f/2,y:l+r/2},{x:a-f/2,y:l+r/2},{x:a-f/2,y:l-r/2+x.height+$},{x:a-x.width/2,y:l-r/2+x.height+$}]:[{x:a-f/2,y:l-r/2},{x:a+f/2,y:l-r/2},{x:a+f/2,y:l-r/2+p},{x:a+x.width/2,y:l-r/2+p},{x:a+x.width/2/2,y:l+r/2},{x:a-x.width/2,y:l+r/2},{x:a-x.width/2,y:l-r/2+p},{x:a-f/2,y:l-r/2+p}],t)},m}async function tu(t,e){let l,{labelStyles:r,nodeStyles:i}=(0,a.styles2String)(e);e.labelStyle=r;let{shapeSvg:n,bbox:s}=await o(t,e,g(e)),d=Math.max(s.width+(e.padding??0)*2,e?.width??0),f=Math.max(s.height+(e.padding??0)*2,e?.height??0),p=[{x:0,y:0},{x:d,y:0},{x:d+3*f/6,y:-f},{x:-3*f/6,y:-f}],{cssStyles:y}=e;if("handDrawn"===e.look){let t=h.default.svg(n),r=(0,a.userNodeOverrides)(e,{}),i=u(p),s=t.path(i,r);l=n.insert(()=>s,":first-child").attr("transform",`translate(${-d/2}, ${f/2})`),y&&l.attr("style",y)}else l=I(n,d,f,p);return i&&l.attr("style",i),e.width=d,e.height=f,c(e,l),e.intersect=function(t){return B(e,p,t)},n}async function tf(t,e,l){let i,{labelStyles:n,nodeStyles:s}=(0,a.styles2String)(e);e.labelStyle=n;let{shapeSvg:d,bbox:u}=await o(t,e,g(e)),f=Math.max(u.width+2*l.labelPaddingX,e?.width||0),p=Math.max(u.height+2*l.labelPaddingY,e?.height||0),m=-f/2,x=-p/2,{rx:w,ry:k}=e,{cssStyles:$}=e;if(l?.rx&&l.ry&&(w=l.rx,k=l.ry),"handDrawn"===e.look){let t=h.default.svg(d),l=(0,a.userNodeOverrides)(e,{}),n=w||k?t.path(b(m,x,f,p,w||0),l):t.rectangle(m,x,f,p,l);(i=d.insert(()=>n,":first-child")).attr("class","basic label-container").attr("style",(0,r.handleUndefinedAttr)($))}else(i=d.insert("rect",":first-child")).attr("class","basic label-container").attr("style",s).attr("rx",(0,r.handleUndefinedAttr)(w)).attr("ry",(0,r.handleUndefinedAttr)(k)).attr("x",m).attr("y",x).attr("width",f).attr("height",p);return c(e,i),e.calcIntersect=function(t,e){return y(t,e)},e.intersect=function(t){return y(e,t)},d}async function tp(t,e){let{shapeSvg:a,bbox:l,label:r}=await o(t,e,"label"),i=a.insert("rect",":first-child");return i.attr("width",.1).attr("height",.1),a.attr("class","label edgeLabel"),r.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),c(e,i),e.intersect=function(t){return y(e,t)},a}async function ty(t,e){let l,{labelStyles:r,nodeStyles:i}=(0,a.styles2String)(e);e.labelStyle=r;let{shapeSvg:n,bbox:s}=await o(t,e,g(e)),d=Math.max(s.width+(e.padding??0),e?.width??0),f=Math.max(s.height+(e.padding??0),e?.height??0),p=[{x:0,y:0},{x:d+3*f/6,y:0},{x:d,y:-f},{x:-(3*f)/6,y:-f}],{cssStyles:y}=e;if("handDrawn"===e.look){let t=h.default.svg(n),r=(0,a.userNodeOverrides)(e,{}),i=u(p),s=t.path(i,r);l=n.insert(()=>s,":first-child").attr("transform",`translate(${-d/2}, ${f/2})`),y&&l.attr("style",y)}else l=I(n,d,f,p);return i&&l.attr("style",i),e.width=d,e.height=f,c(e,l),e.intersect=function(t){return B(e,p,t)},n}async function tm(t,e){let l,{labelStyles:r,nodeStyles:i}=(0,a.styles2String)(e);e.labelStyle=r;let{shapeSvg:n,bbox:s}=await o(t,e,g(e)),d=Math.max(s.width+(e.padding??0),e?.width??0),f=Math.max(s.height+(e.padding??0),e?.height??0),p=[{x:-3*f/6,y:0},{x:d,y:0},{x:d+3*f/6,y:-f},{x:0,y:-f}
2],{cssStyles:y}=e;if("handDrawn"===e.look){let t=h.default.svg(n),r=(0,a.userNodeOverrides)(e,{}),i=u(p),s=t.path(i,r);l=n.insert(()=>s,":first-child").attr("transform",`translate(${-d/2}, ${f/2})`),y&&l.attr("style",y)}else l=I(n,d,f,p);return i&&l.attr("style",i),e.width=d,e.height=f,c(e,l),e.intersect=function(t){return B(e,p,t)},n}function tx(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.label="",e.labelStyle=l;let i=t.insert("g").attr("class",g(e)).attr("id",e.domId??e.id),{cssStyles:s}=e,o=Math.max(35,e?.width??0),d=Math.max(35,e?.height??0),f=[{x:o,y:0},{x:0,y:d+3.5},{x:o-14,y:d+3.5},{x:0,y:2*d},{x:o,y:d-3.5},{x:14,y:d-3.5}],p=h.default.svg(i),y=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(y.roughness=0,y.fillStyle="solid");let m=u(f),x=p.path(m,y),w=i.insert(()=>x,":first-child");return s&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",s),r&&"handDrawn"!==e.look&&w.selectAll("path").attr("style",r),w.attr("transform",`translate(-${o/2},${-d})`),c(e,w),e.intersect=function(t){return n.log.info("lightningBolt intersect",e,t),B(e,f,t)},i}(0,n.__name)(K,"cylinder"),(0,n.__name)(tt,"dividedRectangle"),(0,n.__name)(te,"doublecircle"),(0,n.__name)(ta,"filledCircle"),(0,n.__name)(tl,"flippedTriangle"),(0,n.__name)(tr,"forkJoin"),(0,n.__name)(ti,"halfRoundedRectangle"),(0,n.__name)(tn,"hexagon"),(0,n.__name)(ts,"hourglass"),(0,n.__name)(th,"icon"),(0,n.__name)(to,"iconCircle"),(0,n.__name)(td,"iconRounded"),(0,n.__name)(tc,"iconSquare"),(0,n.__name)(tg,"imageSquare"),(0,n.__name)(tu,"inv_trapezoid"),(0,n.__name)(tf,"drawRect"),(0,n.__name)(tp,"labelRect"),(0,n.__name)(ty,"lean_left"),(0,n.__name)(tm,"lean_right"),(0,n.__name)(tx,"lightningBolt");var tw=(0,n.__name)((t,e,a,l,r,i,n)=>`M${t},${e+i} a${r},${i} 0,0,0 ${a},0 a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l} M${t},${e+i+n} a${r},${i} 0,0,0 ${a},0`,"createCylinderPathD"),tb=(0,n.__name)((t,e,a,l,r,i,n)=>`M${t},${e+i} M${t+a},${e+i} a${r},${i} 0,0,0 ${-a},0 l0,${l} a${r},${i} 0,0,0 ${a},0 l0,${-l} M${t},${e+i+n} a${r},${i} 0,0,0 ${a},0`,"createOuterCylinderPathD"),tk=(0,n.__name)((t,e,a,l,r,i)=>`M${t-a/2},${-l/2} a${r},${i} 0,0,0 ${a},0`,"createInnerCylinderPathD");async function t$(t,e){let l,{labelStyles:i,nodeStyles:n}=(0,a.styles2String)(e);e.labelStyle=i;let{shapeSvg:s,bbox:d,label:u}=await o(t,e,g(e)),f=Math.max(d.width+(e.padding??0),e.width??0),p=f/2,m=p/(2.5+f/50),x=Math.max(d.height+m+(e.padding??0),e.height??0),w=.1*x,{cssStyles:b}=e;
2if("handDrawn"===e.look){let t=h.default.svg(s),r=tb(0,0,f,x,p,m,w),i=tk(0,m,f,x,p,m),n=(0,a.userNodeOverrides)(e,{}),o=t.path(r,n),d=t.path(i,n);s.insert(()=>d,":first-child").attr("class","line"),(l=s.insert(()=>o,":first-child")).attr("class","basic label-container"),b&&l.attr("style",b)}else{let t=tw(0,0,f,x,p,m,w);l=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,r.handleUndefinedAttr)(b)).attr("style",n)}return l.attr("label-offset-y",m),l.attr("transform",`translate(${-f/2}, ${-(x/2+m)})`),c(e,l),u.attr("transform",`translate(${-(d.width/2)-(d.x-(d.left??0))}, ${-(d.height/2)+m-(d.y-(d.top??0))})`),e.intersect=function(t){let a=y(e,t),l=a.x-(e.x??0);if(0!=p&&(Math.abs(l)<(e.width??0)/2||Math.abs(l)==(e.width??0)/2&&Math.abs(a.y-(e.y??0))>(e.height??0)/2-m)){let r=m*m*(1-l*l/(p*p));r>0&&(r=Math.sqrt(r)),r=m-r,t.y-(e.y??0)>0&&(r=-r),a.y+=r}return a},s}async function tM(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n,label:s}=await o(t,e,g(e)),d=Math.max(n.width+(e.padding??0)*2,e?.width??0),u=Math.max(n.height+(e.padding??0)*2,e?.height??0),p=u/4,y=u+p,{cssStyles:m}=e,x=h.default.svg(i),w=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:-d/2-d/2*.1,y:-y/2},{x:-d/2-d/2*.1,y:y/2},...f(-d/2-d/2*.1,y/2,d/2+d/2*.1,y/2,p,.8),{x:d/2+d/2*.1,y:-y/2},{x:-d/2-d/2*.1,y:-y/2},{x:-d/2,y:-y/2},{x:-d/2,y:y/2*1.1},{x:-d/2,y:-y/2}],k=x.polygon(b.map(t=>[t.x,t.y]),w),$=i.insert(()=>k,":first-child");return $.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",m),r&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",r),$.attr("transform",`translate(0,${-p/2})`),s.attr("transform",`translate(${-d/2+(e.padding??0)+d/2*.1/2-(n.x-(n.left??0))},${-u/2+(e.padding??0)-p/2-(n.y-(n.top??0))})`),c(e,$),e.intersect=function(t){return B(e,b,t)},i}async function tS(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n,label:s}=await o(t,e,g(e)),d=Math.max(n.width+(e.padding??0)*2,e?.width??0),f=Math.max(n.height+(e.padding??0)*2,e?.height??0),p=-d/2,y=-f/2,{cssStyles:m}=e,x=h.default.svg(i),w=(0,a.userNodeOverrides)(e,{}),b=[{x:p-5,y:y+5},{x:p-5,y:y+f+5},{x:p+d-5,y:y+f+5},{x:p+d-5,y:y+f},{x:p+d,y:y+f},{x:p+d,y:y+f-5},{x:p+d+5,y:y+f-5},{x:p+d+5,y:y-5},{x:p+5,y:y-5},{x:p+5,y},{x:p,y},{x:p,y:y+5}];"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let k=u(b),$=x.path(k,w),M=u([{x:p,y:y+5},{x:p+d-5,y:y+5},{x:p+d-5,y:y+f},{x:p+d,y:y+f},{x:p+d,y},{x:p,y}]),S=x.path(M,{...w,fill:"none"}),_=i.insert(()=>S,":first-child");return _.insert(()=>$,":first-child"),_.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",m),r&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",r),s.attr("transform",`translate(${-(n.width/2)-5-(n.x-(n.left??0))}, ${-(n.height/2)+5-(n.y-(n.top??0))})`),c(e,_),e.intersect=function(t){return B(e,b,t)},i}async function t_(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n,label:s}=await o(t,e,g(e)),d=Math.max(n.width+(e.padding??0)*2,e?.width??0),p=Math.max(n.height+(e.padding??0)*2,e?.height??0),y=p/4,m=p+y,x=-d/2,w=-m/2,{cssStyles:b}=e,k=f(x-5,w+m+5,x+d-5,w+m+5,y,.8),$=k?.[k.length-1],M=[{x:x-5,y:w+5},{x:x-5,y:w+m+5},...k,{x:x+d-5,y:$.y-5},{x:x+d,y:$.y-5},{x:x+d,y:$.y-10},{x:x+d+5,y:$.y-10},{x:x+d+5,y:w-5},{x:x+5,y:w-5},{x:x+5,y:w},{x,y:w},{x,y:w+5}],S=[{x,y:w+5},{x:x+d-5,y:w+5},{x:x+d-5,y:$.y-5},{x:x+d,y:$.y-5},{x:x+d,y:w},{x,y:w}],_=h.default.svg(i),v=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(v.roughness=0,v.fillStyle="solid");let D=u(M),N=_.path(D,v),C=u(S),A=_.path(C,v),P=i.insert(()=>N,":first-child");return P.insert(()=>A),P.attr("class","basic label-container"),b&&"handDrawn"!==e.look&&P.selectAll("path").attr("style",b),r&&"handDrawn"!==e.look&&P.selectAll("path").attr("style",r),P.attr("transform",`translate(0,${-y/2})`),s.attr("transform",`translate(${-(n.width/2)-5-(n.x-(n.left??0))}, ${-(n.height/2)+5-y/2-(n.y-(n.top??0))})`),c(e,P),e.intersect=function(t){return B(e,M,t)},i}async function tv(t,e,{config:{themeVariables:l}}){let{labelStyles:r,nodeStyles:n}=(0,a.styles2String)(e);e.labelStyle=r,e.useHtmlLabels||(0,i.getConfig)().flowchart?.htmlLabels!==!1||(e.centerLabel=!0);let{shapeSvg:s,bbox:d,label:u}=await o(t,e,g(e)),f=Math.max(d.width+(e.padding??0)*2,e?.width??0),p=Math.max(d.height+(e.padding??0)*2,e?.height??0),{cssStyles:m}=e,x=h.default.svg(s),w=(0,a.userNodeOverrides)(e,{fill:l.noteBkgColor,stroke:l.noteBorderColor});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=x.rectangle(-f/2,-p/2,f,p,w),k=s.insert(()=>b,":first-child");return k.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",m),n&&"handDrawn"!==e.look&&k.selectAll("path").attr("style",n),u.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))}, ${-(d.height/2)-(d.y-(d.top??0))})`),c(e,k),e.intersect=function(t){return y(e,t)},s}(0,n.__name)(t$,"linedCylinder"),(0,n.__name)(tM,"linedWaveEdgedRect"),(0,n.__name)(tS,"multiRect"),(0,n.__name)(t_,"multiWaveEdgedRectangle"),(0,n.__name)(tv,"note");var tD=(0,n.__name)((t,e,a)=>`M${t+a/2},${e} L${t+a},${e-a/2} L${t+a/2},${e-a} L${t},${e-a/2} Z`,"createDecisionBoxPathD");async function tN(t,e){let l,{labelStyles:r,nodeStyles:i}=(0,a.styles2String)(e);e.labelStyle=r;let{shapeSvg:n,bbox:s}=await o(t,e,g(e)),d=s.width+e.padding+(s.height+e.padding),u=[{x:d/2,y:0},{x:d,y:-d/2},{x:d/2,y:-d},{x:0,y:-d/2}],{cssStyles:f}=e;
2if("handDrawn"===e.look){let t=h.default.svg(n),r=(0,a.userNodeOverrides)(e,{}),i=tD(0,0,d),s=t.path(i,r);l=n.insert(()=>s,":first-child").attr("transform",`translate(${-d/2+.5}, ${d/2})`),f&&l.attr("style",f)}else(l=I(n,d,d,u)).attr("transform",`translate(${-d/2+.5}, ${d/2})`);return i&&l.attr("style",i),c(e,l),e.calcIntersect=function(t,e){let a=t.width,l=B(t,[{x:a/2,y:0},{x:a,y:-a/2},{x:a/2,y:-a},{x:0,y:-a/2}],e);return{x:l.x-.5,y:l.y-.5}},e.intersect=function(t){return this.calcIntersect(e,t)},n}async function tC(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n,label:s}=await o(t,e,g(e)),d=Math.max(n.width+(e.padding??0),e?.width??0),f=Math.max(n.height+(e.padding??0),e?.height??0),p=-d/2,y=-f/2,m=y/2,x=[{x:p+m,y},{x:p,y:0},{x:p+m,y:-y},{x:-p,y:-y},{x:-p,y}],{cssStyles:w}=e,b=h.default.svg(i),k=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let $=u(x),M=b.path($,k),S=i.insert(()=>M,":first-child");return S.attr("class","basic label-container"),w&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",w),r&&"handDrawn"!==e.look&&S.selectAll("path").attr("style",r),S.attr("transform",`translate(${-m/2},0)`),s.attr("transform",`translate(${-m/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),c(e,S),e.intersect=function(t){return B(e,x,t)},i}async function tA(t,e){let l,r,o,{labelStyles:d,nodeStyles:g}=(0,a.styles2String)(e);e.labelStyle=d,l=e.cssClasses?"node "+e.cssClasses:"node default";let u=t.insert("g").attr("class",l).attr("id",e.domId||e.id),f=u.insert("g"),p=u.insert("g").attr("class","label").attr("style",g),m=e.description,x=e.label,k=p.node().appendChild(await w(x,e.labelStyle,!0,!0)),$={width:0,height:0};if((0,i.evaluate)((0,i.getConfig2)()?.flowchart?.htmlLabels)){let t=k.children[0],e=(0,s.select)(k);$=t.getBoundingClientRect(),e.attr("width",$.width),e.attr("height",$.height)}n.log.info("Text 2",m);let M=m||[],S=k.getBBox(),_=p.node().appendChild(await w(M.join?M.join("<br/>"):M,e.labelStyle,!0,!0)),v=_.children[0],D=(0,s.select)(_);$=v.getBoundingClientRect(),D.attr("width",$.width),D.attr("height",$.height);let N=(e.padding||0)/2;(0,s.select)(_).attr("transform","translate( "+($.width>S.width?0:(S.width-$.width)/2)+", "+(S.height+N+5)+")"),(0,s.select)(k).attr("transform","translate( "+($.width<S.width?0:-(S.width-$.width)/2)+", 0)"),$=p.node().getBBox(),p.attr("transform","translate("+-$.width/2+", "+(-$.height/2-N+3)+")");let C=$.width+(e.padding||0),A=$.height+(e.padding||0),P=-$.width/2-N,O=-$.height/2-N;if("handDrawn"===e.look){let t=h.default.svg(u),l=(0,a.userNodeOverrides)(e,{}),i=t.path(b(P,O,C,A,e.rx||0),l),s=t.line(-$.width/2-N,-$.height/2-N+S.height+N,$.width/2+N,-$.height/2-N+S.height+N,l);o=u.insert(()=>(n.log.debug("Rough node insert CXC",i),s),":first-child"),r=u.insert(()=>(n.log.debug("Rough node insert CXC",i),i),":first-child")}else r=f.insert("rect",":first-child"),o=f.insert("line"),r.attr("class","outer title-state").attr("style",g).attr("x",-$.width/2-N).attr("y",-$.height/2-N).attr("width",$.width+(e.padding||0)).attr("height",$.height+(e.padding||0)),o.attr("class","divider").attr("x1",-$.width/2-N).attr("x2",$.width/2+N).attr("y1",-$.height/2-N+S.height+N).attr("y2",-$.height/2-N+S.height+N);return c(e,r),e.intersect=function(t){return y(e,t)},u}function tP(t,e,a,l,r,i,n){let s=Math.atan2(l-e,a-t),h=Math.sqrt(((a-t)/2/r)**2+((l-e)/2/i)**2);if(h>1)throw Error("The given radii are too small to create an arc between the points.");let o=Math.sqrt(1-h**2),d=(t+a)/2+o*i*Math.sin(s)*(n?-1:1),c=(e+l)/2-o*r*Math.cos(s)*(n?-1:1),g=Math.atan2((e-c)/i,(t-d)/r),u=Math.atan2((l-c)/i,(a-d)/r)-g;n&&u<0&&(u+=2*Math.PI),!n&&u>0&&(u-=2*Math.PI);let f=[];for(let t=0;t<20;t++){let e=g+t/19*u,a=d+r*Math.cos(e),l=c+i*Math.sin(e);f.push({x:a,y:l})}return f}async function tO(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await o(t,e,g(e)),s=e?.padding??0,d=e?.padding??0,f=(e?.width?e?.width:n.width)+2*s,p=(e?.height?e?.height:n.height)+2*d,y=e.radius||5,m=e.taper||5,{cssStyles:x}=e,w=h.default.svg(i),b=(0,a.userNodeOverrides)(e,{});e.stroke&&(b.stroke=e.stroke),"handDrawn"!==e.look&&(b.roughness=0,b.fillStyle="solid");let k=[{x:-f/2+m,y:-p/2},{x:f/2-m,y:-p/2},...tP(f/2-m,-p/2,f/2,-p/2+m,y,y,!0),{x:f/2,y:-p/2+m},{x:f/2,y:p/2-m},...tP(f/2,p/2-m,f/2-m,p/2,y,y,!0),{x:f/2-m,y:p/2},{x:-f/2+m,y:p/2},...tP(-f/2+m,p/2,-f/2,p/2-m,y,y,!0),{x:-f/2,y:p/2-m},{x:-f/2,y:-p/2+m},...tP(-f/2,-p/2+m,-f/2+m,-p/2,y,y,!0)],$=u(k),M=w.path($,b),S=i.insert(()=>M,":first-child");return S.attr("class","basic label-container outer-path"),x&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",x),r&&"handDrawn"!==e.look&&S.selectChildren("path").attr("style",r),c(e,S),e.intersect=function(t){return B(e,k,t)},i}async function tB(t,e){let{labelStyles:l,nodeStyles:i}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s,label:d}=await o(t,e,g(e)),u=e?.padding??0,f=Math.max(s.width+(e.padding??0)*2,e?.width??0),p=Math.max(s.height+(e.padding??0)*2,e?.height??0),m=-s.width/2-u,x=-s.height/2-u,{cssStyles:w}=e,b=h.default.svg(n),k=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let $=b.polygon([{x:m,y:x},{x:m+f+8,y:x},{x:m+f+8,y:x+p},{x:m-8,y:x+p},{x:m-8,y:x},{x:m,y:x},{x:m,y:x+p}].map(t=>[t.x,t.y]),k),M=n.insert(()=>$,":first-child");return M.attr("class","basic label-container").attr("style",(0,r.handleUndefinedAttr)(w)),i&&"handDrawn"!==e.look&&M.selectAll("path").attr("style",i),w&&"handDrawn"!==e.look&&M.selectAll("path").attr("style",i),d.attr("transform",`translate(${-f/2+4+(e.padding??0)-(s.x-(s.left??0))},${-p/2+(e.padding??0)-(s.y-(s.top??0))})`),c(e,M),e.intersect=function(t){return y(e,t)},n}async function tL(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n,label:s}=await o(t,e,g(e)),d=Math.max(n.width+(e.padding??0)*2,e?.width??0),f=Math.max(n.height+(e.padding??0)*2,e?.height??0),p=-d/2,y=-f/2,{cssStyles:m}=e,x=h.default.svg(i),w=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let b=[{x:p,y},{x:p,y:y+f},{x:p+d,y:y+f},{x:p+d,y:y-f/2}],k=u(b),$=x.path(k,w),M=i.insert(()=>$,":first-child");return M.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",m),r&&"handDrawn"!==e.look&&M.selectChildren("path").attr("style",r),M.attr("transform",`translate(0, ${f/4})`),s.attr("transform",`translate(${-d/2+(e.padding??0)-(n.x-(n.left??0))}, ${-f/4+(e.padding??0)-(n.y-(n.top??0))})`),c(e,M),e.intersect=function(t){return B(e,b,t)},i}async function tT(t,e){let a={rx:0,ry:0,classes:"",labelPaddingX:e.labelPaddingX??2*(e?.padding||0),labelPaddingY:+(e?.padding||0)};return tf(t,e,a)}async function tR(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await o(t,e,g(e)),s=n.height+e.padding,d=n.width+s/4+e.padding,f
2=s/2,{cssStyles:y}=e,m=h.default.svg(i),x=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=[{x:-d/2+f,y:-s/2},{x:d/2-f,y:-s/2},...p(-d/2+f,0,f,50,90,270),{x:d/2-f,y:s/2},...p(d/2-f,0,f,50,270,450)],b=u(w),k=m.path(b,x),$=i.insert(()=>k,":first-child");return $.attr("class","basic label-container outer-path"),y&&"handDrawn"!==e.look&&$.selectChildren("path").attr("style",y),r&&"handDrawn"!==e.look&&$.selectChildren("path").attr("style",r),c(e,$),e.intersect=function(t){return B(e,w,t)},i}async function tI(t,e){return tf(t,e,{rx:5,ry:5,classes:"flowchart-node"})}function tW(t,e,{config:{themeVariables:l}}){let{labelStyles:r,nodeStyles:i}=(0,a.styles2String)(e);e.labelStyle=r;let{cssStyles:n}=e,{lineColor:s,stateBorder:o,nodeBorder:d}=l,g=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),u=h.default.svg(g),f=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(f.roughness=0,f.fillStyle="solid");let p=u.circle(0,0,14,{...f,stroke:s,strokeWidth:2}),y=o??d,m=u.circle(0,0,5,{...f,fill:y,stroke:y,strokeWidth:2,fillStyle:"solid"}),x=g.insert(()=>p,":first-child");return x.insert(()=>m),n&&x.selectAll("path").attr("style",n),i&&x.selectAll("path").attr("style",i),c(e,x),e.intersect=function(t){return A(e,7,t)},g}function tE(t,e,{config:{themeVariables:l}}){let r,{lineColor:i}=l,n=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);if("handDrawn"===e.look){let t=h.default.svg(n).circle(0,0,14,(0,a.solidStateFill)(i));(r=n.insert(()=>t)).attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else(r=n.insert("circle",":first-child")).attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return c(e,r),e.intersect=function(t){return A(e,7,t)},n}async function tz(t,e){let{labelStyles:l,nodeStyles:i}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:n,bbox:s}=await o(t,e,g(e)),d=(e?.padding||0)/2,u=s.width+e.padding,f=s.height+e.padding,p=-s.width/2-d,y=-s.height/2-d,m=[{x:0,y:0},{x:u,y:0},{x:u,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:u+8,y:0},{x:u+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if("handDrawn"===e.look){let t=h.default.svg(n),l=(0,a.userNodeOverrides)(e,{}),i=t.rectangle(p-8,y,u+16,f,l),s=t.line(p,y,p,y+f,l),o=t.line(p+u,y,p+u,y+f,l);n.insert(()=>s,":first-child"),n.insert(()=>o,":first-child");let d=n.insert(()=>i,":first-child"),{cssStyles:g}=e;d.attr("class","basic label-container").attr("style",(0,r.handleUndefinedAttr)(g)),c(e,d)}else{let t=I(n,u,f,m);i&&t.attr("style",i),c(e,t)}return e.intersect=function(t){return B(e,m,t)},n}async function tj(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await o(t,e,g(e)),s=Math.max(n.width+(e.padding??0)*2,e?.width??0),d=Math.max(n.height+(e.padding??0)*2,e?.height??0),f=-s/2,p=-d/2,y=.2*d,{cssStyles:m}=e,x=h.default.svg(i),w=(0,a.userNodeOverrides)(e,{}),b=[{x:f-y/2,y:p},{x:f+s+y/2,y:p},{x:f+s+y/2,y:p+d},{x:f-y/2,y:p+d}];"handDrawn"!==e.look&&(w.roughness=0,w.fillStyle="solid");let k=u(b),$=x.path(k,w),M=u([{x:f+s-y/2,y:p+d},{x:f+s+y/2,y:p+d},{x:f+s+y/2,y:p+d-.2*d}]),S=x.path(M,{...w,fillStyle:"solid"}),_=i.insert(()=>S,":first-child");return _.insert(()=>$,":first-child"),_.attr("class","basic label-container"),m&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",m),r&&"handDrawn"!==e.look&&_.selectAll("path").attr("style",r),c(e,_),e.intersect=function(t){return B(e,b,t)},i}async function tq(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n,label:s}=await o(t,e,g(e)),d=Math.max(n.width+(e.padding??0)*2,e?.width??0),p=Math.max(n.height+(e.padding??0)*2,e?.height??0),y=p/4,m=.2*d,x=.2*p,w=p+y,{cssStyles:b}=e,k=h.default.svg(i),$=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let M=[{x:-d/2-d/2*.1,y:w/2},...f(-d/2-d/2*.1,w/2,d/2+d/2*.1,w/2,y,.8),{x:d/2+d/2*.1,y:-w/2},{x:-d/2-d/2*.1,y:-w/2}],S=-d/2+d/2*.1,_=-w/2-.4*x,v=[{x:S+d-m,y:(_+p)*1.4},{x:S+d,y:_+p-x},{x:S+d,y:(_+p)*.9},...f(S+d,(_+p)*1.3,S+d-m,(_+p)*1.5,-(.03*p),.5)],D=u(M),N=k.path(D,$),C=u(v),A=k.path(C,{...$,fillStyle:"solid"}),P=i.insert(()=>A,":first-child");return P.insert(()=>N,":first-child"),P.attr("class","basic label-container"),b&&"handDrawn"!==e.look&&P.selectAll("path").attr("style",b),r&&"handDrawn"!==e.look&&P.selectAll("path").attr("style",r),P.attr("transform",`translate(0,${-y/2})`),s.attr("transform",`translate(${-d/2+(e.padding??0)-(n.x-(n.left??0))},${-p/2+(e.padding??0)-y/2-(n.y-(n.top??0))})`),c(e,P),e.intersect=function(t){return B(e,M,t)},i}async function tH(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await o(t,e,g(e)),s=Math.max(n.width+e.padding,e?.width||0),h=Math.max(n.height+e.padding,e?.height||0),d=i.insert("rect",":first-child");return d.attr("class","text").attr("style",r).attr("rx",0).attr("ry",0).attr("x",-s/2).attr("y",-h/2).attr("width",s).attr("height",h),c(e,d),e.intersect=function(t){return y(e,t)},i}(0,n.__name)(tN,"question"),(0,n.__name)(tC,"rect_left_inv_arrow"),(0,n.__name)(tA,"rectWithTitle"),
2(0,n.__name)(tP,"generateArcPoints"),(0,n.__name)(tO,"roundedRect"),(0,n.__name)(tB,"shadedProcess"),(0,n.__name)(tL,"slopedRect"),(0,n.__name)(tT,"squareRect"),(0,n.__name)(tR,"stadium"),(0,n.__name)(tI,"state"),(0,n.__name)(tW,"stateEnd"),(0,n.__name)(tE,"stateStart"),(0,n.__name)(tz,"subroutine"),(0,n.__name)(tj,"taggedRect"),(0,n.__name)(tq,"taggedWaveEdgedRectangle"),(0,n.__name)(tH,"text");var tF=(0,n.__name)((t,e,a,l,r,i)=>`M${t},${e} 3 a${r},${i} 0,0,1 0,${-l} 4 l${a},0 5 a${r},${i} 0,0,1 0,${l} 6 M${a},${-l} 7 a${r},${i} 0,0,0 0,${l} 8 l${-a},0`,"createCylinderPathD"),tG=(0,n.__name)((t,e,a,l,r,i)=>`M${t},${e} M${t+a},${e} a${r},${i} 0,0,0 0,${-l} l${-a},0 a${r},${i} 0,0,0 0,${l} l${a},0`,"createOuterCylinderPathD"),tV=(0,n.__name)((t,e,a,l,r,i)=>`M${t+a/2},${-l/2} a${r},${i} 0,0,0 0,${l}`,"createInnerCylinderPathD");async function tU(t,e){let l,{labelStyles:i,nodeStyles:n}=(0,a.styles2String)(e);e.labelStyle=i;let{shapeSvg:s,bbox:d,label:u,halfPadding:f}=await o(t,e,g(e)),p="neo"===e.look?2*f:f,m=d.height+p,x=m/2,w=x/(2.5+m/50),b=d.width+w+p,{cssStyles:k}=e;if("handDrawn"===e.look){let t=h.default.svg(s),r=tG(0,0,b,m,w,x),i=tV(0,0,b,m,w,x),n=t.path(r,(0,a.userNodeOverrides)(e,{})),o=t.path(i,(0,a.userNodeOverrides)(e,{fill:"none"}));l=s.insert(()=>o,":first-child"),(l=s.insert(()=>n,":first-child")).attr("class","basic label-container"),k&&l.attr("style",k)}else{let t=tF(0,0,b,m,w,x);(l=s.insert("path",":first-child").attr("d",t).attr("class","basic label-container").attr("style",(0,r.handleUndefinedAttr)(k)).attr("style",n)).attr("class","basic label-container"),k&&l.selectAll("path").attr("style",k),n&&l.selectAll("path").attr("style",n)}return l.attr("label-offset-x",w),l.attr("transform",`translate(${-b/2}, ${m/2} )`),u.attr("transform",`translate(${-(d.width/2)-w-(d.x-(d.left??0))}, ${-(d.height/2)-(d.y-(d.top??0))})`),c(e,l),e.intersect=function(t){let a=y(e,t),l=a.y-(e.y??0);if(0!=x&&(Math.abs(l)<(e.height??0)/2||Math.abs(l)==(e.height??0)/2&&Math.abs(a.x-(e.x??0))>(e.width??0)/2-w)){let r=w*w*(1-l*l/(x*x));0!=r&&(r=Math.sqrt(Math.abs(r))),r=w-r,t.x-(e.x??0)>0&&(r=-r),a.x+=r}return a},s}async function tZ(t,e){let l,{labelStyles:r,nodeStyles:i}=(0,a.styles2String)(e);e.labelStyle=r;let{shapeSvg:n,bbox:s}=await o(t,e,g(e)),d=s.width+e.padding,f=s.height+e.padding,p=[{x:-3*f/6,y:0},{x:d+3*f/6,y:0},{x:d,y:-f},{x:0,y:-f}],{cssStyles:y}=e;if("handDrawn"===e.look){let t=h.default.svg(n),r=(0,a.userNodeOverrides)(e,{}),i=u(p),s=t.path(i,r);l=n.insert(()=>s,":first-child").attr("transform",`translate(${-d/2}, ${f/2})`),y&&l.attr("style",y)}else l=I(n,d,f,p);return i&&l.attr("style",i),e.width=d,e.height=f,c(e,l),e.intersect=function(t){return B(e,p,t)},n}async function tX(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await o(t,e,g(e)),s=Math.max(60,n.width+(e.padding??0)*2,e?.width??0),d=Math.max(20,n.height+(e.padding??0)*2,e?.height??0),{cssStyles:f}=e,p=h.default.svg(i),y=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(y.roughness=0,y.fillStyle="solid");let m=[{x:-s/2*.8,y:-d/2},{x:s/2*.8,y:-d/2},{x:s/2,y:-d/2*.6},{x:s/2,y:d/2},{x:-s/2,y:d/2},{x:-s/2,y:-d/2*.6}],x=u(m),w=p.path(x,y),b=i.insert(()=>w,":first-child");return b.attr("class","basic label-container"),f&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",f),r&&"handDrawn"!==e.look&&b.selectChildren("path").attr("style",r),c(e,b),e.intersect=function(t){return B(e,m,t)},i}async function tQ(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:s,bbox:d,label:f}=await o(t,e,g(e)),p=(0,i.evaluate)((0,i.getConfig2)().flowchart?.htmlLabels),y=d.width+(e.padding??0),m=y+d.height,x=y+d.height,w=[{x:0,y:0},{x:x,y:0},{x:x/2,y:-m}],{cssStyles:b}=e,k=h.default.svg(s),$=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let M=u(w),S=k.path(M,$),_=s.insert(()=>S,":first-child").attr("transform",`translate(${-m/2}, ${m/2})`);return b&&"handDrawn"!==e.look&&_.selectChildren("path").attr("style",b),r&&"handDrawn"!==e.look&&_.selectChildren("path").attr("style",r),e.width=y,e.height=m,c(e,_),f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))}
8, ${m/2-(d.height+(e.padding??0)/(p?2:1)-(d.y-(d.top??0)))})`),e.intersect=function(t){return n.log.info("Triangle intersect",e,w,t),B(e,w,t)},s}async function tJ(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n,label:s}=await o(t,e,g(e)),d=Math.max(n.width+(e.padding??0)*2,e?.width??0),p=Math.max(n.height+(e.padding??0)*2,e?.height??0),y=p/8,m=p+y,{cssStyles:x}=e,w=70-d,b=w>0?w/2:0,k=h.default.svg(i),$=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let M=[{x:-d/2-b,y:m/2},...f(-d/2-b,m/2,d/2+b,m/2,y,.8),{x:d/2+b,y:-m/2},{x:-d/2-b,y:-m/2}],S=u(M),_=k.path(S,$),v=i.insert(()=>_,":first-child");return v.attr("class","basic label-container"),x&&"handDrawn"!==e.look&&v.selectAll("path").attr("style",x),r&&"handDrawn"!==e.look&&v.selectAll("path").attr("style",r),v.attr("transform",`translate(0,${-y/2})`),s.attr("transform",`translate(${-d/2+(e.padding??0)-(n.x-(n.left??0))},${-p/2+(e.padding??0)-y-(n.y-(n.top??0))})`),c(e,v),e.intersect=function(t){return B(e,M,t)},i}async function tY(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n}=await o(t,e,g(e)),s=Math.max(n.width+(e.padding??0)*2,e?.width??0),d=Math.max(n.height+(e.padding??0)*2,e?.height??0),p=s/d,y=s,m=d;y>m*p?m=y/p:y=m*p,y=Math.max(y,100);let x=Math.min(.2*(m=Math.max(m,50)),m/4),w=m+2*x,{cssStyles:b}=e,k=h.default.svg(i),$=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&($.roughness=0,$.fillStyle="solid");let M=[{x:-y/2,y:w/2},...f(-y/2,w/2,y/2,w/2,x,1),{x:y/2,y:-w/2},...f(y/2,-w/2,-y/2,-w/2,x,-1)],S=u(M),_=k.path(S,$),v=i.insert(()=>_,":first-child");return v.attr("class","basic label-container"),b&&"handDrawn"!==e.look&&v.selectAll("path").attr("style",b),r&&"handDrawn"!==e.look&&v.selectAll("path").attr("style",r),c(e,v),e.intersect=function(t){return B(e,M,t)},i}async function tK(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n,label:s}=await o(t,e,g(e)),d=Math.max(n.width+(e.padding??0)*2,e?.width??0),u=Math.max(n.height+(e.padding??0)*2,e?.height??0),f=-d/2,p=-u/2,{cssStyles:y}=e,m=h.default.svg(i),x=(0,a.userNodeOverrides)(e,{}),w=[{x:f-5,y:p-5},{x:f-5,y:p+u},{x:f+d,y:p+u},{x:f+d,y:p-5}],b=`M${f-5},${p-5} L${f+d},${p-5} L${f+d},${p+u} L${f-5},${p+u} L${f-5},${p-5} 9 M${f-5},${p} L${f+d},${p} 10 M${f},${p-5} L${f},${p+u}`;"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let k=m.path(b,x),$=i.insert(()=>k,":first-child");return $.attr("transform","translate(2.5, 2.5)"),$.attr("class","basic label-container"),y&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",y),r&&"handDrawn"!==e.look&&$.selectAll("path").attr("style",r),s.attr("transform",`translate(${-(n.width/2)+2.5-(n.x-(n.left??0))}, ${-(n.height/2)+2.5-(n.y-(n.top??0))})`),c(e,$),e.intersect=function(t){return B(e,w,t)},i}async function t0(t,e){if(e.alias&&(e.label=e.alias),"handDrawn"===e.look){let{themeVariables:a}=(0,i.getConfig)(),{background:l}=a,r={...e,id:e.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${l}`]};await t0(t,r)}let l=(0,i.getConfig)();e.useHtmlLabels=l.htmlLabels;let n=l.er?.diagramPadding??10,o=l.er?.entityPadding??6,{cssStyles:d}=e,{labelStyles:u,nodeStyles:f}=(0,a.styles2String)(e);if(0===e.attributes.length&&e.label){let a={rx:0,ry:0,labelPaddingX:n,labelPaddingY:1.5*n,classes:""};(0,r.calculateTextWidth)(e.label,l)+2*a.labelPaddingX<l.er.minEntityWidth&&(e.width=l.er.minEntityWidth);let s=await tf(t,e,a);if(!(0,i.evaluate)(l.htmlLabels)){let t=s.select("text"),e=t.node()?.getBBox();t.attr("transform",`translate(${-e.width/2}, 0)`)}return s}l.htmlLabels||(n*=1.25,o*=1.25);let p=g(e);p||(p="node default");let m=t.insert("g").attr("class",p).attr("id",e.domId||e.id),x=await t2(m,e.label??"",l,0,0,["name"],u);x.height+=o;let w=0,b=[],k=[],$=0,M=0,S=0,_=0,v=!0,D=!0;for(let t of e.attributes){let e=await t2(m,t.type,l,0,w,["attribute-type"],u);$=Math.max($,e.width+n);let a=await t2(m,t.name,l,0,w,["attribute-name"],u);M=Math.max(M,a.width+n);
10let r=await t2(m,t.keys.join(),l,0,w,["attribute-keys"],u);S=Math.max(S,r.width+n);let i=await t2(m,t.comment,l,0,w,["attribute-comment"],u);_=Math.max(_,i.width+n);let s=Math.max(e.height,a.height,r.height,i.height)+o;k.push({yOffset:w,rowHeight:s}),w+=s}let N=4;S<=n&&(v=!1,S=0,N--),_<=n&&(D=!1,_=0,N--);let C=m.node().getBBox();if(x.width+2*n-($+M+S+_)>0){let t=x.width+2*n-($+M+S+_);$+=t/N,M+=t/N,S>0&&(S+=t/N),_>0&&(_+=t/N)}let A=$+M+S+_,P=h.default.svg(m),O=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(O.roughness=0,O.fillStyle="solid");let B=0;k.length>0&&(B=k.reduce((t,e)=>t+(e?.rowHeight??0),0));let L=Math.max(C.width+2*n,e?.width||0,A),T=Math.max((B??0)+x.height,e?.height||0),R=-L/2,I=-T/2;m.selectAll("g:not(:first-child)").each((t,e,a)=>{let l=(0,s.select)(a[e]),r=l.attr("transform"),i=0,h=0;if(r){let t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(r);t&&(i=parseFloat(t[1]),h=parseFloat(t[2]),l.attr("class").includes("attribute-name")?i+=$:l.attr("class").includes("attribute-keys")?i+=$+M:l.attr("class").includes("attribute-comment")&&(i+=$+M+S))}l.attr("transform",`translate(${R+n/2+i}, ${h+I+x.height+o/2})`)}),m.select(".name").attr("transform","translate("+-x.width/2+", "+(I+o/2)+")");let W=P.rectangle(R,I,L,T,O),E=m.insert(()=>W,":first-child").attr("style",d.join("")),{themeVariables:z}=(0,i.getConfig)(),{rowEven:j,rowOdd:q,nodeBorder:H}=z;for(let[t,e]of(b.push(0),k.entries())){let a=(t+1)%2==0&&0!==e.yOffset,l=P.rectangle(R,x.height+I+e?.yOffset,L,e?.rowHeight,{...O,fill:a?j:q,stroke:H});m.insert(()=>l,"g.label").attr("style",d.join("")).attr("class",`row-rect-${a?"even":"odd"}`)}let F=P.line(R,x.height+I,L+R,x.height+I,O);for(let t of(m.insert(()=>F).attr("class","divider"),F=P.line($+R,x.height+I,$+R,T+I,O),m.insert(()=>F).attr("class","divider"),v&&(F=P.line($+M+R,x.height+I,$+M+R,T+I,O),m.insert(()=>F).attr("class","divider")),D&&(F=P.line($+M+S+R,x.height+I,$+M+S+R,T+I,O),m.insert(()=>F).attr("class","divider")),b))F=P.line(R,x.height+I+t,L+R,x.height+I+t,O),m.insert(()=>F).attr("class","divider");if(c(e,E),f&&"handDrawn"!==e.look){let t=f.split(";"),e=t?.filter(t=>t.includes("stroke"))?.map(t=>`${t}`).join("; ");m.selectAll("path").attr("style",e??""),m.selectAll(".row-rect-even path").attr("style",f)}return e.intersect=function(t){return y(e,t)},m}async function t2(t,e,a,n=0,h=0,o=[],d=""){let c=t.insert("g").attr("class",`label ${o.join(" ")}`).attr("transform",`translate(${n}, ${h})`).attr("style",d);e!==(0,i.parseGenericTypes)(e)&&(e=(e=(0,i.parseGenericTypes)(e)).replaceAll("<","<").replaceAll(">",">"));let g=c.node().appendChild(await (0,l.createText)(c,e,{width:(0,r.calculateTextWidth)(e,a)+100,style:d,useHtmlLabels:a.htmlLabels},a));if(e.includes("<")||e.includes(">")){let t=g.children[0];for(t.textContent=t.textContent.replaceAll("<","<").replaceAll(">",">");t.childNodes[0];)(t=t.childNodes[0]).textContent=t.textContent.replaceAll("<","<").replaceAll(">",">")}let u=g.getBBox();if((0,i.evaluate)(a.htmlLabels)){let t=g.children[0];t.style.textAlign="start";let e=(0,s.select)(g);u=t.getBoundingClientRect(),e.attr("width",u.width),e.attr("height",u.height)}return u}async function t1(t,e,a,l,r=a.class.padding??12){let i=3*!l,n=t.insert("g").attr("class",g(e)).attr("id",e.domId||e.id),s=null,h=null,o=null,d=null,c=0,u=0,f=0;if(s=n.insert("g").attr("class","annotation-group text"),e.annotations.length>0){let t=e.annotations[0];await t5(s,{text:`\xab${t}\xbb`},0),c=s.node().getBBox().height}h=n.insert("g").attr("class","label-group text"),await t5(h,e,0,["font-weight: bolder"]);let p=h.node().getBBox();u=p.height,o=n.insert("g").attr("class","members-group text");let y=0;for(let t of e.members){let e=await t5(o,t,y,[t.parseClassifier()]);y+=e+i}(f=o.node().getBBox().height)<=0&&(f=r/2),d=n.insert("g").attr("class","methods-group text");let m=0;for(let t of e.methods){let e=await t5(d,t,m,[t.parseClassifier()]);m+=e+i}let x=n.node().getBBox();if(null!==s){let t=s.node().getBBox();s.attr("transform",`translate(${-t.width/2})`)}return h.attr("transform",`translate(${-p.width/2}, ${c})`),x=n.node().getBBox(),o.attr("transform",`translate(0, ${c+u+2*r})`),x=n.node().getBBox(),d.attr("transform",`translate(0, ${c+u+(f?f+4*r:2*r)})`),x=n.node().getBBox(),{shapeSvg:n,bbox:x}}async function t5(t,e,a,h=[]){let o,d=t.insert("g").attr("class","label").attr("style",h.join("; ")),c=(0,i.getConfig)(),g="useHtmlLabels"in e?e.useHtmlLabels:(0,i.evaluate)(c.htmlLabels)??!0,u="";u="text"in e?e.text:e.label,!g&&u.startsWith("\\")&&(u=u.substring(1)),(0,i.hasKatex)(u)&&(g=!0);let f=await (0,l.createText)(d,(0,i.sanitizeText2)((0,r.decodeEntities)(u)),{width:(0,r.calculateTextWidth)(u,c)+50,classes:"markdown-node-label",useHtmlLabels:g},c),p=1;if(g){let t=f.children[0],e=(0,s.select)(f);p=t.innerHTML.split("<br>").length,t.innerHTML.includes("</math>")&&(p+=t.innerHTML.split("<mrow>").length-1);let a=t.getElementsByTagName("img");if(a){let t=""===u.replace(/<img[^>]*>/g,"").trim();await Promise.all([...a].map(e=>new Promise(a=>{function l(){if(e.style.display="flex",e.style.flexDirection="column",t){let t=5*parseInt(c.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,10)+"px";e.style.minWidth=t,e.style.maxWidth=t}else e.style.width="100%";a(e)}(0,n.__name)(l,"setupImage"),setTimeout(()=>{e.complete&&l()}),e.addEventListener("error",l),e.addEventListener("load",l)})))}o=t.getBoundingClientRect(),e.attr("width",o.width),e.attr("height",o.height)}else{h.includes("font-weight: bolder")&&(0,s.select)(f).selectAll("tspan").attr("font-weight",""),p=f.children.length;let t=f.children[0];(""===f.textContent||f.textContent.includes(">"))&&(t.textContent=u[0]+u.substring(1).replaceAll(">",">").replaceAll("<","<").trim()," "===u[1]&&(t.textContent=t.textContent[0]+" "+t.textContent.substring(1))),"undefined"===t.textContent&&(t.textContent=""),o=f.getBBox()}return d.attr("transform","translate(0,"+(-o.height/(2*p)+a)+")"),o.height}async function t3(t,e){let l=(0,i.getConfig2)(),r=l.class.padding??12,n=e.useHtmlLabels??(0,i.evaluate)(l.htmlLabels)??!0;e.annotations=e.annotations??[],e.members=e.members??[],e.methods=e.methods??[];let{shapeSvg:o,bbox:d}=await t1(t,e,l,n,r),{labelStyles:g,nodeStyles:u}=(0,a.styles2String)(e);e.labelStyle=g,e.cssStyles=e.styles||"";let f=e.styles?.join(";")||u||"";e.cssStyles||(e.cssStyles=f.replaceAll("!important","").split(";"));let p=0===e.members.length&&0===e.methods.length&&!l.class?.hideEmptyMembersBox,m=h.default.svg(o),x=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(x.roughness=0,x.fillStyle="solid");let w=d.width,b=d.height;0===e.members.length&&0===e.methods.length?b+=r:e.members.length>0&&0===e.methods.length&&(b+=2*r);let k=-w/2,$=-b/2,M=m.rectangle(k-r,$-r-(p?r:0===e.members.length&&0===e.methods.length?-r/2:0),w+2*r,b+2*r+(p?2*r:0===e.members.length&&0===e.methods.length?-r:0),x),S=o.insert(()=>M,":first-child");S.attr("class","basic label-container");let _=S.node().getBBox();o.selectAll(".text").each((t,a,l)=>{let i=(0,s.select)(l[a]),h=i.attr("transform"),d=0;
10if(h){let t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(h);t&&(d=parseFloat(t[2]))}let c=d+$+r-(p?r:0===e.members.length&&0===e.methods.length?-r/2:0);n||(c-=4);let g=k;(i.attr("class").includes("label-group")||i.attr("class").includes("annotation-group"))&&(g=-i.node()?.getBBox().width/2||0,o.selectAll("text").each(function(t,e,a){"middle"===window.getComputedStyle(a[e]).textAnchor&&(g=0)})),i.attr("transform",`translate(${g}, ${c})`)});let v=o.select(".annotation-group").node().getBBox().height-(p?r/2:0)||0,D=o.select(".label-group").node().getBBox().height-(p?r/2:0)||0,N=o.select(".members-group").node().getBBox().height-(p?r/2:0)||0;if(e.members.length>0||e.methods.length>0||p){let t=m.line(_.x,v+D+$+r,_.x+_.width,v+D+$+r,x);o.insert(()=>t).attr("class","divider").attr("style",f)}if(p||e.members.length>0||e.methods.length>0){let t=m.line(_.x,v+D+N+$+2*r+r,_.x+_.width,v+D+N+$+r+2*r,x);o.insert(()=>t).attr("class","divider").attr("style",f)}if("handDrawn"!==e.look&&o.selectAll("path").attr("style",f),S.select(":nth-child(2)").attr("style",f),o.selectAll(".divider").select("path").attr("style",f),e.labelStyle?o.selectAll("span").attr("style",e.labelStyle):o.selectAll("span").attr("style",f),!n){let t=RegExp(/color\s*:\s*([^;]*)/),e=t.exec(f);if(e){let t=e[0].replace("color","fill");o.selectAll("tspan").attr("style",t)}else if(g){let e=t.exec(g);if(e){let t=e[0].replace("color","fill");o.selectAll("tspan").attr("style",t)}}}return c(e,S),e.intersect=function(t){return y(e,t)},o}async function t8(t,e){let l,{labelStyles:r,nodeStyles:i}=(0,a.styles2String)(e);e.labelStyle=r;let n="verifyMethod"in e,o=g(e),d=t.insert("g").attr("class",o).attr("id",e.domId??e.id),u=l=n?await t4(d,`<<${e.type}>>`,0,e.labelStyle):await t4(d,"<<Element>>",0,e.labelStyle),f=await t4(d,e.name,u,e.labelStyle+"; font-weight: bold;");if(u+=f+20,n){let t=await t4(d,`${e.requirementId?`ID: ${e.requirementId}`:""}`,u,e.labelStyle);u+=t;let a=await t4(d,`${e.text?`Text: ${e.text}`:""}`,u,e.labelStyle);u+=a;let l=await t4(d,`${e.risk?`Risk: ${e.risk}`:""}`,u,e.labelStyle);u+=l,await t4(d,`${e.verifyMethod?`Verification: ${e.verifyMethod}`:""}`,u,e.labelStyle)}else{let t=await t4(d,`${e.type?`Type: ${e.type}`:""}`,u,e.labelStyle);u+=t,await t4(d,`${e.docRef?`Doc Ref: ${e.docRef}`:""}`,u,e.labelStyle)}let p=(d.node()?.getBBox().width??200)+20,m=(d.node()?.getBBox().height??200)+20,x=-p/2,w=-m/2,b=h.default.svg(d),k=(0,a.userNodeOverrides)(e,{});"handDrawn"!==e.look&&(k.roughness=0,k.fillStyle="solid");let $=b.rectangle(x,w,p,m,k),M=d.insert(()=>$,":first-child");if(M.attr("class","basic label-container").attr("style",i),d.selectAll(".label").each((t,e,a)=>{let l=(0,s.select)(a[e]),r=l.attr("transform"),i=0,n=0;if(r){let t=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(r);t&&(i=parseFloat(t[1]),n=parseFloat(t[2]))}let h=n-m/2,o=x+10;(0===e||1===e)&&(o=i),l.attr("transform",`translate(${o}, ${h+20})`)}),u>l+f+20){let t=b.line(x,w+l+f+20,x+p,w+l+f+20,k);d.insert(()=>t).attr("style",i)}return c(e,M),e.intersect=function(t){return y(e,t)},d}async function t4(t,e,a,n=""){let h;if(""===e)return 0;let o=t.insert("g").attr("class","label").attr("style",n),d=(0,i.getConfig2)(),c=d.htmlLabels??!0,g=await (0,l.createText)(o,(0,i.sanitizeText2)((0,r.decodeEntities)(e)),{width:(0,r.calculateTextWidth)(e,d)+50,classes:"markdown-node-label",useHtmlLabels:c,style:n},d);if(c){let t=g.children[0],e=(0,s.select)(g);h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}else{for(let t of g.children[0].children)t.textContent=t.textContent.replaceAll(">",">").replaceAll("<","<"),n&&t.setAttribute("style",n);h=g.getBBox(),h.height+=6}return o.attr("transform",`translate(${-h.width/2},${-h.height/2+a})`),h.height}(0,n.__name)(tU,"tiltedCylinder"),(0,n.__name)(tZ,"trapezoid"),(0,n.__name)(tX,"trapezoidalPentagon"),(0,n.__name)(tQ,"triangle"),(0,n.__name)(tJ,"waveEdgedRectangle"),(0,n.__name)(tY,"waveRectangle"),(0,n.__name)(tK,"windowPane"),(0,n.__name)(t0,"erBox"),(0,n.__name)(t2,"addText"),(0,n.__name)(t1,"textHelper"),(0,n.__name)(t5,"addText"),(0,n.__name)(t3,"classBox"),(0,n.__name)(t8,"requirementBox"),(0,n.__name)(t4,"addText");var t9=(0,n.__name)(t=>{switch(t){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 t6(t,e,{config:l}){let r,i,n,s,{labelStyles:u,nodeStyles:f}=(0,a.styles2String)(e);e.labelStyle=u||"";let p=e.width;e.width=(e.width??200)-10;let{shapeSvg:m,bbox:x,label:w}=await o(t,e,g(e)),k=e.padding||10,$="";"ticket"in e&&e.ticket&&l?.kanban?.ticketBaseUrl&&($=l?.kanban?.ticketBaseUrl.replace("#TICKET#",e.ticket),r=m.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",$).attr("target","_blank"));let M={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1};r?{label:i,bbox:n}=await d(r,"ticket"in e&&e.ticket||"",M):{label:i,bbox:n}=await d(m,"ticket"in e&&e.ticket||"",M);let{label:S,bbox:_}=await d(m,"assigned"in e&&e.assigned||"",M);e.width=p;let v=e?.width||0,D=Math.max(n.height,_.height)/2,N=Math.max(x.height+20,e?.height||0)+D,C=-v/2,A=-N/2;w.attr("transform","translate("+(k-v/2)+", "+(-D-x.height/2)+")"),i.attr("transform","translate("+(k-v/2)+", "+(-D+x.height/2)+")"),S.attr("transform","translate("+(k+v/2-_.width-20)+", "+(-D+x.height/2)+")");let{rx:P,ry:O}=e,{cssStyles:B}=e;
10if("handDrawn"===e.look){let t=h.default.svg(m),l=(0,a.userNodeOverrides)(e,{}),r=P||O?t.path(b(C,A,v,N,P||0),l):t.rectangle(C,A,v,N,l);(s=m.insert(()=>r,":first-child")).attr("class","basic label-container").attr("style",B||null)}else{(s=m.insert("rect",":first-child")).attr("class","basic label-container __APA__").attr("style",f).attr("rx",P??5).attr("ry",O??5).attr("x",C).attr("y",A).attr("width",v).attr("height",N);let t="priority"in e&&e.priority;if(t){let e=m.append("line"),a=C+2,l=A+Math.floor((P??0)/2),r=A+N-Math.floor((P??0)/2);e.attr("x1",a).attr("y1",l).attr("x2",a).attr("y2",r).attr("stroke-width","4").attr("stroke",t9(t))}}return c(e,s),e.height=N,e.intersect=function(t){return y(e,t)},m}async function t7(t,e){let l,{labelStyles:i,nodeStyles:s}=(0,a.styles2String)(e);e.labelStyle=i;let{shapeSvg:d,bbox:u,halfPadding:f,label:p}=await o(t,e,g(e)),m=u.width+10*f,x=u.height+8*f,w=.15*m,{cssStyles:b}=e,k=u.width+20,$=u.height+20,M=Math.max(m,k),S=Math.max(x,$);p.attr("transform",`translate(${-u.width/2}, ${-u.height/2})`);let _=`M0 0 11 a${w},${w} 1 0,0 ${.25*M},${-1*S*.1} 12 a${w},${w} 1 0,0 ${.25*M},0 13 a${w},${w} 1 0,0 ${.25*M},0 14 a${w},${w} 1 0,0 ${.25*M},${.1*S} 15 16 a${w},${w} 1 0,0 ${.15*M},${.33*S} 17 a${.8*w},${.8*w} 1 0,0 0,${.34*S} 18 a${w},${w} 1 0,0 ${-1*M*.15},${.33*S} 19 20 a${w},${w} 1 0,0 ${-1*M*.25},${.15*S} 21 a${w},${w} 1 0,0 ${-1*M*.25},0 22 a${w},${w} 1 0,0 ${-1*M*.25},0 23 a${w},${w} 1 0,0 ${-1*M*.25},${-1*S*.15} 24 25 a${w},${w} 1 0,0 ${-1*M*.1},${-1*S*.33} 26 a${.8*w},${.8*w} 1 0,0 0,${-1*S*.34} 27 a${w},${w} 1 0,0 ${.1*M},${-1*S*.33} 28 H0 V0 Z`;if("handDrawn"===e.look){let t=h.default.svg(d),i=(0,a.userNodeOverrides)(e,{}),n=t.path(_,i);(l=d.insert(()=>n,":first-child")).attr("class","basic label-container").attr("style",(0,r.handleUndefinedAttr)(b))}else l=d.insert("path",":first-child").attr("class","basic label-container").attr("style",s).attr("d",_);return l.attr("transform",`translate(${-M/2}, ${-S/2})`),c(e,l),e.calcIntersect=function(t,e){return y(t,e)},e.intersect=function(t){return n.log.info("Bang intersect",e,t),y(e,t)},d}async function et(t,e){let l,{labelStyles:i,nodeStyles:s}=(0,a.styles2String)(e);e.labelStyle=i;let{shapeSvg:d,bbox:u,halfPadding:f,label:p}=await o(t,e,g(e)),m=u.width+2*f,x=u.height+2*f,w=.15*m,b=.25*m,k=.35*m,$=.2*m,{cssStyles:M}=e,S=`M0 0 29 a${w},${w} 0 0,1 ${.25*m},${-1*m*.1} 30 a${k},${k} 1 0,1 ${.4*m},${-1*m*.1} 31 a${b},${b} 1 0,1 ${.35*m},${.2*m} 32 33 a${w},${w} 1 0,1 ${.15*m},${.35*x} 34 a${$},${$} 1 0,1 ${-1*m*.15},${.65*x} 35 36 a${b},${w} 1 0,1 ${-1*m*.25},${.15*m} 37 a${k},${k} 1 0,1 ${-1*m*.5},0 38 a${w},${w} 1 0,1 ${-1*m*.25},${-1*m*.15} 39 40 a${w},${w} 1 0,1 ${-1*m*.1},${-1*x*.35} 41 a${$},${$} 1 0,1 ${.1*m},${-1*x*.65} 42 H0 V0 Z`;if("handDrawn"===e.look){let t=h.default.svg(d),i=(0,a.userNodeOverrides)(e,{}),n=t.path(S,i);(l=d.insert(()=>n,":first-child")).attr("class","basic label-container").attr("style",(0,r.handleUndefinedAttr)(M))}else l=d.insert("path",":first-child").attr("class","basic label-container").attr("style",s).attr("d",S);return p.attr("transform",`translate(${-u.width/2}, ${-u.height/2})`),l.attr("transform",`translate(${-m/2}, ${-x/2})`),c(e,l),e.calcIntersect=function(t,e){return y(t,e)},e.intersect=function(t){return n.log.info("Cloud intersect",e,t),y(e,t)},d}async function ee(t,e){let{labelStyles:l,nodeStyles:r}=(0,a.styles2String)(e);e.labelStyle=l;let{shapeSvg:i,bbox:n,halfPadding:s,label:h}=await o(t,e,g(e)),d=n.width+8*s,u=n.height+2*s,f=` 43 M${-d/2} ${u/2-5} 44 v${-u+10} 45 q0,-5 5,-5 46 h${d-10} 47 q5,0 5,5 48 v${u-10} 49 q0,5 -5,5 50 h${-d+10} 51 q-5,0 -5,-5 52 Z 53 `,p=i.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+e.type).attr("style",r).attr("d",f);return i.append("line").attr("class","node-line-").attr("x1",-d/2).attr("y1",u/2).attr("x2",d/2).attr("y2",u/2),h.attr("transform",`translate(${-n.width/2}, ${-n.height/2})`),i.append(()=>h.node()),c(e,p),e.calcIntersect=function(t,e){return y(t,e)},e.intersect=function(t){return y(e,t)},i}async function ea(t,e){let a={padding:e.padding??0};return z(t,e,a)}(0,n.__name)(t6,"kanbanItem"),(0,n.__name)(t7,"bang"),(0,n.__name)(et,"cloud"),(0,n.__name)(ee,"defaultMindmapNode"),(0,n.__name)(ea,"mindmapCircle");var el=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:tT},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:tO},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:tR},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","
53subproc","framed-rectangle","subroutine"],handler:tz},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:K},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:z},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:t7},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:et},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:tN},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:tn},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:tm},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:ty},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:tZ},{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:tu},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:te},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:tH}
53,{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:W},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:tB},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:tE},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:tW},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:tr},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:ts},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:F},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:V},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Z},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:tx}
53,{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:tJ},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:ti},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:tU},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:t$},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:X},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:tt},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:tQ},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:tK},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:ta},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:tX},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:tl},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:tL},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:t_},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:tS},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:R},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:q},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:tq},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:tj},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:tY},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:tC},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:tM}],er=(0,n.__name)(()=>Object.fromEntries([...Object.entries({state:tI,choice:E,note:tv,rectWithTitle:tA,labelRect:tp,iconSquare:tc,iconCircle:to,icon:th,iconRounded:td,imageSquare:tg,anchor:L,kanbanItem:t6,mindmapCircle:ea,defaultMindmapNode:ee,classBox:t3,erBox:t0,requirementBox:t8}),...el.flatMap(t=>[t.shortName,..."aliases"in t?t.aliases:[],..."internalAliases"in t?t.internalAliases:[]].map(e=>[e,t.handler]))]),"generateShapeMap")();function ei(t){return t in er}(0,n.__name)(ei,"isValidShape");var en=new Map;async function es(t,e,a){let l,r;"rect"===e.shape&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");let i=e.shape?er[e.shape]:void 0;if(!i)throw Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let n;"sandbox"===a.config.securityLevel?n="_top":e.linkTarget&&(n=e.linkTarget||"_blank"),l=t.insert("svg:a").attr("xlink:href",e.link).attr("target",n??null),r=await i(l,e,a)}else l=r=await i(t,e,a);return e.tooltip&&r.attr("title",e.tooltip),en.set(e.id,l),e.haveCallback&&l.attr("class",l.attr("class")+" clickable"),l}
53(0,n.__name)(es,"insertNode");var eh=(0,n.__name)((t,e)=>{en.set(e.id,t)},"setNodeElem"),eo=(0,n.__name)(()=>{en.clear()},"clear"),ed=(0,n.__name)(t=>{let e=en.get(t.id);n.log.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");let a=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+a-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),a},"positionNode");t.s(["clear",0,N,"clear2",0,eo,"createLabel_default",0,w,"insertCluster",0,D,"insertNode",0,es,"isValidShape",0,ei,"labelHelper",0,o,"positionNode",0,ed,"setNodeElem",0,eh,"updateNodeBounds",0,c])},535309,t=>{"use strict";function e(t,e,a){if(t&&t.length){let[l,r]=e,i=Math.PI/180*a,n=Math.cos(i),s=Math.sin(i);for(let e of t){let[t,a]=e;e[0]=(t-l)*n-(a-r)*s+l,e[1]=(t-l)*s+(a-r)*n+r}}}function a(t,a){var l;let r=a.hachureAngle+90,i=a.hachureGap;i<0&&(i=4*a.strokeWidth),i=Math.round(Math.max(i,.1));let n=1;return a.roughness>=1&&((null==(l=a.randomizer)?void 0:l.next())||Math.random())>.7&&(n=i),function(t,a,l,r=1){let i=Math.max(a,.1),n=t[0]&&t[0][0]&&"number"==typeof t[0][0]?[t]:t,s=[0,0];if(l)for(let t of n)e(t,s,l);let h=function(t,e,a){let l=[];for(let e of t){var r,i;let t=[...e];r=t[0],i=t[t.length-1],r[0]===i[0]&&r[1]===i[1]||t.push([t[0][0],t[0][1]]),t.length>2&&l.push(t)}let n=[];e=Math.max(e,.1);let s=[];for(let t of l)for(let e=0;e<t.length-1;e++){let a=t[e],l=t[e+1];if(a[1]!==l[1]){let t=Math.min(a[1],l[1]);s.push({ymin:t,ymax:Math.max(a[1],l[1]),x:t===a[1]?a[0]:l[0],islope:(l[0]-a[0])/(l[1]-a[1])})}}if(s.sort((t,e)=>t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax)),!s.length)return n;let h=[],o=s[0].ymin,d=0;for(;h.length||s.length;){if(s.length){let t=-1;for(let e=0;e<s.length&&!(s[e].ymin>o);e++)t=e;s.splice(0,t+1).forEach(t=>{h.push({s:o,edge:t})})}if((h=h.filter(t=>!(t.edge.ymax<=o))).sort((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x)),(1!==a||d%e==0)&&h.length>1)for(let t=0;t<h.length;t+=2){let e=t+1;if(e>=h.length)break;let a=h[t].edge,l=h[e].edge;n.push([[Math.round(a.x),o],[Math.round(l.x),o]])}o+=a,h.forEach(t=>{t.edge.x=t.edge.x+a*t.edge.islope}),d++}return n}(n,i,r);if(l){let t;for(let t of n)e(t,s,-l);t=[],h.forEach(e=>t.push(...e)),e(t,s,-l)}return h}(t,i,r,n||1)}class l{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){let l=a(t,e);return{type:"fillSketch",ops:this.renderLines(l,e)}}renderLines(t,e){let a=[];for(let l of t)a.push(...this.helper.doubleLineOps(l[0][0],l[0][1],l[1][0],l[1][1],e));return a}}function r(t){let e=t[0],a=t[1];return Math.sqrt(Math.pow(e[0]-a[0],2)+Math.pow(e[1]-a[1],2))}class i extends l{fillPolygons(t,e){let l=e.hachureGap;l<0&&(l=4*e.strokeWidth);let i=a(t,Object.assign({},e,{hachureGap:l=Math.max(l,.1)})),n=Math.PI/180*e.hachureAngle,s=[],h=.5*l*Math.cos(n),o=.5*l*Math.sin(n);for(let[t,e]of i)r([t,e])&&s.push([[t[0]-h,t[1]+o],[...e]],[[t[0]+h,t[1]-o],[...e]]);return{type:"fillSketch",ops:this.renderLines(s,e)}}}class n extends l{fillPolygons(t,e){let a=this._fillPolygons(t,e),l=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),r=this._fillPolygons(t,l);return a.ops=a.ops.concat(r.ops),a}}class s{constructor(t){this.helper=t}fillPolygons(t,e){let l=a(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(l,e)}dotsOnLines(t,e){let a=[],l=e.hachureGap;l<0&&(l=4*e.strokeWidth),l=Math.max(l,.1);let i=e.fillWeight;i<0&&(i=e.strokeWidth/2);let n=l/4;for(let s of t){let t=r(s),h=Math.ceil(t/l)-1,o=t-h*l,d=(s[0][0]+s[1][0])/2-l/4,c=Math.min(s[0][1],s[1][1]);for(let t=0;t<h;t++){let r=d-n+2*Math.random()*n,s=c+o+t*l-n+2*Math.random()*n,h=this.helper.ellipse(r,s,i,i,e);a.push(...h.ops)}}return{type:"fillSketch",ops:a}}}class h{constructor(t){this.helper=t}fillPolygons(t,e){let l=a(t,e);return{type:"fillSketch",ops:this.dashedLine(l,e)}}dashedLine(t,e){let a=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,l=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,i=[];return t.forEach(t=>{let n=r(t),s=Math.floor(n/(a+l)),h=(n+l-s*(a+l))/2,o=t[0],d=t[1];o[0]>d[0]&&(o=t[1],d=t[0]);let c=Math.atan((d[1]-o[1])/(d[0]-o[0]));for(let t=0;t<s;t++){let r=t*(a+l),n=r+a,s=[o[0]+r*Math.cos(c)+h*Math.cos(c),o[1]+r*Math.sin(c)+h*Math.sin(c)],d=[o[0]+n*Math.cos(c)+h*Math.cos(c),o[1]+n*Math.sin(c)+h*Math.sin(c)];i.push(...this.helper.doubleLineOps(s[0],s[1],d[0],d[1],e))}}),i}}class o{constructor(t){this.helper=t}fillPolygons(t,e){let l=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,r=e.zigzagOffset<0?l:e.zigzagOffset,i=a(t,e=Object.assign({},e,{hachureGap:l+r}));return{type:"fillSketch",ops:this.zigzagLines(i,r,e)}}zigzagLines(t,e,a){let l=[];return t.forEach(t=>{let i=Math.round(r(t)/(2*e)),n=t[0],s=t[1];n[0]>s[0]&&(n=t[1],s=t[0]);let h=Math.atan((s[1]-n[1])/(s[0]-n[0]));for(let t=0;t<i;t++){let r=2*t*e,i=2*(t+1)*e,s=Math.sqrt(2*Math.pow(e,2)),o=[n[0]+r*Math.cos(h),n[1]+r*Math.sin(h)],d=[n[0]+i*Math.cos(h),n[1]+i*Math.sin(h)],c=[o[0]+s*Math.cos(h+Math.PI/4),o[1]+s*Math.sin(h+Math.PI/4)];
53l.push(...this.helper.doubleLineOps(o[0],o[1],c[0],c[1],a),...this.helper.doubleLineOps(c[0],c[1],d[0],d[1],a))}}),l}}let d={};class c{constructor(t){this.seed=t}next(){return this.seed?(0x80000000-1&(this.seed=Math.imul(48271,this.seed)))/0x80000000:Math.random()}}let g={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function u(t){let e=[],a=function(t){let e=[];for(;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:0,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:1,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length)}return e[e.length]={type:2,text:""},e}(t),l="BOD",r=0,i=a[0];for(;2!==i.type;){let n=0,s=[];if("BOD"===l){if("M"!==i.text&&"m"!==i.text)return u("M0,0"+t);r++,n=g[i.text],l=i.text}else 1===i.type?n=g[l]:(r++,n=g[i.text],l=i.text);if(!(r+n<a.length))throw Error("Path data ended short");for(let t=r;t<r+n;t++){let e=a[t];
53if(1!==e.type)throw Error("Param not a number: "+l+","+e.text);s[s.length]=+e.text}if("number"!=typeof g[l])throw Error("Bad segment: "+l);{let t={key:l,data:s};e.push(t),r+=n,i=a[r],"M"===l&&(l="L"),"m"===l&&(l="l")}}return e}function f(t){let e=0,a=0,l=0,r=0,i=[];for(let{key:n,data:s}of t)switch(n){case"M":i.push({key:"M",data:[...s]}),[e,a]=s,[l,r]=s;break;case"m":e+=s[0],a+=s[1],i.push({key:"M",data:[e,a]}),l=e,r=a;break;case"L":i.push({key:"L",data:[...s]}),[e,a]=s;break;case"l":e+=s[0],a+=s[1],i.push({key:"L",data:[e,a]});break;case"C":i.push({key:"C",data:[...s]}),e=s[4],a=s[5];break;case"c":{let t=s.map((t,l)=>l%2?t+a:t+e);i.push({key:"C",data:t}),e=t[4],a=t[5];break}case"Q":i.push({key:"Q",data:[...s]}),e=s[2],a=s[3];break;case"q":{let t=s.map((t,l)=>l%2?t+a:t+e);i.push({key:"Q",data:t}),e=t[2],a=t[3];break}case"A":i.push({key:"A",data:[...s]}),e=s[5],a=s[6];break;case"a":e+=s[5],a+=s[6],i.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],e,a]});break;case"H":i.push({key:"H",data:[...s]}),e=s[0];break;case"h":e+=s[0],i.push({key:"H",data:[e]});break;case"V":i.push({key:"V",data:[...s]}),a=s[0];break;case"v":a+=s[0],i.push({key:"V",data:[a]});break;case"S":i.push({key:"S",data:[...s]}),e=s[2],a=s[3];break;case"s":{let t=s.map((t,l)=>l%2?t+a:t+e);i.push({key:"S",data:t}),e=t[2],a=t[3];break}case"T":i.push({key:"T",data:[...s]}),e=s[0],a=s[1];break;case"t":e+=s[0],a+=s[1],i.push({key:"T",data:[e,a]});break;case"Z":case"z":i.push({key:"Z",data:[]}),e=l,a=r}return i}function p(t){let e=[],a="",l=0,r=0,i=0,n=0,s=0,h=0;for(let{key:o,data:d}of t){switch(o){case"M":e.push({key:"M",data:[...d]}),[l,r]=d,[i,n]=d;break;case"C":e.push({key:"C",data:[...d]}),l=d[4],r=d[5],s=d[2],h=d[3];break;case"L":e.push({key:"L",data:[...d]}),[l,r]=d;break;case"H":l=d[0],e.push({key:"L",data:[l,r]});break;case"V":r=d[0],e.push({key:"L",data:[l,r]});break;case"S":{let t=0,i=0;"C"===a||"S"===a?(t=l+(l-s),i=r+(r-h)):(t=l,i=r),e.push({key:"C",data:[t,i,...d]}),s=d[0],h=d[1],l=d[2],r=d[3];break}case"T":{let[t,i]=d,n=0,o=0;"Q"===a||"T"===a?(n=l+(l-s),o=r+(r-h)):(n=l,o=r);let c=l+2*(n-l)/3,g=r+2*(o-r)/3,u=t+2*(n-t)/3,f=i+2*(o-i)/3;e.push({key:"C",data:[c,g,u,f,t,i]}),s=n,h=o,l=t,r=i;break}case"Q":{let[t,a,i,n]=d,o=l+2*(t-l)/3,c=r+2*(a-r)/3,g=i+2*(t-i)/3,u=n+2*(a-n)/3;e.push({key:"C",data:[o,c,g,u,i,n]}),s=t,h=a,l=i,r=n;break}case"A":{let t=Math.abs(d[0]),a=Math.abs(d[1]),i=d[2],n=d[3],s=d[4],h=d[5],o=d[6];0===t||0===a?(e.push({key:"C",data:[l,r,h,o,h,o]}),l=h,r=o):(l!==h||r!==o)&&((function t(e,a,l,r,i,n,s,h,o,d){let c=Math.PI*s/180,g=[],u=0,f=0,p=0,m=0;if(d)[u,f,p,m]=d;else{[e,a]=y(e,a,-c),[l,r]=y(l,r,-c);let t=(e-l)/2,s=(a-r)/2,d=t*t/(i*i)+s*s/(n*n);d>1&&(i*=d=Math.sqrt(d),n*=d);let g=i*i,x=n*n,w=(h===o?-1:1)*Math.sqrt(Math.abs((g*x-g*s*s-x*t*t)/(g*s*s+x*t*t)));p=w*i*s/n+(e+l)/2,m=-(w*n)*t/i+(a+r)/2,u=Math.asin(parseFloat(((a-m)/n).toFixed(9))),f=Math.asin(parseFloat(((r-m)/n).toFixed(9))),e<p&&(u=Math.PI-u),l<p&&(f=Math.PI-f),u<0&&(u=2*Math.PI+u),f<0&&(f=2*Math.PI+f),o&&u>f&&(u-=2*Math.PI),!o&&f>u&&(f-=2*Math.PI)}let x=f-u;if(Math.abs(x)>120*Math.PI/180){let e=f,a=l,h=r;g=t(l=p+i*Math.cos(f=o&&f>u?u+120*Math.PI/180*1:u+-(120*Math.PI/180*1)),r=m+n*Math.sin(f),a,h,i,n,s,0,o,[f,e,p,m])}x=f-u;let w=Math.cos(u),b=Math.cos(f),k=Math.tan(x/4),$=4/3*i*k,M=4/3*n*k,S=[e,a],_=[e+$*Math.sin(u),a-M*w],v=[l+$*Math.sin(f),r-M*b],D=[l,r];if(_[0]=2*S[0]-_[0],_[1]=2*S[1]-_[1],d)return[_,v,D].concat(g);{g=[_,v,D].concat(g);let t=[];for(let e=0;e<g.length;e+=3){let a=y(g[e][0],g[e][1],c),l=y(g[e+1][0],g[e+1][1],c),r=y(g[e+2][0],g[e+2][1],c);t.push([a[0],a[1],l[0],l[1],r[0],r[1]])}return t}})(l,r,h,o,t,a,i,n,s).forEach(function(t){e.push({key:"C",data:t})}),l=h,r=o);break}case"Z":e.push({key:"Z",data:[]}),l=i,r=n}a=o}return e}function y(t,e,a){return[t*Math.cos(a)-e*Math.sin(a),t*Math.sin(a)+e*Math.cos(a)]}let m={randOffset:function(t,e){return A(t,e)},randOffsetWithRange:function(t,e,a){return C(t,e,a)},ellipse:function(t,e,a,l,r){let i=k(a,l,r);return $(t,e,r,i).opset},doubleLineOps:function(t,e,a,l,r){return P(t,e,a,l,r,!0)}};function x(t,e,a,l,r){return{type:"path",ops:P(t,e,a,l,r)}}function w(t,e,a){let l=(t||[]).length;if(l>2){let r=[];for(let e=0;e<l-1;
53e++)r.push(...P(t[e][0],t[e][1],t[e+1][0],t[e+1][1],a));return e&&r.push(...P(t[l-1][0],t[l-1][1],t[0][0],t[0][1],a)),{type:"path",ops:r}}return 2===l?x(t[0][0],t[0][1],t[1][0],t[1][1],a):{type:"path",ops:[]}}function b(t,e){if(t.length){let a="number"==typeof t[0][0]?[t]:t,l=B(a[0],+(1+.2*e.roughness),e),r=e.disableMultiStroke?[]:B(a[0],1.5*(1+.22*e.roughness),D(e));for(let t=1;t<a.length;t++){let i=a[t];if(i.length){let t=B(i,+(1+.2*e.roughness),e),a=e.disableMultiStroke?[]:B(i,1.5*(1+.22*e.roughness),D(e));for(let e of t)"move"!==e.op&&l.push(e);for(let t of a)"move"!==t.op&&r.push(t)}}return{type:"path",ops:l.concat(r)}}return{type:"path",ops:[]}}function k(t,e,a){let l=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),r=2*Math.PI/Math.ceil(Math.max(a.curveStepCount,a.curveStepCount/Math.sqrt(200)*l)),i=Math.abs(t/2),n=Math.abs(e/2),s=1-a.curveFitting;return i+=A(i*s,a),n+=A(n*s,a),{increment:r,rx:i,ry:n}}function $(t,e,a,l){let[r,i]=T(l.increment,t,e,l.rx,l.ry,1,l.increment*C(.1,C(.4,1,a),a),a),n=L(r,null,a);if(!a.disableMultiStroke&&0!==a.roughness){let[r]=T(l.increment,t,e,l.rx,l.ry,1.5,0,a),i=L(r,null,a);n=n.concat(i)}return{estimatedPoints:i,opset:{type:"path",ops:n}}}function M(t,e,a,l,r,i,n,s,h){let o=Math.abs(a/2),d=Math.abs(l/2);o+=A(.01*o,h),d+=A(.01*d,h);let c=r,g=i;for(;c<0;)c+=2*Math.PI,g+=2*Math.PI;g-c>2*Math.PI&&(c=0,g=2*Math.PI);let u=Math.min(2*Math.PI/h.curveStepCount/2,(g-c)/2),f=R(u,t,e,o,d,c,g,1,h);if(!h.disableMultiStroke){let a=R(u,t,e,o,d,c,g,1.5,h);f.push(...a)}return n&&(s?f.push(...P(t,e,t+o*Math.cos(c),e+d*Math.sin(c),h),...P(t,e,t+o*Math.cos(g),e+d*Math.sin(g),h)):f.push({op:"lineTo",data:[t,e]},{op:"lineTo",data:[t+o*Math.cos(c),e+d*Math.sin(c)]})),{type:"path",ops:f}}function S(t,e){let a=p(f(u(t))),l=[],r=[0,0],i=[0,0];for(let{key:t,data:n}of a)switch(t){case"M":i=[n[0],n[1]],r=[n[0],n[1]];break;case"L":l.push(...P(i[0],i[1],n[0],n[1],e)),i=[n[0],n[1]];break;case"C":{let[t,a,r,s,h,o]=n;l.push(...function(t,e,a,l,r,i,n,s){let h=[],o=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],d=[0,0],c=s.disableMultiStroke?1:2,g=s.preserveVertices;for(let u=0;u<c;u++)0===u?h.push({op:"move",data:[n[0],n[1]]}):h.push({op:"move",data:[n[0]+(g?0:A(o[0],s)),n[1]+(g?0:A(o[0],s))]}),d=g?[r,i]:[r+A(o[u],s),i+A(o[u],s)],h.push({op:"bcurveTo",data:[t+A(o[u],s),e+A(o[u],s),a+A(o[u],s),l+A(o[u],s),d[0],d[1]]});return h}(t,a,r,s,h,o,i,e)),i=[h,o];break}case"Z":l.push(...P(i[0],i[1],r[0],r[1],e)),i=[r[0],r[1]]}return{type:"path",ops:l}}function _(t,e){let a=[];for(let l of t)if(l.length){let t=e.maxRandomnessOffset||0,r=l.length;if(r>2){a.push({op:"move",data:[l[0][0]+A(t,e),l[0][1]+A(t,e)]});for(let i=1;i<r;i++)a.push({op:"lineTo",data:[l[i][0]+A(t,e),l[i][1]+A(t,e)]})}}return{type:"fillPath",ops:a}}function v(t,e){return(function(t,e){let a=t.fillStyle||"hachure";if(!d[a])switch(a){case"zigzag":d[a]||(d[a]=new i(e));break;case"cross-hatch":d[a]||(d[a]=new n(e));break;case"dots":d[a]||(d[a]=new s(e));break;case"dashed":d[a]||(d[a]=new h(e));break;case"zigzag-line":d[a]||(d[a]=new o(e));break;default:d[a="hachure"]||(d[a]=new l(e))}return d[a]})(e,m).fillPolygons(t,e)}function D(t){let e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function N(t){return t.randomizer||(t.randomizer=new c(t.seed||0)),t.randomizer.next()}function C(t,e,a,l=1){return a.roughness*l*(N(a)*(e-t)+t)}function A(t,e,a=1){return C(-t,t,e,a)}function P(t,e,a,l,r,i=!1){let n=i?r.disableMultiStrokeFill:r.disableMultiStroke,s=O(t,e,a,l,r,!0,!1);if(n)return s;let h=O(t,e,a,l,r,!0,!0);return s.concat(h)}function O(t,e,a,l,r,i,n){let s=Math.pow(t-a,2)+Math.pow(e-l,2),h=Math.sqrt(s),o=1;o=h<200?1:h>500?.4:-.0016668*h+1.233334;let d=r.maxRandomnessOffset||0;d*d*100>s&&(d=h/10);let c=d/2,g=.2+.2*N(r),u=r.bowing*r.maxRandomnessOffset*(l-e)/200,f=r.bowing*r.maxRandomnessOffset*(t-a)/200;u=A(u,r,o),f=A(f,r,o);let p=[],y=r.preserveVertices;return i&&(n?p.push({op:"move",data:[t+(y?0:A(c,r,o)),e+(y?0:A(c,r,o))]}):p.push({op:"move",data:[t+(y?0:A(d,r,o)),e+(y?0:A(d,r,o))]})),n?p.push({op:"bcurveTo",data:[u+t+(a-t)*g+A(c,r,o),f+e+(l-e)*g+A(c,r,o),u+t+2*(a-t)*g+A(c,r,o),f+e+2*(l-e)*g+A(c,r,o),a+(y?0:A(c,r,o)),l+(y?0:A(c,r,o))]}):p.push({op:"bcurveTo",data:[u+t+(a-t)*g+A(d,r,o),f+e+(l-e)*g+A(d,r,o),u+t+2*(a-t)*g+A(d,r,o),f+e+2*(l-e)*g+A(d,r,o),a+(y?0:A(d,r,o)),l+(y?0:A(d,r,o))]}),p}function B(t,e,a){if(!t.length)return[];let l=[];l.push([t[0][0]+A(e,a),t[0][1]+A(e,a)]),l.push([t[0][0]+A(e,a),t[0][1]+A(e,a)]);for(let r=1;r<t.length;r++)l.push([t[r][0]+A(e,a),t[r][1]+A(e,a)]),r===t.length-1&&l.push([t[r][0]+A(e,a),t[r][1]+A(e,a)]);return L(l,null,a)}function L(t,e,a){let l=t.length,r=[];if(l>3){let i=[],n=1-a.curveTightness;r.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+2<l;e++){let a=t[e];i[0]=[a[0],a[1]],i[1]=[a[0]+(n*t[e+1][0]-n*t[e-1][0])/6,a[1]+(n*t[e+1][1]-n*t[e-1][1])/6],i[2]=[t[e+1][
530]+(n*t[e][0]-n*t[e+2][0])/6,t[e+1][1]+(n*t[e][1]-n*t[e+2][1])/6],i[3]=[t[e+1][0],t[e+1][1]],r.push({op:"bcurveTo",data:[i[1][0],i[1][1],i[2][0],i[2][1],i[3][0],i[3][1]]})}if(e&&2===e.length){let t=a.maxRandomnessOffset;r.push({op:"lineTo",data:[e[0]+A(t,a),e[1]+A(t,a)]})}}else 3===l?(r.push({op:"move",data:[t[1][0],t[1][1]]}),r.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===l&&r.push(...O(t[0][0],t[0][1],t[1][0],t[1][1],a,!0,!0));return r}function T(t,e,a,l,r,i,n,s){let h=[],o=[];if(0===s.roughness){t/=4,o.push([e+l*Math.cos(-t),a+r*Math.sin(-t)]);for(let i=0;i<=2*Math.PI;i+=t){let t=[e+l*Math.cos(i),a+r*Math.sin(i)];h.push(t),o.push(t)}o.push([e+ +l,a+0*r]),o.push([e+l*Math.cos(t),a+r*Math.sin(t)])}else{let d=A(.5,s)-Math.PI/2;o.push([A(i,s)+e+.9*l*Math.cos(d-t),A(i,s)+a+.9*r*Math.sin(d-t)]);let c=2*Math.PI+d-.01;for(let n=d;n<c;n+=t){let t=[A(i,s)+e+l*Math.cos(n),A(i,s)+a+r*Math.sin(n)];h.push(t),o.push(t)}o.push([A(i,s)+e+l*Math.cos(d+2*Math.PI+.5*n),A(i,s)+a+r*Math.sin(d+2*Math.PI+.5*n)]),o.push([A(i,s)+e+.98*l*Math.cos(d+n),A(i,s)+a+.98*r*Math.sin(d+n)]),o.push([A(i,s)+e+.9*l*Math.cos(d+.5*n),A(i,s)+a+.9*r*Math.sin(d+.5*n)])}return[o,h]}function R(t,e,a,l,r,i,n,s,h){let o=i+A(.1,h),d=[];d.push([A(s,h)+e+.9*l*Math.cos(o-t),A(s,h)+a+.9*r*Math.sin(o-t)]);for(let i=o;i<=n;i+=t)d.push([A(s,h)+e+l*Math.cos(i),A(s,h)+a+r*Math.sin(i)]);return d.push([e+l*Math.cos(n),a+r*Math.sin(n)]),d.push([e+l*Math.cos(n),a+r*Math.sin(n)]),L(d,null,h)}function I(t,e=0){let a=t.length;if(a<3)throw Error("A curve must have at least three points.");let l=[];if(3===a)l.push([...t[0]],[...t[1]],[...t[2]],[...t[2]]);else{let a=[];a.push(t[0],t[0]);for(let e=1;e<t.length;e++)a.push(t[e]),e===t.length-1&&a.push(t[e]);let r=[],i=1-e;l.push([...a[0]]);for(let t=1;t+2<a.length;t++){let e=a[t];r[0]=[e[0],e[1]],r[1]=[e[0]+(i*a[t+1][0]-i*a[t-1][0])/6,e[1]+(i*a[t+1][1]-i*a[t-1][1])/6],r[2]=[a[t+1][0]+(i*a[t][0]-i*a[t+2][0])/6,a[t+1][1]+(i*a[t][1]-i*a[t+2][1])/6],r[3]=[a[t+1][0],a[t+1][1]],l.push(r[1],r[2],r[3])}}return l}function W(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function E(t,e,a){return[t[0]+(e[0]-t[0])*a,t[1]+(e[1]-t[1])*a]}function z(t,e,a,l,r){let i=r||[],n=t[e],s=t[a-1],h=0,o=1;for(let l=e+1;l<a-1;++l){let e=function(t,e,a){let l=W(e,a);if(0===l)return W(t,e);let r=((t[0]-e[0])*(a[0]-e[0])+(t[1]-e[1])*(a[1]-e[1]))/l;return W(t,E(e,a,r=Math.max(0,Math.min(1,r))))}(t[l],n,s);e>h&&(h=e,o=l)}return Math.sqrt(h)>l?(z(t,e,o+1,l,i),z(t,o,a,l,i)):(i.length||i.push(n),i.push(s)),i}function j(t,e=.15,a){let l=[],r=(t.length-1)/3;for(let a=0;a<r;a++)!function t(e,a,l,r){let i,n,s,h,o,d,c,g,u=r||[];if(i=e[a+0],n=e[a+1],s=e[a+2],h=e[a+3],o=3*n[0]-2*i[0]-h[0],o*=o,d=3*n[1]-2*i[1]-h[1],d*=d,c=3*s[0]-2*h[0]-i[0],c*=c,g=3*s[1]-2*h[
531]-i[1],g*=g,o<c&&(o=c),d<g&&(d=g),o+d<l){let t=e[a+0];u.length?Math.sqrt(W(u[u.length-1],t))>1&&u.push(t):u.push(t),u.push(e[a+3])}else{let r=e[a+0],i=e[a+1],n=e[a+2],s=e[a+3],h=E(r,i,.5),o=E(i,n,.5),d=E(n,s,.5),c=E(h,o,.5),g=E(o,d,.5),f=E(c,g,.5);t([r,h,c,f],0,l,u),t([f,g,d,s],0,l,u)}return u}(t,3*a,e,l);return a&&a>0?z(l,0,l.length,a):l}let q="none";class H{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(0x80000000*Math.random())}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,a){return{shape:t,sets:e||[],options:a||this.defaultOptions}}line(t,e,a,l,r){let i=this._o(r);return this._d("line",[x(t,e,a,l,i)],i)}rectangle(t,e,a,l,r){var i,n,s,h;let o=this._o(r),d=[],c=w([[i=t,n=e],[i+(s=a),n],[i+s,n+(h=l)],[i,n+h]],!0,o);if(o.fill){let r=[[t,e],[t+a,e],[t+a,e+l],[t,e+l]];"solid"===o.fillStyle?d.push(_([r],o)):d.push(v([r],o))}return o.stroke!==q&&d.push(c),this._d("rectangle",d,o)}ellipse(t,e,a,l,r){let i=this._o(r),n=[],s=k(a,l,i),h=$(t,e,i,s);if(i.fill)if("solid"===i.fillStyle){let a=$(t,e,i,s).opset;a.type="fillPath",n.push(a)}else n.push(v([h.estimatedPoints],i));return i.stroke!==q&&n.push(h.opset),this._d("ellipse",n,i)}circle(t,e,a,l){let r=this.ellipse(t,e,a,a,l);return r.shape="circle",r}linearPath(t,e){let a=this._o(e);return this._d("linearPath",[w(t,!1,a)],a)}arc(t,e,a,l,r,i,n=!1,s){let h=this._o(s),o=[],d=M(t,e,a,l,r,i,n,!0,h);if(n&&h.fill)if("solid"===h.fillStyle){let n=Object.assign({},h);n.disableMultiStroke=!0;let s=M(t,e,a,l,r,i,!0,!1,n);s.type="fillPath",o.push(s)}else o.push(function(t,e,a,l,r,i,n){let s=Math.abs(a/2),h=Math.abs(l/2);s+=A(.01*s,n),h+=A(.01*h,n);let o=r,d=i;for(;o<0;)o+=2*Math.PI,d+=2*Math.PI;d-o>2*Math.PI&&(o=0,d=2*Math.PI);let c=(d-o)/n.curveStepCount,g=[];for(let a=o;a<=d;a+=c)g.push([t+s*Math.cos(a),e+h*Math.sin(a)]);
53return g.push([t+s*Math.cos(d),e+h*Math.sin(d)]),g.push([t,e]),v([g],n)}(t,e,a,l,r,i,h));return h.stroke!==q&&o.push(d),this._d("arc",o,h)}curve(t,e){let a=this._o(e),l=[],r=b(t,a);if(a.fill&&a.fill!==q)if("solid"===a.fillStyle){let e=b(t,Object.assign(Object.assign({},a),{disableMultiStroke:!0,roughness:a.roughness?a.roughness+a.fillShapeRoughnessGain:0}));l.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else{let e=[];if(t.length)for(let l of"number"==typeof t[0][0]?[t]:t)l.length<3?e.push(...l):3===l.length?e.push(...j(I([l[0],l[0],l[1],l[2]]),10,(1+a.roughness)/2)):e.push(...j(I(l),10,(1+a.roughness)/2));e.length&&l.push(v([e],a))}return a.stroke!==q&&l.push(r),this._d("curve",l,a)}polygon(t,e){let a=this._o(e),l=[],r=w(t,!0,a);return a.fill&&("solid"===a.fillStyle?l.push(_([t],a)):l.push(v([t],a))),a.stroke!==q&&l.push(r),this._d("polygon",l,a)}path(t,e){let a=this._o(e),l=[];if(!t)return this._d("path",l,a);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let r=a.fill&&"transparent"!==a.fill&&a.fill!==q,i=a.stroke!==q,n=!!(a.simplification&&a.simplification<1),s=function(t,e){let a=p(f(u(t))),l=[],r=[],i=[0,0],n=[],s=()=>{n.length>=4&&r.push(...j(n,1)),n=[]},h=()=>{s(),r.length&&(l.push(r),r=[])};for(let{key:t,data:e}of a)switch(t){case"M":h(),i=[e[0],e[1]],r.push(i);break;case"L":s(),r.push([e[0],e[1]]);break;case"C":if(!n.length){let t=r.length?r[r.length-1]:i;n.push([t[0],t[1]])}n.push([e[0],e[1]]),n.push([e[2],e[3]]),n.push([e[4],e[5]]);break;case"Z":s(),r.push([i[0],i[1]])}if(h(),!e)return l;let o=[];for(let t of l){let a=z(t,0,t.length,e);a.length&&o.push(a)}return o}(t,n?4-4*(a.simplification||1):(1+a.roughness)/2),h=S(t,a);if(r)if("solid"===a.fillStyle)if(1===s.length){let e=S(t,Object.assign(Object.assign({},a),{disableMultiStroke:!0,roughness:a.roughness?a.roughness+a.fillShapeRoughnessGain:0}));l.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else l.push(_(s,a));else l.push(v(s,a));return i&&(n?s.forEach(t=>{l.push(w(t,!1,a))}):l.push(h)),this._d("path",l,a)}opsToPath(t,e){let a="";for(let l of t.ops){let t="number"==typeof e&&e>=0?l.data.map(t=>+t.toFixed(e)):l.data;switch(l.op){case"move":a+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":a+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":a+=`L${t[0]} ${t[1]} `}}return a.trim()}toPaths(t){let e=t.sets||[],a=t.options||this.defaultOptions,l=[];for(let t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:a.stroke,strokeWidth:a.strokeWidth,fill:q};break;case"fillPath":e={d:this.opsToPath(t),stroke:q,strokeWidth:0,fill:a.fill||q};break;case"fillSketch":e=this.fillSketch(t,a)}e&&l.push(e)}return l}fillSketch(t,e){let a=e.fillWeight;return a<0&&(a=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||q,strokeWidth:a,fill:q}}_mergedShape(t){return t.filter((t,e)=>0===e||"move"!==t.op)}}class F{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new H(e)}draw(t){let e=t.sets||[],a=t.options||this.getDefaultOptions(),l=this.ctx,r=t.options.fixedDecimalPlaceDigits;for(let i of e)switch(i.type){case"path":l.save(),l.strokeStyle="none"===a.stroke?"transparent":a.stroke,l.lineWidth=a.strokeWidth,a.strokeLineDash&&l.setLineDash(a.strokeLineDash),a.strokeLineDashOffset&&(l.lineDashOffset=a.strokeLineDashOffset),this._drawToContext(l,i,r),l.restore();break;case"fillPath":{l.save(),l.fillStyle=a.fill||"";let e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(l,i,r,e),l.restore();break}case"fillSketch":this.fillSketch(l,i,a)}}fillSketch(t,e,a){let l=a.fillWeight;l<0&&(l=a.strokeWidth/2),t.save(),a.fillLineDash&&t.setLineDash(a.fillLineDash),a.fillLineDashOffset&&(t.lineDashOffset=a.fillLineDashOffset),t.strokeStyle=a.fill||"",t.lineWidth=l,this._drawToContext(t,e,a.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,a,l="nonzero"){for(let l of(t.beginPath(),e.ops)){let e="number"==typeof a&&a>=0?l.data.map(t=>+t.toFixed(a)):l.data;switch(l.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(l):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,a,l,r){let i=this.gen.line(t,e,a,l,r);return this.draw(i),i}rectangle(t,e,a,l,r){let i=this.gen.rectangle(t,e,a,l,r);return this.draw(i),i}ellipse(t,e,a,l,r){let i=this.gen.ellipse(t,e,a,l,r);return this.draw(i),i}circle(t,e,a,l){let r=this.gen.circle(t,e,a,l);return this.draw(r),r}linearPath(t,e){let a=this.gen.linearPath(t,e);return this.draw(a),a}polygon(t,e){let a=this.gen.polygon(t,e);return this.draw(a),a}arc(t,e,a,l,r,i,n=!1,s){let h=this.gen.arc(t,e,a,l,r,i,n,s);return this.draw(h),h}curve(t,e){let a=this.gen.curve(t,e);return this.draw(a),a}path(t,e){let a=this.gen.path(t,e);return this.draw(a),a}}let G="http://www.w3.org/2000/svg";class V{constructor(t,e){this.svg=t,this.gen=new H(e)}draw(t){let e=t.sets||[],a=t.options||this.getDefaultOptions(),l=this.svg.ownerDocument||window.document,r=l.createElementNS(G,"g"),i=t.options.fixedDecimalPlaceDigits;for(let n of e){let e=null;switch(n.type){case"path":(e=l.createElementNS(G,"path")).setAttribute("d",this.opsToPath(n,i)),e.setAttribute("stroke",a.stroke),e.setAttribute("stroke-width",a.strokeWidth+""),e.setAttribute("fill","none"),a.strokeLineDash&&e.setAttribute("stroke-dasharray",a.strokeLineDash.join(" ").trim()),a.strokeLineDashOffset&&e.setAttribute("stroke-dashoffset",`${a.strokeLineDashOffset}`);break;case"fillPath":(e=l.createElementNS(G,"path")).setAttribute("d",this.opsToPath(n,i)),e.setAttribute("stroke","none"),e.setAttribute("stroke-width","0"),e.setAttribute("fill",a.fill||""),"curve"!==t.shape&&"polygon"!==t.shape||e.setAttribute("fill-rule","evenodd");break;case"fillSketch":e=this.fillSketch(l,n,a)}e&&r.appendChild(e)}return r}fillSketch(t,e,a){let l=a.fillWeight;l<0&&(l=a.strokeWidth/2);let r=t.createElementNS(G,"path");return r.setAttribute("d",this.opsToPath(e,a.fixedDecimalPlaceDigits)),r.setAttribute("stroke",a.fill||""),r.setAttribute("stroke-width",l+""),r.setAttribute("fill","none"),a.fillLineDash&&r.setAttribute("stroke-dasharray",a.fillLineDash.join(" ").trim()),a.fillLineDashOffset&&r.setAttribute("stroke-dashoffset",`${a.fillLineDashOffset}`),r}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,a,l,r){let i=this.gen.line(t,e,a,l,r);return this.draw(i)}rectangle(t,e,a,l,r){let i=this.gen.rectangle(t,e,a,l,r);return this.draw(i)}ellipse(t,e,a,l,r){let i=this.gen.ellipse(t,e,a,l,r);return this.draw(i)}circle(t,e,a,l){let r=this.gen.circle(t,e,a,l);return this.draw(r)}linearPath(t,e){let a=this.gen.linearPath(t,e);return this.draw(a)}polygon(t,e){let a=this.gen.polygon(t,e);return this.draw(a)}arc(t,e,a,l,r,i,n=!1,s){let h=this.gen.arc(t,e,a,l,r,i,n,s);return this.draw(h)}curve(t,e){let a=this.gen.curve(t,e);return this.draw(a)}path(t,e){let a=this.gen.path(t,e);return this.draw(a)}}t.s(["default",0,{canvas:(t,e)=>new F(t,e),svg:(t,e)=>new V(t,e),generator:t=>new H(t),newSeed:()=>H.newSeed()}])}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.