`+n+""+i+`>
`}listitem(t){let e="";if(t.task){let r=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=r+" "+yc(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`${e}
`}checkbox({checked:t}){return" '}paragraph({tokens:t}){return`${this.parser.parseInline(t)}
`}table(t){let e="",r="";for(let i=0;i${n}`),`
`}tablerow({text:t}){return`
${t}
`}tablecell(t){let e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`${r}>
`}strong({tokens:t}){return`${this.parser.parseInline(t)} `}em({tokens:t}){return`${this.parser.parseInline(t)} `}codespan({text:t}){return`${yc(t,!0)}
`}br(t){return" "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:e,tokens:r}){let n=this.parser.parseInline(r),i=JK(t);if(i===null)return n;t=i;let a='"+n+" ",a}image({href:t,title:e,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let i=JK(t);if(i===null)return yc(r);t=i;let a=` ",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:yc(t.text)}},sL=class{static{o(this,"_")}strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Ru=class Q9{static{o(this,"a")}options;renderer;textRenderer;constructor(e){this.options=e||Pd,this.options.renderer=this.options.renderer||new $T,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new sL}static parse(e,r){return new Q9(r).parse(e)}static parseInline(e,r){return new Q9(r).parseInline(e)}parse(e,r=!0){let n="";for(let i=0;i{let s=i[a].flat(1/0);r=r.concat(this.walkTokens(s,e))}):i.tokens&&(r=r.concat(this.walkTokens(i.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let a=e.renderers[i.name];a?e.renderers[i.name]=function(...s){let l=i.renderer.apply(this,s);return l===!1&&(l=a.apply(this,s)),l}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[i.level];a?a.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),n.extensions=e),r.renderer){let i=this.defaults.renderer||new $T(this.defaults);for(let a in r.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let s=a,l=r.renderer[s],u=i[s];i[s]=(...h)=>{let f=l.apply(i,h);return f===!1&&(f=u.apply(i,h)),f||""}}n.renderer=i}if(r.tokenizer){let i=this.defaults.tokenizer||new FT(this.defaults);for(let a in r.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let s=a,l=r.tokenizer[s],u=i[s];i[s]=(...h)=>{let f=l.apply(i,h);return f===!1&&(f=u.apply(i,h)),f}}n.tokenizer=i}if(r.hooks){let i=this.defaults.hooks||new PT;for(let a in r.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let s=a,l=r.hooks[s],u=i[s];PT.passThroughHooks.has(a)?i[s]=h=>{if(this.defaults.async)return Promise.resolve(l.call(i,h)).then(d=>u.call(i,d));let f=l.call(i,h);return u.call(i,f)}:i[s]=(...h)=>{let f=l.apply(i,h);return f===!1&&(f=u.apply(i,h)),f}}n.hooks=i}if(r.walkTokens){let i=this.defaults.walkTokens,a=r.walkTokens;n.walkTokens=function(s){let l=[];return l.push(a.call(this,s)),i&&(l=l.concat(i.call(this,s))),l}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Lu.lex(t,e??this.defaults)}parser(t,e){return Ru.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let n={...r},i={...this.defaults,...n},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&n.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=t);let s=i.hooks?i.hooks.provideLexer():t?Lu.lex:Lu.lexInline,l=i.hooks?i.hooks.provideParser():t?Ru.parse:Ru.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(e):e).then(u=>s(u,i)).then(u=>i.hooks?i.hooks.processAllTokens(u):u).then(u=>i.walkTokens?Promise.all(this.walkTokens(u,i.walkTokens)).then(()=>u):u).then(u=>l(u,i)).then(u=>i.hooks?i.hooks.postprocess(u):u).catch(a);try{i.hooks&&(e=i.hooks.preprocess(e));let u=s(e,i);i.hooks&&(u=i.hooks.processAllTokens(u)),i.walkTokens&&this.walkTokens(u,i.walkTokens);let h=l(u,i);return i.hooks&&(h=i.hooks.postprocess(h)),h}catch(u){return a(u)}}}onError(t,e){return r=>{if(r.message+=`
Please report this to https://github.com/markedjs/marked.`,t){let n="An error occurred:
"+yc(r.message+"",!0)+" ";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},Od=new cDe;o(Zr,"k");Zr.options=Zr.setOptions=function(t){return Od.setOptions(t),Zr.defaults=Od.defaults,rQ(Zr.defaults),Zr};Zr.getDefaults=Z9;Zr.defaults=Pd;Zr.use=function(...t){return Od.use(...t),Zr.defaults=Od.defaults,rQ(Zr.defaults),Zr};Zr.walkTokens=function(t,e){return Od.walkTokens(t,e)};Zr.parseInline=Od.parseInline;Zr.Parser=Ru;Zr.parser=Ru.parse;Zr.Renderer=$T;Zr.TextRenderer=sL;Zr.Lexer=Lu;Zr.lexer=Lu.lex;Zr.Tokenizer=FT;Zr.Hooks=PT;Zr.parse=Zr;ISt=Zr.options,OSt=Zr.setOptions,PSt=Zr.use,BSt=Zr.walkTokens,FSt=Zr.parseInline,$St=Ru.parse,zSt=Lu.lex});function uDe(t,{markdownAutoWrap:e}){let n=t.replace(/ /g,`
`).replace(/\n{2,}/g,`
`),i=N3(n);return e===!1?i.replace(/ /g," "):i}function pQ(t,e={}){let r=uDe(t,e),n=Zr.lexer(r),i=[[]],a=0;function s(l,u="normal"){l.type==="text"?l.text.split(`
`).forEach((f,d)=>{d!==0&&(a++,i.push([])),f.split(" ").forEach(p=>{p=p.replace(/'/g,"'"),p&&i[a].push({content:p,type:u})})}):l.type==="strong"||l.type==="em"?l.tokens.forEach(h=>{s(h,l.type)}):l.type==="html"&&i[a].push({content:l.text,type:"normal"})}return o(s,"processNode"),n.forEach(l=>{l.type==="paragraph"?l.tokens?.forEach(u=>{s(u)}):l.type==="html"?i[a].push({content:l.text,type:"normal"}):i[a].push({content:l.raw,type:"normal"})}),i}function mQ(t,{markdownAutoWrap:e}={}){let r=Zr.lexer(t);function n(i){return i.type==="text"?e===!1?i.text.replace(/\n */g," ").replace(/ /g," "):i.text.replace(/\n */g," "):i.type==="strong"?`${i.tokens?.map(n).join("")} `:i.type==="em"?`${i.tokens?.map(n).join("")} `:i.type==="paragraph"?`${i.tokens?.map(n).join("")}
`:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(X.warn(`Unsupported markdown: ${i.type}`),i.raw)}return o(n,"output"),r.map(n).join("")}var gQ=N(()=>{"use strict";dQ();pA();yt();o(uDe,"preprocessMarkdown");o(pQ,"markdownToLines");o(mQ,"markdownToHTML")});function hDe(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}function fDe(t,e){let r=hDe(e.content);return yQ(t,[],r,e.type)}function yQ(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];let[i,...a]=r,s=[...e,i];return t([{content:s.join(""),type:n}])?yQ(t,s,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}function vQ(t,e){if(t.some(({content:r})=>r.includes(`
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return oL(t,e)}function oL(t,e,r=[],n=[]){if(t.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";t[0].content===" "&&(i=" ",t.shift());let a=t.shift()??{content:" ",type:"normal"},s=[...n];if(i!==""&&s.push({content:i,type:"normal"}),s.push(a),e(s))return oL(t,e,r,s);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){let[l,u]=fDe(e,a);r.push([l]),u.content&&t.unshift(u)}return oL(t,e,r)}var xQ=N(()=>{"use strict";o(hDe,"splitTextToChars");o(fDe,"splitWordToFitWidth");o(yQ,"splitWordToFitWidthRecursion");o(vQ,"splitLineToFitWidth");o(oL,"splitLineToFitWidthRecursion")});function bQ(t,e){e&&t.attr("style",e)}async function dDe(t,e,r,n,i=!1,a=Qt()){let s=t.append("foreignObject");s.attr("width",`${10*r}px`),s.attr("height",`${10*r}px`);let l=s.append("xhtml:div"),u=gi(e.label)?await yh(e.label.replace(Ze.lineBreakRegex,`
`),a):ar(e.label,a),h=e.isNode?"nodeLabel":"edgeLabel",f=l.append("span");f.html(u),bQ(f,e.labelStyle),f.attr("class",`${h} ${n}`),bQ(l,e.labelStyle),l.style("display","table-cell"),l.style("white-space","nowrap"),l.style("line-height","1.5"),l.style("max-width",r+"px"),l.style("text-align","center"),l.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&l.attr("class","labelBkg");let d=l.node().getBoundingClientRect();return d.width===r&&(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",r+"px"),d=l.node().getBoundingClientRect()),s.node()}function lL(t,e,r){return t.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em")}function pDe(t,e,r){let n=t.append("text"),i=lL(n,1,e);cL(i,r);let a=i.node().getComputedTextLength();return n.remove(),a}function TQ(t,e,r){let n=t.append("text"),i=lL(n,1,e);cL(i,[{content:r,type:"normal"}]);let a=i.node()?.getBoundingClientRect();return a&&n.remove(),a}function mDe(t,e,r,n=!1){let a=e.append("g"),s=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1"),u=0;for(let h of r){let f=o(p=>pDe(a,1.1,p)<=t,"checkWidth"),d=f(h)?[h]:vQ(h,f);for(let p of d){let m=lL(l,u,1.1);cL(m,p),u++}}if(n){let h=l.node().getBBox(),f=2;return s.attr("x",h.x-f).attr("y",h.y-f).attr("width",h.width+2*f).attr("height",h.height+2*f),a.node()}else return l.node()}function cL(t,e){t.text(""),e.forEach((r,n)=>{let i=t.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?i.text(r.content):i.text(" "+r.content)})}async function uL(t,e={}){let r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,s)=>(r.push((async()=>{let l=`${a}:${s}`;return await AV(l)?await Es(l,void 0,{class:"label-icon"}):` `})()),i));let n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}var Hn,no=N(()=>{"use strict";pr();dr();yt();gQ();nr();rc();xQ();Jn();o(bQ,"applyStyle");o(dDe,"addHtmlSpan");o(lL,"createTspan");o(pDe,"computeWidthOfText");o(TQ,"computeDimensionOfText");o(mDe,"createFormattedText");o(cL,"updateTextContentAndStyles");o(uL,"replaceIconSubstring");Hn=o(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,isNode:s=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(X.debug("XYZ createText",e,r,n,i,a,s,"addSvgBackground: ",u),a){let f=mQ(e,h),d=await uL(ta(f),h),p=e.replace(/\\\\/g,"\\"),m={isNode:s,label:gi(e)?p:d,labelStyle:r.replace("fill:","color:")};return await dDe(t,m,l,i,u,h)}else{let f=e.replace(/ /g," "),d=pQ(f.replace(" "," "),h),p=mDe(l,t,d,e?u:!1);if(s){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));let m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ge(p).attr("style",m)}else{let m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");Ge(p).select("rect").attr("style",m.replace(/background:/g,"fill:"));let g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ge(p).select("text").attr("style",g)}return p}},"createText")});function zt(t){let e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}function $o(t,e,r,n,i,a){let s=[],u=r-t,h=n-e,f=u/a,d=2*Math.PI/f,p=e+h/2;for(let m=0;m<=50;m++){let g=m/50,y=t+g*u,v=p+i*Math.sin(d*(y-t));s.push({x:y,y:v})}return s}function Bd(t,e,r,n,i,a){let s=[],l=i*Math.PI/180,f=(a*Math.PI/180-l)/(n-1);for(let d=0;d{"use strict";no();qt();pr();Ca();dr();nr();pt=o(async(t,e,r)=>{let n,i=e.useHtmlLabels||mr(ge()?.htmlLabels);r?n=r:n="node default";let a=t.insert("g").attr("class",n).attr("id",e.domId||e.id),s=a.insert("g").attr("class","label").attr("style",ii(e.labelStyle)),l;e.label===void 0?l="":l=typeof e.label=="string"?e.label:e.label[0];let u=await Hn(s,ar(ta(l),ge()),{useHtmlLabels:i,width:e.width||ge().flowchart?.wrappingWidth,cssClasses:"markdown-node-label",style:e.labelStyle,addSvgBackground:!!e.icon||!!e.img}),h=u.getBBox(),f=(e?.padding??0)/2;if(i){let d=u.children[0],p=Ge(u),m=d.getElementsByTagName("img");if(m){let g=l.replace(/ ]*>/g,"").trim()==="";await Promise.all([...m].map(y=>new Promise(v=>{function x(){if(y.style.display="flex",y.style.flexDirection="column",g){let b=ge().fontSize?ge().fontSize:window.getComputedStyle(document.body).fontSize,T=5,[C=lr.fontSize]=Fo(b),w=C*T+"px";y.style.minWidth=w,y.style.maxWidth=w}else y.style.width="100%";v(y)}o(x,"setupImage"),setTimeout(()=>{y.complete&&x()}),y.addEventListener("error",x),y.addEventListener("load",x)})))}h=d.getBoundingClientRect(),p.attr("width",h.width),p.attr("height",h.height)}return i?s.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"):s.attr("transform","translate(0, "+-h.height/2+")"),e.centerLabel&&s.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:a,bbox:h,halfPadding:f,label:s}},"labelHelper"),VT=o(async(t,e,r)=>{let n=r.useHtmlLabels||mr(ge()?.flowchart?.htmlLabels),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await Hn(i,ar(ta(e),ge()),{useHtmlLabels:n,width:r.width||ge()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),s=a.getBBox(),l=r.padding/2;if(mr(ge()?.flowchart?.htmlLabels)){let u=a.children[0],h=Ge(a);s=u.getBoundingClientRect(),h.attr("width",s.width),h.attr("height",s.height)}return n?i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):i.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:s,halfPadding:l,label:i}},"insertLabel"),Ke=o((t,e)=>{let r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),ot=o((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");o(zt,"createPathFromPoints");o($o,"generateFullSineWavePoints");o(Bd,"generateCirclePoints")});function gDe(t,e){return t.intersect(e)}var wQ,kQ=N(()=>{"use strict";o(gDe,"intersectNode");wQ=gDe});function yDe(t,e,r,n){var i=t.x,a=t.y,s=i-n.x,l=a-n.y,u=Math.sqrt(e*e*l*l+r*r*s*s),h=Math.abs(e*r*s/u);n.x{"use strict";o(yDe,"intersectEllipse");UT=yDe});function vDe(t,e,r){return UT(t,e,e,r)}var EQ,SQ=N(()=>{"use strict";hL();o(vDe,"intersectCircle");EQ=vDe});function xDe(t,e,r,n){var i,a,s,l,u,h,f,d,p,m,g,y,v,x,b;if(i=e.y-t.y,s=t.x-e.x,u=e.x*t.y-t.x*e.y,p=i*r.x+s*r.y+u,m=i*n.x+s*n.y+u,!(p!==0&&m!==0&&CQ(p,m))&&(a=n.y-r.y,l=r.x-n.x,h=n.x*r.y-r.x*n.y,f=a*t.x+l*t.y+h,d=a*e.x+l*e.y+h,!(f!==0&&d!==0&&CQ(f,d))&&(g=i*l-a*s,g!==0)))return y=Math.abs(g/2),v=s*h-l*u,x=v<0?(v-y)/g:(v+y)/g,v=a*u-i*h,b=v<0?(v-y)/g:(v+y)/g,{x,y:b}}function CQ(t,e){return t*e>0}var AQ,_Q=N(()=>{"use strict";o(xDe,"intersectLine");o(CQ,"sameSign");AQ=xDe});function bDe(t,e,r){let n=t.x,i=t.y,a=[],s=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(f){s=Math.min(s,f.x),l=Math.min(l,f.y)}):(s=Math.min(s,e.x),l=Math.min(l,e.y));let u=n-t.width/2-s,h=i-t.height/2-l;for(let f=0;f1&&a.sort(function(f,d){let p=f.x-r.x,m=f.y-r.y,g=Math.sqrt(p*p+m*m),y=d.x-r.x,v=d.y-r.y,x=Math.sqrt(y*y+v*v);return g{"use strict";_Q();o(bDe,"intersectPolygon");DQ=bDe});var TDe,Hh,fL=N(()=>{"use strict";TDe=o((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,s=t.width/2,l=t.height/2,u,h;return Math.abs(a)*s>Math.abs(i)*l?(a<0&&(l=-l),u=a===0?0:l*i/a,h=l):(i<0&&(s=-s),u=s,h=i===0?0:s*a/i),{x:r+u,y:n+h}},"intersectRect"),Hh=TDe});var Xe,Ht=N(()=>{"use strict";kQ();SQ();hL();LQ();fL();Xe={node:wQ,circle:EQ,ellipse:UT,polygon:DQ,rect:Hh}});var RQ,vc,wDe,k2,qe,Qe,kDe,Gt=N(()=>{"use strict";qt();RQ=o(t=>{let{handDrawnSeed:e}=ge();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),vc=o(t=>{let e=wDe([...t.cssCompiledStyles||[],...t.cssStyles||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),wDe=o(t=>{let e=new Map;return t.forEach(r=>{let[n,i]=r.split(":");e.set(n.trim(),i?.trim())}),e},"styles2Map"),k2=o(t=>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","isLabelStyle"),qe=o(t=>{let{stylesArray:e}=vc(t),r=[],n=[],i=[],a=[];return e.forEach(s=>{let l=s[0];k2(l)?r.push(s.join(":")+" !important"):(n.push(s.join(":")+" !important"),l.includes("stroke")&&i.push(s.join(":")+" !important"),l==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),Qe=o((t,e)=>{let{themeVariables:r,handDrawnSeed:n}=ge(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:s}=vc(t);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:s.get("stroke")||i,seed:n,strokeWidth:s.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:kDe(s.get("stroke-dasharray"))},e)},"userNodeOverrides"),kDe=o(t=>{if(!t)return[0,0];let e=t.trim().split(/\s+/).map(Number);if(e.length===1){let i=isNaN(e[0])?0:e[0];return[i,i]}let r=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1];return[r,n]},"getStrokeDashArray")});function dL(t,e,r){if(t&&t.length){let[n,i]=e,a=Math.PI/180*r,s=Math.cos(a),l=Math.sin(a);for(let u of t){let[h,f]=u;u[0]=(h-n)*s-(f-i)*l+n,u[1]=(h-n)*l+(f-i)*s+i}}}function EDe(t,e){return t[0]===e[0]&&t[1]===e[1]}function SDe(t,e,r,n=1){let i=r,a=Math.max(e,.1),s=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,l=[0,0];if(i)for(let h of s)dL(h,l,i);let u=function(h,f,d){let p=[];for(let b of h){let T=[...b];EDe(T[0],T[T.length-1])||T.push([T[0][0],T[0][1]]),T.length>2&&p.push(T)}let m=[];f=Math.max(f,.1);let g=[];for(let b of p)for(let T=0;Tb.yminT.ymin?1:b.xT.x?1:b.ymax===T.ymax?0:(b.ymax-T.ymax)/Math.abs(b.ymax-T.ymax)),!g.length)return m;let y=[],v=g[0].ymin,x=0;for(;y.length||g.length;){if(g.length){let b=-1;for(let T=0;Tv);T++)b=T;g.splice(0,b+1).forEach(T=>{y.push({s:v,edge:T})})}if(y=y.filter(b=>!(b.edge.ymax<=v)),y.sort((b,T)=>b.edge.x===T.edge.x?0:(b.edge.x-T.edge.x)/Math.abs(b.edge.x-T.edge.x)),(d!==1||x%f==0)&&y.length>1)for(let b=0;b=y.length)break;let C=y[b].edge,w=y[T].edge;m.push([[Math.round(C.x),v],[Math.round(w.x),v]])}v+=d,y.forEach(b=>{b.edge.x=b.edge.x+d*b.edge.islope}),x++}return m}(s,a,n);if(i){for(let h of s)dL(h,l,-i);(function(h,f,d){let p=[];h.forEach(m=>p.push(...m)),dL(p,f,d)})(u,l,-i)}return u}function A2(t,e){var r;let n=e.hachureAngle+90,i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return e.roughness>=1&&(((r=e.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),SDe(t,i,n,a||1)}function ZT(t){let e=t[0],r=t[1];return Math.sqrt(Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2))}function mL(t,e){return t.type===e}function DL(t){let e=[],r=function(s){let l=new Array;for(;s!=="";)if(s.match(/^([ \t\r\n,]+)/))s=s.substr(RegExp.$1.length);else if(s.match(/^([aAcChHlLmMqQsStTvVzZ])/))l[l.length]={type:CDe,text:RegExp.$1},s=s.substr(RegExp.$1.length);else{if(!s.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];l[l.length]={type:pL,text:`${parseFloat(RegExp.$1)}`},s=s.substr(RegExp.$1.length)}return l[l.length]={type:NQ,text:""},l}(t),n="BOD",i=0,a=r[i];for(;!mL(a,NQ);){let s=0,l=[];if(n==="BOD"){if(a.text!=="M"&&a.text!=="m")return DL("M0,0"+t);i++,s=HT[a.text],n=a.text}else mL(a,pL)?s=HT[n]:(i++,s=HT[a.text],n=a.text);if(!(i+sf%2?h+r:h+e);a.push({key:"C",data:u}),e=u[4],r=u[5];break}case"Q":a.push({key:"Q",data:[...l]}),e=l[2],r=l[3];break;case"q":{let u=l.map((h,f)=>f%2?h+r:h+e);a.push({key:"Q",data:u}),e=u[2],r=u[3];break}case"A":a.push({key:"A",data:[...l]}),e=l[5],r=l[6];break;case"a":e+=l[5],r+=l[6],a.push({key:"A",data:[l[0],l[1],l[2],l[3],l[4],e,r]});break;case"H":a.push({key:"H",data:[...l]}),e=l[0];break;case"h":e+=l[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...l]}),r=l[0];break;case"v":r+=l[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...l]}),e=l[2],r=l[3];break;case"s":{let u=l.map((h,f)=>f%2?h+r:h+e);a.push({key:"S",data:u}),e=u[2],r=u[3];break}case"T":a.push({key:"T",data:[...l]}),e=l[0],r=l[1];break;case"t":e+=l[0],r+=l[1],a.push({key:"T",data:[e,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=n,r=i}return a}function GQ(t){let e=[],r="",n=0,i=0,a=0,s=0,l=0,u=0;for(let{key:h,data:f}of t){switch(h){case"M":e.push({key:"M",data:[...f]}),[n,i]=f,[a,s]=f;break;case"C":e.push({key:"C",data:[...f]}),n=f[4],i=f[5],l=f[2],u=f[3];break;case"L":e.push({key:"L",data:[...f]}),[n,i]=f;break;case"H":n=f[0],e.push({key:"L",data:[n,i]});break;case"V":i=f[0],e.push({key:"L",data:[n,i]});break;case"S":{let d=0,p=0;r==="C"||r==="S"?(d=n+(n-l),p=i+(i-u)):(d=n,p=i),e.push({key:"C",data:[d,p,...f]}),l=f[0],u=f[1],n=f[2],i=f[3];break}case"T":{let[d,p]=f,m=0,g=0;r==="Q"||r==="T"?(m=n+(n-l),g=i+(i-u)):(m=n,g=i);let y=n+2*(m-n)/3,v=i+2*(g-i)/3,x=d+2*(m-d)/3,b=p+2*(g-p)/3;e.push({key:"C",data:[y,v,x,b,d,p]}),l=m,u=g,n=d,i=p;break}case"Q":{let[d,p,m,g]=f,y=n+2*(d-n)/3,v=i+2*(p-i)/3,x=m+2*(d-m)/3,b=g+2*(p-g)/3;e.push({key:"C",data:[y,v,x,b,m,g]}),l=d,u=p,n=m,i=g;break}case"A":{let d=Math.abs(f[0]),p=Math.abs(f[1]),m=f[2],g=f[3],y=f[4],v=f[5],x=f[6];d===0||p===0?(e.push({key:"C",data:[n,i,v,x,v,x]}),n=v,i=x):(n!==v||i!==x)&&(VQ(n,i,v,x,d,p,m,g,y).forEach(function(b){e.push({key:"C",data:b})}),n=v,i=x);break}case"Z":e.push({key:"Z",data:[]}),n=a,i=s}r=h}return e}function E2(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function VQ(t,e,r,n,i,a,s,l,u,h){let f=(d=s,Math.PI*d/180);var d;let p=[],m=0,g=0,y=0,v=0;if(h)[m,g,y,v]=h;else{[t,e]=E2(t,e,-f),[r,n]=E2(r,n,-f);let L=(t-r)/2,S=(e-n)/2,I=L*L/(i*i)+S*S/(a*a);I>1&&(I=Math.sqrt(I),i*=I,a*=I);let M=i*i,P=a*a,B=M*P-M*S*S-P*L*L,F=M*S*S+P*L*L,z=(l===u?-1:1)*Math.sqrt(Math.abs(B/F));y=z*i*S/a+(t+r)/2,v=z*-a*L/i+(e+n)/2,m=Math.asin(parseFloat(((e-v)/a).toFixed(9))),g=Math.asin(parseFloat(((n-v)/a).toFixed(9))),tg&&(m-=2*Math.PI),!u&&g>m&&(g-=2*Math.PI)}let x=g-m;if(Math.abs(x)>120*Math.PI/180){let L=g,S=r,I=n;g=u&&g>m?m+120*Math.PI/180*1:m+120*Math.PI/180*-1,p=VQ(r=y+i*Math.cos(g),n=v+a*Math.sin(g),S,I,i,a,s,0,u,[g,L,y,v])}x=g-m;let b=Math.cos(m),T=Math.sin(m),C=Math.cos(g),w=Math.sin(g),E=Math.tan(x/4),_=4/3*i*E,A=4/3*a*E,D=[t,e],O=[t+_*T,e-A*b],R=[r+_*w,n-A*C],k=[r,n];if(O[0]=2*D[0]-O[0],O[1]=2*D[1]-O[1],h)return[O,R,k].concat(p);{p=[O,R,k].concat(p);let L=[];for(let S=0;S2){let i=[];for(let a=0;a2*Math.PI&&(m=0,g=2*Math.PI);let y=2*Math.PI/u.curveStepCount,v=Math.min(y/2,(g-m)/2),x=FQ(v,h,f,d,p,m,g,1,u);if(!u.disableMultiStroke){let b=FQ(v,h,f,d,p,m,g,1.5,u);x.push(...b)}return s&&(l?x.push(...Wh(h,f,h+d*Math.cos(m),f+p*Math.sin(m),u),...Wh(h,f,h+d*Math.cos(g),f+p*Math.sin(g),u)):x.push({op:"lineTo",data:[h,f]},{op:"lineTo",data:[h+d*Math.cos(m),f+p*Math.sin(m)]})),{type:"path",ops:x}}function OQ(t,e){let r=GQ(zQ(DL(t))),n=[],i=[0,0],a=[0,0];for(let{key:s,data:l}of r)switch(s){case"M":a=[l[0],l[1]],i=[l[0],l[1]];break;case"L":n.push(...Wh(a[0],a[1],l[0],l[1],e)),a=[l[0],l[1]];break;case"C":{let[u,h,f,d,p,m]=l;n.push(...DDe(u,h,f,d,p,m,a,e)),a=[p,m];break}case"Z":n.push(...Wh(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function gL(t,e){let r=[];for(let n of t)if(n.length){let i=e.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+sr(i,e),n[0][1]+sr(i,e)]});for(let s=1;s500?.4:-.0016668*u+1.233334;let f=i.maxRandomnessOffset||0;f*f*100>l&&(f=u/10);let d=f/2,p=.2+.2*WQ(i),m=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;m=sr(m,i,h),g=sr(g,i,h);let y=[],v=o(()=>sr(d,i,h),"M"),x=o(()=>sr(f,i,h),"k"),b=i.preserveVertices;return a&&(s?y.push({op:"move",data:[t+(b?0:v()),e+(b?0:v())]}):y.push({op:"move",data:[t+(b?0:sr(f,i,h)),e+(b?0:sr(f,i,h))]})),s?y.push({op:"bcurveTo",data:[m+t+(r-t)*p+v(),g+e+(n-e)*p+v(),m+t+2*(r-t)*p+v(),g+e+2*(n-e)*p+v(),r+(b?0:v()),n+(b?0:v())]}):y.push({op:"bcurveTo",data:[m+t+(r-t)*p+x(),g+e+(n-e)*p+x(),m+t+2*(r-t)*p+x(),g+e+2*(n-e)*p+x(),r+(b?0:x()),n+(b?0:x())]}),y}function WT(t,e,r){if(!t.length)return[];let n=[];n.push([t[0][0]+sr(e,r),t[0][1]+sr(e,r)]),n.push([t[0][0]+sr(e,r),t[0][1]+sr(e,r)]);for(let i=1;i3){let a=[],s=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let l=1;l+21&&i.push(l)):i.push(l),i.push(t[e+3])}else{let u=t[e+0],h=t[e+1],f=t[e+2],d=t[e+3],p=Fd(u,h,.5),m=Fd(h,f,.5),g=Fd(f,d,.5),y=Fd(p,m,.5),v=Fd(m,g,.5),x=Fd(y,v,.5);CL([u,p,y,x],0,r,i),CL([x,v,g,d],0,r,i)}var a,s;return i}function RDe(t,e){return QT(t,0,t.length,e)}function QT(t,e,r,n,i){let a=i||[],s=t[e],l=t[r-1],u=0,h=1;for(let f=e+1;fu&&(u=d,h=f)}return Math.sqrt(u)>n?(QT(t,e,h+1,n,a),QT(t,h,r,n,a)):(a.length||a.push(s),a.push(l)),a}function yL(t,e=.15,r){let n=[],i=(t.length-1)/3;for(let a=0;a0?QT(n,0,n.length,r):n}var C2,vL,xL,bL,TL,wL,Ns,kL,CDe,pL,NQ,HT,ADe,io,vm,AL,qT,_L,je,Wt=N(()=>{"use strict";o(dL,"t");o(EDe,"e");o(SDe,"s");o(A2,"n");C2=class{static{o(this,"o")}constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){let n=A2(e,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(e,r){let n=[];for(let i of e)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}};o(ZT,"a");vL=class extends C2{static{o(this,"h")}fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);let i=A2(e,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,s=[],l=.5*n*Math.cos(a),u=.5*n*Math.sin(a);for(let[h,f]of i)ZT([h,f])&&s.push([[h[0]-l,h[1]+u],[...f]],[[h[0]+l,h[1]-u],[...f]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}},xL=class extends C2{static{o(this,"r")}fillPolygons(e,r){let n=this._fillPolygons(e,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(e,i);return n.ops=n.ops.concat(a.ops),n}},bL=class{static{o(this,"i")}constructor(e){this.helper=e}fillPolygons(e,r){let n=A2(e,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(e,r){let n=[],i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);let s=i/4;for(let l of e){let u=ZT(l),h=u/i,f=Math.ceil(h)-1,d=u-f*i,p=(l[0][0]+l[1][0])/2-i/4,m=Math.min(l[0][1],l[1][1]);for(let g=0;g{let l=ZT(s),u=Math.floor(l/(n+i)),h=(l+i-u*(n+i))/2,f=s[0],d=s[1];f[0]>d[0]&&(f=s[1],d=s[0]);let p=Math.atan((d[1]-f[1])/(d[0]-f[0]));for(let m=0;m{let s=ZT(a),l=Math.round(s/(2*r)),u=a[0],h=a[1];u[0]>h[0]&&(u=a[1],h=a[0]);let f=Math.atan((h[1]-u[1])/(h[0]-u[0]));for(let d=0;d2*Math.PI&&(_=0,A=2*Math.PI);let D=(A-_)/b.curveStepCount,O=[];for(let R=_;R<=A;R+=D)O.push([T+w*Math.cos(R),C+E*Math.sin(R)]);return O.push([T+w*Math.cos(A),C+E*Math.sin(A)]),O.push([T,C]),ym([O],b)}(e,r,n,i,a,s,h));return h.stroke!==io&&f.push(d),this._d("arc",f,h)}curve(e,r){let n=this._o(r),i=[],a=MQ(e,n);if(n.fill&&n.fill!==io)if(n.fillStyle==="solid"){let s=MQ(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{let s=[],l=e;if(l.length){let u=typeof l[0][0]=="number"?[l]:l;for(let h of u)h.length<3?s.push(...h):h.length===3?s.push(...yL($Q([h[0],h[0],h[1],h[2]]),10,(1+n.roughness)/2)):s.push(...yL($Q(h),10,(1+n.roughness)/2))}s.length&&i.push(ym([s],n))}return n.stroke!==io&&i.push(a),this._d("curve",i,n)}polygon(e,r){let n=this._o(r),i=[],a=YT(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(gL([e],n)):i.push(ym([e],n))),n.stroke!==io&&i.push(a),this._d("polygon",i,n)}path(e,r){let n=this._o(r),i=[];if(!e)return this._d("path",i,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let a=n.fill&&n.fill!=="transparent"&&n.fill!==io,s=n.stroke!==io,l=!!(n.simplification&&n.simplification<1),u=function(f,d,p){let m=GQ(zQ(DL(f))),g=[],y=[],v=[0,0],x=[],b=o(()=>{x.length>=4&&y.push(...yL(x,d)),x=[]},"i"),T=o(()=>{b(),y.length&&(g.push(y),y=[])},"c");for(let{key:w,data:E}of m)switch(w){case"M":T(),v=[E[0],E[1]],y.push(v);break;case"L":b(),y.push([E[0],E[1]]);break;case"C":if(!x.length){let _=y.length?y[y.length-1]:v;x.push([_[0],_[1]])}x.push([E[0],E[1]]),x.push([E[2],E[3]]),x.push([E[4],E[5]]);break;case"Z":b(),y.push([v[0],v[1]])}if(T(),!p)return g;let C=[];for(let w of g){let E=RDe(w,p);E.length&&C.push(E)}return C}(e,1,l?4-4*(n.simplification||1):(1+n.roughness)/2),h=OQ(e,n);if(a)if(n.fillStyle==="solid")if(u.length===1){let f=OQ(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(f.ops)})}else i.push(gL(u,n));else i.push(ym(u,n));return s&&(l?u.forEach(f=>{i.push(YT(f,!1,n))}):i.push(h)),this._d("path",i,n)}opsToPath(e,r){let n="";for(let i of e.ops){let a=typeof r=="number"&&r>=0?i.data.map(s=>+s.toFixed(r)):i.data;switch(i.op){case"move":n+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":n+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":n+=`L${a[0]} ${a[1]} `}}return n.trim()}toPaths(e){let r=e.sets||[],n=e.options||this.defaultOptions,i=[];for(let a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:io};break;case"fillPath":s={d:this.opsToPath(a),stroke:io,strokeWidth:0,fill:n.fill||io};break;case"fillSketch":s=this.fillSketch(a,n)}s&&i.push(s)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||io,strokeWidth:n,fill:io}}_mergedShape(e){return e.filter((r,n)=>n===0||r.op!=="move")}},AL=class{static{o(this,"st")}constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new vm(r)}draw(e){let r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(let s of r)switch(s.type){case"path":i.save(),i.strokeStyle=n.stroke==="none"?"transparent":n.stroke,i.lineWidth=n.strokeWidth,n.strokeLineDash&&i.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(i.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(i,s,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";let l=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,s,a,l),i.restore();break}case"fillSketch":this.fillSketch(i,s,n)}}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=i,this._drawToContext(e,r,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,r,n,i="nonzero"){e.beginPath();for(let a of r.ops){let s=typeof n=="number"&&n>=0?a.data.map(l=>+l.toFixed(n)):a.data;switch(a.op){case"move":e.moveTo(s[0],s[1]);break;case"bcurveTo":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":e.lineTo(s[0],s[1])}}r.type==="fillPath"?e.fill(i):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,r,n,i,a){let s=this.gen.line(e,r,n,i,a);return this.draw(s),s}rectangle(e,r,n,i,a){let s=this.gen.rectangle(e,r,n,i,a);return this.draw(s),s}ellipse(e,r,n,i,a){let s=this.gen.ellipse(e,r,n,i,a);return this.draw(s),s}circle(e,r,n,i){let a=this.gen.circle(e,r,n,i);return this.draw(a),a}linearPath(e,r){let n=this.gen.linearPath(e,r);return this.draw(n),n}polygon(e,r){let n=this.gen.polygon(e,r);return this.draw(n),n}arc(e,r,n,i,a,s,l=!1,u){let h=this.gen.arc(e,r,n,i,a,s,l,u);return this.draw(h),h}curve(e,r){let n=this.gen.curve(e,r);return this.draw(n),n}path(e,r){let n=this.gen.path(e,r);return this.draw(n),n}},qT="http://www.w3.org/2000/svg",_L=class{static{o(this,"ot")}constructor(e,r){this.svg=e,this.gen=new vm(r)}draw(e){let r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(qT,"g"),s=e.options.fixedDecimalPlaceDigits;for(let l of r){let u=null;switch(l.type){case"path":u=i.createElementNS(qT,"path"),u.setAttribute("d",this.opsToPath(l,s)),u.setAttribute("stroke",n.stroke),u.setAttribute("stroke-width",n.strokeWidth+""),u.setAttribute("fill","none"),n.strokeLineDash&&u.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&u.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":u=i.createElementNS(qT,"path"),u.setAttribute("d",this.opsToPath(l,s)),u.setAttribute("stroke","none"),u.setAttribute("stroke-width","0"),u.setAttribute("fill",n.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||u.setAttribute("fill-rule","evenodd");break;case"fillSketch":u=this.fillSketch(i,l,n)}u&&a.appendChild(u)}return a}fillSketch(e,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);let a=e.createElementNS(qT,"path");return a.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),a.setAttribute("stroke",n.fill||""),a.setAttribute("stroke-width",i+""),a.setAttribute("fill","none"),n.fillLineDash&&a.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,r){return this.gen.opsToPath(e,r)}line(e,r,n,i,a){let s=this.gen.line(e,r,n,i,a);return this.draw(s)}rectangle(e,r,n,i,a){let s=this.gen.rectangle(e,r,n,i,a);return this.draw(s)}ellipse(e,r,n,i,a){let s=this.gen.ellipse(e,r,n,i,a);return this.draw(s)}circle(e,r,n,i){let a=this.gen.circle(e,r,n,i);return this.draw(a)}linearPath(e,r){let n=this.gen.linearPath(e,r);return this.draw(n)}polygon(e,r){let n=this.gen.polygon(e,r);return this.draw(n)}arc(e,r,n,i,a,s,l=!1,u){let h=this.gen.arc(e,r,n,i,a,s,l,u);return this.draw(h)}curve(e,r){let n=this.gen.curve(e,r);return this.draw(n)}path(e,r){let n=this.gen.path(e,r);return this.draw(n)}},je={canvas:o((t,e)=>new AL(t,e),"canvas"),svg:o((t,e)=>new _L(t,e),"svg"),generator:o(t=>new vm(t),"generator"),newSeed:o(()=>vm.newSeed(),"newSeed")}});function qQ(t,e){let{labelStyles:r}=qe(e);e.labelStyle=r;let n=ot(e),i=n;n||(i="anchor");let a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=1,{cssStyles:l}=e,u=je.svg(a),h=Qe(e,{fill:"black",stroke:"none",fillStyle:"solid"});e.look!=="handDrawn"&&(h.roughness=0);let f=u.circle(0,0,s*2,h),d=a.insert(()=>f,":first-child");return d.attr("class","anchor").attr("style",ii(l)),Ke(e,d),e.intersect=function(p){return X.info("Circle intersect",e,s,p),Xe.circle(e,s,p)},a}var YQ=N(()=>{"use strict";yt();Ft();Ht();Gt();Wt();nr();o(qQ,"anchor")});function XQ(t,e,r,n,i,a,s){let u=(t+r)/2,h=(e+n)/2,f=Math.atan2(n-e,r-t),d=(r-t)/2,p=(n-e)/2,m=d/i,g=p/a,y=Math.sqrt(m**2+g**2);if(y>1)throw new Error("The given radii are too small to create an arc between the points.");let v=Math.sqrt(1-y**2),x=u+v*a*Math.sin(f)*(s?-1:1),b=h-v*i*Math.cos(f)*(s?-1:1),T=Math.atan2((e-b)/a,(t-x)/i),w=Math.atan2((n-b)/a,(r-x)/i)-T;s&&w<0&&(w+=2*Math.PI),!s&&w>0&&(w-=2*Math.PI);let E=[];for(let _=0;_<20;_++){let A=_/19,D=T+A*w,O=x+i*Math.cos(D),R=b+a*Math.sin(D);E.push({x:O,y:R})}return E}async function jQ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await pt(t,e,ot(e)),s=a.width+e.padding+20,l=a.height+e.padding,u=l/2,h=u/(2.5+l/50),{cssStyles:f}=e,d=[{x:s/2,y:-l/2},{x:-s/2,y:-l/2},...XQ(-s/2,-l/2,-s/2,l/2,h,u,!1),{x:s/2,y:l/2},...XQ(s/2,l/2,s/2,-l/2,h,u,!0)],p=je.svg(i),m=Qe(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=zt(d),y=p.path(g,m),v=i.insert(()=>y,":first-child");return v.attr("class","basic label-container"),f&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",n),v.attr("transform",`translate(${h/2}, 0)`),Ke(e,v),e.intersect=function(x){return Xe.polygon(e,d,x)},i}var KQ=N(()=>{"use strict";Ft();Ht();Gt();Wt();o(XQ,"generateArcPoints");o(jQ,"bowTieRect")});function Ms(t,e,r,n){return t.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}var qh=N(()=>{"use strict";o(Ms,"insertPolygonShape")});async function QQ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await pt(t,e,ot(e)),s=a.height+e.padding,l=12,u=a.width+e.padding+l,h=0,f=u,d=-s,p=0,m=[{x:h+l,y:d},{x:f,y:d},{x:f,y:p},{x:h,y:p},{x:h,y:d+l},{x:h+l,y:d}],g,{cssStyles:y}=e;if(e.look==="handDrawn"){let v=je.svg(i),x=Qe(e,{}),b=zt(m),T=v.path(b,x);g=i.insert(()=>T,":first-child").attr("transform",`translate(${-u/2}, ${s/2})`),y&&g.attr("style",y)}else g=Ms(i,u,s,m);return n&&g.attr("style",n),Ke(e,g),e.intersect=function(v){return Xe.polygon(e,m,v)},i}var ZQ=N(()=>{"use strict";Ft();Ht();Gt();Wt();qh();Ft();o(QQ,"card")});function JQ(t,e){let{nodeStyles:r}=qe(e);e.label="";let n=t.insert("g").attr("class",ot(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,a=Math.max(28,e.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],l=je.svg(n),u=Qe(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let h=zt(s),f=l.path(h,u),d=n.insert(()=>f,":first-child");return i&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",i),r&&e.look!=="handDrawn"&&d.selectAll("path").attr("style",r),e.width=28,e.height=28,e.intersect=function(p){return Xe.polygon(e,s,p)},n}var eZ=N(()=>{"use strict";Ht();Wt();Gt();Ft();o(JQ,"choice")});async function tZ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,halfPadding:s}=await pt(t,e,ot(e)),l=a.width/2+s,u,{cssStyles:h}=e;if(e.look==="handDrawn"){let f=je.svg(i),d=Qe(e,{}),p=f.circle(0,0,l*2,d);u=i.insert(()=>p,":first-child"),u.attr("class","basic label-container").attr("style",ii(h))}else u=i.insert("circle",":first-child").attr("class","basic label-container").attr("style",n).attr("r",l).attr("cx",0).attr("cy",0);return Ke(e,u),e.intersect=function(f){return X.info("Circle intersect",e,l,f),Xe.circle(e,l,f)},i}var rZ=N(()=>{"use strict";yt();Ft();Ht();Gt();Wt();nr();o(tZ,"circle")});function NDe(t){let e=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=t*2,i={x:n/2*e,y:n/2*r},a={x:-(n/2)*e,y:n/2*r},s={x:-(n/2)*e,y:-(n/2)*r},l={x:n/2*e,y:-(n/2)*r};return`M ${a.x},${a.y} L ${l.x},${l.y}
M ${i.x},${i.y} L ${s.x},${s.y}`}function nZ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r,e.label="";let i=t.insert("g").attr("class",ot(e)).attr("id",e.domId??e.id),a=Math.max(30,e?.width??0),{cssStyles:s}=e,l=je.svg(i),u=Qe(e,{});e.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let h=l.circle(0,0,a*2,u),f=NDe(a),d=l.path(f,u),p=i.insert(()=>h,":first-child");return p.insert(()=>d),s&&e.look!=="handDrawn"&&p.selectAll("path").attr("style",s),n&&e.look!=="handDrawn"&&p.selectAll("path").attr("style",n),Ke(e,p),e.intersect=function(m){return X.info("crossedCircle intersect",e,{radius:a,point:m}),Xe.circle(e,a,m)},i}var iZ=N(()=>{"use strict";yt();Ft();Gt();Wt();Ht();o(NDe,"createLine");o(nZ,"crossedCircle")});function Yh(t,e,r,n=100,i=0,a=180){let s=[],l=i*Math.PI/180,f=(a*Math.PI/180-l)/(n-1);for(let d=0;dT,":first-child").attr("stroke-opacity",0),C.insert(()=>x,":first-child"),C.attr("class","text"),f&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${h}, 0)`),s.attr("transform",`translate(${-l/2+h-(a.x-(a.left??0))},${-u/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Ke(e,C),e.intersect=function(w){return Xe.polygon(e,p,w)},i}var sZ=N(()=>{"use strict";Ft();Ht();Gt();Wt();o(Yh,"generateCirclePoints");o(aZ,"curlyBraceLeft")});function Xh(t,e,r,n=100,i=0,a=180){let s=[],l=i*Math.PI/180,f=(a*Math.PI/180-l)/(n-1);for(let d=0;dT,":first-child").attr("stroke-opacity",0),C.insert(()=>x,":first-child"),C.attr("class","text"),f&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${-h}, 0)`),s.attr("transform",`translate(${-l/2+(e.padding??0)/2-(a.x-(a.left??0))},${-u/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Ke(e,C),e.intersect=function(w){return Xe.polygon(e,p,w)},i}var lZ=N(()=>{"use strict";Ft();Ht();Gt();Wt();o(Xh,"generateCirclePoints");o(oZ,"curlyBraceRight")});function Ra(t,e,r,n=100,i=0,a=180){let s=[],l=i*Math.PI/180,f=(a*Math.PI/180-l)/(n-1);for(let d=0;d_,":first-child").attr("stroke-opacity",0),A.insert(()=>b,":first-child"),A.insert(()=>w,":first-child"),A.attr("class","text"),f&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",f),n&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",n),A.attr("transform",`translate(${h-h/4}, 0)`),s.attr("transform",`translate(${-l/2+(e.padding??0)/2-(a.x-(a.left??0))},${-u/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Ke(e,A),e.intersect=function(D){return Xe.polygon(e,m,D)},i}var uZ=N(()=>{"use strict";Ft();Ht();Gt();Wt();o(Ra,"generateCirclePoints");o(cZ,"curlyBraces")});async function hZ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await pt(t,e,ot(e)),s=80,l=20,u=Math.max(s,(a.width+(e.padding??0)*2)*1.25,e?.width??0),h=Math.max(l,a.height+(e.padding??0)*2,e?.height??0),f=h/2,{cssStyles:d}=e,p=je.svg(i),m=Qe(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=u,y=h,v=g-f,x=y/4,b=[{x:v,y:0},{x,y:0},{x:0,y:y/2},{x,y},{x:v,y},...Bd(-v,-y/2,f,50,270,90)],T=zt(b),C=p.path(T,m),w=i.insert(()=>C,":first-child");return w.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&w.selectChildren("path").attr("style",d),n&&e.look!=="handDrawn"&&w.selectChildren("path").attr("style",n),w.attr("transform",`translate(${-u/2}, ${-h/2})`),Ke(e,w),e.intersect=function(E){return Xe.polygon(e,b,E)},i}var fZ=N(()=>{"use strict";Ft();Ht();Gt();Wt();o(hZ,"curvedTrapezoid")});async function dZ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,label:s}=await pt(t,e,ot(e)),l=Math.max(a.width+e.padding,e.width??0),u=l/2,h=u/(2.5+l/50),f=Math.max(a.height+h+e.padding,e.height??0),d,{cssStyles:p}=e;if(e.look==="handDrawn"){let m=je.svg(i),g=IDe(0,0,l,f,u,h),y=ODe(0,h,l,f,u,h),v=m.path(g,Qe(e,{})),x=m.path(y,Qe(e,{fill:"none"}));d=i.insert(()=>x,":first-child"),d=i.insert(()=>v,":first-child"),d.attr("class","basic label-container"),p&&d.attr("style",p)}else{let m=MDe(0,0,l,f,u,h);d=i.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",ii(p)).attr("style",n)}return d.attr("label-offset-y",h),d.attr("transform",`translate(${-l/2}, ${-(f/2+h)})`),Ke(e,d),s.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+(e.padding??0)/1.5-(a.y-(a.top??0))})`),e.intersect=function(m){let g=Xe.rect(e,m),y=g.x-(e.x??0);if(u!=0&&(Math.abs(y)<(e.width??0)/2||Math.abs(y)==(e.width??0)/2&&Math.abs(g.y-(e.y??0))>(e.height??0)/2-h)){let v=h*h*(1-y*y/(u*u));v>0&&(v=Math.sqrt(v)),v=h-v,m.y-(e.y??0)>0&&(v=-v),g.y+=v}return g},i}var MDe,IDe,ODe,pZ=N(()=>{"use strict";Ft();Ht();Gt();Wt();nr();MDe=o((t,e,r,n,i,a)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),IDe=o((t,e,r,n,i,a)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),ODe=o((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");o(dZ,"cylinder")});async function mZ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,label:s}=await pt(t,e,ot(e)),l=a.width+e.padding,u=a.height+e.padding,h=u*.2,f=-l/2,d=-u/2-h/2,{cssStyles:p}=e,m=je.svg(i),g=Qe(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let y=[{x:f,y:d+h},{x:-f,y:d+h},{x:-f,y:-d},{x:f,y:-d},{x:f,y:d},{x:-f,y:d},{x:-f,y:d+h}],v=m.polygon(y.map(b=>[b.x,b.y]),g),x=i.insert(()=>v,":first-child");return x.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",n),s.attr("transform",`translate(${f+(e.padding??0)/2-(a.x-(a.left??0))}, ${d+h+(e.padding??0)/2-(a.y-(a.top??0))})`),Ke(e,x),e.intersect=function(b){return Xe.rect(e,b)},i}var gZ=N(()=>{"use strict";Ft();Ht();Gt();Wt();o(mZ,"dividedRectangle")});async function yZ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,halfPadding:s}=await pt(t,e,ot(e)),u=a.width/2+s+5,h=a.width/2+s,f,{cssStyles:d}=e;if(e.look==="handDrawn"){let p=je.svg(i),m=Qe(e,{roughness:.2,strokeWidth:2.5}),g=Qe(e,{roughness:.2,strokeWidth:1.5}),y=p.circle(0,0,u*2,m),v=p.circle(0,0,h*2,g);f=i.insert("g",":first-child"),f.attr("class",ii(e.cssClasses)).attr("style",ii(d)),f.node()?.appendChild(y),f.node()?.appendChild(v)}else{f=i.insert("g",":first-child");let p=f.insert("circle",":first-child"),m=f.insert("circle");f.attr("class","basic label-container").attr("style",n),p.attr("class","outer-circle").attr("style",n).attr("r",u).attr("cx",0).attr("cy",0),m.attr("class","inner-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0)}return Ke(e,f),e.intersect=function(p){return X.info("DoubleCircle intersect",e,u,p),Xe.circle(e,u,p)},i}var vZ=N(()=>{"use strict";yt();Ft();Ht();Gt();Wt();nr();o(yZ,"doublecircle")});function xZ(t,e,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=qe(e);e.label="",e.labelStyle=n;let a=t.insert("g").attr("class",ot(e)).attr("id",e.domId??e.id),s=7,{cssStyles:l}=e,u=je.svg(a),{nodeBorder:h}=r,f=Qe(e,{fillStyle:"solid"});e.look!=="handDrawn"&&(f.roughness=0);let d=u.circle(0,0,s*2,f),p=a.insert(()=>d,":first-child");return p.selectAll("path").attr("style",`fill: ${h} !important;`),l&&l.length>0&&e.look!=="handDrawn"&&p.selectAll("path").attr("style",l),i&&e.look!=="handDrawn"&&p.selectAll("path").attr("style",i),Ke(e,p),e.intersect=function(m){return X.info("filledCircle intersect",e,{radius:s,point:m}),Xe.circle(e,s,m)},a}var bZ=N(()=>{"use strict";Wt();yt();Ht();Gt();Ft();o(xZ,"filledCircle")});async function TZ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,label:s}=await pt(t,e,ot(e)),l=a.width+(e.padding??0),u=l+a.height,h=l+a.height,f=[{x:0,y:-u},{x:h,y:-u},{x:h/2,y:0}],{cssStyles:d}=e,p=je.svg(i),m=Qe(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=zt(f),y=p.path(g,m),v=i.insert(()=>y,":first-child").attr("transform",`translate(${-u/2}, ${u/2})`);return d&&e.look!=="handDrawn"&&v.selectChildren("path").attr("style",d),n&&e.look!=="handDrawn"&&v.selectChildren("path").attr("style",n),e.width=l,e.height=u,Ke(e,v),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${-u/2+(e.padding??0)/2+(a.y-(a.top??0))})`),e.intersect=function(x){return X.info("Triangle intersect",e,f,x),Xe.polygon(e,f,x)},i}var wZ=N(()=>{"use strict";yt();Ft();Ht();Gt();Wt();Ft();o(TZ,"flippedTriangle")});function kZ(t,e,{dir:r,config:{state:n,themeVariables:i}}){let{nodeStyles:a}=qe(e);e.label="";let s=t.insert("g").attr("class",ot(e)).attr("id",e.domId??e.id),{cssStyles:l}=e,u=Math.max(70,e?.width??0),h=Math.max(10,e?.height??0);r==="LR"&&(u=Math.max(10,e?.width??0),h=Math.max(70,e?.height??0));let f=-1*u/2,d=-1*h/2,p=je.svg(s),m=Qe(e,{stroke:i.lineColor,fill:i.lineColor});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=p.rectangle(f,d,u,h,m),y=s.insert(()=>g,":first-child");l&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",l),a&&e.look!=="handDrawn"&&y.selectAll("path").attr("style",a),Ke(e,y);let v=n?.padding??0;return e.width&&e.height&&(e.width+=v/2||0,e.height+=v/2||0),e.intersect=function(x){return Xe.rect(e,x)},s}var EZ=N(()=>{"use strict";Wt();Ht();Gt();Ft();o(kZ,"forkJoin")});async function SZ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let i=80,a=50,{shapeSvg:s,bbox:l}=await pt(t,e,ot(e)),u=Math.max(i,l.width+(e.padding??0)*2,e?.width??0),h=Math.max(a,l.height+(e.padding??0)*2,e?.height??0),f=h/2,{cssStyles:d}=e,p=je.svg(s),m=Qe(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=[{x:-u/2,y:-h/2},{x:u/2-f,y:-h/2},...Bd(-u/2+f,0,f,50,90,270),{x:u/2-f,y:h/2},{x:-u/2,y:h/2}],y=zt(g),v=p.path(y,m),x=s.insert(()=>v,":first-child");return x.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",d),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),Ke(e,x),e.intersect=function(b){return X.info("Pill intersect",e,{radius:f,point:b}),Xe.polygon(e,g,b)},s}var CZ=N(()=>{"use strict";yt();Ft();Ht();Gt();Wt();o(SZ,"halfRoundedRectangle")});async function AZ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await pt(t,e,ot(e)),s=a.height+(e.padding??0),l=a.width+(e.padding??0)*2.5,{cssStyles:u}=e,h=je.svg(i),f=Qe(e,{});e.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let d=l/2,p=d/6;d=d+p;let m=s/2,g=m/2,y=d-g,v=[{x:-y,y:-m},{x:0,y:-m},{x:y,y:-m},{x:d,y:0},{x:y,y:m},{x:0,y:m},{x:-y,y:m},{x:-d,y:0}],x=zt(v),b=h.path(x,f),T=i.insert(()=>b,":first-child");return T.attr("class","basic label-container"),u&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",u),n&&e.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),e.width=l,e.height=s,Ke(e,T),e.intersect=function(C){return Xe.polygon(e,v,C)},i}var _Z=N(()=>{"use strict";Ft();Ht();Gt();Wt();o(AZ,"hexagon")});async function DZ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.label="",e.labelStyle=r;let{shapeSvg:i}=await pt(t,e,ot(e)),a=Math.max(30,e?.width??0),s=Math.max(30,e?.height??0),{cssStyles:l}=e,u=je.svg(i),h=Qe(e,{});e.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let f=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],d=zt(f),p=u.path(d,h),m=i.insert(()=>p,":first-child");return m.attr("class","basic label-container"),l&&e.look!=="handDrawn"&&m.selectChildren("path").attr("style",l),n&&e.look!=="handDrawn"&&m.selectChildren("path").attr("style",n),m.attr("transform",`translate(${-a/2}, ${-s/2})`),Ke(e,m),e.intersect=function(g){return X.info("Pill intersect",e,{points:f}),Xe.polygon(e,f,g)},i}var LZ=N(()=>{"use strict";yt();Ft();Ht();Gt();Wt();o(DZ,"hourglass")});async function RZ(t,e,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=qe(e);e.labelStyle=i;let a=e.assetHeight??48,s=e.assetWidth??48,l=Math.max(a,s),u=n?.wrappingWidth;e.width=Math.max(l,u??0);let{shapeSvg:h,bbox:f,label:d}=await pt(t,e,"icon-shape default"),p=e.pos==="t",m=l,g=l,{nodeBorder:y}=r,{stylesMap:v}=vc(e),x=-g/2,b=-m/2,T=e.label?8:0,C=je.svg(h),w=Qe(e,{stroke:"none",fill:"none"});e.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let E=C.rectangle(x,b,g,m,w),_=Math.max(g,f.width),A=m+f.height+T,D=C.rectangle(-_/2,-A/2,_,A,{...w,fill:"transparent",stroke:"none"}),O=h.insert(()=>E,":first-child"),R=h.insert(()=>D);if(e.icon){let k=h.append("g");k.html(`${await Es(e.icon,{height:l,width:l,fallbackPrefix:""})} `);let L=k.node().getBBox(),S=L.width,I=L.height,M=L.x,P=L.y;k.attr("transform",`translate(${-S/2-M},${p?f.height/2+T/2-I/2-P:-f.height/2-T/2-I/2-P})`),k.attr("style",`color: ${v.get("stroke")??y};`)}return d.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${p?-A/2:A/2-f.height})`),O.attr("transform",`translate(0,${p?f.height/2+T/2:-f.height/2-T/2})`),Ke(e,R),e.intersect=function(k){if(X.info("iconSquare intersect",e,k),!e.label)return Xe.rect(e,k);let L=e.x??0,S=e.y??0,I=e.height??0,M=[];return p?M=[{x:L-f.width/2,y:S-I/2},{x:L+f.width/2,y:S-I/2},{x:L+f.width/2,y:S-I/2+f.height+T},{x:L+g/2,y:S-I/2+f.height+T},{x:L+g/2,y:S+I/2},{x:L-g/2,y:S+I/2},{x:L-g/2,y:S-I/2+f.height+T},{x:L-f.width/2,y:S-I/2+f.height+T}]:M=[{x:L-g/2,y:S-I/2},{x:L+g/2,y:S-I/2},{x:L+g/2,y:S-I/2+m},{x:L+f.width/2,y:S-I/2+m},{x:L+f.width/2/2,y:S+I/2},{x:L-f.width/2,y:S+I/2},{x:L-f.width/2,y:S-I/2+m},{x:L-g/2,y:S-I/2+m}],Xe.polygon(e,M,k)},h}var NZ=N(()=>{"use strict";Wt();yt();rc();Ht();Gt();Ft();o(RZ,"icon")});async function MZ(t,e,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=qe(e);e.labelStyle=i;let a=e.assetHeight??48,s=e.assetWidth??48,l=Math.max(a,s),u=n?.wrappingWidth;e.width=Math.max(l,u??0);let{shapeSvg:h,bbox:f,label:d}=await pt(t,e,"icon-shape default"),p=20,m=e.label?8:0,g=e.pos==="t",{nodeBorder:y,mainBkg:v}=r,{stylesMap:x}=vc(e),b=je.svg(h),T=Qe(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let C=x.get("fill");T.stroke=C??v;let w=h.append("g");e.icon&&w.html(`${await Es(e.icon,{height:l,width:l,fallbackPrefix:""})} `);let E=w.node().getBBox(),_=E.width,A=E.height,D=E.x,O=E.y,R=Math.max(_,A)*Math.SQRT2+p*2,k=b.circle(0,0,R,T),L=Math.max(R,f.width),S=R+f.height+m,I=b.rectangle(-L/2,-S/2,L,S,{...T,fill:"transparent",stroke:"none"}),M=h.insert(()=>k,":first-child"),P=h.insert(()=>I);return w.attr("transform",`translate(${-_/2-D},${g?f.height/2+m/2-A/2-O:-f.height/2-m/2-A/2-O})`),w.attr("style",`color: ${x.get("stroke")??y};`),d.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-S/2:S/2-f.height})`),M.attr("transform",`translate(0,${g?f.height/2+m/2:-f.height/2-m/2})`),Ke(e,P),e.intersect=function(B){return X.info("iconSquare intersect",e,B),Xe.rect(e,B)},h}var IZ=N(()=>{"use strict";Wt();yt();rc();Ht();Gt();Ft();o(MZ,"iconCircle")});var Is,$d=N(()=>{"use strict";Is=o((t,e,r,n,i)=>["M",t+i,e,"H",t+r-i,"A",i,i,0,0,1,t+r,e+i,"V",e+n-i,"A",i,i,0,0,1,t+r-i,e+n,"H",t+i,"A",i,i,0,0,1,t,e+n-i,"V",e+i,"A",i,i,0,0,1,t+i,e,"Z"].join(" "),"createRoundedRectPathD")});async function OZ(t,e,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=qe(e);e.labelStyle=i;let a=e.assetHeight??48,s=e.assetWidth??48,l=Math.max(a,s),u=n?.wrappingWidth;e.width=Math.max(l,u??0);let{shapeSvg:h,bbox:f,halfPadding:d,label:p}=await pt(t,e,"icon-shape default"),m=e.pos==="t",g=l+d*2,y=l+d*2,{nodeBorder:v,mainBkg:x}=r,{stylesMap:b}=vc(e),T=-y/2,C=-g/2,w=e.label?8:0,E=je.svg(h),_=Qe(e,{});e.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");let A=b.get("fill");_.stroke=A??x;let D=E.path(Is(T,C,y,g,5),_),O=Math.max(y,f.width),R=g+f.height+w,k=E.rectangle(-O/2,-R/2,O,R,{..._,fill:"transparent",stroke:"none"}),L=h.insert(()=>D,":first-child").attr("class","icon-shape2"),S=h.insert(()=>k);if(e.icon){let I=h.append("g");I.html(`${await Es(e.icon,{height:l,width:l,fallbackPrefix:""})} `);let M=I.node().getBBox(),P=M.width,B=M.height,F=M.x,z=M.y;I.attr("transform",`translate(${-P/2-F},${m?f.height/2+w/2-B/2-z:-f.height/2-w/2-B/2-z})`),I.attr("style",`color: ${b.get("stroke")??v};`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-R/2:R/2-f.height})`),L.attr("transform",`translate(0,${m?f.height/2+w/2:-f.height/2-w/2})`),Ke(e,S),e.intersect=function(I){if(X.info("iconSquare intersect",e,I),!e.label)return Xe.rect(e,I);let M=e.x??0,P=e.y??0,B=e.height??0,F=[];return m?F=[{x:M-f.width/2,y:P-B/2},{x:M+f.width/2,y:P-B/2},{x:M+f.width/2,y:P-B/2+f.height+w},{x:M+y/2,y:P-B/2+f.height+w},{x:M+y/2,y:P+B/2},{x:M-y/2,y:P+B/2},{x:M-y/2,y:P-B/2+f.height+w},{x:M-f.width/2,y:P-B/2+f.height+w}]:F=[{x:M-y/2,y:P-B/2},{x:M+y/2,y:P-B/2},{x:M+y/2,y:P-B/2+g},{x:M+f.width/2,y:P-B/2+g},{x:M+f.width/2/2,y:P+B/2},{x:M-f.width/2,y:P+B/2},{x:M-f.width/2,y:P-B/2+g},{x:M-y/2,y:P-B/2+g}],Xe.polygon(e,F,I)},h}var PZ=N(()=>{"use strict";Wt();yt();rc();Ht();Gt();$d();Ft();o(OZ,"iconRounded")});async function BZ(t,e,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=qe(e);e.labelStyle=i;let a=e.assetHeight??48,s=e.assetWidth??48,l=Math.max(a,s),u=n?.wrappingWidth;e.width=Math.max(l,u??0);let{shapeSvg:h,bbox:f,halfPadding:d,label:p}=await pt(t,e,"icon-shape default"),m=e.pos==="t",g=l+d*2,y=l+d*2,{nodeBorder:v,mainBkg:x}=r,{stylesMap:b}=vc(e),T=-y/2,C=-g/2,w=e.label?8:0,E=je.svg(h),_=Qe(e,{});e.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");let A=b.get("fill");_.stroke=A??x;let D=E.path(Is(T,C,y,g,.1),_),O=Math.max(y,f.width),R=g+f.height+w,k=E.rectangle(-O/2,-R/2,O,R,{..._,fill:"transparent",stroke:"none"}),L=h.insert(()=>D,":first-child"),S=h.insert(()=>k);if(e.icon){let I=h.append("g");I.html(`${await Es(e.icon,{height:l,width:l,fallbackPrefix:""})} `);let M=I.node().getBBox(),P=M.width,B=M.height,F=M.x,z=M.y;I.attr("transform",`translate(${-P/2-F},${m?f.height/2+w/2-B/2-z:-f.height/2-w/2-B/2-z})`),I.attr("style",`color: ${b.get("stroke")??v};`)}return p.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-R/2:R/2-f.height})`),L.attr("transform",`translate(0,${m?f.height/2+w/2:-f.height/2-w/2})`),Ke(e,S),e.intersect=function(I){if(X.info("iconSquare intersect",e,I),!e.label)return Xe.rect(e,I);let M=e.x??0,P=e.y??0,B=e.height??0,F=[];return m?F=[{x:M-f.width/2,y:P-B/2},{x:M+f.width/2,y:P-B/2},{x:M+f.width/2,y:P-B/2+f.height+w},{x:M+y/2,y:P-B/2+f.height+w},{x:M+y/2,y:P+B/2},{x:M-y/2,y:P+B/2},{x:M-y/2,y:P-B/2+f.height+w},{x:M-f.width/2,y:P-B/2+f.height+w}]:F=[{x:M-y/2,y:P-B/2},{x:M+y/2,y:P-B/2},{x:M+y/2,y:P-B/2+g},{x:M+f.width/2,y:P-B/2+g},{x:M+f.width/2/2,y:P+B/2},{x:M-f.width/2,y:P+B/2},{x:M-f.width/2,y:P-B/2+g},{x:M-y/2,y:P-B/2+g}],Xe.polygon(e,F,I)},h}var FZ=N(()=>{"use strict";Wt();yt();rc();Ht();$d();Gt();Ft();o(BZ,"iconSquare")});async function $Z(t,e,{config:{flowchart:r}}){let n=new Image;n.src=e?.img??"",await n.decode();let i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));e.imageAspectRatio=i/a;let{labelStyles:s}=qe(e);e.labelStyle=s;let l=r?.wrappingWidth;e.defaultWidth=r?.wrappingWidth;let u=Math.max(e.label?l??0:0,e?.assetWidth??i),h=e.constraint==="on"&&e?.assetHeight?e.assetHeight*e.imageAspectRatio:u,f=e.constraint==="on"?h/e.imageAspectRatio:e?.assetHeight??a;e.width=Math.max(h,l??0);let{shapeSvg:d,bbox:p,label:m}=await pt(t,e,"image-shape default"),g=e.pos==="t",y=-h/2,v=-f/2,x=e.label?8:0,b=je.svg(d),T=Qe(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let C=b.rectangle(y,v,h,f,T),w=Math.max(h,p.width),E=f+p.height+x,_=b.rectangle(-w/2,-E/2,w,E,{...T,fill:"none",stroke:"none"}),A=d.insert(()=>C,":first-child"),D=d.insert(()=>_);if(e.img){let O=d.append("image");O.attr("href",e.img),O.attr("width",h),O.attr("height",f),O.attr("preserveAspectRatio","none"),O.attr("transform",`translate(${-h/2},${g?E/2-f:-E/2})`)}return m.attr("transform",`translate(${-p.width/2-(p.x-(p.left??0))},${g?-f/2-p.height/2-x/2:f/2-p.height/2+x/2})`),A.attr("transform",`translate(0,${g?p.height/2+x/2:-p.height/2-x/2})`),Ke(e,D),e.intersect=function(O){if(X.info("iconSquare intersect",e,O),!e.label)return Xe.rect(e,O);let R=e.x??0,k=e.y??0,L=e.height??0,S=[];return g?S=[{x:R-p.width/2,y:k-L/2},{x:R+p.width/2,y:k-L/2},{x:R+p.width/2,y:k-L/2+p.height+x},{x:R+h/2,y:k-L/2+p.height+x},{x:R+h/2,y:k+L/2},{x:R-h/2,y:k+L/2},{x:R-h/2,y:k-L/2+p.height+x},{x:R-p.width/2,y:k-L/2+p.height+x}]:S=[{x:R-h/2,y:k-L/2},{x:R+h/2,y:k-L/2},{x:R+h/2,y:k-L/2+f},{x:R+p.width/2,y:k-L/2+f},{x:R+p.width/2/2,y:k+L/2},{x:R-p.width/2,y:k+L/2},{x:R-p.width/2,y:k-L/2+f},{x:R-h/2,y:k-L/2+f}],Xe.polygon(e,S,O)},d}var zZ=N(()=>{"use strict";Wt();yt();Ht();Gt();Ft();o($Z,"imageSquare")});async function GZ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await pt(t,e,ot(e)),s=Math.max(a.width+(e.padding??0)*2,e?.width??0),l=Math.max(a.height+(e.padding??0)*2,e?.height??0),u=[{x:0,y:0},{x:s,y:0},{x:s+3*l/6,y:-l},{x:-3*l/6,y:-l}],h,{cssStyles:f}=e;if(e.look==="handDrawn"){let d=je.svg(i),p=Qe(e,{}),m=zt(u),g=d.path(m,p);h=i.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${l/2})`),f&&h.attr("style",f)}else h=Ms(i,s,l,u);return n&&h.attr("style",n),e.width=s,e.height=l,Ke(e,h),e.intersect=function(d){return Xe.polygon(e,u,d)},i}var VZ=N(()=>{"use strict";Ft();Ht();Gt();Wt();qh();o(GZ,"inv_trapezoid")});async function zd(t,e,r){let{labelStyles:n,nodeStyles:i}=qe(e);e.labelStyle=n;let{shapeSvg:a,bbox:s}=await pt(t,e,ot(e)),l=Math.max(s.width+r.labelPaddingX*2,e?.width||0),u=Math.max(s.height+r.labelPaddingY*2,e?.height||0),h=-l/2,f=-u/2,d,{rx:p,ry:m}=e,{cssStyles:g}=e;if(r?.rx&&r.ry&&(p=r.rx,m=r.ry),e.look==="handDrawn"){let y=je.svg(a),v=Qe(e,{}),x=p||m?y.path(Is(h,f,l,u,p||0),v):y.rectangle(h,f,l,u,v);d=a.insert(()=>x,":first-child"),d.attr("class","basic label-container").attr("style",ii(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",ii(p)).attr("ry",ii(m)).attr("x",h).attr("y",f).attr("width",l).attr("height",u);return Ke(e,d),e.intersect=function(y){return Xe.rect(e,y)},a}var _2=N(()=>{"use strict";Ft();Ht();$d();Gt();Wt();nr();o(zd,"drawRect")});async function UZ(t,e){let{shapeSvg:r,bbox:n,label:i}=await pt(t,e,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),i.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Ke(e,a),e.intersect=function(u){return Xe.rect(e,u)},r}var HZ=N(()=>{"use strict";_2();Ft();Ht();o(UZ,"labelRect")});async function WZ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await pt(t,e,ot(e)),s=Math.max(a.width+(e.padding??0),e?.width??0),l=Math.max(a.height+(e.padding??0),e?.height??0),u=[{x:0,y:0},{x:s+3*l/6,y:0},{x:s,y:-l},{x:-(3*l)/6,y:-l}],h,{cssStyles:f}=e;if(e.look==="handDrawn"){let d=je.svg(i),p=Qe(e,{}),m=zt(u),g=d.path(m,p);h=i.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${l/2})`),f&&h.attr("style",f)}else h=Ms(i,s,l,u);return n&&h.attr("style",n),e.width=s,e.height=l,Ke(e,h),e.intersect=function(d){return Xe.polygon(e,u,d)},i}var qZ=N(()=>{"use strict";Ft();Ht();Gt();Wt();qh();o(WZ,"lean_left")});async function YZ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await pt(t,e,ot(e)),s=Math.max(a.width+(e.padding??0),e?.width??0),l=Math.max(a.height+(e.padding??0),e?.height??0),u=[{x:-3*l/6,y:0},{x:s,y:0},{x:s+3*l/6,y:-l},{x:0,y:-l}],h,{cssStyles:f}=e;if(e.look==="handDrawn"){let d=je.svg(i),p=Qe(e,{}),m=zt(u),g=d.path(m,p);h=i.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${l/2})`),f&&h.attr("style",f)}else h=Ms(i,s,l,u);return n&&h.attr("style",n),e.width=s,e.height=l,Ke(e,h),e.intersect=function(d){return Xe.polygon(e,u,d)},i}var XZ=N(()=>{"use strict";Ft();Ht();Gt();Wt();qh();o(YZ,"lean_right")});function jZ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.label="",e.labelStyle=r;let i=t.insert("g").attr("class",ot(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,s=Math.max(35,e?.width??0),l=Math.max(35,e?.height??0),u=7,h=[{x:s,y:0},{x:0,y:l+u/2},{x:s-2*u,y:l+u/2},{x:0,y:2*l},{x:s,y:l-u/2},{x:2*u,y:l-u/2}],f=je.svg(i),d=Qe(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let p=zt(h),m=f.path(p,d),g=i.insert(()=>m,":first-child");return a&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",a),n&&e.look!=="handDrawn"&&g.selectAll("path").attr("style",n),g.attr("transform",`translate(-${s/2},${-l})`),Ke(e,g),e.intersect=function(y){return X.info("lightningBolt intersect",e,y),Xe.polygon(e,h,y)},i}var KZ=N(()=>{"use strict";yt();Ft();Gt();Wt();Ht();Ft();o(jZ,"lightningBolt")});async function QZ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,label:s}=await pt(t,e,ot(e)),l=Math.max(a.width+(e.padding??0),e.width??0),u=l/2,h=u/(2.5+l/50),f=Math.max(a.height+h+(e.padding??0),e.height??0),d=f*.1,p,{cssStyles:m}=e;if(e.look==="handDrawn"){let g=je.svg(i),y=BDe(0,0,l,f,u,h,d),v=FDe(0,h,l,f,u,h),x=Qe(e,{}),b=g.path(y,x),T=g.path(v,x);i.insert(()=>T,":first-child").attr("class","line"),p=i.insert(()=>b,":first-child"),p.attr("class","basic label-container"),m&&p.attr("style",m)}else{let g=PDe(0,0,l,f,u,h,d);p=i.insert("path",":first-child").attr("d",g).attr("class","basic label-container").attr("style",ii(m)).attr("style",n)}return p.attr("label-offset-y",h),p.attr("transform",`translate(${-l/2}, ${-(f/2+h)})`),Ke(e,p),s.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${-(a.height/2)+h-(a.y-(a.top??0))})`),e.intersect=function(g){let y=Xe.rect(e,g),v=y.x-(e.x??0);if(u!=0&&(Math.abs(v)<(e.width??0)/2||Math.abs(v)==(e.width??0)/2&&Math.abs(y.y-(e.y??0))>(e.height??0)/2-h)){let x=h*h*(1-v*v/(u*u));x>0&&(x=Math.sqrt(x)),x=h-x,g.y-(e.y??0)>0&&(x=-x),y.y+=x}return y},i}var PDe,BDe,FDe,ZZ=N(()=>{"use strict";Ft();Ht();Gt();Wt();nr();PDe=o((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`a${i},${a} 0,0,0 ${r},0`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),BDe=o((t,e,r,n,i,a,s)=>[`M${t},${e+a}`,`M${t+r},${e+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${t},${e+a+s}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),FDe=o((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");o(QZ,"linedCylinder")});async function JZ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,label:s}=await pt(t,e,ot(e)),l=Math.max(a.width+(e.padding??0)*2,e?.width??0),u=Math.max(a.height+(e.padding??0)*2,e?.height??0),h=u/4,f=u+h,{cssStyles:d}=e,p=je.svg(i),m=Qe(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=[{x:-l/2-l/2*.1,y:-f/2},{x:-l/2-l/2*.1,y:f/2},...$o(-l/2-l/2*.1,f/2,l/2+l/2*.1,f/2,h,.8),{x:l/2+l/2*.1,y:-f/2},{x:-l/2-l/2*.1,y:-f/2},{x:-l/2,y:-f/2},{x:-l/2,y:f/2*1.1},{x:-l/2,y:-f/2}],y=p.polygon(g.map(x=>[x.x,x.y]),m),v=i.insert(()=>y,":first-child");return v.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",d),n&&e.look!=="handDrawn"&&v.selectAll("path").attr("style",n),v.attr("transform",`translate(0,${-h/2})`),s.attr("transform",`translate(${-l/2+(e.padding??0)+l/2*.1/2-(a.x-(a.left??0))},${-u/2+(e.padding??0)-h/2-(a.y-(a.top??0))})`),Ke(e,v),e.intersect=function(x){return Xe.polygon(e,g,x)},i}var eJ=N(()=>{"use strict";Ft();Ht();Wt();Gt();o(JZ,"linedWaveEdgedRect")});async function tJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,label:s}=await pt(t,e,ot(e)),l=Math.max(a.width+(e.padding??0)*2,e?.width??0),u=Math.max(a.height+(e.padding??0)*2,e?.height??0),h=5,f=-l/2,d=-u/2,{cssStyles:p}=e,m=je.svg(i),g=Qe(e,{}),y=[{x:f-h,y:d+h},{x:f-h,y:d+u+h},{x:f+l-h,y:d+u+h},{x:f+l-h,y:d+u},{x:f+l,y:d+u},{x:f+l,y:d+u-h},{x:f+l+h,y:d+u-h},{x:f+l+h,y:d-h},{x:f+h,y:d-h},{x:f+h,y:d},{x:f,y:d},{x:f,y:d+h}],v=[{x:f,y:d+h},{x:f+l-h,y:d+h},{x:f+l-h,y:d+u},{x:f+l,y:d+u},{x:f+l,y:d},{x:f,y:d}];e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let x=zt(y),b=m.path(x,g),T=zt(v),C=m.path(T,{...g,fill:"none"}),w=i.insert(()=>C,":first-child");return w.insert(()=>b,":first-child"),w.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),s.attr("transform",`translate(${-(a.width/2)-h-(a.x-(a.left??0))}, ${-(a.height/2)+h-(a.y-(a.top??0))})`),Ke(e,w),e.intersect=function(E){return Xe.polygon(e,y,E)},i}var rJ=N(()=>{"use strict";Ft();Gt();Wt();Ht();o(tJ,"multiRect")});async function nJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,label:s}=await pt(t,e,ot(e)),l=Math.max(a.width+(e.padding??0)*2,e?.width??0),u=Math.max(a.height+(e.padding??0)*2,e?.height??0),h=u/4,f=u+h,d=-l/2,p=-f/2,m=5,{cssStyles:g}=e,y=$o(d-m,p+f+m,d+l-m,p+f+m,h,.8),v=y?.[y.length-1],x=[{x:d-m,y:p+m},{x:d-m,y:p+f+m},...y,{x:d+l-m,y:v.y-m},{x:d+l,y:v.y-m},{x:d+l,y:v.y-2*m},{x:d+l+m,y:v.y-2*m},{x:d+l+m,y:p-m},{x:d+m,y:p-m},{x:d+m,y:p},{x:d,y:p},{x:d,y:p+m}],b=[{x:d,y:p+m},{x:d+l-m,y:p+m},{x:d+l-m,y:v.y-m},{x:d+l,y:v.y-m},{x:d+l,y:p},{x:d,y:p}],T=je.svg(i),C=Qe(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");let w=zt(x),E=T.path(w,C),_=zt(b),A=T.path(_,C),D=i.insert(()=>E,":first-child");return D.insert(()=>A),D.attr("class","basic label-container"),g&&e.look!=="handDrawn"&&D.selectAll("path").attr("style",g),n&&e.look!=="handDrawn"&&D.selectAll("path").attr("style",n),D.attr("transform",`translate(0,${-h/2})`),s.attr("transform",`translate(${-(a.width/2)-m-(a.x-(a.left??0))}, ${-(a.height/2)+m-h/2-(a.y-(a.top??0))})`),Ke(e,D),e.intersect=function(O){return Xe.polygon(e,x,O)},i}var iJ=N(()=>{"use strict";Ft();Ht();Wt();Gt();o(nJ,"multiWaveEdgedRectangle")});async function aJ(t,e,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=qe(e);e.labelStyle=n,e.useHtmlLabels||Qt().flowchart?.htmlLabels!==!1||(e.centerLabel=!0);let{shapeSvg:s,bbox:l,label:u}=await pt(t,e,ot(e)),h=Math.max(l.width+(e.padding??0)*2,e?.width??0),f=Math.max(l.height+(e.padding??0)*2,e?.height??0),d=-h/2,p=-f/2,{cssStyles:m}=e,g=je.svg(s),y=Qe(e,{fill:r.noteBkgColor,stroke:r.noteBorderColor});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=g.rectangle(d,p,h,f,y),x=s.insert(()=>v,":first-child");return x.attr("class","basic label-container"),m&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",m),i&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",i),u.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),Ke(e,x),e.intersect=function(b){return Xe.rect(e,b)},s}var sJ=N(()=>{"use strict";Wt();Ht();Gt();Ft();Jn();o(aJ,"note")});async function oJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await pt(t,e,ot(e)),s=a.width+e.padding,l=a.height+e.padding,u=s+l,h=.5,f=[{x:u/2,y:0},{x:u,y:-u/2},{x:u/2,y:-u},{x:0,y:-u/2}],d,{cssStyles:p}=e;if(e.look==="handDrawn"){let m=je.svg(i),g=Qe(e,{}),y=$De(0,0,u),v=m.path(y,g);d=i.insert(()=>v,":first-child").attr("transform",`translate(${-u/2+h}, ${u/2})`),p&&d.attr("style",p)}else d=Ms(i,u,u,f),d.attr("transform",`translate(${-u/2+h}, ${u/2})`);return n&&d.attr("style",n),Ke(e,d),e.intersect=function(m){return X.debug(`APA12 Intersect called SPLIT
point:`,m,`
node:
`,e,`
res:`,Xe.polygon(e,f,m)),Xe.polygon(e,f,m)},i}var $De,lJ=N(()=>{"use strict";yt();Ft();Ht();Gt();Wt();qh();$De=o((t,e,r)=>[`M${t+r/2},${e}`,`L${t+r},${e-r/2}`,`L${t+r/2},${e-r}`,`L${t},${e-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");o(oJ,"question")});async function cJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,label:s}=await pt(t,e,ot(e)),l=Math.max(a.width+(e.padding??0),e?.width??0),u=Math.max(a.height+(e.padding??0),e?.height??0),h=-l/2,f=-u/2,d=f/2,p=[{x:h+d,y:f},{x:h,y:0},{x:h+d,y:-f},{x:-h,y:-f},{x:-h,y:f}],{cssStyles:m}=e,g=je.svg(i),y=Qe(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=zt(p),x=g.path(v,y),b=i.insert(()=>x,":first-child");return b.attr("class","basic label-container"),m&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),b.attr("transform",`translate(${-d/2},0)`),s.attr("transform",`translate(${-d/2-a.width/2-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),Ke(e,b),e.intersect=function(T){return Xe.polygon(e,p,T)},i}var uJ=N(()=>{"use strict";Ft();Ht();Gt();Wt();o(cJ,"rect_left_inv_arrow")});function zDe(t,e){e&&t.attr("style",e)}async function GDe(t){let e=Ge(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=e.append("xhtml:div"),n=ge(),i=t.label;t.label&&gi(t.label)&&(i=await yh(t.label.replace(Ze.lineBreakRegex,`
`),n));let s='"+i+" ";return r.html(ar(s,n)),zDe(r,t.labelStyle),r.style("display","inline-block"),r.style("padding-right","1px"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),e.node()}var VDe,xc,JT=N(()=>{"use strict";pr();qt();dr();yt();nr();o(zDe,"applyStyle");o(GDe,"addHtmlLabel");VDe=o(async(t,e,r,n)=>{let i=t||"";if(typeof i=="object"&&(i=i[0]),mr(ge().flowchart.htmlLabels)){i=i.replace(/\\n|\n/g," "),X.info("vertexText"+i);let a={isNode:n,label:ta(i).replace(/fa[blrs]?:fa-[\w-]+/g,l=>` `),labelStyle:e&&e.replace("fill:","color:")};return await GDe(a)}else{let a=document.createElementNS("http://www.w3.org/2000/svg","text");a.setAttribute("style",e.replace("color:","fill:"));let s=[];typeof i=="string"?s=i.split(/\\n|\n| /gi):Array.isArray(i)?s=i:s=[];for(let l of s){let u=document.createElementNS("http://www.w3.org/2000/svg","tspan");u.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),u.setAttribute("dy","1em"),u.setAttribute("x","0"),r?u.setAttribute("class","title-row"):u.setAttribute("class","row"),u.textContent=l.trim(),a.appendChild(u)}return a}},"createLabel"),xc=VDe});async function hJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let i;e.cssClasses?i="node "+e.cssClasses:i="node default";let a=t.insert("g").attr("class",i).attr("id",e.domId||e.id),s=a.insert("g"),l=a.insert("g").attr("class","label").attr("style",n),u=e.description,h=e.label,f=l.node().appendChild(await xc(h,e.labelStyle,!0,!0)),d={width:0,height:0};if(mr(ge()?.flowchart?.htmlLabels)){let A=f.children[0],D=Ge(f);d=A.getBoundingClientRect(),D.attr("width",d.width),D.attr("height",d.height)}X.info("Text 2",u);let p=u||[],m=f.getBBox(),g=l.node().appendChild(await xc(p.join?p.join(" "):p,e.labelStyle,!0,!0)),y=g.children[0],v=Ge(g);d=y.getBoundingClientRect(),v.attr("width",d.width),v.attr("height",d.height);let x=(e.padding||0)/2;Ge(g).attr("transform","translate( "+(d.width>m.width?0:(m.width-d.width)/2)+", "+(m.height+x+5)+")"),Ge(f).attr("transform","translate( "+(d.width(X.debug("Rough node insert CXC",O),R),":first-child"),E=a.insert(()=>(X.debug("Rough node insert CXC",O),O),":first-child")}else E=s.insert("rect",":first-child"),_=s.insert("line"),E.attr("class","outer title-state").attr("style",n).attr("x",-d.width/2-x).attr("y",-d.height/2-x).attr("width",d.width+(e.padding||0)).attr("height",d.height+(e.padding||0)),_.attr("class","divider").attr("x1",-d.width/2-x).attr("x2",d.width/2+x).attr("y1",-d.height/2-x+m.height+x).attr("y2",-d.height/2-x+m.height+x);return Ke(e,E),e.intersect=function(A){return Xe.rect(e,A)},a}var fJ=N(()=>{"use strict";pr();dr();Ft();JT();Ht();Gt();Wt();qt();$d();yt();o(hJ,"rectWithTitle")});function ew(t,e,r,n,i,a,s){let u=(t+r)/2,h=(e+n)/2,f=Math.atan2(n-e,r-t),d=(r-t)/2,p=(n-e)/2,m=d/i,g=p/a,y=Math.sqrt(m**2+g**2);if(y>1)throw new Error("The given radii are too small to create an arc between the points.");let v=Math.sqrt(1-y**2),x=u+v*a*Math.sin(f)*(s?-1:1),b=h-v*i*Math.cos(f)*(s?-1:1),T=Math.atan2((e-b)/a,(t-x)/i),w=Math.atan2((n-b)/a,(r-x)/i)-T;s&&w<0&&(w+=2*Math.PI),!s&&w>0&&(w-=2*Math.PI);let E=[];for(let _=0;_<20;_++){let A=_/19,D=T+A*w,O=x+i*Math.cos(D),R=b+a*Math.sin(D);E.push({x:O,y:R})}return E}async function dJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await pt(t,e,ot(e)),s=e?.padding??0,l=e?.padding??0,u=(e?.width?e?.width:a.width)+s*2,h=(e?.height?e?.height:a.height)+l*2,f=5,d=5,{cssStyles:p}=e,m=je.svg(i),g=Qe(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let y=[{x:-u/2+d,y:-h/2},{x:u/2-d,y:-h/2},...ew(u/2-d,-h/2,u/2,-h/2+d,f,f,!0),{x:u/2,y:-h/2+d},{x:u/2,y:h/2-d},...ew(u/2,h/2-d,u/2-d,h/2,f,f,!0),{x:u/2-d,y:h/2},{x:-u/2+d,y:h/2},...ew(-u/2+d,h/2,-u/2,h/2-d,f,f,!0),{x:-u/2,y:h/2-d},{x:-u/2,y:-h/2+d},...ew(-u/2,-h/2+d,-u/2+d,-h/2,f,f,!0)],v=zt(y),x=m.path(v,g),b=i.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Ke(e,b),e.intersect=function(T){return Xe.polygon(e,y,T)},i}var pJ=N(()=>{"use strict";Ft();Ht();Gt();Wt();o(ew,"generateArcPoints");o(dJ,"roundedRect")});async function mJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,label:s}=await pt(t,e,ot(e)),l=e?.padding??0,u=Math.max(a.width+(e.padding??0)*2,e?.width??0),h=Math.max(a.height+(e.padding??0)*2,e?.height??0),f=-a.width/2-l,d=-a.height/2-l,{cssStyles:p}=e,m=je.svg(i),g=Qe(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let y=[{x:f,y:d},{x:f+u+8,y:d},{x:f+u+8,y:d+h},{x:f-8,y:d+h},{x:f-8,y:d},{x:f,y:d},{x:f,y:d+h}],v=m.polygon(y.map(b=>[b.x,b.y]),g),x=i.insert(()=>v,":first-child");return x.attr("class","basic label-container").attr("style",ii(p)),n&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",n),p&&e.look!=="handDrawn"&&x.selectAll("path").attr("style",n),s.attr("transform",`translate(${-u/2+4+(e.padding??0)-(a.x-(a.left??0))},${-h/2+(e.padding??0)-(a.y-(a.top??0))})`),Ke(e,x),e.intersect=function(b){return Xe.rect(e,b)},i}var gJ=N(()=>{"use strict";Ft();Ht();Gt();Wt();nr();o(mJ,"shadedProcess")});async function yJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,label:s}=await pt(t,e,ot(e)),l=Math.max(a.width+(e.padding??0)*2,e?.width??0),u=Math.max(a.height+(e.padding??0)*2,e?.height??0),h=-l/2,f=-u/2,{cssStyles:d}=e,p=je.svg(i),m=Qe(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let g=[{x:h,y:f},{x:h,y:f+u},{x:h+l,y:f+u},{x:h+l,y:f-u/2}],y=zt(g),v=p.path(y,m),x=i.insert(()=>v,":first-child");return x.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",d),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),x.attr("transform",`translate(0, ${u/4})`),s.attr("transform",`translate(${-l/2+(e.padding??0)-(a.x-(a.left??0))}, ${-u/4+(e.padding??0)-(a.y-(a.top??0))})`),Ke(e,x),e.intersect=function(b){return Xe.polygon(e,g,b)},i}var vJ=N(()=>{"use strict";Ft();Ht();Gt();Wt();o(yJ,"slopedRect")});async function xJ(t,e){let r={rx:0,ry:0,classes:"",labelPaddingX:(e?.padding||0)*2,labelPaddingY:(e?.padding||0)*1};return zd(t,e,r)}var bJ=N(()=>{"use strict";_2();o(xJ,"squareRect")});async function TJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await pt(t,e,ot(e)),s=a.height+e.padding,l=a.width+s/4+e.padding,u=s/2,{cssStyles:h}=e,f=je.svg(i),d=Qe(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let p=[{x:-l/2+u,y:-s/2},{x:l/2-u,y:-s/2},...Bd(-l/2+u,0,u,50,90,270),{x:l/2-u,y:s/2},...Bd(l/2-u,0,u,50,270,450)],m=zt(p),g=f.path(m,d),y=i.insert(()=>g,":first-child");return y.attr("class","basic label-container outer-path"),h&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",h),n&&e.look!=="handDrawn"&&y.selectChildren("path").attr("style",n),Ke(e,y),e.intersect=function(v){return Xe.polygon(e,p,v)},i}var wJ=N(()=>{"use strict";Ft();Ht();Gt();Wt();o(TJ,"stadium")});async function kJ(t,e){return zd(t,e,{rx:5,ry:5,classes:"flowchart-node"})}var EJ=N(()=>{"use strict";_2();o(kJ,"state")});function SJ(t,e,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=qe(e);e.labelStyle=n;let{cssStyles:a}=e,{lineColor:s,stateBorder:l,nodeBorder:u}=r,h=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),f=je.svg(h),d=Qe(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let p=f.circle(0,0,14,{...d,stroke:s,strokeWidth:2}),m=l??u,g=f.circle(0,0,5,{...d,fill:m,stroke:m,strokeWidth:2,fillStyle:"solid"}),y=h.insert(()=>p,":first-child");return y.insert(()=>g),a&&y.selectAll("path").attr("style",a),i&&y.selectAll("path").attr("style",i),Ke(e,y),e.intersect=function(v){return Xe.circle(e,7,v)},h}var CJ=N(()=>{"use strict";Wt();Ht();Gt();Ft();o(SJ,"stateEnd")});function AJ(t,e,{config:{themeVariables:r}}){let{lineColor:n}=r,i=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a;if(e.look==="handDrawn"){let l=je.svg(i).circle(0,0,14,RQ(n));a=i.insert(()=>l),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else a=i.insert("circle",":first-child"),a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return Ke(e,a),e.intersect=function(s){return Xe.circle(e,7,s)},i}var _J=N(()=>{"use strict";Wt();Ht();Gt();Ft();o(AJ,"stateStart")});async function DJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await pt(t,e,ot(e)),s=(e?.padding||0)/2,l=a.width+e.padding,u=a.height+e.padding,h=-a.width/2-s,f=-a.height/2-s,d=[{x:0,y:0},{x:l,y:0},{x:l,y:-u},{x:0,y:-u},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-u},{x:-8,y:-u},{x:-8,y:0}];if(e.look==="handDrawn"){let p=je.svg(i),m=Qe(e,{}),g=p.rectangle(h-8,f,l+16,u,m),y=p.line(h,f,h,f+u,m),v=p.line(h+l,f,h+l,f+u,m);i.insert(()=>y,":first-child"),i.insert(()=>v,":first-child");let x=i.insert(()=>g,":first-child"),{cssStyles:b}=e;x.attr("class","basic label-container").attr("style",ii(b)),Ke(e,x)}else{let p=Ms(i,l,u,d);n&&p.attr("style",n),Ke(e,p)}return e.intersect=function(p){return Xe.polygon(e,d,p)},i}var LJ=N(()=>{"use strict";Ft();Ht();Gt();Wt();qh();nr();o(DJ,"subroutine")});async function RJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await pt(t,e,ot(e)),s=Math.max(a.width+(e.padding??0)*2,e?.width??0),l=Math.max(a.height+(e.padding??0)*2,e?.height??0),u=-s/2,h=-l/2,f=.2*l,d=.2*l,{cssStyles:p}=e,m=je.svg(i),g=Qe(e,{}),y=[{x:u-f/2,y:h},{x:u+s+f/2,y:h},{x:u+s+f/2,y:h+l},{x:u-f/2,y:h+l}],v=[{x:u+s-f/2,y:h+l},{x:u+s+f/2,y:h+l},{x:u+s+f/2,y:h+l-d}];e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let x=zt(y),b=m.path(x,g),T=zt(v),C=m.path(T,{...g,fillStyle:"solid"}),w=i.insert(()=>C,":first-child");return w.insert(()=>b,":first-child"),w.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),Ke(e,w),e.intersect=function(E){return Xe.polygon(e,y,E)},i}var NJ=N(()=>{"use strict";Ft();Gt();Wt();Ht();o(RJ,"taggedRect")});async function MJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,label:s}=await pt(t,e,ot(e)),l=Math.max(a.width+(e.padding??0)*2,e?.width??0),u=Math.max(a.height+(e.padding??0)*2,e?.height??0),h=u/4,f=.2*l,d=.2*u,p=u+h,{cssStyles:m}=e,g=je.svg(i),y=Qe(e,{});e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let v=[{x:-l/2-l/2*.1,y:p/2},...$o(-l/2-l/2*.1,p/2,l/2+l/2*.1,p/2,h,.8),{x:l/2+l/2*.1,y:-p/2},{x:-l/2-l/2*.1,y:-p/2}],x=-l/2+l/2*.1,b=-p/2-d*.4,T=[{x:x+l-f,y:(b+u)*1.4},{x:x+l,y:b+u-d},{x:x+l,y:(b+u)*.9},...$o(x+l,(b+u)*1.3,x+l-f,(b+u)*1.5,-u*.03,.5)],C=zt(v),w=g.path(C,y),E=zt(T),_=g.path(E,{...y,fillStyle:"solid"}),A=i.insert(()=>_,":first-child");return A.insert(()=>w,":first-child"),A.attr("class","basic label-container"),m&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&A.selectAll("path").attr("style",n),A.attr("transform",`translate(0,${-h/2})`),s.attr("transform",`translate(${-l/2+(e.padding??0)-(a.x-(a.left??0))},${-u/2+(e.padding??0)-h/2-(a.y-(a.top??0))})`),Ke(e,A),e.intersect=function(D){return Xe.polygon(e,v,D)},i}var IJ=N(()=>{"use strict";Ft();Ht();Wt();Gt();o(MJ,"taggedWaveEdgedRectangle")});async function OJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await pt(t,e,ot(e)),s=Math.max(a.width+e.padding,e?.width||0),l=Math.max(a.height+e.padding,e?.height||0),u=-s/2,h=-l/2,f=i.insert("rect",":first-child");return f.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",u).attr("y",h).attr("width",s).attr("height",l),Ke(e,f),e.intersect=function(d){return Xe.rect(e,d)},i}var PJ=N(()=>{"use strict";Ft();Ht();Gt();o(OJ,"text")});async function BJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,label:s,halfPadding:l}=await pt(t,e,ot(e)),u=e.look==="neo"?l*2:l,h=a.height+u,f=h/2,d=f/(2.5+h/50),p=a.width+d+u,{cssStyles:m}=e,g;if(e.look==="handDrawn"){let y=je.svg(i),v=HDe(0,0,p,h,d,f),x=WDe(0,0,p,h,d,f),b=y.path(v,Qe(e,{})),T=y.path(x,Qe(e,{fill:"none"}));g=i.insert(()=>T,":first-child"),g=i.insert(()=>b,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{let y=UDe(0,0,p,h,d,f);g=i.insert("path",":first-child").attr("d",y).attr("class","basic label-container").attr("style",ii(m)).attr("style",n),g.attr("class","basic label-container"),m&&g.selectAll("path").attr("style",m),n&&g.selectAll("path").attr("style",n)}return g.attr("label-offset-x",d),g.attr("transform",`translate(${-p/2}, ${h/2} )`),s.attr("transform",`translate(${-(a.width/2)-d-(a.x-(a.left??0))}, ${-(a.height/2)-(a.y-(a.top??0))})`),Ke(e,g),e.intersect=function(y){let v=Xe.rect(e,y),x=v.y-(e.y??0);if(f!=0&&(Math.abs(x)<(e.height??0)/2||Math.abs(x)==(e.height??0)/2&&Math.abs(v.x-(e.x??0))>(e.width??0)/2-d)){let b=d*d*(1-x*x/(f*f));b!=0&&(b=Math.sqrt(Math.abs(b))),b=d-b,y.x-(e.x??0)>0&&(b=-b),v.x+=b}return v},i}var UDe,HDe,WDe,FJ=N(()=>{"use strict";Ft();Gt();Wt();Ht();nr();UDe=o((t,e,r,n,i,a)=>`M${t},${e}
a${i},${a} 0,0,1 0,${-n}
l${r},0
a${i},${a} 0,0,1 0,${n}
M${r},${-n}
a${i},${a} 0,0,0 0,${n}
l${-r},0`,"createCylinderPathD"),HDe=o((t,e,r,n,i,a)=>[`M${t},${e}`,`M${t+r},${e}`,`a${i},${a} 0,0,0 0,${-n}`,`l${-r},0`,`a${i},${a} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),WDe=o((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD");o(BJ,"tiltedCylinder")});async function $J(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await pt(t,e,ot(e)),s=a.width+e.padding,l=a.height+e.padding,u=[{x:-3*l/6,y:0},{x:s+3*l/6,y:0},{x:s,y:-l},{x:0,y:-l}],h,{cssStyles:f}=e;if(e.look==="handDrawn"){let d=je.svg(i),p=Qe(e,{}),m=zt(u),g=d.path(m,p);h=i.insert(()=>g,":first-child").attr("transform",`translate(${-s/2}, ${l/2})`),f&&h.attr("style",f)}else h=Ms(i,s,l,u);return n&&h.attr("style",n),e.width=s,e.height=l,Ke(e,h),e.intersect=function(d){return Xe.polygon(e,u,d)},i}var zJ=N(()=>{"use strict";Ft();Ht();Gt();Wt();qh();o($J,"trapezoid")});async function GJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await pt(t,e,ot(e)),s=60,l=20,u=Math.max(s,a.width+(e.padding??0)*2,e?.width??0),h=Math.max(l,a.height+(e.padding??0)*2,e?.height??0),{cssStyles:f}=e,d=je.svg(i),p=Qe(e,{});e.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let m=[{x:-u/2*.8,y:-h/2},{x:u/2*.8,y:-h/2},{x:u/2,y:-h/2*.6},{x:u/2,y:h/2},{x:-u/2,y:h/2},{x:-u/2,y:-h/2*.6}],g=zt(m),y=d.path(g,p),v=i.insert(()=>y,":first-child");return v.attr("class","basic label-container"),f&&e.look!=="handDrawn"&&v.selectChildren("path").attr("style",f),n&&e.look!=="handDrawn"&&v.selectChildren("path").attr("style",n),Ke(e,v),e.intersect=function(x){return Xe.polygon(e,m,x)},i}var VJ=N(()=>{"use strict";Ft();Ht();Gt();Wt();o(GJ,"trapezoidalPentagon")});async function UJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,label:s}=await pt(t,e,ot(e)),l=mr(ge().flowchart?.htmlLabels),u=a.width+(e.padding??0),h=u+a.height,f=u+a.height,d=[{x:0,y:0},{x:f,y:0},{x:f/2,y:-h}],{cssStyles:p}=e,m=je.svg(i),g=Qe(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let y=zt(d),v=m.path(y,g),x=i.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`);return p&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",p),n&&e.look!=="handDrawn"&&x.selectChildren("path").attr("style",n),e.width=u,e.height=h,Ke(e,x),s.attr("transform",`translate(${-a.width/2-(a.x-(a.left??0))}, ${h/2-(a.height+(e.padding??0)/(l?2:1)-(a.y-(a.top??0)))})`),e.intersect=function(b){return X.info("Triangle intersect",e,d,b),Xe.polygon(e,d,b)},i}var HJ=N(()=>{"use strict";yt();Ft();Ht();Gt();Wt();Ft();dr();qt();o(UJ,"triangle")});async function WJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,label:s}=await pt(t,e,ot(e)),l=Math.max(a.width+(e.padding??0)*2,e?.width??0),u=Math.max(a.height+(e.padding??0)*2,e?.height??0),h=u/8,f=u+h,{cssStyles:d}=e,m=70-l,g=m>0?m/2:0,y=je.svg(i),v=Qe(e,{});e.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let x=[{x:-l/2-g,y:f/2},...$o(-l/2-g,f/2,l/2+g,f/2,h,.8),{x:l/2+g,y:-f/2},{x:-l/2-g,y:-f/2}],b=zt(x),T=y.path(b,v),C=i.insert(()=>T,":first-child");return C.attr("class","basic label-container"),d&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",d),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(0,${-h/2})`),s.attr("transform",`translate(${-l/2+(e.padding??0)-(a.x-(a.left??0))},${-u/2+(e.padding??0)-h-(a.y-(a.top??0))})`),Ke(e,C),e.intersect=function(w){return Xe.polygon(e,x,w)},i}var qJ=N(()=>{"use strict";Ft();Ht();Wt();Gt();o(WJ,"waveEdgedRectangle")});async function YJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a}=await pt(t,e,ot(e)),s=100,l=50,u=Math.max(a.width+(e.padding??0)*2,e?.width??0),h=Math.max(a.height+(e.padding??0)*2,e?.height??0),f=u/h,d=u,p=h;d>p*f?p=d/f:d=p*f,d=Math.max(d,s),p=Math.max(p,l);let m=Math.min(p*.2,p/4),g=p+m*2,{cssStyles:y}=e,v=je.svg(i),x=Qe(e,{});e.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let b=[{x:-d/2,y:g/2},...$o(-d/2,g/2,d/2,g/2,m,1),{x:d/2,y:-g/2},...$o(d/2,-g/2,-d/2,-g/2,m,-1)],T=zt(b),C=v.path(T,x),w=i.insert(()=>C,":first-child");return w.attr("class","basic label-container"),y&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",y),n&&e.look!=="handDrawn"&&w.selectAll("path").attr("style",n),Ke(e,w),e.intersect=function(E){return Xe.polygon(e,b,E)},i}var XJ=N(()=>{"use strict";Ft();Ht();Gt();Wt();o(YJ,"waveRectangle")});async function jJ(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let{shapeSvg:i,bbox:a,label:s}=await pt(t,e,ot(e)),l=Math.max(a.width+(e.padding??0)*2,e?.width??0),u=Math.max(a.height+(e.padding??0)*2,e?.height??0),h=5,f=-l/2,d=-u/2,{cssStyles:p}=e,m=je.svg(i),g=Qe(e,{}),y=[{x:f-h,y:d-h},{x:f-h,y:d+u},{x:f+l,y:d+u},{x:f+l,y:d-h}],v=`M${f-h},${d-h} L${f+l},${d-h} L${f+l},${d+u} L${f-h},${d+u} L${f-h},${d-h}
M${f-h},${d} L${f+l},${d}
M${f},${d-h} L${f},${d+u}`;e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let x=m.path(v,g),b=i.insert(()=>x,":first-child");return b.attr("transform",`translate(${h/2}, ${h/2})`),b.attr("class","basic label-container"),p&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&b.selectAll("path").attr("style",n),s.attr("transform",`translate(${-(a.width/2)+h/2-(a.x-(a.left??0))}, ${-(a.height/2)+h/2-(a.y-(a.top??0))})`),Ke(e,b),e.intersect=function(T){return Xe.polygon(e,y,T)},i}var KJ=N(()=>{"use strict";Ft();Gt();Wt();Ht();o(jJ,"windowPane")});async function LL(t,e){let r=e;if(r.alias&&(e.label=r.alias),e.look==="handDrawn"){let{themeVariables:U}=Qt(),{background:K}=U,ee={...e,id:e.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${K}`]};await LL(t,ee)}let n=Qt();e.useHtmlLabels=n.htmlLabels;let i=n.er?.diagramPadding??10,a=n.er?.entityPadding??6,{cssStyles:s}=e,{labelStyles:l,nodeStyles:u}=qe(e);if(r.attributes.length===0&&e.label){let U={rx:0,ry:0,labelPaddingX:i,labelPaddingY:i*1.5,classes:""};ea(e.label,n)+U.labelPaddingX*20){let U=d.width+i*2-(y+v+x+b);y+=U/w,v+=U/w,x>0&&(x+=U/w),b>0&&(b+=U/w)}let _=y+v+x+b,A=je.svg(f),D=Qe(e,{});e.look!=="handDrawn"&&(D.roughness=0,D.fillStyle="solid");let O=0;g.length>0&&(O=g.reduce((U,K)=>U+(K?.rowHeight??0),0));let R=Math.max(E.width+i*2,e?.width||0,_),k=Math.max((O??0)+d.height,e?.height||0),L=-R/2,S=-k/2;f.selectAll("g:not(:first-child)").each((U,K,ee)=>{let Y=Ge(ee[K]),ce=Y.attr("transform"),Z=0,ue=0;if(ce){let j=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ce);j&&(Z=parseFloat(j[1]),ue=parseFloat(j[2]),Y.attr("class").includes("attribute-name")?Z+=y:Y.attr("class").includes("attribute-keys")?Z+=y+v:Y.attr("class").includes("attribute-comment")&&(Z+=y+v+x))}Y.attr("transform",`translate(${L+i/2+Z}, ${ue+S+d.height+a/2})`)}),f.select(".name").attr("transform","translate("+-d.width/2+", "+(S+a/2)+")");let I=A.rectangle(L,S,R,k,D),M=f.insert(()=>I,":first-child").attr("style",s.join("")),{themeVariables:P}=Qt(),{rowEven:B,rowOdd:F,nodeBorder:z}=P;m.push(0);for(let[U,K]of g.entries()){let Y=(U+1)%2===0&&K.yOffset!==0,ce=A.rectangle(L,d.height+S+K?.yOffset,R,K?.rowHeight,{...D,fill:Y?B:F,stroke:z});f.insert(()=>ce,"g.label").attr("style",s.join("")).attr("class",`row-rect-${Y?"even":"odd"}`)}let $=A.line(L,d.height+S,R+L,d.height+S,D);f.insert(()=>$).attr("class","divider"),$=A.line(y+L,d.height+S,y+L,k+S,D),f.insert(()=>$).attr("class","divider"),T&&($=A.line(y+v+L,d.height+S,y+v+L,k+S,D),f.insert(()=>$).attr("class","divider")),C&&($=A.line(y+v+x+L,d.height+S,y+v+x+L,k+S,D),f.insert(()=>$).attr("class","divider"));for(let U of m)$=A.line(L,d.height+S+U,R+L,d.height+S+U,D),f.insert(()=>$).attr("class","divider");if(Ke(e,M),u&&e.look!=="handDrawn"){let K=u.split(";")?.filter(ee=>ee.includes("stroke"))?.map(ee=>`${ee}`).join("; ");f.selectAll("path").attr("style",K??""),f.selectAll(".row-rect-even path").attr("style",u)}return e.intersect=function(U){return Xe.rect(e,U)},f}async function D2(t,e,r,n=0,i=0,a=[],s=""){let l=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",s);e!==tc(e)&&(e=tc(e),e=e.replaceAll("<","<").replaceAll(">",">"));let u=l.node().appendChild(await Hn(l,e,{width:ea(e,r)+100,style:s,useHtmlLabels:r.htmlLabels},r));if(e.includes("<")||e.includes(">")){let f=u.children[0];for(f.textContent=f.textContent.replaceAll("<","<").replaceAll(">",">");f.childNodes[0];)f=f.childNodes[0],f.textContent=f.textContent.replaceAll("<","<").replaceAll(">",">")}let h=u.getBBox();if(mr(r.htmlLabels)){let f=u.children[0];f.style.textAlign="start";let d=Ge(u);h=f.getBoundingClientRect(),d.attr("width",h.width),d.attr("height",h.height)}return h}var QJ=N(()=>{"use strict";Ft();Ht();Gt();Wt();_2();Jn();no();dr();pr();nr();o(LL,"erBox");o(D2,"addText")});async function ZJ(t,e,r,n,i=r.class.padding??12){let a=n?0:3,s=t.insert("g").attr("class",ot(e)).attr("id",e.domId||e.id),l=null,u=null,h=null,f=null,d=0,p=0,m=0;if(l=s.insert("g").attr("class","annotation-group text"),e.annotations.length>0){let b=e.annotations[0];await tw(l,{text:`\xAB${b}\xBB`},0),d=l.node().getBBox().height}u=s.insert("g").attr("class","label-group text"),await tw(u,e,0,["font-weight: bolder"]);let g=u.node().getBBox();p=g.height,h=s.insert("g").attr("class","members-group text");let y=0;for(let b of e.members){let T=await tw(h,b,y,[b.parseClassifier()]);y+=T+a}m=h.node().getBBox().height,m<=0&&(m=i/2),f=s.insert("g").attr("class","methods-group text");let v=0;for(let b of e.methods){let T=await tw(f,b,v,[b.parseClassifier()]);v+=T+a}let x=s.node().getBBox();if(l!==null){let b=l.node().getBBox();l.attr("transform",`translate(${-b.width/2})`)}return u.attr("transform",`translate(${-g.width/2}, ${d})`),x=s.node().getBBox(),h.attr("transform",`translate(0, ${d+p+i*2})`),x=s.node().getBBox(),f.attr("transform",`translate(0, ${d+p+(m?m+i*4:i*2)})`),x=s.node().getBBox(),{shapeSvg:s,bbox:x}}async function tw(t,e,r,n=[]){let i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=Qt(),s="useHtmlLabels"in e?e.useHtmlLabels:mr(a.htmlLabels)??!0,l="";"text"in e?l=e.text:l=e.label,!s&&l.startsWith("\\")&&(l=l.substring(1)),gi(l)&&(s=!0);let u=await Hn(i,tv(ta(l)),{width:ea(l,a)+50,classes:"markdown-node-label",useHtmlLabels:s},a),h,f=1;if(s){let d=u.children[0],p=Ge(u);f=d.innerHTML.split(" ").length,d.innerHTML.includes("")&&(f+=d.innerHTML.split("").length-1);let m=d.getElementsByTagName("img");if(m){let g=l.replace(/ ]*>/g,"").trim()==="";await Promise.all([...m].map(y=>new Promise(v=>{function x(){if(y.style.display="flex",y.style.flexDirection="column",g){let b=a.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,C=parseInt(b,10)*5+"px";y.style.minWidth=C,y.style.maxWidth=C}else y.style.width="100%";v(y)}o(x,"setupImage"),setTimeout(()=>{y.complete&&x()}),y.addEventListener("error",x),y.addEventListener("load",x)})))}h=d.getBoundingClientRect(),p.attr("width",h.width),p.attr("height",h.height)}else{n.includes("font-weight: bolder")&&Ge(u).selectAll("tspan").attr("font-weight",""),f=u.children.length;let d=u.children[0];(u.textContent===""||u.textContent.includes(">"))&&(d.textContent=l[0]+l.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),l[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),h=u.getBBox()}return i.attr("transform","translate(0,"+(-h.height/(2*f)+r)+")"),h.height}var JJ=N(()=>{"use strict";pr();Jn();Ft();nr();qt();no();dr();o(ZJ,"textHelper");o(tw,"addText")});async function eee(t,e){let r=ge(),n=r.class.padding??12,i=n,a=e.useHtmlLabels??mr(r.htmlLabels)??!0,s=e;s.annotations=s.annotations??[],s.members=s.members??[],s.methods=s.methods??[];let{shapeSvg:l,bbox:u}=await ZJ(t,e,r,a,i),{labelStyles:h,nodeStyles:f}=qe(e);e.labelStyle=h,e.cssStyles=s.styles||"";let d=s.styles?.join(";")||f||"";e.cssStyles||(e.cssStyles=d.replaceAll("!important","").split(";"));let p=s.members.length===0&&s.methods.length===0&&!r.class?.hideEmptyMembersBox,m=je.svg(l),g=Qe(e,{});e.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let y=u.width,v=u.height;s.members.length===0&&s.methods.length===0?v+=i:s.members.length>0&&s.methods.length===0&&(v+=i*2);let x=-y/2,b=-v/2,T=m.rectangle(x-n,b-n-(p?n:s.members.length===0&&s.methods.length===0?-n/2:0),y+2*n,v+2*n+(p?n*2:s.members.length===0&&s.methods.length===0?-n:0),g),C=l.insert(()=>T,":first-child");C.attr("class","basic label-container");let w=C.node().getBBox();l.selectAll(".text").each((D,O,R)=>{let k=Ge(R[O]),L=k.attr("transform"),S=0;if(L){let B=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(L);B&&(S=parseFloat(B[2]))}let I=S+b+n-(p?n:s.members.length===0&&s.methods.length===0?-n/2:0);a||(I-=4);let M=x;(k.attr("class").includes("label-group")||k.attr("class").includes("annotation-group"))&&(M=-k.node()?.getBBox().width/2||0,l.selectAll("text").each(function(P,B,F){window.getComputedStyle(F[B]).textAnchor==="middle"&&(M=0)})),k.attr("transform",`translate(${M}, ${I})`)});let E=l.select(".annotation-group").node().getBBox().height-(p?n/2:0)||0,_=l.select(".label-group").node().getBBox().height-(p?n/2:0)||0,A=l.select(".members-group").node().getBBox().height-(p?n/2:0)||0;if(s.members.length>0||s.methods.length>0||p){let D=m.line(w.x,E+_+b+n,w.x+w.width,E+_+b+n,g);l.insert(()=>D).attr("class","divider").attr("style",d)}if(p||s.members.length>0||s.methods.length>0){let D=m.line(w.x,E+_+A+b+i*2+n,w.x+w.width,E+_+A+b+n+i*2,g);l.insert(()=>D).attr("class","divider").attr("style",d)}if(s.look!=="handDrawn"&&l.selectAll("path").attr("style",d),C.select(":nth-child(2)").attr("style",d),l.selectAll(".divider").select("path").attr("style",d),e.labelStyle?l.selectAll("span").attr("style",e.labelStyle):l.selectAll("span").attr("style",d),!a){let D=RegExp(/color\s*:\s*([^;]*)/),O=D.exec(d);if(O){let R=O[0].replace("color","fill");l.selectAll("tspan").attr("style",R)}else if(h){let R=D.exec(h);if(R){let k=R[0].replace("color","fill");l.selectAll("tspan").attr("style",k)}}}return Ke(e,C),e.intersect=function(D){return Xe.rect(e,D)},l}var tee=N(()=>{"use strict";Ft();qt();pr();Wt();Gt();Ht();JJ();dr();o(eee,"classBox")});async function ree(t,e){let{labelStyles:r,nodeStyles:n}=qe(e);e.labelStyle=r;let i=e,a=e,s=20,l=20,u="verifyMethod"in e,h=ot(e),f=t.insert("g").attr("class",h).attr("id",e.domId??e.id),d;u?d=await Nu(f,`<<${i.type}>>`,0,e.labelStyle):d=await Nu(f,"<<Element>>",0,e.labelStyle);let p=d,m=await Nu(f,i.name,p,e.labelStyle+"; font-weight: bold;");if(p+=m+l,u){let E=await Nu(f,`${i.requirementId?`ID: ${i.requirementId}`:""}`,p,e.labelStyle);p+=E;let _=await Nu(f,`${i.text?`Text: ${i.text}`:""}`,p,e.labelStyle);p+=_;let A=await Nu(f,`${i.risk?`Risk: ${i.risk}`:""}`,p,e.labelStyle);p+=A,await Nu(f,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,p,e.labelStyle)}else{let E=await Nu(f,`${a.type?`Type: ${a.type}`:""}`,p,e.labelStyle);p+=E,await Nu(f,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,p,e.labelStyle)}let g=(f.node()?.getBBox().width??200)+s,y=(f.node()?.getBBox().height??200)+s,v=-g/2,x=-y/2,b=je.svg(f),T=Qe(e,{});e.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let C=b.rectangle(v,x,g,y,T),w=f.insert(()=>C,":first-child");if(w.attr("class","basic label-container").attr("style",n),f.selectAll(".label").each((E,_,A)=>{let D=Ge(A[_]),O=D.attr("transform"),R=0,k=0;if(O){let M=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(O);M&&(R=parseFloat(M[1]),k=parseFloat(M[2]))}let L=k-y/2,S=v+s/2;(_===0||_===1)&&(S=R),D.attr("transform",`translate(${S}, ${L+s})`)}),p>d+m+l){let E=b.line(v,x+d+m+l,v+g,x+d+m+l,T);f.insert(()=>E).attr("style",n)}return Ke(e,w),e.intersect=function(E){return Xe.rect(e,E)},f}async function Nu(t,e,r,n=""){if(e==="")return 0;let i=t.insert("g").attr("class","label").attr("style",n),a=ge(),s=a.htmlLabels??!0,l=await Hn(i,tv(ta(e)),{width:ea(e,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:n},a),u;if(s){let h=l.children[0],f=Ge(l);u=h.getBoundingClientRect(),f.attr("width",u.width),f.attr("height",u.height)}else{let h=l.children[0];for(let f of h.children)f.textContent=f.textContent.replaceAll(">",">").replaceAll("<","<"),n&&f.setAttribute("style",n);u=l.getBBox(),u.height+=6}return i.attr("transform",`translate(${-u.width/2},${-u.height/2+r})`),u.height}var nee=N(()=>{"use strict";Ft();Ht();Gt();Wt();nr();qt();no();pr();o(ree,"requirementBox");o(Nu,"addText")});async function iee(t,e,{config:r}){let{labelStyles:n,nodeStyles:i}=qe(e);e.labelStyle=n||"";let a=10,s=e.width;e.width=(e.width??200)-10;let{shapeSvg:l,bbox:u,label:h}=await pt(t,e,ot(e)),f=e.padding||10,d="",p;"ticket"in e&&e.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",e.ticket),p=l.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));let m={useHtmlLabels:e.useHtmlLabels,labelStyle:e.labelStyle||"",width:e.width,img:e.img,padding:e.padding||8,centerLabel:!1},g,y;p?{label:g,bbox:y}=await VT(p,"ticket"in e&&e.ticket||"",m):{label:g,bbox:y}=await VT(l,"ticket"in e&&e.ticket||"",m);let{label:v,bbox:x}=await VT(l,"assigned"in e&&e.assigned||"",m);e.width=s;let b=10,T=e?.width||0,C=Math.max(y.height,x.height)/2,w=Math.max(u.height+b*2,e?.height||0)+C,E=-T/2,_=-w/2;h.attr("transform","translate("+(f-T/2)+", "+(-C-u.height/2)+")"),g.attr("transform","translate("+(f-T/2)+", "+(-C+u.height/2)+")"),v.attr("transform","translate("+(f+T/2-x.width-2*a)+", "+(-C+u.height/2)+")");let A,{rx:D,ry:O}=e,{cssStyles:R}=e;if(e.look==="handDrawn"){let k=je.svg(l),L=Qe(e,{}),S=D||O?k.path(Is(E,_,T,w,D||0),L):k.rectangle(E,_,T,w,L);A=l.insert(()=>S,":first-child"),A.attr("class","basic label-container").attr("style",R||null)}else{A=l.insert("rect",":first-child"),A.attr("class","basic label-container __APA__").attr("style",i).attr("rx",D??5).attr("ry",O??5).attr("x",E).attr("y",_).attr("width",T).attr("height",w);let k="priority"in e&&e.priority;if(k){let L=l.append("line"),S=E+2,I=_+Math.floor((D??0)/2),M=_+w-Math.floor((D??0)/2);L.attr("x1",S).attr("y1",I).attr("x2",S).attr("y2",M).attr("stroke-width","4").attr("stroke",qDe(k))}}return Ke(e,A),e.height=w,e.intersect=function(k){return Xe.rect(e,k)},l}var qDe,aee=N(()=>{"use strict";Ft();Ht();$d();Gt();Wt();qDe=o(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");o(iee,"kanbanItem")});function see(t){return t in RL}var YDe,XDe,RL,NL=N(()=>{"use strict";YQ();KQ();ZQ();eZ();rZ();iZ();sZ();lZ();uZ();fZ();pZ();gZ();vZ();bZ();wZ();EZ();CZ();_Z();LZ();NZ();IZ();PZ();FZ();zZ();VZ();HZ();qZ();XZ();KZ();ZZ();eJ();rJ();iJ();sJ();lJ();uJ();fJ();pJ();gJ();vJ();bJ();wJ();EJ();CJ();_J();LJ();NJ();IJ();PJ();FJ();zJ();VJ();HJ();qJ();XJ();KJ();QJ();tee();nee();aee();YDe=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:xJ},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:dJ},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:TJ},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:DJ},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:dZ},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:tZ},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:oJ},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:AZ},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:YZ},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:WZ},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:$J},{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:GZ},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:yZ},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:OJ},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:QQ},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:mJ},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:AJ},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:SJ},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:kZ},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:DZ},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:aZ},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:oZ},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:cZ},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:jZ},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:WJ},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:SZ},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:BJ},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:QZ},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:hZ},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:mZ},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:UJ},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:jJ},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:xZ},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:GJ},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:TZ},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:yJ},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:nJ},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:tJ},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:jQ},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:nZ},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:MJ},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:RJ},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:YJ},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:cJ},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:JZ}],XDe=o(()=>{let e=[...Object.entries({state:kJ,choice:JQ,note:aJ,rectWithTitle:hJ,labelRect:UZ,iconSquare:BZ,iconCircle:MZ,icon:RZ,iconRounded:OZ,imageSquare:$Z,anchor:qQ,kanbanItem:iee,classBox:eee,erBox:LL,requirementBox:ree}),...YDe.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),RL=XDe();o(see,"isValidShape")});var jDe,rw,oee=N(()=>{"use strict";pr();IT();qt();yt();NL();nr();dr();ci();jDe="flowchart-",rw=class{constructor(){this.vertexCounter=0;this.config=ge();this.vertices=new Map;this.edges=[];this.classes=new Map;this.subGraphs=[];this.subGraphLookup=new Map;this.tooltips=new Map;this.subCount=0;this.firstGraphFlag=!0;this.secCount=-1;this.posCrossRef=[];this.funs=[];this.setAccTitle=Cr;this.setAccDescription=Dr;this.setDiagramTitle=Ir;this.getAccTitle=_r;this.getAccDescription=Lr;this.getDiagramTitle=Rr;this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{o(this,"FlowDB")}sanitizeText(e){return Ze.sanitizeText(e,this.config)}lookUpDomId(e){for(let r of this.vertices.values())if(r.id===e)return r.domId;return e}addVertex(e,r,n,i,a,s,l={},u){if(!e||e.trim().length===0)return;let h;if(u!==void 0){let m;u.includes(`
`)?m=u+`
`:m=`{
`+u+`
}`,h=gm(m,{schema:mm})}let f=this.edges.find(m=>m.id===e);if(f){let m=h;m?.animate!==void 0&&(f.animate=m.animate),m?.animation!==void 0&&(f.animation=m.animation),m?.curve!==void 0&&(f.interpolate=m.curve);return}let d,p=this.vertices.get(e);if(p===void 0&&(p={id:e,labelType:"text",domId:jDe+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,p)),this.vertexCounter++,r!==void 0?(this.config=ge(),d=this.sanitizeText(r.text.trim()),p.labelType=r.type,d.startsWith('"')&&d.endsWith('"')&&(d=d.substring(1,d.length-1)),p.text=d):p.text===void 0&&(p.text=e),n!==void 0&&(p.type=n),i?.forEach(m=>{p.styles.push(m)}),a?.forEach(m=>{p.classes.push(m)}),s!==void 0&&(p.dir=s),p.props===void 0?p.props=l:l!==void 0&&Object.assign(p.props,l),h!==void 0){if(h.shape){if(h.shape!==h.shape.toLowerCase()||h.shape.includes("_"))throw new Error(`No such shape: ${h.shape}. Shape names should be lowercase.`);if(!see(h.shape))throw new Error(`No such shape: ${h.shape}.`);p.type=h?.shape}h?.label&&(p.text=h?.label),h?.icon&&(p.icon=h?.icon,!h.label?.trim()&&p.text===e&&(p.text="")),h?.form&&(p.form=h?.form),h?.pos&&(p.pos=h?.pos),h?.img&&(p.img=h?.img,!h.label?.trim()&&p.text===e&&(p.text="")),h?.constraint&&(p.constraint=h.constraint),h.w&&(p.assetWidth=Number(h.w)),h.h&&(p.assetHeight=Number(h.h))}}addSingleLink(e,r,n,i){let l={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};X.info("abc78 Got edge...",l);let u=n.text;if(u!==void 0&&(l.text=this.sanitizeText(u.text.trim()),l.text.startsWith('"')&&l.text.endsWith('"')&&(l.text=l.text.substring(1,l.text.length-1)),l.labelType=u.type),n!==void 0&&(l.type=n.type,l.stroke=n.stroke,l.length=n.length>10?10:n.length),i&&!this.edges.some(h=>h.id===i))l.id=i,l.isUserDefinedId=!0;else{let h=this.edges.filter(f=>f.start===l.start&&f.end===l.end);h.length===0?l.id=Gh(l.start,l.end,{counter:0,prefix:"L"}):l.id=Gh(l.start,l.end,{counter:h.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))X.info("Pushing edge..."),this.edges.push(l);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
Initialize mermaid with maxEdges set to a higher number to allow more edges.
You cannot set this config via configuration inside the diagram as it is a secure config.
You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,r,n){let i=this.isLinkData(n)?n.id.replace("@",""):void 0;X.info("addLink",e,r,i);for(let a of e)for(let s of r){let l=a===e[e.length-1],u=s===r[0];l&&u?this.addSingleLink(a,s,n,i):this.addSingleLink(a,s,n,void 0)}}updateLinkInterpolate(e,r){e.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(e,r){e.forEach(n=>{if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);n==="default"?this.edges.defaultStyle=r:(this.edges[n].style=r,(this.edges[n]?.style?.length??0)>0&&!this.edges[n]?.style?.some(i=>i?.startsWith("fill"))&&this.edges[n]?.style?.push("fill:none"))})}addClass(e,r){let n=r.join().replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/ยงยงยง/g,",").split(";");e.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n?.forEach(s=>{if(/color/.exec(s)){let l=s.replace("fill","bgFill");a.textStyles.push(l)}a.styles.push(s)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(e,r){for(let n of e.split(",")){let i=this.vertices.get(n);i&&i.classes.push(r);let a=this.edges.find(l=>l.id===n);a&&a.classes.push(r);let s=this.subGraphLookup.get(n);s&&s.classes.push(r)}}setTooltip(e,r){if(r!==void 0){r=this.sanitizeText(r);for(let n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(e,r,n){let i=this.lookUpDomId(e);if(ge().securityLevel!=="loose"||r===void 0)return;let a=[];if(typeof n=="string"){a=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{let l=document.querySelector(`[id="${i}"]`);l!==null&&l.addEventListener("click",()=>{Vt.runFunc(r,...a)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{let a=this.vertices.get(i);a!==void 0&&(a.link=Vt.formatUrl(r,this.config),a.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(r=>{r(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){let r=Ge(".mermaidTooltip");(r._groups||r)[0][0]===null&&(r=Ge("body").append("div").attr("class","mermaidTooltip").style("opacity",0)),Ge(e).select("svg").selectAll("g.node").on("mouseover",a=>{let s=Ge(a.currentTarget);if(s.attr("title")===null)return;let u=a.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(s.attr("title")).style("left",window.scrollX+u.left+(u.right-u.left)/2+"px").style("top",window.scrollY+u.bottom+"px"),r.html(r.html().replace(/<br\/>/g," ")),s.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),Ge(a.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=ge(),wr()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,n){let i=e.text.trim(),a=n.text;e===n&&/\s/.exec(n.text)&&(i=void 0);let l=o(p=>{let m={boolean:{},number:{},string:{}},g=[],y;return{nodeList:p.filter(function(x){let b=typeof x;return x.stmt&&x.stmt==="dir"?(y=x.value,!1):x.trim()===""?!1:b in m?m[b].hasOwnProperty(x)?!1:m[b][x]=!0:g.includes(x)?!1:g.push(x)}),dir:y}},"uniq")(r.flat()),u=l.nodeList,h=l.dir,f=ge().flowchart??{};if(h=h??(f.inheritDir?this.getDirection()??ge().direction??void 0:void 0),this.version==="gen-1")for(let p=0;p2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let i=0,a=1;for(;i=0){let l=this.indexNodes2(e,s);if(l.result)return{result:!0,count:a+l.count};a=a+l.count}i=i+1}return{result:!1,count:a}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let r=e.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let i="normal";return r.includes("=")&&(i="thick"),r.includes(".")&&(i="dotted"),{type:n,stroke:i}}countChar(e,r){let n=r.length,i=0;for(let a=0;a":i="arrow_point",r.startsWith("<")&&(i="double_"+i,n=n.slice(1));break;case"o":i="arrow_circle",r.startsWith("o")&&(i="double_"+i,n=n.slice(1));break}let a="normal",s=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");let l=this.countChar(".",n);return l&&(a="dotted",s=l),{type:i,stroke:a,length:s}}destructLink(e,r){let n=this.destructEndLink(e),i;if(r){if(i=this.destructStartLink(r),i.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(i.type==="arrow_open")i.type=n.type;else{if(i.type!==n.type)return{type:"INVALID",stroke:"INVALID"};i.type="double_"+i.type}return i.type==="double_arrow"&&(i.type="double_arrow_point"),i.length=n.length,i}return n}exists(e,r){for(let n of e)if(n.nodes.includes(r))return!0;return!1}makeUniq(e,r){let n=[];return e.nodes.forEach((i,a)=>{this.exists(r,i)||n.push(e.nodes[a])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon)return e.form==="circle"?"iconCircle":e.form==="square"?"iconSquare":e.form==="rounded"?"iconRounded":"icon";switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find(n=>n.id===r)}destructEdgeType(e){let r="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(e,r,n,i,a,s){let l=n.get(e.id),u=i.get(e.id)??!1,h=this.findNode(r,e.id);if(h)h.cssStyles=e.styles,h.cssCompiledStyles=this.getCompiledStyles(e.classes),h.cssClasses=e.classes.join(" ");else{let f={id:e.id,label:e.text,labelStyle:"",parentId:l,padding:a.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:s,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};u?r.push({...f,isGroup:!0,shape:"rect"}):r.push({...f,isGroup:!1,shape:this.getTypeFromVertex(e)})}}getCompiledStyles(e){let r=[];for(let n of e){let i=this.classes.get(n);i?.styles&&(r=[...r,...i.styles??[]].map(a=>a.trim())),i?.textStyles&&(r=[...r,...i.textStyles??[]].map(a=>a.trim()))}return r}getData(){let e=ge(),r=[],n=[],i=this.getSubGraphs(),a=new Map,s=new Map;for(let h=i.length-1;h>=0;h--){let f=i[h];f.nodes.length>0&&s.set(f.id,!0);for(let d of f.nodes)a.set(d,f.id)}for(let h=i.length-1;h>=0;h--){let f=i[h];r.push({id:f.id,label:f.title,labelStyle:"",parentId:a.get(f.id),padding:8,cssCompiledStyles:this.getCompiledStyles(f.classes),cssClasses:f.classes.join(" "),shape:"rect",dir:f.dir,isGroup:!0,look:e.look})}this.getVertices().forEach(h=>{this.addNodeFromVertex(h,r,a,s,e,e.look||"classic")});let u=this.getEdges();return u.forEach((h,f)=>{let{arrowTypeStart:d,arrowTypeEnd:p}=this.destructEdgeType(h.type),m=[...u.defaultStyle??[]];h.style&&m.push(...h.style);let g={id:Gh(h.start,h.end,{counter:f,prefix:"L"},h.id),isUserDefinedId:h.isUserDefinedId,start:h.start,end:h.end,type:h.type??"normal",label:h.text,labelpos:"c",thickness:h.stroke,minlen:h.length,classes:h?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:h?.stroke==="invisible"||h?.type==="arrow_open"?"none":d,arrowTypeEnd:h?.stroke==="invisible"||h?.type==="arrow_open"?"none":p,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(h.classes),labelStyle:m,style:m,pattern:h.stroke,look:e.look,animate:h.animate,animation:h.animation,curve:h.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};n.push(g)}),{nodes:r,edges:n,other:{},config:e}}defaultConfig(){return B3.flowchart}}});var bc,xm=N(()=>{"use strict";pr();bc=o((t,e)=>{let r;return e==="sandbox"&&(r=Ge("#i"+t)),(e==="sandbox"?Ge(r.nodes()[0].contentDocument.body):Ge("body")).select(`[id="${t}"]`)},"getDiagramElement")});var Mu,L2=N(()=>{"use strict";Mu=o(({flowchart:t})=>{let e=t?.subGraphTitleMargin?.top??0,r=t?.subGraphTitleMargin?.bottom??0,n=e+r;return{subGraphTitleTopMargin:e,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins")});var lee,KDe,QDe,ZDe,JDe,e9e,t9e,cee,bm,uee,nw=N(()=>{"use strict";qt();dr();yt();L2();pr();Wt();no();fL();JT();$d();Gt();lee=o(async(t,e)=>{X.info("Creating subgraph rect for ",e.id,e);let r=ge(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:f}=qe(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),p=mr(r.flowchart.htmlLabels),m=d.insert("g").attr("class","cluster-label "),g=await Hn(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0}),y=g.getBBox();if(mr(r.flowchart.htmlLabels)){let _=g.children[0],A=Ge(g);y=_.getBoundingClientRect(),A.attr("width",y.width),A.attr("height",y.height)}let v=e.width<=y.width+e.padding?y.width+e.padding:e.width;e.width<=y.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;let x=e.height,b=e.x-v/2,T=e.y-x/2;X.trace("Data ",e,JSON.stringify(e));let C;if(e.look==="handDrawn"){let _=je.svg(d),A=Qe(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),D=_.path(Is(b,T,v,x,0),A);C=d.insert(()=>(X.debug("Rough node insert CXC",D),D),":first-child"),C.select("path:nth-child(2)").attr("style",h.join(";")),C.select("path").attr("style",f.join(";").replace("fill","stroke"))}else C=d.insert("rect",":first-child"),C.attr("style",u).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",T).attr("width",v).attr("height",x);let{subGraphTitleTopMargin:w}=Mu(r);if(m.attr("transform",`translate(${e.x-y.width/2}, ${e.y-e.height/2+w})`),l){let _=m.select("span");_&&_.attr("style",l)}let E=C.node().getBBox();return e.offsetX=0,e.width=E.width,e.height=E.height,e.offsetY=y.height-e.padding/2,e.intersect=function(_){return Hh(e,_)},{cluster:d,labelBBox:y}},"rect"),KDe=o((t,e)=>{let r=t.insert("g").attr("class","note-cluster").attr("id",e.id),n=r.insert("rect",":first-child"),i=0*e.padding,a=i/2;n.attr("rx",e.rx).attr("ry",e.ry).attr("x",e.x-e.width/2-a).attr("y",e.y-e.height/2-a).attr("width",e.width+i).attr("height",e.height+i).attr("fill","none");let s=n.node().getBBox();return e.width=s.width,e.height=s.height,e.intersect=function(l){return Hh(e,l)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),QDe=o(async(t,e)=>{let r=ge(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:s,compositeTitleBackground:l,nodeBorder:u}=n,h=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-id",e.id).attr("data-look",e.look),f=h.insert("g",":first-child"),d=h.insert("g").attr("class","cluster-label"),p=h.append("rect"),m=d.node().appendChild(await xc(e.label,e.labelStyle,void 0,!0)),g=m.getBBox();if(mr(r.flowchart.htmlLabels)){let D=m.children[0],O=Ge(m);g=D.getBoundingClientRect(),O.attr("width",g.width),O.attr("height",g.height)}let y=0*e.padding,v=y/2,x=(e.width<=g.width+e.padding?g.width+e.padding:e.width)+y;e.width<=g.width+e.padding?e.diff=(x-e.width)/2-e.padding:e.diff=-e.padding;let b=e.height+y,T=e.height+y-g.height-6,C=e.x-x/2,w=e.y-b/2;e.width=x;let E=e.y-e.height/2-v+g.height+2,_;if(e.look==="handDrawn"){let D=e.cssClasses.includes("statediagram-cluster-alt"),O=je.svg(h),R=e.rx||e.ry?O.path(Is(C,w,x,b,10),{roughness:.7,fill:l,fillStyle:"solid",stroke:u,seed:i}):O.rectangle(C,w,x,b,{seed:i});_=h.insert(()=>R,":first-child");let k=O.rectangle(C,E,x,T,{fill:D?a:s,fillStyle:D?"hachure":"solid",stroke:u,seed:i});_=h.insert(()=>R,":first-child"),p=h.insert(()=>k)}else _=f.insert("rect",":first-child"),_.attr("class","outer").attr("x",C).attr("y",w).attr("width",x).attr("height",b).attr("data-look",e.look),p.attr("class","inner").attr("x",C).attr("y",E).attr("width",x).attr("height",T);d.attr("transform",`translate(${e.x-g.width/2}, ${w+1-(mr(r.flowchart.htmlLabels)?0:3)})`);let A=_.node().getBBox();return e.height=A.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(D){return Hh(e,D)},{cluster:h,labelBBox:g}},"roundedWithTitle"),ZDe=o(async(t,e)=>{X.info("Creating subgraph rect for ",e.id,e);let r=ge(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:s}=n,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:f}=qe(e),d=t.insert("g").attr("class","cluster "+e.cssClasses).attr("id",e.id).attr("data-look",e.look),p=mr(r.flowchart.htmlLabels),m=d.insert("g").attr("class","cluster-label "),g=await Hn(m,e.label,{style:e.labelStyle,useHtmlLabels:p,isNode:!0,width:e.width}),y=g.getBBox();if(mr(r.flowchart.htmlLabels)){let _=g.children[0],A=Ge(g);y=_.getBoundingClientRect(),A.attr("width",y.width),A.attr("height",y.height)}let v=e.width<=y.width+e.padding?y.width+e.padding:e.width;e.width<=y.width+e.padding?e.diff=(v-e.width)/2-e.padding:e.diff=-e.padding;let x=e.height,b=e.x-v/2,T=e.y-x/2;X.trace("Data ",e,JSON.stringify(e));let C;if(e.look==="handDrawn"){let _=je.svg(d),A=Qe(e,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:i}),D=_.path(Is(b,T,v,x,e.rx),A);C=d.insert(()=>(X.debug("Rough node insert CXC",D),D),":first-child"),C.select("path:nth-child(2)").attr("style",h.join(";")),C.select("path").attr("style",f.join(";").replace("fill","stroke"))}else C=d.insert("rect",":first-child"),C.attr("style",u).attr("rx",e.rx).attr("ry",e.ry).attr("x",b).attr("y",T).attr("width",v).attr("height",x);let{subGraphTitleTopMargin:w}=Mu(r);if(m.attr("transform",`translate(${e.x-y.width/2}, ${e.y-e.height/2+w})`),l){let _=m.select("span");_&&_.attr("style",l)}let E=C.node().getBBox();return e.offsetX=0,e.width=E.width,e.height=E.height,e.offsetY=y.height-e.padding/2,e.intersect=function(_){return Hh(e,_)},{cluster:d,labelBBox:y}},"kanbanSection"),JDe=o((t,e)=>{let r=ge(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,s=t.insert("g").attr("class",e.cssClasses).attr("id",e.id).attr("data-look",e.look),l=s.insert("g",":first-child"),u=0*e.padding,h=e.width+u;e.diff=-e.padding;let f=e.height+u,d=e.x-h/2,p=e.y-f/2;e.width=h;let m;if(e.look==="handDrawn"){let v=je.svg(s).rectangle(d,p,h,f,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});m=s.insert(()=>v,":first-child")}else m=l.insert("rect",":first-child"),m.attr("class","divider").attr("x",d).attr("y",p).attr("width",h).attr("height",f).attr("data-look",e.look);let g=m.node().getBBox();return e.height=g.height,e.offsetX=0,e.offsetY=0,e.intersect=function(y){return Hh(e,y)},{cluster:s,labelBBox:{}}},"divider"),e9e=lee,t9e={rect:lee,squareRect:e9e,roundedWithTitle:QDe,noteGroup:KDe,divider:JDe,kanbanSection:ZDe},cee=new Map,bm=o(async(t,e)=>{let r=e.shape||"rect",n=await t9e[r](t,e);return cee.set(e.id,n),n},"insertCluster"),uee=o(()=>{cee=new Map},"clear")});function iw(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=Wn(t),e=Wn(e);let[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],s=i-r,l=a-n;return{angle:Math.atan(l/s),deltaX:s,deltaY:l}}var zo,Wn,aw,ML=N(()=>{"use strict";zo={aggregation:18,extension:18,composition:18,dependency:6,lollipop:13.5,arrow_point:4};o(iw,"calculateDeltaAndAngle");Wn=o(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),aw=o(t=>({x:o(function(e,r,n){let i=0,a=Wn(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(zo,t.arrowTypeEnd)){let{angle:m,deltaX:g}=iw(n[n.length-1],n[n.length-2]);i=zo[t.arrowTypeEnd]*Math.cos(m)*(g>=0?1:-1)}let s=Math.abs(Wn(e).x-Wn(n[n.length-1]).x),l=Math.abs(Wn(e).y-Wn(n[n.length-1]).y),u=Math.abs(Wn(e).x-Wn(n[0]).x),h=Math.abs(Wn(e).y-Wn(n[0]).y),f=zo[t.arrowTypeStart],d=zo[t.arrowTypeEnd],p=1;if(s0&&l0&&h=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(zo,t.arrowTypeEnd)){let{angle:m,deltaY:g}=iw(n[n.length-1],n[n.length-2]);i=zo[t.arrowTypeEnd]*Math.abs(Math.sin(m))*(g>=0?1:-1)}let s=Math.abs(Wn(e).y-Wn(n[n.length-1]).y),l=Math.abs(Wn(e).x-Wn(n[n.length-1]).x),u=Math.abs(Wn(e).y-Wn(n[0]).y),h=Math.abs(Wn(e).x-Wn(n[0]).x),f=zo[t.arrowTypeStart],d=zo[t.arrowTypeEnd],p=1;if(s0&&l0&&h{"use strict";yt();fee=o((t,e,r,n,i,a)=>{e.arrowTypeStart&&hee(t,"start",e.arrowTypeStart,r,n,i,a),e.arrowTypeEnd&&hee(t,"end",e.arrowTypeEnd,r,n,i,a)},"addEdgeMarkers"),r9e={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},hee=o((t,e,r,n,i,a,s)=>{let l=r9e[r];if(!l){X.warn(`Unknown arrow type: ${r}`);return}let u=l.type,f=`${i}_${a}-${u}${e==="start"?"Start":"End"}`;if(s&&s.trim()!==""){let d=s.replace(/[^\dA-Za-z]/g,"_"),p=`${f}_${d}`;if(!document.getElementById(p)){let m=document.getElementById(f);if(m){let g=m.cloneNode(!0);g.id=p,g.querySelectorAll("path, circle, line").forEach(v=>{v.setAttribute("stroke",s),l.fill&&v.setAttribute("fill",s)}),m.parentNode?.appendChild(g)}}t.attr(`marker-${e}`,`url(${n}#${p})`)}else t.attr(`marker-${e}`,`url(${n}#${f})`)},"addEdgeMarker")});function sw(t,e){ge().flowchart.htmlLabels&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}function a9e(t){let e=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===s.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-s.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}var ow,ha,gee,R2,lw,cw,n9e,i9e,pee,mee,s9e,uw,IL=N(()=>{"use strict";qt();dr();yt();no();nr();ML();L2();pr();Wt();JT();dee();Gt();ow=new Map,ha=new Map,gee=o(()=>{ow.clear(),ha.clear()},"clear"),R2=o(t=>t?t.reduce((r,n)=>r+";"+n,""):"","getLabelStyles"),lw=o(async(t,e)=>{let r=mr(ge().flowchart.htmlLabels),n=await Hn(t,e.label,{style:R2(e.labelStyle),useHtmlLabels:r,addSvgBackground:!0,isNode:!1});X.info("abc82",e,e.labelType);let i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label");a.node().appendChild(n);let s=n.getBBox();if(r){let u=n.children[0],h=Ge(n);s=u.getBoundingClientRect(),h.attr("width",s.width),h.attr("height",s.height)}a.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),ow.set(e.id,i),e.width=s.width,e.height=s.height;let l;if(e.startLabelLeft){let u=await xc(e.startLabelLeft,R2(e.labelStyle)),h=t.insert("g").attr("class","edgeTerminals"),f=h.insert("g").attr("class","inner");l=f.node().appendChild(u);let d=u.getBBox();f.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),ha.get(e.id)||ha.set(e.id,{}),ha.get(e.id).startLeft=h,sw(l,e.startLabelLeft)}if(e.startLabelRight){let u=await xc(e.startLabelRight,R2(e.labelStyle)),h=t.insert("g").attr("class","edgeTerminals"),f=h.insert("g").attr("class","inner");l=h.node().appendChild(u),f.node().appendChild(u);let d=u.getBBox();f.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),ha.get(e.id)||ha.set(e.id,{}),ha.get(e.id).startRight=h,sw(l,e.startLabelRight)}if(e.endLabelLeft){let u=await xc(e.endLabelLeft,R2(e.labelStyle)),h=t.insert("g").attr("class","edgeTerminals"),f=h.insert("g").attr("class","inner");l=f.node().appendChild(u);let d=u.getBBox();f.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),h.node().appendChild(u),ha.get(e.id)||ha.set(e.id,{}),ha.get(e.id).endLeft=h,sw(l,e.endLabelLeft)}if(e.endLabelRight){let u=await xc(e.endLabelRight,R2(e.labelStyle)),h=t.insert("g").attr("class","edgeTerminals"),f=h.insert("g").attr("class","inner");l=f.node().appendChild(u);let d=u.getBBox();f.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),h.node().appendChild(u),ha.get(e.id)||ha.set(e.id,{}),ha.get(e.id).endRight=h,sw(l,e.endLabelRight)}return n},"insertEdgeLabel");o(sw,"setTerminalWidth");cw=o((t,e)=>{X.debug("Moving label abc88 ",t.id,t.label,ow.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath,n=ge(),{subGraphTitleTotalMargin:i}=Mu(n);if(t.label){let a=ow.get(t.id),s=t.x,l=t.y;if(r){let u=Vt.calcLabelPosition(r);X.debug("Moving label "+t.label+" from (",s,",",l,") to (",u.x,",",u.y,") abc88"),e.updatedPath&&(s=u.x,l=u.y)}a.attr("transform",`translate(${s}, ${l+i/2})`)}if(t.startLabelLeft){let a=ha.get(t.id).startLeft,s=t.x,l=t.y;if(r){let u=Vt.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(t.startLabelRight){let a=ha.get(t.id).startRight,s=t.x,l=t.y;if(r){let u=Vt.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(t.endLabelLeft){let a=ha.get(t.id).endLeft,s=t.x,l=t.y;if(r){let u=Vt.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}if(t.endLabelRight){let a=ha.get(t.id).endRight,s=t.x,l=t.y;if(r){let u=Vt.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);s=u.x,l=u.y}a.attr("transform",`translate(${s}, ${l})`)}},"positionEdgeLabel"),n9e=o((t,e)=>{let r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),s=t.width/2,l=t.height/2;return i>=s||a>=l},"outsideNode"),i9e=o((t,e,r)=>{X.debug(`intersection calc abc89:
outsidePoint: ${JSON.stringify(e)}
insidePoint : ${JSON.stringify(r)}
node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);let n=t.x,i=t.y,a=Math.abs(n-r.x),s=t.width/2,l=r.xMath.abs(n-e.x)*u){let d=r.y{X.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(X.info("abc88 checking point",a,e),!n9e(e,a)&&!i){let s=i9e(e,n,a);X.debug("abc88 inside",a,n,s),X.debug("abc88 intersection",s,e);let l=!1;r.forEach(u=>{l=l||u.x===s.x&&u.y===s.y}),r.some(u=>u.x===s.x&&u.y===s.y)?X.warn("abc88 no intersect",s,r):r.push(s),i=!0}else X.warn("abc88 outside",a,n),n=a,i||r.push(a)}),X.debug("returning points",r),r},"cutPathAtIntersect");o(a9e,"extractCornerPoints");mee=o(function(t,e,r){let n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),s=r/a;return{x:e.x-s*n,y:e.y-s*i}},"findAdjacentPoint"),s9e=o(function(t){let{cornerPointPositions:e}=a9e(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){X.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));let m=5;s.x===l.x?p={x:h<0?l.x-m+d:l.x+m-d,y:f<0?l.y-d:l.y+d}:p={x:h<0?l.x-d:l.x+d,y:f<0?l.y-m+d:l.y+m-d}}else X.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(p,u)}else r.push(t[n]);return r},"fixCorners"),uw=o(function(t,e,r,n,i,a,s){let{handDrawnSeed:l}=ge(),u=e.points,h=!1,f=i;var d=a;let p=[];for(let R in e.cssCompiledStyles)k2(R)||p.push(e.cssCompiledStyles[R]);d.intersect&&f.intersect&&(u=u.slice(1,e.points.length-1),u.unshift(f.intersect(u[0])),X.debug("Last point APA12",e.start,"-->",e.end,u[u.length-1],d,d.intersect(u[u.length-1])),u.push(d.intersect(u[u.length-1]))),e.toCluster&&(X.info("to cluster abc88",r.get(e.toCluster)),u=pee(e.points,r.get(e.toCluster).node),h=!0),e.fromCluster&&(X.debug("from cluster abc88",r.get(e.fromCluster),JSON.stringify(u,null,2)),u=pee(u.reverse(),r.get(e.fromCluster).node).reverse(),h=!0);let m=u.filter(R=>!Number.isNaN(R.y));m=s9e(m);let g=Lo;switch(g=ku,e.curve){case"linear":g=ku;break;case"basis":g=Lo;break;case"cardinal":g=Hv;break;case"bumpX":g=$v;break;case"bumpY":g=zv;break;case"catmullRom":g=Yv;break;case"monotoneX":g=Xv;break;case"monotoneY":g=jv;break;case"natural":g=W0;break;case"step":g=q0;break;case"stepAfter":g=Qv;break;case"stepBefore":g=Kv;break;default:g=Lo}let{x:y,y:v}=aw(e),x=El().x(y).y(v).curve(g),b;switch(e.thickness){case"normal":b="edge-thickness-normal";break;case"thick":b="edge-thickness-thick";break;case"invisible":b="edge-thickness-invisible";break;default:b="edge-thickness-normal"}switch(e.pattern){case"solid":b+=" edge-pattern-solid";break;case"dotted":b+=" edge-pattern-dotted";break;case"dashed":b+=" edge-pattern-dashed";break;default:b+=" edge-pattern-solid"}let T,C=x(m),w=Array.isArray(e.style)?e.style:e.style?[e.style]:[],E=w.find(R=>R?.startsWith("stroke:"));if(e.look==="handDrawn"){let R=je.svg(t);Object.assign([],m);let k=R.path(C,{roughness:.3,seed:l});b+=" transition",T=Ge(k).select("path").attr("id",e.id).attr("class"," "+b+(e.classes?" "+e.classes:"")).attr("style",w?w.reduce((S,I)=>S+";"+I,""):"");let L=T.attr("d");T.attr("d",L),t.node().appendChild(T.node())}else{let R=p.join(";"),k=w?w.reduce((I,M)=>I+M+";",""):"",L="";e.animate&&(L=" edge-animation-fast"),e.animation&&(L=" edge-animation-"+e.animation);let S=R?R+";"+k+";":k;T=t.append("path").attr("d",C).attr("id",e.id).attr("class"," "+b+(e.classes?" "+e.classes:"")+(L??"")).attr("style",S),E=S.match(/stroke:([^;]+)/)?.[1]}let _="";(ge().flowchart.arrowMarkerAbsolute||ge().state.arrowMarkerAbsolute)&&(_=fu(!0)),X.info("arrowTypeStart",e.arrowTypeStart),X.info("arrowTypeEnd",e.arrowTypeEnd),fee(T,e,_,s,n,E);let A=Math.floor(u.length/2),D=u[A];Vt.isLabelCoordinateInPath(D,T.attr("d"))||(h=!0);let O={};return h&&(O.updatedPath=u),O.originalPath=e.points,O},"insertEdge")});var o9e,l9e,c9e,u9e,h9e,f9e,d9e,p9e,m9e,g9e,y9e,v9e,x9e,b9e,T9e,w9e,k9e,hw,OL=N(()=>{"use strict";yt();o9e=o((t,e,r,n)=>{e.forEach(i=>{k9e[i](t,r,n)})},"insertMarkers"),l9e=o((t,e,r)=>{X.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),c9e=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),u9e=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),h9e=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),f9e=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),d9e=o((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),p9e=o((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),m9e=o((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),g9e=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),y9e=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneStart").attr("class","marker onlyOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),t.append("defs").append("marker").attr("id",r+"_"+e+"-onlyOneEnd").attr("class","marker onlyOne "+e).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),v9e=o((t,e,r)=>{let n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneStart").attr("class","marker zeroOrOne "+e).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");let i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+e).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),i.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),x9e=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreStart").attr("class","marker oneOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),t.append("defs").append("marker").attr("id",r+"_"+e+"-oneOrMoreEnd").attr("class","marker oneOrMore "+e).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),b9e=o((t,e,r)=>{let n=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+e).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");let i=t.append("defs").append("marker").attr("id",r+"_"+e+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+e).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),i.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),T9e=o((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
L20,10
M20,10
L0,20`)},"requirement_arrow"),w9e=o((t,e,r)=>{let n=t.append("defs").append("marker").attr("id",r+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),k9e={extension:l9e,composition:c9e,aggregation:u9e,dependency:h9e,lollipop:f9e,point:d9e,circle:p9e,cross:m9e,barb:g9e,only_one:y9e,zero_or_one:v9e,one_or_more:x9e,zero_or_more:b9e,requirement_arrow:T9e,requirement_contains:w9e},hw=o9e});async function Tm(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");let a=e.shape?RL[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let s;r.config.securityLevel==="sandbox"?s="_top":e.linkTarget&&(s=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",s??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),fw.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}var fw,yee,vee,N2,dw=N(()=>{"use strict";yt();NL();fw=new Map;o(Tm,"insertNode");yee=o((t,e)=>{fw.set(e.id,t)},"setNodeElem"),vee=o(()=>{fw.clear()},"clear"),N2=o(t=>{let e=fw.get(t.id);X.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");let r=8,n=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+n-t.width/2)+", "+(t.y-t.height/2-r)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),n},"positionNode")});var xee,bee=N(()=>{"use strict";Jn();dr();yt();nw();IL();OL();dw();Ft();nr();xee={common:Ze,getConfig:Qt,insertCluster:bm,insertEdge:uw,insertEdgeLabel:lw,insertMarkers:hw,insertNode:Tm,interpolateToCurve:E9,labelHelper:pt,log:X,positionEdgeLabel:cw}});function S9e(t){return typeof t=="symbol"||ni(t)&&ua(t)==E9e}var E9e,ao,Gd=N(()=>{"use strict";Su();Mo();E9e="[object Symbol]";o(S9e,"isSymbol");ao=S9e});function C9e(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r{"use strict";o(C9e,"arrayMap");Os=C9e});function kee(t){if(typeof t=="string")return t;if(Pt(t))return Os(t,kee)+"";if(ao(t))return wee?wee.call(t):"";var e=t+"";return e=="0"&&1/t==-A9e?"-0":e}var A9e,Tee,wee,Eee,See=N(()=>{"use strict";Cd();Vd();Un();Gd();A9e=1/0,Tee=Zi?Zi.prototype:void 0,wee=Tee?Tee.toString:void 0;o(kee,"baseToString");Eee=kee});function D9e(t){for(var e=t.length;e--&&_9e.test(t.charAt(e)););return e}var _9e,Cee,Aee=N(()=>{"use strict";_9e=/\s/;o(D9e,"trimmedEndIndex");Cee=D9e});function R9e(t){return t&&t.slice(0,Cee(t)+1).replace(L9e,"")}var L9e,_ee,Dee=N(()=>{"use strict";Aee();L9e=/^\s+/;o(R9e,"baseTrim");_ee=R9e});function P9e(t){if(typeof t=="number")return t;if(ao(t))return Lee;if(xn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=xn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=_ee(t);var r=M9e.test(t);return r||I9e.test(t)?O9e(t.slice(2),r?2:8):N9e.test(t)?Lee:+t}var Lee,N9e,M9e,I9e,O9e,Ree,Nee=N(()=>{"use strict";Dee();to();Gd();Lee=NaN,N9e=/^[-+]0x[0-9a-f]+$/i,M9e=/^0b[01]+$/i,I9e=/^0o[0-7]+$/i,O9e=parseInt;o(P9e,"toNumber");Ree=P9e});function F9e(t){if(!t)return t===0?t:0;if(t=Ree(t),t===Mee||t===-Mee){var e=t<0?-1:1;return e*B9e}return t===t?t:0}var Mee,B9e,wm,PL=N(()=>{"use strict";Nee();Mee=1/0,B9e=17976931348623157e292;o(F9e,"toFinite");wm=F9e});function $9e(t){var e=wm(t),r=e%1;return e===e?r?e-r:e:0}var Tc,km=N(()=>{"use strict";PL();o($9e,"toInteger");Tc=$9e});var z9e,pw,Iee=N(()=>{"use strict";Nh();Ro();z9e=Cs(hi,"WeakMap"),pw=z9e});function G9e(){}var ai,BL=N(()=>{"use strict";o(G9e,"noop");ai=G9e});function V9e(t,e){for(var r=-1,n=t==null?0:t.length;++r{"use strict";o(V9e,"arrayEach");mw=V9e});function U9e(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a{"use strict";o(U9e,"baseFindIndex");gw=U9e});function H9e(t){return t!==t}var Oee,Pee=N(()=>{"use strict";o(H9e,"baseIsNaN");Oee=H9e});function W9e(t,e,r){for(var n=r-1,i=t.length;++n{"use strict";o(W9e,"strictIndexOf");Bee=W9e});function q9e(t,e,r){return e===e?Bee(t,e,r):gw(t,Oee,r)}var Em,yw=N(()=>{"use strict";$L();Pee();Fee();o(q9e,"baseIndexOf");Em=q9e});function Y9e(t,e){var r=t==null?0:t.length;return!!r&&Em(t,e,0)>-1}var vw,zL=N(()=>{"use strict";yw();o(Y9e,"arrayIncludes");vw=Y9e});var X9e,$ee,zee=N(()=>{"use strict";h9();X9e=dT(Object.keys,Object),$ee=X9e});function Q9e(t){if(!dc(t))return $ee(t);var e=[];for(var r in Object(t))K9e.call(t,r)&&r!="constructor"&&e.push(r);return e}var j9e,K9e,Sm,xw=N(()=>{"use strict";am();zee();j9e=Object.prototype,K9e=j9e.hasOwnProperty;o(Q9e,"baseKeys");Sm=Q9e});function Z9e(t){return fi(t)?vT(t):Sm(t)}var $r,wc=N(()=>{"use strict";g9();xw();Io();o(Z9e,"keys");$r=Z9e});var J9e,eLe,tLe,fa,Gee=N(()=>{"use strict";cm();Rd();b9();Io();am();wc();J9e=Object.prototype,eLe=J9e.hasOwnProperty,tLe=TT(function(t,e){if(dc(e)||fi(e)){Bo(e,$r(e),t);return}for(var r in e)eLe.call(e,r)&&pc(t,r,e[r])}),fa=tLe});function iLe(t,e){if(Pt(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||ao(t)?!0:nLe.test(t)||!rLe.test(t)||e!=null&&t in Object(e)}var rLe,nLe,Cm,bw=N(()=>{"use strict";Un();Gd();rLe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nLe=/^\w*$/;o(iLe,"isKey");Cm=iLe});function sLe(t){var e=Q0(t,function(n){return r.size===aLe&&r.clear(),n}),r=e.cache;return e}var aLe,Vee,Uee=N(()=>{"use strict";i9();aLe=500;o(sLe,"memoizeCapped");Vee=sLe});var oLe,lLe,cLe,Hee,Wee=N(()=>{"use strict";Uee();oLe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,lLe=/\\(\\)?/g,cLe=Vee(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(oLe,function(r,n,i,a){e.push(i?a.replace(lLe,"$1"):n||r)}),e}),Hee=cLe});function uLe(t){return t==null?"":Eee(t)}var Tw,GL=N(()=>{"use strict";See();o(uLe,"toString");Tw=uLe});function hLe(t,e){return Pt(t)?t:Cm(t,e)?[t]:Hee(Tw(t))}var jh,M2=N(()=>{"use strict";Un();bw();Wee();GL();o(hLe,"castPath");jh=hLe});function dLe(t){if(typeof t=="string"||ao(t))return t;var e=t+"";return e=="0"&&1/t==-fLe?"-0":e}var fLe,kc,Am=N(()=>{"use strict";Gd();fLe=1/0;o(dLe,"toKey");kc=dLe});function pLe(t,e){e=jh(e,t);for(var r=0,n=e.length;t!=null&&r{"use strict";M2();Am();o(pLe,"baseGet");Kh=pLe});function mLe(t,e,r){var n=t==null?void 0:Kh(t,e);return n===void 0?r:n}var qee,Yee=N(()=>{"use strict";I2();o(mLe,"get");qee=mLe});function gLe(t,e){for(var r=-1,n=e.length,i=t.length;++r{"use strict";o(gLe,"arrayPush");_m=gLe});function yLe(t){return Pt(t)||Al(t)||!!(Xee&&t&&t[Xee])}var Xee,jee,Kee=N(()=>{"use strict";Cd();sm();Un();Xee=Zi?Zi.isConcatSpreadable:void 0;o(yLe,"isFlattenable");jee=yLe});function Qee(t,e,r,n,i){var a=-1,s=t.length;for(r||(r=jee),i||(i=[]);++a0&&r(l)?e>1?Qee(l,e-1,r,n,i):_m(i,l):n||(i[i.length]=l)}return i}var Ec,Dm=N(()=>{"use strict";ww();Kee();o(Qee,"baseFlatten");Ec=Qee});function vLe(t){var e=t==null?0:t.length;return e?Ec(t,1):[]}var Wr,kw=N(()=>{"use strict";Dm();o(vLe,"flatten");Wr=vLe});function xLe(t){return bT(xT(t,void 0,Wr),t+"")}var Zee,Jee=N(()=>{"use strict";kw();y9();x9();o(xLe,"flatRest");Zee=xLe});function bLe(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++n{"use strict";o(bLe,"baseSlice");Ew=bLe});function DLe(t){return _Le.test(t)}var TLe,wLe,kLe,ELe,SLe,CLe,ALe,_Le,ete,tte=N(()=>{"use strict";TLe="\\ud800-\\udfff",wLe="\\u0300-\\u036f",kLe="\\ufe20-\\ufe2f",ELe="\\u20d0-\\u20ff",SLe=wLe+kLe+ELe,CLe="\\ufe0e\\ufe0f",ALe="\\u200d",_Le=RegExp("["+ALe+TLe+SLe+CLe+"]");o(DLe,"hasUnicode");ete=DLe});function LLe(t,e,r,n){var i=-1,a=t==null?0:t.length;for(n&&a&&(r=t[++i]);++i{"use strict";o(LLe,"arrayReduce");rte=LLe});function RLe(t,e){return t&&Bo(e,$r(e),t)}var ite,ate=N(()=>{"use strict";Rd();wc();o(RLe,"baseAssign");ite=RLe});function NLe(t,e){return t&&Bo(e,As(e),t)}var ste,ote=N(()=>{"use strict";Rd();$h();o(NLe,"baseAssignIn");ste=NLe});function MLe(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r{"use strict";o(MLe,"arrayFilter");Lm=MLe});function ILe(){return[]}var Cw,UL=N(()=>{"use strict";o(ILe,"stubArray");Cw=ILe});var OLe,PLe,lte,BLe,Rm,Aw=N(()=>{"use strict";Sw();UL();OLe=Object.prototype,PLe=OLe.propertyIsEnumerable,lte=Object.getOwnPropertySymbols,BLe=lte?function(t){return t==null?[]:(t=Object(t),Lm(lte(t),function(e){return PLe.call(t,e)}))}:Cw,Rm=BLe});function FLe(t,e){return Bo(t,Rm(t),e)}var cte,ute=N(()=>{"use strict";Rd();Aw();o(FLe,"copySymbols");cte=FLe});var $Le,zLe,_w,HL=N(()=>{"use strict";ww();pT();Aw();UL();$Le=Object.getOwnPropertySymbols,zLe=$Le?function(t){for(var e=[];t;)_m(e,Rm(t)),t=im(t);return e}:Cw,_w=zLe});function GLe(t,e){return Bo(t,_w(t),e)}var hte,fte=N(()=>{"use strict";Rd();HL();o(GLe,"copySymbolsIn");hte=GLe});function VLe(t,e,r){var n=e(t);return Pt(t)?n:_m(n,r(t))}var Dw,WL=N(()=>{"use strict";ww();Un();o(VLe,"baseGetAllKeys");Dw=VLe});function ULe(t){return Dw(t,$r,Rm)}var O2,qL=N(()=>{"use strict";WL();Aw();wc();o(ULe,"getAllKeys");O2=ULe});function HLe(t){return Dw(t,As,_w)}var Lw,YL=N(()=>{"use strict";WL();HL();$h();o(HLe,"getAllKeysIn");Lw=HLe});var WLe,Rw,dte=N(()=>{"use strict";Nh();Ro();WLe=Cs(hi,"DataView"),Rw=WLe});var qLe,Nw,pte=N(()=>{"use strict";Nh();Ro();qLe=Cs(hi,"Promise"),Nw=qLe});var YLe,Qh,XL=N(()=>{"use strict";Nh();Ro();YLe=Cs(hi,"Set"),Qh=YLe});var mte,XLe,gte,yte,vte,xte,jLe,KLe,QLe,ZLe,JLe,Ud,so,Hd=N(()=>{"use strict";dte();sT();pte();XL();Iee();Su();t9();mte="[object Map]",XLe="[object Object]",gte="[object Promise]",yte="[object Set]",vte="[object WeakMap]",xte="[object DataView]",jLe=Cu(Rw),KLe=Cu(Oh),QLe=Cu(Nw),ZLe=Cu(Qh),JLe=Cu(pw),Ud=ua;(Rw&&Ud(new Rw(new ArrayBuffer(1)))!=xte||Oh&&Ud(new Oh)!=mte||Nw&&Ud(Nw.resolve())!=gte||Qh&&Ud(new Qh)!=yte||pw&&Ud(new pw)!=vte)&&(Ud=o(function(t){var e=ua(t),r=e==XLe?t.constructor:void 0,n=r?Cu(r):"";if(n)switch(n){case jLe:return xte;case KLe:return mte;case QLe:return gte;case ZLe:return yte;case JLe:return vte}return e},"getTag"));so=Ud});function rRe(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&tRe.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var eRe,tRe,bte,Tte=N(()=>{"use strict";eRe=Object.prototype,tRe=eRe.hasOwnProperty;o(rRe,"initCloneArray");bte=rRe});function nRe(t,e){var r=e?nm(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var wte,kte=N(()=>{"use strict";uT();o(nRe,"cloneDataView");wte=nRe});function aRe(t){var e=new t.constructor(t.source,iRe.exec(t));return e.lastIndex=t.lastIndex,e}var iRe,Ete,Ste=N(()=>{"use strict";iRe=/\w*$/;o(aRe,"cloneRegExp");Ete=aRe});function sRe(t){return Ate?Object(Ate.call(t)):{}}var Cte,Ate,_te,Dte=N(()=>{"use strict";Cd();Cte=Zi?Zi.prototype:void 0,Ate=Cte?Cte.valueOf:void 0;o(sRe,"cloneSymbol");_te=sRe});function CRe(t,e,r){var n=t.constructor;switch(e){case mRe:return nm(t);case oRe:case lRe:return new n(+t);case gRe:return wte(t,r);case yRe:case vRe:case xRe:case bRe:case TRe:case wRe:case kRe:case ERe:case SRe:return hT(t,r);case cRe:return new n;case uRe:case dRe:return new n(t);case hRe:return Ete(t);case fRe:return new n;case pRe:return _te(t)}}var oRe,lRe,cRe,uRe,hRe,fRe,dRe,pRe,mRe,gRe,yRe,vRe,xRe,bRe,TRe,wRe,kRe,ERe,SRe,Lte,Rte=N(()=>{"use strict";uT();kte();Ste();Dte();c9();oRe="[object Boolean]",lRe="[object Date]",cRe="[object Map]",uRe="[object Number]",hRe="[object RegExp]",fRe="[object Set]",dRe="[object String]",pRe="[object Symbol]",mRe="[object ArrayBuffer]",gRe="[object DataView]",yRe="[object Float32Array]",vRe="[object Float64Array]",xRe="[object Int8Array]",bRe="[object Int16Array]",TRe="[object Int32Array]",wRe="[object Uint8Array]",kRe="[object Uint8ClampedArray]",ERe="[object Uint16Array]",SRe="[object Uint32Array]";o(CRe,"initCloneByTag");Lte=CRe});function _Re(t){return ni(t)&&so(t)==ARe}var ARe,Nte,Mte=N(()=>{"use strict";Hd();Mo();ARe="[object Map]";o(_Re,"baseIsMap");Nte=_Re});var Ite,DRe,Ote,Pte=N(()=>{"use strict";Mte();Ld();c2();Ite=Po&&Po.isMap,DRe=Ite?Oo(Ite):Nte,Ote=DRe});function RRe(t){return ni(t)&&so(t)==LRe}var LRe,Bte,Fte=N(()=>{"use strict";Hd();Mo();LRe="[object Set]";o(RRe,"baseIsSet");Bte=RRe});var $te,NRe,zte,Gte=N(()=>{"use strict";Fte();Ld();c2();$te=Po&&Po.isSet,NRe=$te?Oo($te):Bte,zte=NRe});function Mw(t,e,r,n,i,a){var s,l=e&MRe,u=e&IRe,h=e&ORe;if(r&&(s=i?r(t,n,i,a):r(t)),s!==void 0)return s;if(!xn(t))return t;var f=Pt(t);if(f){if(s=bte(t),!l)return fT(t,s)}else{var d=so(t),p=d==Ute||d==zRe;if(_l(t))return cT(t,l);if(d==Hte||d==Vte||p&&!i){if(s=u||p?{}:mT(t),!l)return u?hte(t,ste(s,t)):cte(t,ite(s,t))}else{if(!An[d])return i?t:{};s=Lte(t,d,l)}}a||(a=new hc);var m=a.get(t);if(m)return m;a.set(t,s),zte(t)?t.forEach(function(v){s.add(Mw(v,e,r,v,t,a))}):Ote(t)&&t.forEach(function(v,x){s.set(x,Mw(v,e,r,x,t,a))});var g=h?u?Lw:O2:u?As:$r,y=f?void 0:g(t);return mw(y||t,function(v,x){y&&(x=v,v=t[x]),pc(s,x,Mw(v,e,r,x,t,a))}),s}var MRe,IRe,ORe,Vte,PRe,BRe,FRe,$Re,Ute,zRe,GRe,VRe,Hte,URe,HRe,WRe,qRe,YRe,XRe,jRe,KRe,QRe,ZRe,JRe,eNe,tNe,rNe,nNe,iNe,An,Iw,jL=N(()=>{"use strict";s2();FL();cm();ate();ote();o9();u9();ute();fte();qL();YL();Hd();Tte();Rte();f9();Un();lm();Pte();to();Gte();wc();$h();MRe=1,IRe=2,ORe=4,Vte="[object Arguments]",PRe="[object Array]",BRe="[object Boolean]",FRe="[object Date]",$Re="[object Error]",Ute="[object Function]",zRe="[object GeneratorFunction]",GRe="[object Map]",VRe="[object Number]",Hte="[object Object]",URe="[object RegExp]",HRe="[object Set]",WRe="[object String]",qRe="[object Symbol]",YRe="[object WeakMap]",XRe="[object ArrayBuffer]",jRe="[object DataView]",KRe="[object Float32Array]",QRe="[object Float64Array]",ZRe="[object Int8Array]",JRe="[object Int16Array]",eNe="[object Int32Array]",tNe="[object Uint8Array]",rNe="[object Uint8ClampedArray]",nNe="[object Uint16Array]",iNe="[object Uint32Array]",An={};An[Vte]=An[PRe]=An[XRe]=An[jRe]=An[BRe]=An[FRe]=An[KRe]=An[QRe]=An[ZRe]=An[JRe]=An[eNe]=An[GRe]=An[VRe]=An[Hte]=An[URe]=An[HRe]=An[WRe]=An[qRe]=An[tNe]=An[rNe]=An[nNe]=An[iNe]=!0;An[$Re]=An[Ute]=An[YRe]=!1;o(Mw,"baseClone");Iw=Mw});function sNe(t){return Iw(t,aNe)}var aNe,nn,KL=N(()=>{"use strict";jL();aNe=4;o(sNe,"clone");nn=sNe});function cNe(t){return Iw(t,oNe|lNe)}var oNe,lNe,QL,Wte=N(()=>{"use strict";jL();oNe=1,lNe=4;o(cNe,"cloneDeep");QL=cNe});function uNe(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e{"use strict";o(uNe,"compact");Sc=uNe});function fNe(t){return this.__data__.set(t,hNe),this}var hNe,Yte,Xte=N(()=>{"use strict";hNe="__lodash_hash_undefined__";o(fNe,"setCacheAdd");Yte=fNe});function dNe(t){return this.__data__.has(t)}var jte,Kte=N(()=>{"use strict";o(dNe,"setCacheHas");jte=dNe});function Ow(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new _d;++e{"use strict";oT();Xte();Kte();o(Ow,"SetCache");Ow.prototype.add=Ow.prototype.push=Yte;Ow.prototype.has=jte;Nm=Ow});function pNe(t,e){for(var r=-1,n=t==null?0:t.length;++r{"use strict";o(pNe,"arraySome");Bw=pNe});function mNe(t,e){return t.has(e)}var Mm,Fw=N(()=>{"use strict";o(mNe,"cacheHas");Mm=mNe});function vNe(t,e,r,n,i,a){var s=r&gNe,l=t.length,u=e.length;if(l!=u&&!(s&&u>l))return!1;var h=a.get(t),f=a.get(e);if(h&&f)return h==e&&f==t;var d=-1,p=!0,m=r&yNe?new Nm:void 0;for(a.set(t,e),a.set(e,t);++d{"use strict";Pw();ZL();Fw();gNe=1,yNe=2;o(vNe,"equalArrays");$w=vNe});function xNe(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var Qte,Zte=N(()=>{"use strict";o(xNe,"mapToArray");Qte=xNe});function bNe(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Im,zw=N(()=>{"use strict";o(bNe,"setToArray");Im=bNe});function INe(t,e,r,n,i,a,s){switch(r){case MNe:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case NNe:return!(t.byteLength!=e.byteLength||!a(new rm(t),new rm(e)));case kNe:case ENe:case ANe:return No(+t,+e);case SNe:return t.name==e.name&&t.message==e.message;case _Ne:case LNe:return t==e+"";case CNe:var l=Qte;case DNe:var u=n&TNe;if(l||(l=Im),t.size!=e.size&&!u)return!1;var h=s.get(t);if(h)return h==e;n|=wNe,s.set(t,e);var f=$w(l(t),l(e),n,i,a,s);return s.delete(t),f;case RNe:if(eR)return eR.call(t)==eR.call(e)}return!1}var TNe,wNe,kNe,ENe,SNe,CNe,ANe,_Ne,DNe,LNe,RNe,NNe,MNe,Jte,eR,ere,tre=N(()=>{"use strict";Cd();l9();Ad();JL();Zte();zw();TNe=1,wNe=2,kNe="[object Boolean]",ENe="[object Date]",SNe="[object Error]",CNe="[object Map]",ANe="[object Number]",_Ne="[object RegExp]",DNe="[object Set]",LNe="[object String]",RNe="[object Symbol]",NNe="[object ArrayBuffer]",MNe="[object DataView]",Jte=Zi?Zi.prototype:void 0,eR=Jte?Jte.valueOf:void 0;o(INe,"equalByTag");ere=INe});function FNe(t,e,r,n,i,a){var s=r&ONe,l=O2(t),u=l.length,h=O2(e),f=h.length;if(u!=f&&!s)return!1;for(var d=u;d--;){var p=l[d];if(!(s?p in e:BNe.call(e,p)))return!1}var m=a.get(t),g=a.get(e);if(m&&g)return m==e&&g==t;var y=!0;a.set(t,e),a.set(e,t);for(var v=s;++d