@mermaid-js/tiny 11.17.0 → 11.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -199,7 +199,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error
199
199
  `);return MT(n)}function BU(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}function FU(e,t={}){let r=qPe(e,t),n=Xr.lexer(r),i=[[]],a=0;function o(l,u="normal"){l.type==="text"?l.text.split(`
200
200
  `).forEach((d,f)=>{f!==0&&(a++,i.push([])),d.split(" ").forEach(p=>{p=p.replace(/&#39;/g,"'"),p&&i[a].push({content:p,type:u})})}):l.type==="strong"||l.type==="em"?l.tokens.forEach(h=>{o(h,l.type)}):l.type==="html"&&i[a].push({content:l.text,type:"normal"})}return s(o,"processNode"),n.forEach(l=>{l.type==="paragraph"?l.tokens?.forEach(u=>{o(u)}):l.type==="html"?i[a].push({content:l.text,type:"normal"}):i[a].push({content:l.raw,type:"normal"})}),i}function GU(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}function zU(e,{markdownAutoWrap:t}={}){let r=Xr.lexer(e);function n(i){return i.type==="text"?t===!1?i.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):i.text.replace(/\n */g,"<br/>"):i.type==="strong"?`<strong>${i.tokens?.map(n).join("")}</strong>`:i.type==="em"?`<em>${i.tokens?.map(n).join("")}</em>`:i.type==="paragraph"?`<p>${i.tokens?.map(n).join("")}</p>`:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(Y.warn(`Unsupported markdown: ${i.type}`),i.raw)}return s(n,"output"),r.map(n).join("")}var VU=_(()=>{"use strict";$U();bR();ft();s(qPe,"preprocessMarkdown");s(BU,"nonMarkdownToLines");s(FU,"markdownToLines");s(GU,"nonMarkdownToHTML");s(zU,"markdownToHTML")});var WU=Ul((P4,M4)=>{"use strict";(function(e){"use strict";var t=function(){},r=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||function(h){return setTimeout(h,16)};function n(){var h=this;h.reads=[],h.writes=[],h.raf=r.bind(e),t("initialized",h)}s(n,"FastDom"),n.prototype={constructor:n,runTasks:s(function(h){t("run tasks");for(var d;d=h.shift();)d()},"runTasks"),measure:s(function(h,d){t("measure");var f=d?h.bind(d):h;return this.reads.push(f),i(this),f},"measure"),mutate:s(function(h,d){t("mutate");var f=d?h.bind(d):h;return this.writes.push(f),i(this),f},"mutate"),clear:s(function(h){return t("clear",h),o(this.reads,h)||o(this.writes,h)},"clear"),extend:s(function(h){if(t("extend",h),typeof h!="object")throw new Error("expected object");var d=Object.create(this);return l(d,h),d.fastdom=this,d.initialize&&d.initialize(),d},"extend"),catch:null};function i(h){h.scheduled||(h.scheduled=!0,h.raf(a.bind(null,h)),t("flush scheduled"))}s(i,"scheduleFlush");function a(h){t("flush");var d=h.writes,f=h.reads,p;try{t("flushing reads",f.length),h.runTasks(f),t("flushing writes",d.length),h.runTasks(d)}catch(g){p=g}if(h.scheduled=!1,(f.length||d.length)&&i(h),p)if(t("task errored",p.message),h.catch)h.catch(p);else throw p}s(a,"flush");function o(h,d){var f=h.indexOf(d);return!!~f&&!!h.splice(f,1)}s(o,"remove");function l(h,d){for(var f in d)d.hasOwnProperty(f)&&(h[f]=d[f])}s(l,"mixin");var u=e.fastdom=e.fastdom||new n;typeof define=="function"?define(function(){return u}):typeof M4=="object"&&(M4.exports=u)})(typeof window<"u"?window:typeof P4<"u"?P4:globalThis)});var qU=Ul((fPt,O4)=>{"use strict";(function(){var e={initialize:s(function(){this._tasks=new Map},"initialize"),mutate:s(function(r,n){return t(this,"mutate",r,n)},"mutate"),measure:s(function(r,n){return t(this,"measure",r,n)},"measure"),clear:s(function(r){var n=this._tasks,i=n.get(r);this.fastdom.clear(i),n.delete(r)},"clear")};function t(r,n,i,a){var o=r._tasks,l=r.fastdom,u,h=new Promise(function(d,f){u=l[n](function(){o.delete(h);try{d(a?i.call(a):i())}catch(p){f(p)}},a)});return o.set(h,u),h}s(t,"create"),(typeof define)[0]=="f"?define(function(){return e}):(typeof O4)[0]=="o"?O4.exports=e:window.fastdomPromised=e})()});var jU,HU,jPe,nl,$C=_(()=>{"use strict";jU=sa(WU(),1),HU=sa(qU(),1),jPe=jU.default.extend({raf(e){typeof queueMicrotask=="function"?queueMicrotask(e):setTimeout(e,0)}}).extend(HU.default),nl=jPe});function HPe(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}function UPe(e,t){let r=HPe(t.content);return UU(e,[],r,t.type)}function UU(e,t,r,n){if(r.length===0)return[{content:t.join(""),type:n},{content:"",type:n}];let[i,...a]=r,o=[...t,i];return e([{content:o.join(""),type:n}])?UU(e,o,a,n):(t.length===0&&i&&(t.push(i),r.shift()),[{content:t.join(""),type:n},{content:r.join(""),type:n}])}function YU(e,t){if(e.some(({content:r})=>r.includes(`
201
201
  `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return $4(e,t)}function $4(e,t,r=[],n=[]){if(e.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let i="";e[0].content===" "&&(i=" ",e.shift());let a=e.shift()??{content:" ",type:"normal"},o=[...n];if(i!==""&&o.push({content:i,type:"normal"}),o.push(a),t(o))return $4(e,t,r,o);if(n.length>0)r.push(n),e.unshift(a);else if(a.content){let[l,u]=UPe(t,a);r.push([l]),u.content&&e.unshift(u)}return $4(e,t,r)}var KU=_(()=>{"use strict";s(HPe,"splitTextToChars");s(UPe,"splitWordToFitWidth");s(UU,"splitWordToFitWidthRecursion");s(YU,"splitLineToFitWidth");s($4,"splitLineToFitWidthRecursion")});function XU(e,t){t&&e.attr("style",t)}async function YPe(e,t,r,n,i=!1,a=mt()){let o=e.append("foreignObject");o.attr("width",`${Math.min(10*r,QU)}px`),o.attr("height",`${Math.min(10*r,QU)}px`);let l=o.append("xhtml:div"),u=Ln(t.label)?await Op(t.label.replace(ot.lineBreakRegex,`
202
- `),a):fr(t.label,a),h=t.isNode?"nodeLabel":"edgeLabel",d=l.append("span");return d.html(u),XU(d,t.labelStyle),d.attr("class",`${h} ${n}`),XU(l,t.labelStyle),l.style("display","table-cell"),l.style("white-space","nowrap"),l.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(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"),(await nl.measure(()=>l.node().getBoundingClientRect())).width===r&&(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",r+"px")),o.node()}function B4(e,t,r,n=!1){let i=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}function KPe(e,t,r){let n=e.append("text"),i=B4(n,1,t);F4(i,r);let a=i.node().getComputedTextLength();return n.remove(),a}function JU(e,t,r){let n=e.append("text"),i=B4(n,1,t);F4(i,[{content:r,type:"normal"}]);let a=i.node()?.getBoundingClientRect();return a&&n.remove(),a}function XPe(e,t,r,n=!1,i=!1){let o=t.append("g"),l=o.insert("rect").attr("class","background").attr("style","stroke: none"),u=o.append("text").attr("y","-10.1");i&&u.attr("text-anchor","middle");let h=0;for(let d of r){let f=s(g=>KPe(o,1.1,g)<=e,"checkWidth"),p=f(d)?[d]:YU(d,f);for(let g of p){let m=B4(u,h,1.1,i);F4(m,g),h++}}if(n){let d=u.node().getBBox(),f=2;return l.attr("x",d.x-f).attr("y",d.y-f).attr("width",d.width+2*f).attr("height",d.height+2*f),o.node()}else return u.node()}function ZU(e){let t=/&(amp|lt|gt);/g;return e.replace(t,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}function F4(e,t){e.text(""),t.forEach((r,n)=>{let i=e.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(ZU(r.content)):i.text(" "+ZU(r.content))})}async function QPe(e,t={}){let r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,o)=>(r.push((async()=>{let l=`${a}:${o}`;return await gz(l)?await Ia(l,void 0,{class:"label-icon"}):`<i class='${fr(i,t).replace(":"," ")}'></i>`})()),i));let n=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}var QU,si,mo=_(()=>{"use strict";Sr();vr();ft();mm();VU();Pt();$C();cu();KU();ir();s(XU,"applyStyle");QU=16384;s(YPe,"addHtmlSpan");s(B4,"createTspan");s(KPe,"computeWidthOfText");s(JU,"computeDimensionOfText");s(XPe,"createFormattedText");s(ZU,"decodeHTMLEntities");s(F4,"updateTextContentAndStyles");s(QPe,"replaceIconSubstring");si=s(async(e,t="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:o=!0,isNode:l=!0,width:u=200,addSvgBackground:h=!1}={},d)=>{if(Y.debug("XYZ createText",t,r,n,i,a,l,"addSvgBackground: ",h),a){let f=o?zU(t,d):GU(t),p=await QPe(Ps(f),d),g=t.replace(/\\\\/g,"\\"),m={isNode:l,label:Ln(t)?g:p,labelStyle:r.replace("fill:","color:")};return await YPe(e,m,u,i,h,d)}else{let f=Ps(t.replace(/<br\s*\/?>/g,"<br/>")),p=o?FU(f.replace("<br>","<br/>"),d):BU(f),g=XPe(u,e,p,t?h:!1,!l);if(l){/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:");et(g).attr("style",m)}else{let m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");et(g).select("rect").attr("style",m.replace(/background:/g,"fill:"));let y=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");et(g).select("text").attr("style",y)}return n?et(g).selectAll("tspan.text-outer-tspan").classed("title-row",!0):et(g).selectAll("tspan.text-outer-tspan").classed("row",!0),g}},"createText")});async function BC(e){let t=e.getElementsByTagName("img");if(!t||t.length===0)return;let r=!eY(e);await Promise.all([...t].map(n=>new Promise(i=>{function a(){if(n.style.display="flex",n.style.flexDirection="column",r){let o=xe().fontSize?xe().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=ar.fontSize]=Ns(o),h=u*l+"px";n.style.minWidth=h,n.style.maxWidth=h}else n.style.width="100%";i(n)}s(a,"setupImage"),setTimeout(()=>{n.complete&&a()}),n.addEventListener("error",a),n.addEventListener("load",a)})))}function eY(e){return e.nodeType===JPe?e.textContent?.trim()!=="":e.nodeType!==ZPe||e.tagName.toLowerCase()==="img"?!1:[...e.childNodes].some(eY)}var ZPe,JPe,G4=_(()=>{"use strict";Nt();Vi();Pt();ZPe=1,JPe=3;s(BC,"configureLabelImages");s(eY,"hasTextBesidesImages")});var tY,eMe,rY,nY=_(()=>{"use strict";Sr();mo();Nt();vr();Pt();tY=3,eMe=32,rY=s(async(e,t,r)=>{let n=xe(),i=e.insert("g").attr("class",r??"node default").attr("id",t.domId||t.id),a=i.insert("g").attr("class","label").attr("style",$r(t.labelStyle)),l=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(x=>({text:x,cssClass:"c4-descr"}))].filter(x=>x.text),u=t.width?Math.max(t.width-2*(t.padding??0),eMe):xe().flowchart?.wrappingWidth??200,h=n.wrap?u:Number.POSITIVE_INFINITY,d=await Promise.all(l.map(async x=>{let T=a.append("g").attr("class",x.cssClass),C=await si(T,fr(Ps(x.text??""),n),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:h,style:t.labelStyle},n);return et(C).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),et(C).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:T,box:T.node().getBBox()}})),f=Math.max(...d.map(({box:x})=>x.width),0),p=0;for(let{el:x,box:T}of d)x.attr("transform",`translate(${f/2-T.x-T.width/2}, ${p-T.y})`),p+=T.height+tY;let g=d.length>0?p-tY:0;a.insert("rect",":first-child"),a.attr("transform",`translate(${-f/2}, ${-g/2})`);let m=a.node().getBBox(),y=(t.padding??0)/2;return{shapeSvg:i,bbox:m,halfPadding:y,label:a}},"c4LabelHelper")});function Gt(e){let t=e.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}function Ma(e,t,r,n,i,a){let o=[],u=r-e,h=n-t,d=u/a,f=2*Math.PI/d,p=t+h/2;for(let g=0;g<=50;g++){let m=g/50,y=e+m*u,x=p+i*Math.sin(f*(y-e));o.push({x:y,y:x})}return o}function ha(e,t,r,n,i,a){let o=[],l=i*Math.PI/180,d=(a*Math.PI/180-l)/(n-1);for(let f=0;f<n;f++){let p=l+f*d,g=e+r*Math.cos(p),m=t+r*Math.sin(p);o.push({x:-g,y:-m})}return o}function z4(e){let t=Array.from(e.childNodes).filter(u=>u.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=t.map(u=>u.getAttribute("d")).filter(u=>u!==null).join(" ");r.setAttribute("d",n);let i=t.find(u=>u.getAttribute("fill")!=="none"),a=t.find(u=>u.getAttribute("stroke")!=="none"),o=s((u,h)=>u?.getAttribute(h)??void 0,"getAttr");if(i){let u={fill:o(i,"fill"),"fill-opacity":o(i,"fill-opacity")??"1"};Object.entries(u).forEach(([h,d])=>{d&&r.setAttribute(h,d)})}if(a){let u={stroke:o(a,"stroke"),"stroke-width":o(a,"stroke-width")??"1","stroke-opacity":o(a,"stroke-opacity")??"1"};Object.entries(u).forEach(([h,d])=>{d&&r.setAttribute(h,d)})}let l=document.createElementNS("http://www.w3.org/2000/svg","g");return l.appendChild(r),l}var it,FC,Ze,st,Ct=_(()=>{"use strict";mo();$C();Nt();ir();Sr();vr();Pt();G4();mm();nY();it=s(async(e,t,r)=>{if(t.stereotype!==void 0)return rY(e,t,r);let n,i=t.useHtmlLabels||Ei(xe()?.htmlLabels);r?n=r:n="node default";let a=e.insert("g").attr("class",n).attr("id",t.domId||t.id),o=a.insert("g").attr("class","label").attr("style",$r(t.labelStyle)),l;t.label===void 0?l="":l=typeof t.label=="string"?t.label:t.label[0];let u=!!t.icon||!!t.img,h=t.labelType==="markdown",d=await si(o,fr(Ps(l),xe()),{useHtmlLabels:i,width:t.width||t.wrappingWidth||xe().flowchart?.wrappingWidth,classes:h?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:u,markdown:h},xe()),f=(t?.padding??0)/2,p;if(i){let g=d.children[0],m=et(d);await BC(g),p=await nl.measure(()=>g.getBoundingClientRect()),m.attr("width",p.width),m.attr("height",p.height)}else p=await nl.measure(()=>d.getBBox());return i?o.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):o.attr("transform","translate(0, "+-p.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:a,bbox:p,halfPadding:f,label:o}},"labelHelper"),FC=s(async(e,t,r)=>{let n=r.useHtmlLabels??vn(xe()),i=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await si(i,fr(Ps(t),xe()),{useHtmlLabels:n,width:r.width||xe()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),o=r.padding/2,l;if(vn(xe())){let u=a.children[0],h=et(a);l=await nl.measure(()=>u.getBoundingClientRect()),h.attr("width",l.width),h.attr("height",l.height)}else l=await nl.measure(()=>a.getBBox());return n?i.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"):i.attr("transform","translate(0, "+-l.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:e,bbox:l,halfPadding:o,label:i}},"insertLabel"),Ze=s((e,t,r)=>{if(r){e.width=r.width,e.height=r.height;return}let n=t.node().getBBox();e.width=n.width,e.height=n.height},"updateNodeBounds"),st=s((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");s(Gt,"createPathFromPoints");s(Ma,"generateFullSineWavePoints");s(ha,"generateCirclePoints");s(z4,"mergePaths")});function tMe(e,t){return e.intersect(t)}var iY,sY=_(()=>{"use strict";s(tMe,"intersectNode");iY=tMe});function rMe(e,t,r,n){var i=e.x,a=e.y,o=i-n.x,l=a-n.y,u=Math.sqrt(t*t*l*l+r*r*o*o),h=Math.abs(t*r*o/u);n.x<i&&(h=-h);var d=Math.abs(t*r*l/u);return n.y<a&&(d=-d),{x:i+h,y:a+d}}var GC,V4=_(()=>{"use strict";s(rMe,"intersectEllipse");GC=rMe});function nMe(e,t,r){return GC(e,t,t,r)}var aY,oY=_(()=>{"use strict";V4();s(nMe,"intersectCircle");aY=nMe});function iMe(e,t,r,n){{let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,l=i*r.x+a*r.y+o,u=i*n.x+a*n.y+o,h=1e-6;if(l!==0&&u!==0&&lY(l,u))return;let d=n.y-r.y,f=r.x-n.x,p=n.x*r.y-r.x*n.y,g=d*e.x+f*e.y+p,m=d*t.x+f*t.y+p;if(Math.abs(g)<h&&Math.abs(m)<h&&lY(g,m))return;let y=i*f-d*a;if(y===0)return;let x=Math.abs(y/2),T=a*p-f*o,C=T<0?(T-x)/y:(T+x)/y;T=d*o-i*p;let k=T<0?(T-x)/y:(T+x)/y;return{x:C,y:k}}}function lY(e,t){return e*t>0}var cY,uY=_(()=>{"use strict";s(iMe,"intersectLine");s(lY,"sameSign");cY=iMe});function sMe(e,t,r){let n=e.x,i=e.y,a=[],o=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(d){o=Math.min(o,d.x),l=Math.min(l,d.y)}):(o=Math.min(o,t.x),l=Math.min(l,t.y));let u=n-e.width/2-o,h=i-e.height/2-l;for(let d=0;d<t.length;d++){let f=t[d],p=t[d<t.length-1?d+1:0],g=cY(e,r,{x:u+f.x,y:h+f.y},{x:u+p.x,y:h+p.y});g&&a.push(g)}return a.length?(a.length>1&&a.sort(function(d,f){let p=d.x-r.x,g=d.y-r.y,m=Math.sqrt(p*p+g*g),y=f.x-r.x,x=f.y-r.y,T=Math.sqrt(y*y+x*x);return m<T?-1:m===T?0:1}),a[0]):e}var hY,dY=_(()=>{"use strict";uY();s(sMe,"intersectPolygon");hY=sMe});var aMe,il,zC=_(()=>{"use strict";aMe=s((e,t)=>{var r=e.x,n=e.y,i=t.x-r,a=t.y-n,o=e.width/2,l=e.height/2,u,h;return Math.abs(a)*o>Math.abs(i)*l?(a<0&&(l=-l),u=a===0?0:l*i/a,h=l):(i<0&&(o=-o),u=o,h=i===0?0:o*a/i),{x:r+u,y:n+h}},"intersectRect"),il=aMe});var je,Lt=_(()=>{"use strict";sY();oY();V4();dY();zC();je={node:iY,circle:aY,ellipse:GC,polygon:hY,rect:il}});var fY,oMe,sl,lMe,C1,Ke,Je,cMe,_t=_(()=>{"use strict";Nt();fY=s(e=>{let{handDrawnSeed:t}=xe();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),oMe=s(e=>Array.isArray(e)?e:e?e.split(";").map(t=>t.trim()).filter(Boolean):[],"normalizeStyleList"),sl=s(e=>{let t=lMe([...e.cssCompiledStyles||[],...e.cssStyles||[],...oMe(e.labelStyle)]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),lMe=s(e=>{let t=new Map;return e.forEach(r=>{let[n,i]=r.split(":");t.set(n.trim(),i?.trim())}),t},"styles2Map"),C1=s(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),Ke=s(e=>{let{stylesArray:t}=sl(e),r=[],n=[],i=[],a=[];return t.forEach(o=>{let l=o[0];C1(l)?r.push(o.join(":")+" !important"):(n.push(o.join(":")+" !important"),l.includes("stroke")&&i.push(o.join(":")+" !important"),l==="fill"&&a.push(o.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:t,borderStyles:i,backgroundStyles:a}},"styles2String"),Je=s((e,t)=>{let{themeVariables:r,handDrawnSeed:n}=xe(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:o}=sl(e);return Object.assign({roughness:.7,fill:o.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:o.get("stroke")||i,seed:n,strokeWidth:o.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:cMe(o.get("stroke-dasharray"))},t)},"userNodeOverrides"),cMe=s(e=>{if(!e)return[0,0];let t=e.trim().split(/\s+/).map(Number);if(t.length===1){let i=isNaN(t[0])?0:t[0];return[i,i]}let r=isNaN(t[0])?0:t[0],n=isNaN(t[1])?0:t[1];return[r,n]},"getStrokeDashArray")});function W4(e,t,r){if(e&&e.length){let[n,i]=t,a=Math.PI/180*r,o=Math.cos(a),l=Math.sin(a);for(let u of e){let[h,d]=u;u[0]=(h-n)*o-(d-i)*l+n,u[1]=(h-n)*l+(d-i)*o+i}}}function uMe(e,t){return e[0]===t[0]&&e[1]===t[1]}function hMe(e,t,r,n=1){let i=r,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,l=[0,0];if(i)for(let h of o)W4(h,l,i);let u=(function(h,d,f){let p=[];for(let C of h){let k=[...C];uMe(k[0],k[k.length-1])||k.push([k[0][0],k[0][1]]),k.length>2&&p.push(k)}let g=[];d=Math.max(d,.1);let m=[];for(let C of p)for(let k=0;k<C.length-1;k++){let E=C[k],v=C[k+1];if(E[1]!==v[1]){let S=Math.min(E[1],v[1]);m.push({ymin:S,ymax:Math.max(E[1],v[1]),x:S===E[1]?E[0]:v[0],islope:(v[0]-E[0])/(v[1]-E[1])})}}if(m.sort(((C,k)=>C.ymin<k.ymin?-1:C.ymin>k.ymin?1:C.x<k.x?-1:C.x>k.x?1:C.ymax===k.ymax?0:(C.ymax-k.ymax)/Math.abs(C.ymax-k.ymax))),!m.length)return g;let y=[],x=m[0].ymin,T=0;for(;y.length||m.length;){if(m.length){let C=-1;for(let k=0;k<m.length&&!(m[k].ymin>x);k++)C=k;m.splice(0,C+1).forEach((k=>{y.push({s:x,edge:k})}))}if(y=y.filter((C=>!(C.edge.ymax<=x))),y.sort(((C,k)=>C.edge.x===k.edge.x?0:(C.edge.x-k.edge.x)/Math.abs(C.edge.x-k.edge.x))),(f!==1||T%d==0)&&y.length>1)for(let C=0;C<y.length;C+=2){let k=C+1;if(k>=y.length)break;let E=y[C].edge,v=y[k].edge;g.push([[Math.round(E.x),x],[Math.round(v.x),x]])}x+=f,y.forEach((C=>{C.edge.x=C.edge.x+f*C.edge.islope})),T++}return g})(o,a,n);if(i){for(let h of o)W4(h,l,-i);(function(h,d,f){let p=[];h.forEach((g=>p.push(...g))),W4(p,d,f)})(u,l,-i)}return u}function E1(e,t){var r;let n=t.hachureAngle+90,i=t.hachureGap;i<0&&(i=4*t.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),hMe(e,i,n,a||1)}function XC(e){let t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}function j4(e,t){return e.type===t}function sI(e){let t=[],r=(function(o){let l=new Array;for(;o!=="";)if(o.match(/^([ \t\r\n,]+)/))o=o.substr(RegExp.$1.length);else if(o.match(/^([aAcChHlLmMqQsStTvVzZ])/))l[l.length]={type:dMe,text:RegExp.$1},o=o.substr(RegExp.$1.length);else{if(!o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];l[l.length]={type:q4,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return l[l.length]={type:pY,text:""},l})(e),n="BOD",i=0,a=r[i];for(;!j4(a,pY);){let o=0,l=[];if(n==="BOD"){if(a.text!=="M"&&a.text!=="m")return sI("M0,0"+e);i++,o=VC[a.text],n=a.text}else j4(a,q4)?o=VC[n]:(i++,o=VC[a.text],n=a.text);if(!(i+o<r.length))throw new Error("Path data ended short");for(let u=i;u<i+o;u++){let h=r[u];if(!j4(h,q4))throw new Error("Param not a number: "+n+","+h.text);l[l.length]=+h.text}if(typeof VC[n]!="number")throw new Error("Bad segment: "+n);{let u={key:n,data:l};t.push(u),i+=o,a=r[i],n==="M"&&(n="L"),n==="m"&&(n="l")}}return t}function kY(e){let t=0,r=0,n=0,i=0,a=[];for(let{key:o,data:l}of e)switch(o){case"M":a.push({key:"M",data:[...l]}),[t,r]=l,[n,i]=l;break;case"m":t+=l[0],r+=l[1],a.push({key:"M",data:[t,r]}),n=t,i=r;break;case"L":a.push({key:"L",data:[...l]}),[t,r]=l;break;case"l":t+=l[0],r+=l[1],a.push({key:"L",data:[t,r]});break;case"C":a.push({key:"C",data:[...l]}),t=l[4],r=l[5];break;case"c":{let u=l.map(((h,d)=>d%2?h+r:h+t));a.push({key:"C",data:u}),t=u[4],r=u[5];break}case"Q":a.push({key:"Q",data:[...l]}),t=l[2],r=l[3];break;case"q":{let u=l.map(((h,d)=>d%2?h+r:h+t));a.push({key:"Q",data:u}),t=u[2],r=u[3];break}case"A":a.push({key:"A",data:[...l]}),t=l[5],r=l[6];break;case"a":t+=l[5],r+=l[6],a.push({key:"A",data:[l[0],l[1],l[2],l[3],l[4],t,r]});break;case"H":a.push({key:"H",data:[...l]}),t=l[0];break;case"h":t+=l[0],a.push({key:"H",data:[t]});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]}),t=l[2],r=l[3];break;case"s":{let u=l.map(((h,d)=>d%2?h+r:h+t));a.push({key:"S",data:u}),t=u[2],r=u[3];break}case"T":a.push({key:"T",data:[...l]}),t=l[0],r=l[1];break;case"t":t+=l[0],r+=l[1],a.push({key:"T",data:[t,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),t=n,r=i}return a}function SY(e){let t=[],r="",n=0,i=0,a=0,o=0,l=0,u=0;for(let{key:h,data:d}of e){switch(h){case"M":t.push({key:"M",data:[...d]}),[n,i]=d,[a,o]=d;break;case"C":t.push({key:"C",data:[...d]}),n=d[4],i=d[5],l=d[2],u=d[3];break;case"L":t.push({key:"L",data:[...d]}),[n,i]=d;break;case"H":n=d[0],t.push({key:"L",data:[n,i]});break;case"V":i=d[0],t.push({key:"L",data:[n,i]});break;case"S":{let f=0,p=0;r==="C"||r==="S"?(f=n+(n-l),p=i+(i-u)):(f=n,p=i),t.push({key:"C",data:[f,p,...d]}),l=d[0],u=d[1],n=d[2],i=d[3];break}case"T":{let[f,p]=d,g=0,m=0;r==="Q"||r==="T"?(g=n+(n-l),m=i+(i-u)):(g=n,m=i);let y=n+2*(g-n)/3,x=i+2*(m-i)/3,T=f+2*(g-f)/3,C=p+2*(m-p)/3;t.push({key:"C",data:[y,x,T,C,f,p]}),l=g,u=m,n=f,i=p;break}case"Q":{let[f,p,g,m]=d,y=n+2*(f-n)/3,x=i+2*(p-i)/3,T=g+2*(f-g)/3,C=m+2*(p-m)/3;t.push({key:"C",data:[y,x,T,C,g,m]}),l=f,u=p,n=g,i=m;break}case"A":{let f=Math.abs(d[0]),p=Math.abs(d[1]),g=d[2],m=d[3],y=d[4],x=d[5],T=d[6];f===0||p===0?(t.push({key:"C",data:[n,i,x,T,x,T]}),n=x,i=T):(n!==x||i!==T)&&(vY(n,i,x,T,f,p,g,m,y).forEach((function(C){t.push({key:"C",data:C})})),n=x,i=T);break}case"Z":t.push({key:"Z",data:[]}),n=a,i=o}r=h}return t}function k1(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function vY(e,t,r,n,i,a,o,l,u,h){let d=(f=o,Math.PI*f/180);var f;let p=[],g=0,m=0,y=0,x=0;if(h)[g,m,y,x]=h;else{[e,t]=k1(e,t,-d),[r,n]=k1(r,n,-d);let A=(e-r)/2,M=(t-n)/2,I=A*A/(i*i)+M*M/(a*a);I>1&&(I=Math.sqrt(I),i*=I,a*=I);let P=i*i,B=a*a,D=P*B-P*M*M-B*A*A,$=P*M*M+B*A*A,W=(l===u?-1:1)*Math.sqrt(Math.abs(D/$));y=W*i*M/a+(e+r)/2,x=W*-a*A/i+(t+n)/2,g=Math.asin(parseFloat(((t-x)/a).toFixed(9))),m=Math.asin(parseFloat(((n-x)/a).toFixed(9))),e<y&&(g=Math.PI-g),r<y&&(m=Math.PI-m),g<0&&(g=2*Math.PI+g),m<0&&(m=2*Math.PI+m),u&&g>m&&(g-=2*Math.PI),!u&&m>g&&(m-=2*Math.PI)}let T=m-g;if(Math.abs(T)>120*Math.PI/180){let A=m,M=r,I=n;m=u&&m>g?g+120*Math.PI/180*1:g+120*Math.PI/180*-1,p=vY(r=y+i*Math.cos(m),n=x+a*Math.sin(m),M,I,i,a,o,0,u,[m,A,y,x])}T=m-g;let C=Math.cos(g),k=Math.sin(g),E=Math.cos(m),v=Math.sin(m),S=Math.tan(T/4),w=4/3*i*S,L=4/3*a*S,O=[e,t],F=[e+w*k,t-L*C],N=[r+w*v,n-L*E],G=[r,n];if(F[0]=2*O[0]-F[0],F[1]=2*O[1]-F[1],h)return[F,N,G].concat(p);{p=[F,N,G].concat(p);let A=[];for(let M=0;M<p.length;M+=3){let I=k1(p[M][0],p[M][1],d),P=k1(p[M+1][0],p[M+1][1],d),B=k1(p[M+2][0],p[M+2][1],d);A.push([I[0],I[1],P[0],P[1],B[0],B[1]])}return A}}function EY(e,t,r,n,i){return{type:"path",ops:Ru(e,t,r,n,i)}}function jC(e,t,r){let n=(e||[]).length;if(n>2){let i=[];for(let a=0;a<n-1;a++)i.push(...Ru(e[a][0],e[a][1],e[a+1][0],e[a+1][1],r));return t&&i.push(...Ru(e[n-1][0],e[n-1][1],e[0][0],e[0][1],r)),{type:"path",ops:i}}return n===2?EY(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function pMe(e,t,r,n,i){return(function(a,o){return jC(a,!0,o)})([[e,t],[e+r,t],[e+r,t+n],[e,t+n]],i)}function mY(e,t){if(e.length){let r=typeof e[0][0]=="number"?[e]:e,n=WC(r[0],1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:WC(r[0],1.5*(1+.22*t.roughness),xY(t));for(let a=1;a<r.length;a++){let o=r[a];if(o.length){let l=WC(o,1*(1+.2*t.roughness),t),u=t.disableMultiStroke?[]:WC(o,1.5*(1+.22*t.roughness),xY(t));for(let h of l)h.op!=="move"&&n.push(h);for(let h of u)h.op!=="move"&&i.push(h)}}return{type:"path",ops:n.concat(i)}}return{type:"path",ops:[]}}function wY(e,t,r){let n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*n)),a=2*Math.PI/i,o=Math.abs(e/2),l=Math.abs(t/2),u=1-r.curveFitting;return o+=tr(o*u,r),l+=tr(l*u,r),{increment:a,rx:o,ry:l}}function eI(e,t,r,n){let[i,a]=bY(n.increment,e,t,n.rx,n.ry,1,n.increment*UC(.1,UC(.4,1,r),r),r),o=YC(i,null,r);if(!r.disableMultiStroke&&r.roughness!==0){let[l]=bY(n.increment,e,t,n.rx,n.ry,1.5,0,r),u=YC(l,null,r);o=o.concat(u)}return{estimatedPoints:a,opset:{type:"path",ops:o}}}function gY(e,t,r,n,i,a,o,l,u){let h=e,d=t,f=Math.abs(r/2),p=Math.abs(n/2);f+=tr(.01*f,u),p+=tr(.01*p,u);let g=i,m=a;for(;g<0;)g+=2*Math.PI,m+=2*Math.PI;m-g>2*Math.PI&&(g=0,m=2*Math.PI);let y=2*Math.PI/u.curveStepCount,x=Math.min(y/2,(m-g)/2),T=TY(x,h,d,f,p,g,m,1,u);if(!u.disableMultiStroke){let C=TY(x,h,d,f,p,g,m,1.5,u);T.push(...C)}return o&&(l?T.push(...Ru(h,d,h+f*Math.cos(g),d+p*Math.sin(g),u),...Ru(h,d,h+f*Math.cos(m),d+p*Math.sin(m),u)):T.push({op:"lineTo",data:[h,d]},{op:"lineTo",data:[h+f*Math.cos(g),d+p*Math.sin(g)]})),{type:"path",ops:T}}function yY(e,t){let r=SY(kY(sI(e))),n=[],i=[0,0],a=[0,0];for(let{key:o,data:l}of r)switch(o){case"M":a=[l[0],l[1]],i=[l[0],l[1]];break;case"L":n.push(...Ru(a[0],a[1],l[0],l[1],t)),a=[l[0],l[1]];break;case"C":{let[u,h,d,f,p,g]=l;n.push(...mMe(u,h,d,f,p,g,a,t)),a=[p,g];break}case"Z":n.push(...Ru(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:"path",ops:n}}function H4(e,t){let r=[];for(let n of e)if(n.length){let i=t.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+tr(i,t),n[0][1]+tr(i,t)]});for(let o=1;o<a;o++)r.push({op:"lineTo",data:[n[o][0]+tr(i,t),n[o][1]+tr(i,t)]})}}return{type:"fillPath",ops:r}}function gm(e,t){return(function(r,n){let i=r.fillStyle||"hachure";if(!Ms[i])switch(i){case"zigzag":Ms[i]||(Ms[i]=new Y4(n));break;case"cross-hatch":Ms[i]||(Ms[i]=new K4(n));break;case"dots":Ms[i]||(Ms[i]=new X4(n));break;case"dashed":Ms[i]||(Ms[i]=new Q4(n));break;case"zigzag-line":Ms[i]||(Ms[i]=new Z4(n));break;default:i="hachure",Ms[i]||(Ms[i]=new v1(n))}return Ms[i]})(t,fMe).fillPolygons(e,t)}function xY(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function _Y(e){return e.randomizer||(e.randomizer=new J4(e.seed||0)),e.randomizer.next()}function UC(e,t,r,n=1){return r.roughness*n*(_Y(r)*(t-e)+e)}function tr(e,t,r=1){return UC(-e,e,t,r)}function Ru(e,t,r,n,i,a=!1){let o=a?i.disableMultiStrokeFill:i.disableMultiStroke,l=tI(e,t,r,n,i,!0,!1);if(o)return l;let u=tI(e,t,r,n,i,!0,!0);return l.concat(u)}function tI(e,t,r,n,i,a,o){let l=Math.pow(e-r,2)+Math.pow(t-n,2),u=Math.sqrt(l),h=1;h=u<200?1:u>500?.4:-.0016668*u+1.233334;let d=i.maxRandomnessOffset||0;d*d*100>l&&(d=u/10);let f=d/2,p=.2+.2*_Y(i),g=i.bowing*i.maxRandomnessOffset*(n-t)/200,m=i.bowing*i.maxRandomnessOffset*(e-r)/200;g=tr(g,i,h),m=tr(m,i,h);let y=[],x=s(()=>tr(f,i,h),"M"),T=s(()=>tr(d,i,h),"k"),C=i.preserveVertices;return a&&(o?y.push({op:"move",data:[e+(C?0:x()),t+(C?0:x())]}):y.push({op:"move",data:[e+(C?0:tr(d,i,h)),t+(C?0:tr(d,i,h))]})),o?y.push({op:"bcurveTo",data:[g+e+(r-e)*p+x(),m+t+(n-t)*p+x(),g+e+2*(r-e)*p+x(),m+t+2*(n-t)*p+x(),r+(C?0:x()),n+(C?0:x())]}):y.push({op:"bcurveTo",data:[g+e+(r-e)*p+T(),m+t+(n-t)*p+T(),g+e+2*(r-e)*p+T(),m+t+2*(n-t)*p+T(),r+(C?0:T()),n+(C?0:T())]}),y}function WC(e,t,r){if(!e.length)return[];let n=[];n.push([e[0][0]+tr(t,r),e[0][1]+tr(t,r)]),n.push([e[0][0]+tr(t,r),e[0][1]+tr(t,r)]);for(let i=1;i<e.length;i++)n.push([e[i][0]+tr(t,r),e[i][1]+tr(t,r)]),i===e.length-1&&n.push([e[i][0]+tr(t,r),e[i][1]+tr(t,r)]);return YC(n,null,r)}function YC(e,t,r){let n=e.length,i=[];if(n>3){let a=[],o=1-r.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let l=1;l+2<n;l++){let u=e[l];a[0]=[u[0],u[1]],a[1]=[u[0]+(o*e[l+1][0]-o*e[l-1][0])/6,u[1]+(o*e[l+1][1]-o*e[l-1][1])/6],a[2]=[e[l+1][0]+(o*e[l][0]-o*e[l+2][0])/6,e[l+1][1]+(o*e[l][1]-o*e[l+2][1])/6],a[3]=[e[l+1][0],e[l+1][1]],i.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(t&&t.length===2){let l=r.maxRandomnessOffset;i.push({op:"lineTo",data:[t[0]+tr(l,r),t[1]+tr(l,r)]})}}else n===3?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):n===2&&i.push(...tI(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return i}function bY(e,t,r,n,i,a,o,l){let u=[],h=[];if(l.roughness===0){e/=4,h.push([t+n*Math.cos(-e),r+i*Math.sin(-e)]);for(let d=0;d<=2*Math.PI;d+=e){let f=[t+n*Math.cos(d),r+i*Math.sin(d)];u.push(f),h.push(f)}h.push([t+n*Math.cos(0),r+i*Math.sin(0)]),h.push([t+n*Math.cos(e),r+i*Math.sin(e)])}else{let d=tr(.5,l)-Math.PI/2;h.push([tr(a,l)+t+.9*n*Math.cos(d-e),tr(a,l)+r+.9*i*Math.sin(d-e)]);let f=2*Math.PI+d-.01;for(let p=d;p<f;p+=e){let g=[tr(a,l)+t+n*Math.cos(p),tr(a,l)+r+i*Math.sin(p)];u.push(g),h.push(g)}h.push([tr(a,l)+t+n*Math.cos(d+2*Math.PI+.5*o),tr(a,l)+r+i*Math.sin(d+2*Math.PI+.5*o)]),h.push([tr(a,l)+t+.98*n*Math.cos(d+o),tr(a,l)+r+.98*i*Math.sin(d+o)]),h.push([tr(a,l)+t+.9*n*Math.cos(d+.5*o),tr(a,l)+r+.9*i*Math.sin(d+.5*o)])}return[h,u]}function TY(e,t,r,n,i,a,o,l,u){let h=a+tr(.1,u),d=[];d.push([tr(l,u)+t+.9*n*Math.cos(h-e),tr(l,u)+r+.9*i*Math.sin(h-e)]);for(let f=h;f<=o;f+=e)d.push([tr(l,u)+t+n*Math.cos(f),tr(l,u)+r+i*Math.sin(f)]);return d.push([t+n*Math.cos(o),r+i*Math.sin(o)]),d.push([t+n*Math.cos(o),r+i*Math.sin(o)]),YC(d,null,u)}function mMe(e,t,r,n,i,a,o,l){let u=[],h=[l.maxRandomnessOffset||1,(l.maxRandomnessOffset||1)+.3],d=[0,0],f=l.disableMultiStroke?1:2,p=l.preserveVertices;for(let g=0;g<f;g++)g===0?u.push({op:"move",data:[o[0],o[1]]}):u.push({op:"move",data:[o[0]+(p?0:tr(h[0],l)),o[1]+(p?0:tr(h[0],l))]}),d=p?[i,a]:[i+tr(h[g],l),a+tr(h[g],l)],u.push({op:"bcurveTo",data:[e+tr(h[g],l),t+tr(h[g],l),r+tr(h[g],l),n+tr(h[g],l),d[0],d[1]]});return u}function S1(e){return[...e]}function CY(e,t=0){let r=e.length;if(r<3)throw new Error("A curve must have at least three points.");let n=[];if(r===3)n.push(S1(e[0]),S1(e[1]),S1(e[2]),S1(e[2]));else{let i=[];i.push(e[0],e[0]);for(let l=1;l<e.length;l++)i.push(e[l]),l===e.length-1&&i.push(e[l]);let a=[],o=1-t;n.push(S1(i[0]));for(let l=1;l+2<i.length;l++){let u=i[l];a[0]=[u[0],u[1]],a[1]=[u[0]+(o*i[l+1][0]-o*i[l-1][0])/6,u[1]+(o*i[l+1][1]-o*i[l-1][1])/6],a[2]=[i[l+1][0]+(o*i[l][0]-o*i[l+2][0])/6,i[l+1][1]+(o*i[l][1]-o*i[l+2][1])/6],a[3]=[i[l+1][0],i[l+1][1]],n.push(a[1],a[2],a[3])}}return n}function HC(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function gMe(e,t,r){let n=HC(t,r);if(n===0)return HC(e,t);let i=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/n;return i=Math.max(0,Math.min(1,i)),HC(e,Ad(t,r,i))}function Ad(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function rI(e,t,r,n){let i=n||[];if((function(l,u){let h=l[u+0],d=l[u+1],f=l[u+2],p=l[u+3],g=3*d[0]-2*h[0]-p[0];g*=g;let m=3*d[1]-2*h[1]-p[1];m*=m;let y=3*f[0]-2*p[0]-h[0];y*=y;let x=3*f[1]-2*p[1]-h[1];return x*=x,g<y&&(g=y),m<x&&(m=x),g+m})(e,t)<r){let l=e[t+0];i.length?(a=i[i.length-1],o=l,Math.sqrt(HC(a,o))>1&&i.push(l)):i.push(l),i.push(e[t+3])}else{let u=e[t+0],h=e[t+1],d=e[t+2],f=e[t+3],p=Ad(u,h,.5),g=Ad(h,d,.5),m=Ad(d,f,.5),y=Ad(p,g,.5),x=Ad(g,m,.5),T=Ad(y,x,.5);rI([u,p,y,T],0,r,i),rI([T,x,m,f],0,r,i)}var a,o;return i}function yMe(e,t){return KC(e,0,e.length,t)}function KC(e,t,r,n,i){let a=i||[],o=e[t],l=e[r-1],u=0,h=1;for(let d=t+1;d<r-1;++d){let f=gMe(e[d],o,l);f>u&&(u=f,h=d)}return Math.sqrt(u)>n?(KC(e,t,h+1,n,a),KC(e,h,r,n,a)):(a.length||a.push(o),a.push(l)),a}function U4(e,t=.15,r){let n=[],i=(e.length-1)/3;for(let a=0;a<i;a++)rI(e,3*a,t,n);return r&&r>0?KC(n,0,n.length,r):n}var v1,Y4,K4,X4,Q4,Z4,Ms,J4,dMe,q4,pY,VC,fMe,da,ym,nI,qC,iI,Xe,At=_(()=>{"use strict";s(W4,"t");s(uMe,"e");s(hMe,"s");s(E1,"n");v1=class{static{s(this,"o")}constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){let n=E1(t,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(t,r){let n=[];for(let i of t)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}};s(XC,"a");Y4=class extends v1{static{s(this,"h")}fillPolygons(t,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);let i=E1(t,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,o=[],l=.5*n*Math.cos(a),u=.5*n*Math.sin(a);for(let[h,d]of i)XC([h,d])&&o.push([[h[0]-l,h[1]+u],[...d]],[[h[0]+l,h[1]-u],[...d]]);return{type:"fillSketch",ops:this.renderLines(o,r)}}},K4=class extends v1{static{s(this,"r")}fillPolygons(t,r){let n=this._fillPolygons(t,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(t,i);return n.ops=n.ops.concat(a.ops),n}},X4=class{static{s(this,"i")}constructor(t){this.helper=t}fillPolygons(t,r){let n=E1(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(t,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 o=i/4;for(let l of t){let u=XC(l),h=u/i,d=Math.ceil(h)-1,f=u-d*i,p=(l[0][0]+l[1][0])/2-i/4,g=Math.min(l[0][1],l[1][1]);for(let m=0;m<d;m++){let y=g+f+m*i,x=p-o+2*Math.random()*o,T=y-o+2*Math.random()*o,C=this.helper.ellipse(x,T,a,a,r);n.push(...C.ops)}}return{type:"fillSketch",ops:n}}},Q4=class{static{s(this,"c")}constructor(t){this.helper=t}fillPolygons(t,r){let n=E1(t,r);return{type:"fillSketch",ops:this.dashedLine(n,r)}}dashedLine(t,r){let n=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,i=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,a=[];return t.forEach((o=>{let l=XC(o),u=Math.floor(l/(n+i)),h=(l+i-u*(n+i))/2,d=o[0],f=o[1];d[0]>f[0]&&(d=o[1],f=o[0]);let p=Math.atan((f[1]-d[1])/(f[0]-d[0]));for(let g=0;g<u;g++){let m=g*(n+i),y=m+n,x=[d[0]+m*Math.cos(p)+h*Math.cos(p),d[1]+m*Math.sin(p)+h*Math.sin(p)],T=[d[0]+y*Math.cos(p)+h*Math.cos(p),d[1]+y*Math.sin(p)+h*Math.sin(p)];a.push(...this.helper.doubleLineOps(x[0],x[1],T[0],T[1],r))}})),a}},Z4=class{static{s(this,"l")}constructor(t){this.helper=t}fillPolygons(t,r){let n=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,i=r.zigzagOffset<0?n:r.zigzagOffset,a=E1(t,r=Object.assign({},r,{hachureGap:n+i}));return{type:"fillSketch",ops:this.zigzagLines(a,i,r)}}zigzagLines(t,r,n){let i=[];return t.forEach((a=>{let o=XC(a),l=Math.round(o/(2*r)),u=a[0],h=a[1];u[0]>h[0]&&(u=a[1],h=a[0]);let d=Math.atan((h[1]-u[1])/(h[0]-u[0]));for(let f=0;f<l;f++){let p=2*f*r,g=2*(f+1)*r,m=Math.sqrt(2*Math.pow(r,2)),y=[u[0]+p*Math.cos(d),u[1]+p*Math.sin(d)],x=[u[0]+g*Math.cos(d),u[1]+g*Math.sin(d)],T=[y[0]+m*Math.cos(d+Math.PI/4),y[1]+m*Math.sin(d+Math.PI/4)];i.push(...this.helper.doubleLineOps(y[0],y[1],T[0],T[1],n),...this.helper.doubleLineOps(T[0],T[1],x[0],x[1],n))}})),i}},Ms={},J4=class{static{s(this,"p")}constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},dMe=0,q4=1,pY=2,VC={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};s(j4,"k");s(sI,"b");s(kY,"y");s(SY,"m");s(k1,"w");s(vY,"x");fMe={randOffset:s(function(e,t){return tr(e,t)},"randOffset"),randOffsetWithRange:s(function(e,t,r){return UC(e,t,r)},"randOffsetWithRange"),ellipse:s(function(e,t,r,n,i){let a=wY(r,n,i);return eI(e,t,i,a).opset},"ellipse"),doubleLineOps:s(function(e,t,r,n,i){return Ru(e,t,r,n,i,!0)},"doubleLineOps")};s(EY,"v");s(jC,"S");s(pMe,"O");s(mY,"L");s(wY,"T");s(eI,"D");s(gY,"A");s(yY,"_");s(H4,"I");s(gm,"C");s(xY,"z");s(_Y,"W");s(UC,"E");s(tr,"G");s(Ru,"$");s(tI,"R");s(WC,"j");s(YC,"q");s(bY,"F");s(TY,"V");s(mMe,"Z");s(S1,"Q");s(CY,"H");s(HC,"N");s(gMe,"B");s(Ad,"J");s(rI,"K");s(yMe,"U");s(KC,"X");s(U4,"Y");da="none",ym=class{static{s(this,"et")}constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,n){return{shape:t,sets:r||[],options:n||this.defaultOptions}}line(t,r,n,i,a){let o=this._o(a);return this._d("line",[EY(t,r,n,i,o)],o)}rectangle(t,r,n,i,a){let o=this._o(a),l=[],u=pMe(t,r,n,i,o);if(o.fill){let h=[[t,r],[t+n,r],[t+n,r+i],[t,r+i]];o.fillStyle==="solid"?l.push(H4([h],o)):l.push(gm([h],o))}return o.stroke!==da&&l.push(u),this._d("rectangle",l,o)}ellipse(t,r,n,i,a){let o=this._o(a),l=[],u=wY(n,i,o),h=eI(t,r,o,u);if(o.fill)if(o.fillStyle==="solid"){let d=eI(t,r,o,u).opset;d.type="fillPath",l.push(d)}else l.push(gm([h.estimatedPoints],o));return o.stroke!==da&&l.push(h.opset),this._d("ellipse",l,o)}circle(t,r,n,i){let a=this.ellipse(t,r,n,n,i);return a.shape="circle",a}linearPath(t,r){let n=this._o(r);return this._d("linearPath",[jC(t,!1,n)],n)}arc(t,r,n,i,a,o,l=!1,u){let h=this._o(u),d=[],f=gY(t,r,n,i,a,o,l,!0,h);if(l&&h.fill)if(h.fillStyle==="solid"){let p=Object.assign({},h);p.disableMultiStroke=!0;let g=gY(t,r,n,i,a,o,!0,!1,p);g.type="fillPath",d.push(g)}else d.push((function(p,g,m,y,x,T,C){let k=p,E=g,v=Math.abs(m/2),S=Math.abs(y/2);v+=tr(.01*v,C),S+=tr(.01*S,C);let w=x,L=T;for(;w<0;)w+=2*Math.PI,L+=2*Math.PI;L-w>2*Math.PI&&(w=0,L=2*Math.PI);let O=(L-w)/C.curveStepCount,F=[];for(let N=w;N<=L;N+=O)F.push([k+v*Math.cos(N),E+S*Math.sin(N)]);return F.push([k+v*Math.cos(L),E+S*Math.sin(L)]),F.push([k,E]),gm([F],C)})(t,r,n,i,a,o,h));return h.stroke!==da&&d.push(f),this._d("arc",d,h)}curve(t,r){let n=this._o(r),i=[],a=mY(t,n);if(n.fill&&n.fill!==da)if(n.fillStyle==="solid"){let o=mY(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(o.ops)})}else{let o=[],l=t;if(l.length){let u=typeof l[0][0]=="number"?[l]:l;for(let h of u)h.length<3?o.push(...h):h.length===3?o.push(...U4(CY([h[0],h[0],h[1],h[2]]),10,(1+n.roughness)/2)):o.push(...U4(CY(h),10,(1+n.roughness)/2))}o.length&&i.push(gm([o],n))}return n.stroke!==da&&i.push(a),this._d("curve",i,n)}polygon(t,r){let n=this._o(r),i=[],a=jC(t,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(H4([t],n)):i.push(gm([t],n))),n.stroke!==da&&i.push(a),this._d("polygon",i,n)}path(t,r){let n=this._o(r),i=[];if(!t)return this._d("path",i,n);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let a=n.fill&&n.fill!=="transparent"&&n.fill!==da,o=n.stroke!==da,l=!!(n.simplification&&n.simplification<1),u=(function(d,f,p){let g=SY(kY(sI(d))),m=[],y=[],x=[0,0],T=[],C=s(()=>{T.length>=4&&y.push(...U4(T,f)),T=[]},"i"),k=s(()=>{C(),y.length&&(m.push(y),y=[])},"c");for(let{key:v,data:S}of g)switch(v){case"M":k(),x=[S[0],S[1]],y.push(x);break;case"L":C(),y.push([S[0],S[1]]);break;case"C":if(!T.length){let w=y.length?y[y.length-1]:x;T.push([w[0],w[1]])}T.push([S[0],S[1]]),T.push([S[2],S[3]]),T.push([S[4],S[5]]);break;case"Z":C(),y.push([x[0],x[1]])}if(k(),!p)return m;let E=[];for(let v of m){let S=yMe(v,p);S.length&&E.push(S)}return E})(t,1,l?4-4*(n.simplification||1):(1+n.roughness)/2),h=yY(t,n);if(a)if(n.fillStyle==="solid")if(u.length===1){let d=yY(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(d.ops)})}else i.push(H4(u,n));else i.push(gm(u,n));return o&&(l?u.forEach((d=>{i.push(jC(d,!1,n))})):i.push(h)),this._d("path",i,n)}opsToPath(t,r){let n="";for(let i of t.ops){let a=typeof r=="number"&&r>=0?i.data.map((o=>+o.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(t){let r=t.sets||[],n=t.options||this.defaultOptions,i=[];for(let a of r){let o=null;switch(a.type){case"path":o={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:da};break;case"fillPath":o={d:this.opsToPath(a),stroke:da,strokeWidth:0,fill:n.fill||da};break;case"fillSketch":o=this.fillSketch(a,n)}o&&i.push(o)}return i}fillSketch(t,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||da,strokeWidth:n,fill:da}}_mergedShape(t){return t.filter(((r,n)=>n===0||r.op!=="move"))}},nI=class{static{s(this,"st")}constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new ym(r)}draw(t){let r=t.sets||[],n=t.options||this.getDefaultOptions(),i=this.ctx,a=t.options.fixedDecimalPlaceDigits;for(let o of r)switch(o.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,o,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";let l=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,o,a,l),i.restore();break}case"fillSketch":this.fillSketch(i,o,n)}}fillSketch(t,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),t.save(),n.fillLineDash&&t.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(t.lineDashOffset=n.fillLineDashOffset),t.strokeStyle=n.fill||"",t.lineWidth=i,this._drawToContext(t,r,n.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,n,i="nonzero"){t.beginPath();for(let a of r.ops){let o=typeof n=="number"&&n>=0?a.data.map((l=>+l.toFixed(n))):a.data;switch(a.op){case"move":t.moveTo(o[0],o[1]);break;case"bcurveTo":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":t.lineTo(o[0],o[1])}}r.type==="fillPath"?t.fill(i):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,n,i,a){let o=this.gen.line(t,r,n,i,a);return this.draw(o),o}rectangle(t,r,n,i,a){let o=this.gen.rectangle(t,r,n,i,a);return this.draw(o),o}ellipse(t,r,n,i,a){let o=this.gen.ellipse(t,r,n,i,a);return this.draw(o),o}circle(t,r,n,i){let a=this.gen.circle(t,r,n,i);return this.draw(a),a}linearPath(t,r){let n=this.gen.linearPath(t,r);return this.draw(n),n}polygon(t,r){let n=this.gen.polygon(t,r);return this.draw(n),n}arc(t,r,n,i,a,o,l=!1,u){let h=this.gen.arc(t,r,n,i,a,o,l,u);return this.draw(h),h}curve(t,r){let n=this.gen.curve(t,r);return this.draw(n),n}path(t,r){let n=this.gen.path(t,r);return this.draw(n),n}},qC="http://www.w3.org/2000/svg",iI=class{static{s(this,"ot")}constructor(t,r){this.svg=t,this.gen=new ym(r)}draw(t){let r=t.sets||[],n=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(qC,"g"),o=t.options.fixedDecimalPlaceDigits;for(let l of r){let u=null;switch(l.type){case"path":u=i.createElementNS(qC,"path"),u.setAttribute("d",this.opsToPath(l,o)),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(qC,"path"),u.setAttribute("d",this.opsToPath(l,o)),u.setAttribute("stroke","none"),u.setAttribute("stroke-width","0"),u.setAttribute("fill",n.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||u.setAttribute("fill-rule","evenodd");break;case"fillSketch":u=this.fillSketch(i,l,n)}u&&a.appendChild(u)}return a}fillSketch(t,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);let a=t.createElementNS(qC,"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(t,r){return this.gen.opsToPath(t,r)}line(t,r,n,i,a){let o=this.gen.line(t,r,n,i,a);return this.draw(o)}rectangle(t,r,n,i,a){let o=this.gen.rectangle(t,r,n,i,a);return this.draw(o)}ellipse(t,r,n,i,a){let o=this.gen.ellipse(t,r,n,i,a);return this.draw(o)}circle(t,r,n,i){let a=this.gen.circle(t,r,n,i);return this.draw(a)}linearPath(t,r){let n=this.gen.linearPath(t,r);return this.draw(n)}polygon(t,r){let n=this.gen.polygon(t,r);return this.draw(n)}arc(t,r,n,i,a,o,l=!1,u){let h=this.gen.arc(t,r,n,i,a,o,l,u);return this.draw(h)}curve(t,r){let n=this.gen.curve(t,r);return this.draw(n)}path(t,r){let n=this.gen.path(t,r);return this.draw(n)}},Xe={canvas:s((e,t)=>new nI(e,t),"canvas"),svg:s((e,t)=>new iI(e,t),"svg"),generator:s(e=>new ym(e),"generator"),newSeed:s(()=>ym.newSeed(),"newSeed")}});function AY(e,t){let{labelStyles:r}=Ke(t);t.labelStyle=r;let n=st(t),i=n;n||(i="anchor");let a=e.insert("g").attr("class",i).attr("id",t.domId||t.id),o=1,{cssStyles:l}=t,u=Xe.svg(a),h=Je(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);let d=u.circle(0,0,o*2,h),f=a.insert(()=>d,":first-child");return f.attr("class","anchor").attr("style",$r(l)),Ze(t,f),t.intersect=function(p){return Y.info("Circle intersect",t,o,p),je.circle(t,o,p)},a}var RY=_(()=>{"use strict";ft();Ct();Lt();_t();At();Pt();s(AY,"anchor")});function LY(e,t,r,n,i,a,o){let u=(e+r)/2,h=(t+n)/2,d=Math.atan2(n-t,r-e),f=(r-e)/2,p=(n-t)/2,g=f/i,m=p/a,y=Math.sqrt(g**2+m**2);if(y>1)throw new Error("The given radii are too small to create an arc between the points.");let x=Math.sqrt(1-y**2),T=u+x*a*Math.sin(d)*(o?-1:1),C=h-x*i*Math.cos(d)*(o?-1:1),k=Math.atan2((t-C)/a,(e-T)/i),v=Math.atan2((n-C)/a,(r-T)/i)-k;o&&v<0&&(v+=2*Math.PI),!o&&v>0&&(v-=2*Math.PI);let S=[];for(let w=0;w<20;w++){let L=w/19,O=k+L*v,F=T+i*Math.cos(O),N=C+a*Math.sin(O);S.push({x:F,y:N})}return S}function xMe(e,t,r){let[n,i]=[t,r].sort((a,o)=>o-a);return i*(1-Math.sqrt(1-(e/n/2)**2))}async function DY(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i,l=s(O=>O+o,"calcTotalHeight"),u=s(O=>{let F=O/2;return[F/(2.5+O/50),F]},"calcEllipseRadius"),{shapeSvg:h,bbox:d}=await it(e,t,st(t)),f=l(t?.height?t?.height:d.height),[p,g]=u(f),m=xMe(f,p,g),x=(t?.width?t?.width:d.width)+a*2+m-m,T=f,{cssStyles:C}=t,k=[{x:x/2,y:-T/2},{x:-x/2,y:-T/2},...LY(-x/2,-T/2,-x/2,T/2,p,g,!1),{x:x/2,y:T/2},...LY(x/2,T/2,x/2,-T/2,p,g,!0)],E=Xe.svg(h),v=Je(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let S=Gt(k),w=E.path(S,v),L=h.insert(()=>w,":first-child");return L.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",C),n&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",n),L.attr("transform",`translate(${p/2}, 0)`),Ze(t,L),t.intersect=function(O){return je.polygon(t,k,O)},h}var IY=_(()=>{"use strict";Ct();Lt();_t();At();s(LY,"generateArcPoints");s(xMe,"calculateArcSagitta");s(DY,"bowTieRect")});async function NY(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=Ke(t);t.labelStyle=n;let{shapeSvg:a,bbox:o,label:l}=await it(e,t,st(t)),u=r?.nodeBorder??r?.lineColor??"currentColor",h=t.padding??12,d=Math.max(o.width+h*2,t.width??0,80),f=Math.max(Math.min(d*.08,12),5),p=Math.max(o.height+h*2+f,t.height??0),g=-p/2+f,m=p/2,y=d*.72,x=[`M${-d/2},${g}`,`L${-y/2},${m}`,`A${y/2},${f} 0 0 0 ${y/2},${m}`,`L${d/2},${g}`,`A${d/2},${f} 0 0 0 ${-d/2},${g}`,"Z"].join(" "),{cssStyles:T}=t,C=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let L=Xe.svg(a).path(x,Je(t,{}));C.node()?.appendChild(L),T&&C.attr("style",T)}else C.append("path").attr("d",x).attr("style",i);C.append("ellipse").attr("cx",0).attr("cy",g).attr("rx",d/2).attr("ry",f).attr("style",`fill:none;stroke:${u};stroke-width:1px`),Ze(t,C);let k=g+(m-g)/2;l.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${k-o.height/2-(o.y-(o.top??0))})`);let E=12,v=s((w,L,O)=>Array.from({length:E+1},(F,N)=>{let G=Math.PI-N*Math.PI/E;return{x:w*Math.cos(G),y:L+O*f*Math.sin(G)}}),"arc"),S=[...v(d/2,g,-1),...v(y/2,m,1).reverse()];return t.intersect=function(w){return je.polygon(t,S,w)},a}var PY=_(()=>{"use strict";Ct();Lt();_t();At();s(NY,"bucket")});var Gn,go=_(()=>{"use strict";Gn=s((e,t,r,n,i)=>["M",e+i,t,"H",e+r-i,"A",i,i,0,0,1,e+r,t+i,"V",t+n-i,"A",i,i,0,0,1,e+r-i,t+n,"H",e+i,"A",i,i,0,0,1,e,t+n-i,"V",t+i,"A",i,i,0,0,1,e+i,t,"Z"].join(" "),"createRoundedRectPathD")});async function MY(e,t){let{themeVariables:r}=xe(),n=r.clusterBkg,i=r.clusterBorder,{nodeStyles:a}=Ke(t),{shapeSvg:o,bbox:l}=await it(e,t,st(t)),u=t.padding??8,h=l.height,d=Math.max(l.width+u*2,bMe,t?.width??0),f=Math.max(h+oI+aI+u*2,t?.height??0),p=-d/2,g=-f/2,m=-(oI+aI)/2,y=o.select(".label");y&&(t.useHtmlLabels??vn(xe())?y.attr("transform",`translate(${-l.width/2}, ${-l.height/2+m})`):y.attr("transform",`translate(0, ${-l.height/2+m})`));let x;if(t.look==="handDrawn"){let v=Xe.svg(o),S=Je(t,{fill:n,stroke:i,fillStyle:"solid"}),w=v.path(Gn(p,g,d,f,lI),S);x=o.insert(()=>w,":first-child"),x.attr("class","basic label-container collapsed-group").attr("style",$r(t.cssStyles))}else x=o.insert("rect",":first-child"),x.attr("class","basic label-container collapsed-group").attr("style",a).attr("rx",lI).attr("ry",lI).attr("x",p).attr("y",g).attr("width",d).attr("height",f).attr("fill",n).attr("stroke",i);let T=g+u+h+oI;o.append("line").attr("class","collapsed-separator").attr("x1",p+8).attr("y1",T).attr("x2",p+d-8).attr("y2",T).attr("stroke",i).attr("stroke-dasharray","3, 3");let C=T+aI/2,k=2.5,E=10;for(let v=-1;v<=1;v++)o.append("circle").attr("class","collapsed-indicator").attr("cx",v*E).attr("cy",C).attr("r",k).attr("fill",i);return Ze(t,x),t.calcIntersect=function(v,S){return je.rect(v,S)},t.intersect=function(v){return je.rect(t,v)},o}var aI,oI,bMe,lI,OY=_(()=>{"use strict";Nt();ir();Ct();Lt();go();_t();At();Pt();aI=20,oI=8,bMe=80,lI=8;s(MY,"collapsedGroup")});function Ii(e,t,r,n){return e.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}var al=_(()=>{"use strict";s(Ii,"insertPolygonShape")});async function BY(e,t){let r=t,{shapeSvg:n,bbox:i}=await it(e,r,st(r)),a=r.padding??0,o=i.height+2*a,l=o/2,u=i.width+2*l+a,h=r.width??0,f=r.positioned&&(r.widthInColumns??1)>1&&h>u?h:u,p=SMe(r.directions??[],i,r,f),g=Ii(n,f,o,p);return g.attr("style",r.style??null),Ze(r,g),r.intersect=function(m){return je.polygon(r,p,m)},n}var TMe,cI,CMe,kMe,$Y,SMe,FY=_(()=>{"use strict";Lt();al();Ct();TMe=["right","left","up","down"],cI="point",CMe=s(e=>{let t=new Set;for(let r of e)switch(r){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(r);break}return t},"expandAndDeduplicateDirections"),kMe=s(e=>TMe.filter(t=>e.has(t)).join("|")||cI,"getDirectionKey"),$Y={"right|left|up|down":s(({height:e,midpoint:t,padding:r,width:n})=>[{x:0,y:0},{x:t,y:0},{x:n/2,y:2*r},{x:n-t,y:0},{x:n,y:0},{x:n,y:-e/3},{x:n+2*r,y:-e/2},{x:n,y:-2*e/3},{x:n,y:-e},{x:n-t,y:-e},{x:n/2,y:-e-2*r},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*r,y:-e/2},{x:0,y:-e/3}],"right|left|up|down"),"right|left|up":s(({height:e,midpoint:t,width:r})=>[{x:t,y:0},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],"right|left|up"),"right|left|down":s(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:t,y:-e},{x:r-t,y:-e},{x:r,y:0}],"right|left|down"),"right|up|down":s(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:r,y:-e+t},{x:0,y:-e}],"right|up|down"),"left|up|down":s(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:r,y:-e}],"left|up|down"),"right|left":s(({height:e,midpoint:t,padding:r,width:n})=>[{x:t,y:0},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:n-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"right|left"),"up|down":s(({height:e,midpoint:t,padding:r,width:n})=>[{x:n/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:n/2,y:-e},{x:n,y:-e+r},{x:n-t,y:-e+r},{x:n-t,y:-r},{x:n,y:-r}],"up|down"),"right|up":s(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:0,y:-e}],"right|up"),"right|down":s(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],"right|down"),"left|up":s(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:r,y:-e}],"left|up"),"left|down":s(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],"left|down"),right:s(({height:e,midpoint:t,padding:r,width:n})=>[{x:t,y:-r},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:n-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e+r}],"right"),left:s(({height:e,midpoint:t,padding:r,width:n})=>[{x:t,y:0},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"left"),up:s(({height:e,midpoint:t,padding:r,width:n})=>[{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:n/2,y:-e},{x:n,y:-e+r},{x:n-t,y:-e+r},{x:n-t,y:-r}],"up"),down:s(({height:e,midpoint:t,padding:r,width:n})=>[{x:n/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:n-t,y:-e+r},{x:n-t,y:-r},{x:n,y:-r}],"down"),[cI]:()=>[{x:0,y:0}]},SMe=s((e,t,r,n)=>{let i=CMe(e),a=(r.padding??0)/2,o=t.height+4*a,l=o/2,u=n??t.width+2*l+2*a,h=kMe(i);return($Y[h]??$Y[cI])({height:o,midpoint:l,padding:a,width:u})},"getArrowPoints");s(BY,"block_arrow")});async function GY(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=Ke(t);t.labelStyle=n;let{shapeSvg:a,bbox:o,label:l}=await it(e,t,st(t)),u=r?.nodeBorder??r?.lineColor??"currentColor",h=t.padding??12,d=18,f=12,p=Math.max(o.width+h*2,t.width??0,90),g=Math.max(o.height+h*2+d,t.height??0),m=-g/2,{cssStyles:y}=t,x=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let k=Xe.svg(a).path(Gn(-p/2,m,p,g,f),Je(t,{}));x.node()?.appendChild(k),y&&x.attr("style",y)}else x.append("rect").attr("x",-p/2).attr("y",m).attr("width",p).attr("height",g).attr("rx",f).attr("ry",f).attr("style",i);x.append("line").attr("x1",-p/2).attr("y1",m+d).attr("x2",p/2).attr("y2",m+d).attr("style",`stroke:${u};stroke-width:1px`);for(let C=0;C<3;C++)x.append("circle").attr("cx",-p/2+12+C*9).attr("cy",m+d/2).attr("r",2.5).attr("style",`fill:${u};stroke:none`);x.append("rect").attr("class","browser-address-bar").attr("x",-p/2+44).attr("y",m+4).attr("width",Math.max(p-56,10)).attr("height",d-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${u};stroke-width:1px;opacity:0.6`),Ze(t,x);let T=m+d+(g-d)/2;return l.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${T-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(C){return je.rect(t,C)},a}var zY=_(()=>{"use strict";Ct();Lt();go();_t();At();s(GY,"browser")});async function VY(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?28:i,o=t.look==="neo"?24:i,{shapeSvg:l,bbox:u}=await it(e,t,st(t)),h=(t?.width??u.width)+(t.look==="neo"?a*2:a+QC),d=(t?.height??u.height)+(t.look==="neo"?o*2:o),f=0,p=h,g=-d,m=0,y=[{x:f+QC,y:g},{x:p,y:g},{x:p,y:m},{x:f,y:m},{x:f,y:g+QC},{x:f+QC,y:g}],x,{cssStyles:T}=t;if(t.look==="handDrawn"){let C=Xe.svg(l),k=Je(t,{}),E=Gt(y),v=C.path(E,k);x=l.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${d/2})`),T&&x.attr("style",T)}else x=Ii(l,h,d,y);return n&&x.attr("style",n),Ze(t,x),t.intersect=function(C){return je.polygon(t,y,C)},l}var QC,WY=_(()=>{"use strict";Ct();Lt();_t();At();al();Ct();QC=12;s(VY,"card")});function qY(e,t){let{nodeStyles:r}=Ke(t);t.label="";let n=e.insert("g").attr("class",st(t)).attr("id",t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],l=Xe.svg(n),u=Je(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let h=Gt(o),d=l.path(h,u),f=n.insert(()=>d,":first-child");return i&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",i),r&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(p){return je.polygon(t,o,p)},n}var jY=_(()=>{"use strict";Lt();At();_t();Ct();s(qY,"choice")});async function ZC(e,t,r){let{labelStyles:n,nodeStyles:i}=Ke(t);t.labelStyle=n;let{shapeSvg:a,bbox:o,halfPadding:l}=await it(e,t,st(t)),u=16,h=r?.padding??l,d=t.look==="neo"?o.width/2+u*2:o.width/2+h,f,{cssStyles:p}=t;if(t.look==="handDrawn"){let g=Xe.svg(a),m=Je(t,{}),y=g.circle(0,0,d*2,m);f=a.insert(()=>y,":first-child"),f.attr("class","basic label-container").attr("style",$r(p))}else f=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",d).attr("cx",0).attr("cy",0);return Ze(t,f),t.calcIntersect=function(g,m){let y=g.width/2;return je.circle(g,y,m)},t.intersect=function(g){return Y.info("Circle intersect",t,d,g),je.circle(t,d,g)},a}var uI=_(()=>{"use strict";At();ft();Pt();Lt();_t();Ct();s(ZC,"circle")});async function HY(e,t){let r=t,n=["node",r.cssClasses,r.class].filter(Boolean).join(" "),{shapeSvg:i,bbox:a,halfPadding:o}=await it(e,r,n),l=i.insert("rect",":first-child"),u=r.padding??0,h=r.positioned?r.width??0:a.width+u,d=r.positioned?r.height??0:a.height+u,f=r.positioned?-h/2:-a.width/2-o,p=r.positioned?-d/2:-a.height/2-o;return l.attr("class","basic cluster composite label-container").attr("style",r.style??null).attr("rx",r.rx??null).attr("ry",r.ry??null).attr("x",f).attr("y",p).attr("width",h).attr("height",d),Ze(r,l),r.intersect=function(g){return je.rect(r,g)},i}var UY=_(()=>{"use strict";Lt();Ct();s(HY,"composite")});async function YY(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=Ke(t);t.labelStyle=n;let{shapeSvg:a,bbox:o,label:l}=await it(e,t,st(t)),u=r?.nodeBorder??r?.lineColor??"currentColor",h=t.padding??12,d=20,f=12,p=Math.max(o.width+h*2,t.width??0,90),g=Math.max(o.height+h*2+d,t.height??0),m=-g/2,{cssStyles:y}=t,x=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let k=Xe.svg(a).path(Gn(-p/2,m,p,g,f),Je(t,{}));x.node()?.appendChild(k),y&&x.attr("style",y)}else x.append("rect").attr("x",-p/2).attr("y",m).attr("width",p).attr("height",g).attr("rx",f).attr("ry",f).attr("style",i);x.append("text").attr("x",-p/2+12).attr("y",m+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${u}`).text(">_"),Ze(t,x);let T=m+d+(g-d)/2;return l.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${T-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(C){return je.rect(t,C)},a}var KY=_(()=>{"use strict";Ct();Lt();go();_t();At();s(YY,"consoleWindow")});function vMe(e){let t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=e*2,i={x:n/2*t,y:n/2*r},a={x:-(n/2)*t,y:n/2*r},o={x:-(n/2)*t,y:-(n/2)*r},l={x:n/2*t,y:-(n/2)*r};return`M ${a.x},${a.y} L ${l.x},${l.y}
202
+ `),a):fr(t.label,a),h=t.isNode?"nodeLabel":"edgeLabel",d=l.append("span");return d.html(u),XU(d,t.labelStyle),d.attr("class",`${h} ${n}`),XU(l,t.labelStyle),l.style("display","table-cell"),l.style("white-space","nowrap"),l.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(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"),(await nl.measure(()=>l.node().getBoundingClientRect())).width===r&&(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",r+"px")),o.node()}function B4(e,t,r,n=!1){let i=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return n&&i.attr("text-anchor","middle"),i}function KPe(e,t,r){let n=e.append("text"),i=B4(n,1,t);F4(i,r);let a=i.node().getComputedTextLength();return n.remove(),a}function JU(e,t,r){let n=e.append("text"),i=B4(n,1,t);F4(i,[{content:r,type:"normal"}]);let a=i.node()?.getBoundingClientRect();return a&&n.remove(),a}function XPe(e,t,r,n=!1,i=!1){let o=t.append("g"),l=o.insert("rect").attr("class","background").attr("style","stroke: none"),u=o.append("text").attr("y","-10.1");i&&u.attr("text-anchor","middle");let h=0;for(let d of r){let f=s(g=>KPe(o,1.1,g)<=e,"checkWidth"),p=f(d)?[d]:YU(d,f);for(let g of p){let m=B4(u,h,1.1,i);F4(m,g),h++}}if(n){let d=u.node().getBBox(),f=2;return l.attr("x",d.x-f).attr("y",d.y-f).attr("width",d.width+2*f).attr("height",d.height+2*f),o.node()}else return u.node()}function ZU(e){let t=/&(amp|lt|gt);/g;return e.replace(t,(r,n)=>{switch(n){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}function F4(e,t){e.text(""),t.forEach((r,n)=>{let i=e.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(ZU(r.content)):i.text(" "+ZU(r.content))})}async function QPe(e,t={}){let r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,o)=>(r.push((async()=>{let l=`${a}:${o}`;return await gz(l)?await Ia(l,void 0,{class:"label-icon"}):`<i class='${fr(i,t).replace(":"," ")}'></i>`})()),i));let n=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}var QU,si,mo=_(()=>{"use strict";Sr();vr();ft();mm();VU();Pt();$C();cu();KU();ir();s(XU,"applyStyle");QU=16384;s(YPe,"addHtmlSpan");s(B4,"createTspan");s(KPe,"computeWidthOfText");s(JU,"computeDimensionOfText");s(XPe,"createFormattedText");s(ZU,"decodeHTMLEntities");s(F4,"updateTextContentAndStyles");s(QPe,"replaceIconSubstring");si=s(async(e,t="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:o=!0,isNode:l=!0,width:u=200,addSvgBackground:h=!1}={},d)=>{if(Y.debug("XYZ createText",t,r,n,i,a,l,"addSvgBackground: ",h),a){let f=o?zU(t,d):GU(t),p=await QPe(Ps(f),d),g=t.replace(/\\\\/g,"\\"),m={isNode:l,label:Ln(t)?g:p,labelStyle:r.replace("fill:","color:")};return await YPe(e,m,u,i,h,d)}else{let f=Ps(t.replace(/<br\s*\/?>/g,"<br/>")),p=o?FU(f.replace("<br>","<br/>"),d):BU(f),g=XPe(u,e,p,t?h:!1,!l);if(l){/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:");et(g).attr("style",m)}else{let m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");et(g).select("rect").attr("style",m.replace(/background:/g,"fill:"));let y=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");et(g).select("text").attr("style",y)}return n?et(g).selectAll("tspan.text-outer-tspan").classed("title-row",!0):et(g).selectAll("tspan.text-outer-tspan").classed("row",!0),g}},"createText")});async function BC(e){let t=e.getElementsByTagName("img");if(!t||t.length===0)return;let r=!eY(e);await Promise.all([...t].map(n=>new Promise(i=>{function a(){if(n.style.display="flex",n.style.flexDirection="column",r){let o=xe().fontSize?xe().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=ar.fontSize]=Ns(o),h=u*l+"px";n.style.minWidth=h,n.style.maxWidth=h}else n.style.width="100%";i(n)}s(a,"setupImage"),setTimeout(()=>{n.complete&&a()}),n.addEventListener("error",a),n.addEventListener("load",a)})))}function eY(e){return e.nodeType===JPe?e.textContent?.trim()!=="":e.nodeType!==ZPe||e.tagName.toLowerCase()==="img"?!1:[...e.childNodes].some(eY)}var ZPe,JPe,G4=_(()=>{"use strict";Nt();Vi();Pt();ZPe=1,JPe=3;s(BC,"configureLabelImages");s(eY,"hasTextBesidesImages")});var tY,eMe,rY,nY=_(()=>{"use strict";Sr();mo();Nt();vr();Pt();tY=3,eMe=32,rY=s(async(e,t,r)=>{let n=xe(),i=e.insert("g").attr("class",r??"node default").attr("id",t.domId||t.id),a=i.insert("g").attr("class","label").attr("style",$r(t.labelStyle)),l=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(T=>({text:T,cssClass:"c4-descr"}))].filter(T=>T.text),u=t.width?Math.max(t.width-2*(t.padding??0),eMe):xe().flowchart?.wrappingWidth??200,d=n.c4?.wrap??!0?u:Number.POSITIVE_INFINITY,f=await Promise.all(l.map(async T=>{let C=a.append("g").attr("class",T.cssClass),k=await si(C,fr(Ps(T.text??""),n),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:d,style:t.labelStyle},n);return et(k).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),et(k).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:C,box:C.node().getBBox()}})),p=Math.max(...f.map(({box:T})=>T.width),0),g=0;for(let{el:T,box:C}of f)T.attr("transform",`translate(${p/2-C.x-C.width/2}, ${g-C.y})`),g+=C.height+tY;let m=f.length>0?g-tY:0;a.insert("rect",":first-child"),a.attr("transform",`translate(${-p/2}, ${-m/2})`);let y=a.node().getBBox(),x=(t.padding??0)/2;return{shapeSvg:i,bbox:y,halfPadding:x,label:a}},"c4LabelHelper")});function Gt(e){let t=e.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}function Ma(e,t,r,n,i,a){let o=[],u=r-e,h=n-t,d=u/a,f=2*Math.PI/d,p=t+h/2;for(let g=0;g<=50;g++){let m=g/50,y=e+m*u,x=p+i*Math.sin(f*(y-e));o.push({x:y,y:x})}return o}function ha(e,t,r,n,i,a){let o=[],l=i*Math.PI/180,d=(a*Math.PI/180-l)/(n-1);for(let f=0;f<n;f++){let p=l+f*d,g=e+r*Math.cos(p),m=t+r*Math.sin(p);o.push({x:-g,y:-m})}return o}function z4(e){let t=Array.from(e.childNodes).filter(u=>u.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),n=t.map(u=>u.getAttribute("d")).filter(u=>u!==null).join(" ");r.setAttribute("d",n);let i=t.find(u=>u.getAttribute("fill")!=="none"),a=t.find(u=>u.getAttribute("stroke")!=="none"),o=s((u,h)=>u?.getAttribute(h)??void 0,"getAttr");if(i){let u={fill:o(i,"fill"),"fill-opacity":o(i,"fill-opacity")??"1"};Object.entries(u).forEach(([h,d])=>{d&&r.setAttribute(h,d)})}if(a){let u={stroke:o(a,"stroke"),"stroke-width":o(a,"stroke-width")??"1","stroke-opacity":o(a,"stroke-opacity")??"1"};Object.entries(u).forEach(([h,d])=>{d&&r.setAttribute(h,d)})}let l=document.createElementNS("http://www.w3.org/2000/svg","g");return l.appendChild(r),l}var it,FC,Ze,st,Ct=_(()=>{"use strict";mo();$C();Nt();ir();Sr();vr();Pt();G4();mm();nY();it=s(async(e,t,r)=>{if(t.stereotype!==void 0)return rY(e,t,r);let n,i=t.useHtmlLabels||Ei(xe()?.htmlLabels);r?n=r:n="node default";let a=e.insert("g").attr("class",n).attr("id",t.domId||t.id),o=a.insert("g").attr("class","label").attr("style",$r(t.labelStyle)),l;t.label===void 0?l="":l=typeof t.label=="string"?t.label:t.label[0];let u=!!t.icon||!!t.img,h=t.labelType==="markdown",d=await si(o,fr(Ps(l),xe()),{useHtmlLabels:i,width:t.width||t.wrappingWidth||xe().flowchart?.wrappingWidth,classes:h?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:u,markdown:h},xe()),f=(t?.padding??0)/2,p;if(i){let g=d.children[0],m=et(d);await BC(g),p=await nl.measure(()=>g.getBoundingClientRect()),m.attr("width",p.width),m.attr("height",p.height)}else p=await nl.measure(()=>d.getBBox());return i?o.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):o.attr("transform","translate(0, "+-p.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:a,bbox:p,halfPadding:f,label:o}},"labelHelper"),FC=s(async(e,t,r)=>{let n=r.useHtmlLabels??vn(xe()),i=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await si(i,fr(Ps(t),xe()),{useHtmlLabels:n,width:r.width||xe()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),o=r.padding/2,l;if(vn(xe())){let u=a.children[0],h=et(a);l=await nl.measure(()=>u.getBoundingClientRect()),h.attr("width",l.width),h.attr("height",l.height)}else l=await nl.measure(()=>a.getBBox());return n?i.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"):i.attr("transform","translate(0, "+-l.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:e,bbox:l,halfPadding:o,label:i}},"insertLabel"),Ze=s((e,t,r)=>{if(r){e.width=r.width,e.height=r.height;return}let n=t.node().getBBox();e.width=n.width,e.height=n.height},"updateNodeBounds"),st=s((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");s(Gt,"createPathFromPoints");s(Ma,"generateFullSineWavePoints");s(ha,"generateCirclePoints");s(z4,"mergePaths")});function tMe(e,t){return e.intersect(t)}var iY,sY=_(()=>{"use strict";s(tMe,"intersectNode");iY=tMe});function rMe(e,t,r,n){var i=e.x,a=e.y,o=i-n.x,l=a-n.y,u=Math.sqrt(t*t*l*l+r*r*o*o),h=Math.abs(t*r*o/u);n.x<i&&(h=-h);var d=Math.abs(t*r*l/u);return n.y<a&&(d=-d),{x:i+h,y:a+d}}var GC,V4=_(()=>{"use strict";s(rMe,"intersectEllipse");GC=rMe});function nMe(e,t,r){return GC(e,t,t,r)}var aY,oY=_(()=>{"use strict";V4();s(nMe,"intersectCircle");aY=nMe});function iMe(e,t,r,n){{let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,l=i*r.x+a*r.y+o,u=i*n.x+a*n.y+o,h=1e-6;if(l!==0&&u!==0&&lY(l,u))return;let d=n.y-r.y,f=r.x-n.x,p=n.x*r.y-r.x*n.y,g=d*e.x+f*e.y+p,m=d*t.x+f*t.y+p;if(Math.abs(g)<h&&Math.abs(m)<h&&lY(g,m))return;let y=i*f-d*a;if(y===0)return;let x=Math.abs(y/2),T=a*p-f*o,C=T<0?(T-x)/y:(T+x)/y;T=d*o-i*p;let k=T<0?(T-x)/y:(T+x)/y;return{x:C,y:k}}}function lY(e,t){return e*t>0}var cY,uY=_(()=>{"use strict";s(iMe,"intersectLine");s(lY,"sameSign");cY=iMe});function sMe(e,t,r){let n=e.x,i=e.y,a=[],o=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(d){o=Math.min(o,d.x),l=Math.min(l,d.y)}):(o=Math.min(o,t.x),l=Math.min(l,t.y));let u=n-e.width/2-o,h=i-e.height/2-l;for(let d=0;d<t.length;d++){let f=t[d],p=t[d<t.length-1?d+1:0],g=cY(e,r,{x:u+f.x,y:h+f.y},{x:u+p.x,y:h+p.y});g&&a.push(g)}return a.length?(a.length>1&&a.sort(function(d,f){let p=d.x-r.x,g=d.y-r.y,m=Math.sqrt(p*p+g*g),y=f.x-r.x,x=f.y-r.y,T=Math.sqrt(y*y+x*x);return m<T?-1:m===T?0:1}),a[0]):e}var hY,dY=_(()=>{"use strict";uY();s(sMe,"intersectPolygon");hY=sMe});var aMe,il,zC=_(()=>{"use strict";aMe=s((e,t)=>{var r=e.x,n=e.y,i=t.x-r,a=t.y-n,o=e.width/2,l=e.height/2,u,h;return Math.abs(a)*o>Math.abs(i)*l?(a<0&&(l=-l),u=a===0?0:l*i/a,h=l):(i<0&&(o=-o),u=o,h=i===0?0:o*a/i),{x:r+u,y:n+h}},"intersectRect"),il=aMe});var je,Lt=_(()=>{"use strict";sY();oY();V4();dY();zC();je={node:iY,circle:aY,ellipse:GC,polygon:hY,rect:il}});var fY,oMe,sl,lMe,C1,Ke,Je,cMe,_t=_(()=>{"use strict";Nt();fY=s(e=>{let{handDrawnSeed:t}=xe();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),oMe=s(e=>Array.isArray(e)?e:e?e.split(";").map(t=>t.trim()).filter(Boolean):[],"normalizeStyleList"),sl=s(e=>{let t=lMe([...e.cssCompiledStyles||[],...e.cssStyles||[],...oMe(e.labelStyle)]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),lMe=s(e=>{let t=new Map;return e.forEach(r=>{let[n,i]=r.split(":");t.set(n.trim(),i?.trim())}),t},"styles2Map"),C1=s(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),Ke=s(e=>{let{stylesArray:t}=sl(e),r=[],n=[],i=[],a=[];return t.forEach(o=>{let l=o[0];C1(l)?r.push(o.join(":")+" !important"):(n.push(o.join(":")+" !important"),l.includes("stroke")&&i.push(o.join(":")+" !important"),l==="fill"&&a.push(o.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:t,borderStyles:i,backgroundStyles:a}},"styles2String"),Je=s((e,t)=>{let{themeVariables:r,handDrawnSeed:n}=xe(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:o}=sl(e);return Object.assign({roughness:.7,fill:o.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:o.get("stroke")||i,seed:n,strokeWidth:o.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:cMe(o.get("stroke-dasharray"))},t)},"userNodeOverrides"),cMe=s(e=>{if(!e)return[0,0];let t=e.trim().split(/\s+/).map(Number);if(t.length===1){let i=isNaN(t[0])?0:t[0];return[i,i]}let r=isNaN(t[0])?0:t[0],n=isNaN(t[1])?0:t[1];return[r,n]},"getStrokeDashArray")});function W4(e,t,r){if(e&&e.length){let[n,i]=t,a=Math.PI/180*r,o=Math.cos(a),l=Math.sin(a);for(let u of e){let[h,d]=u;u[0]=(h-n)*o-(d-i)*l+n,u[1]=(h-n)*l+(d-i)*o+i}}}function uMe(e,t){return e[0]===t[0]&&e[1]===t[1]}function hMe(e,t,r,n=1){let i=r,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,l=[0,0];if(i)for(let h of o)W4(h,l,i);let u=(function(h,d,f){let p=[];for(let C of h){let k=[...C];uMe(k[0],k[k.length-1])||k.push([k[0][0],k[0][1]]),k.length>2&&p.push(k)}let g=[];d=Math.max(d,.1);let m=[];for(let C of p)for(let k=0;k<C.length-1;k++){let E=C[k],v=C[k+1];if(E[1]!==v[1]){let S=Math.min(E[1],v[1]);m.push({ymin:S,ymax:Math.max(E[1],v[1]),x:S===E[1]?E[0]:v[0],islope:(v[0]-E[0])/(v[1]-E[1])})}}if(m.sort(((C,k)=>C.ymin<k.ymin?-1:C.ymin>k.ymin?1:C.x<k.x?-1:C.x>k.x?1:C.ymax===k.ymax?0:(C.ymax-k.ymax)/Math.abs(C.ymax-k.ymax))),!m.length)return g;let y=[],x=m[0].ymin,T=0;for(;y.length||m.length;){if(m.length){let C=-1;for(let k=0;k<m.length&&!(m[k].ymin>x);k++)C=k;m.splice(0,C+1).forEach((k=>{y.push({s:x,edge:k})}))}if(y=y.filter((C=>!(C.edge.ymax<=x))),y.sort(((C,k)=>C.edge.x===k.edge.x?0:(C.edge.x-k.edge.x)/Math.abs(C.edge.x-k.edge.x))),(f!==1||T%d==0)&&y.length>1)for(let C=0;C<y.length;C+=2){let k=C+1;if(k>=y.length)break;let E=y[C].edge,v=y[k].edge;g.push([[Math.round(E.x),x],[Math.round(v.x),x]])}x+=f,y.forEach((C=>{C.edge.x=C.edge.x+f*C.edge.islope})),T++}return g})(o,a,n);if(i){for(let h of o)W4(h,l,-i);(function(h,d,f){let p=[];h.forEach((g=>p.push(...g))),W4(p,d,f)})(u,l,-i)}return u}function E1(e,t){var r;let n=t.hachureAngle+90,i=t.hachureGap;i<0&&(i=4*t.strokeWidth),i=Math.round(Math.max(i,.1));let a=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=i),hMe(e,i,n,a||1)}function XC(e){let t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}function j4(e,t){return e.type===t}function sI(e){let t=[],r=(function(o){let l=new Array;for(;o!=="";)if(o.match(/^([ \t\r\n,]+)/))o=o.substr(RegExp.$1.length);else if(o.match(/^([aAcChHlLmMqQsStTvVzZ])/))l[l.length]={type:dMe,text:RegExp.$1},o=o.substr(RegExp.$1.length);else{if(!o.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];l[l.length]={type:q4,text:`${parseFloat(RegExp.$1)}`},o=o.substr(RegExp.$1.length)}return l[l.length]={type:pY,text:""},l})(e),n="BOD",i=0,a=r[i];for(;!j4(a,pY);){let o=0,l=[];if(n==="BOD"){if(a.text!=="M"&&a.text!=="m")return sI("M0,0"+e);i++,o=VC[a.text],n=a.text}else j4(a,q4)?o=VC[n]:(i++,o=VC[a.text],n=a.text);if(!(i+o<r.length))throw new Error("Path data ended short");for(let u=i;u<i+o;u++){let h=r[u];if(!j4(h,q4))throw new Error("Param not a number: "+n+","+h.text);l[l.length]=+h.text}if(typeof VC[n]!="number")throw new Error("Bad segment: "+n);{let u={key:n,data:l};t.push(u),i+=o,a=r[i],n==="M"&&(n="L"),n==="m"&&(n="l")}}return t}function kY(e){let t=0,r=0,n=0,i=0,a=[];for(let{key:o,data:l}of e)switch(o){case"M":a.push({key:"M",data:[...l]}),[t,r]=l,[n,i]=l;break;case"m":t+=l[0],r+=l[1],a.push({key:"M",data:[t,r]}),n=t,i=r;break;case"L":a.push({key:"L",data:[...l]}),[t,r]=l;break;case"l":t+=l[0],r+=l[1],a.push({key:"L",data:[t,r]});break;case"C":a.push({key:"C",data:[...l]}),t=l[4],r=l[5];break;case"c":{let u=l.map(((h,d)=>d%2?h+r:h+t));a.push({key:"C",data:u}),t=u[4],r=u[5];break}case"Q":a.push({key:"Q",data:[...l]}),t=l[2],r=l[3];break;case"q":{let u=l.map(((h,d)=>d%2?h+r:h+t));a.push({key:"Q",data:u}),t=u[2],r=u[3];break}case"A":a.push({key:"A",data:[...l]}),t=l[5],r=l[6];break;case"a":t+=l[5],r+=l[6],a.push({key:"A",data:[l[0],l[1],l[2],l[3],l[4],t,r]});break;case"H":a.push({key:"H",data:[...l]}),t=l[0];break;case"h":t+=l[0],a.push({key:"H",data:[t]});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]}),t=l[2],r=l[3];break;case"s":{let u=l.map(((h,d)=>d%2?h+r:h+t));a.push({key:"S",data:u}),t=u[2],r=u[3];break}case"T":a.push({key:"T",data:[...l]}),t=l[0],r=l[1];break;case"t":t+=l[0],r+=l[1],a.push({key:"T",data:[t,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),t=n,r=i}return a}function SY(e){let t=[],r="",n=0,i=0,a=0,o=0,l=0,u=0;for(let{key:h,data:d}of e){switch(h){case"M":t.push({key:"M",data:[...d]}),[n,i]=d,[a,o]=d;break;case"C":t.push({key:"C",data:[...d]}),n=d[4],i=d[5],l=d[2],u=d[3];break;case"L":t.push({key:"L",data:[...d]}),[n,i]=d;break;case"H":n=d[0],t.push({key:"L",data:[n,i]});break;case"V":i=d[0],t.push({key:"L",data:[n,i]});break;case"S":{let f=0,p=0;r==="C"||r==="S"?(f=n+(n-l),p=i+(i-u)):(f=n,p=i),t.push({key:"C",data:[f,p,...d]}),l=d[0],u=d[1],n=d[2],i=d[3];break}case"T":{let[f,p]=d,g=0,m=0;r==="Q"||r==="T"?(g=n+(n-l),m=i+(i-u)):(g=n,m=i);let y=n+2*(g-n)/3,x=i+2*(m-i)/3,T=f+2*(g-f)/3,C=p+2*(m-p)/3;t.push({key:"C",data:[y,x,T,C,f,p]}),l=g,u=m,n=f,i=p;break}case"Q":{let[f,p,g,m]=d,y=n+2*(f-n)/3,x=i+2*(p-i)/3,T=g+2*(f-g)/3,C=m+2*(p-m)/3;t.push({key:"C",data:[y,x,T,C,g,m]}),l=f,u=p,n=g,i=m;break}case"A":{let f=Math.abs(d[0]),p=Math.abs(d[1]),g=d[2],m=d[3],y=d[4],x=d[5],T=d[6];f===0||p===0?(t.push({key:"C",data:[n,i,x,T,x,T]}),n=x,i=T):(n!==x||i!==T)&&(vY(n,i,x,T,f,p,g,m,y).forEach((function(C){t.push({key:"C",data:C})})),n=x,i=T);break}case"Z":t.push({key:"Z",data:[]}),n=a,i=o}r=h}return t}function k1(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function vY(e,t,r,n,i,a,o,l,u,h){let d=(f=o,Math.PI*f/180);var f;let p=[],g=0,m=0,y=0,x=0;if(h)[g,m,y,x]=h;else{[e,t]=k1(e,t,-d),[r,n]=k1(r,n,-d);let A=(e-r)/2,M=(t-n)/2,I=A*A/(i*i)+M*M/(a*a);I>1&&(I=Math.sqrt(I),i*=I,a*=I);let P=i*i,B=a*a,D=P*B-P*M*M-B*A*A,$=P*M*M+B*A*A,W=(l===u?-1:1)*Math.sqrt(Math.abs(D/$));y=W*i*M/a+(e+r)/2,x=W*-a*A/i+(t+n)/2,g=Math.asin(parseFloat(((t-x)/a).toFixed(9))),m=Math.asin(parseFloat(((n-x)/a).toFixed(9))),e<y&&(g=Math.PI-g),r<y&&(m=Math.PI-m),g<0&&(g=2*Math.PI+g),m<0&&(m=2*Math.PI+m),u&&g>m&&(g-=2*Math.PI),!u&&m>g&&(m-=2*Math.PI)}let T=m-g;if(Math.abs(T)>120*Math.PI/180){let A=m,M=r,I=n;m=u&&m>g?g+120*Math.PI/180*1:g+120*Math.PI/180*-1,p=vY(r=y+i*Math.cos(m),n=x+a*Math.sin(m),M,I,i,a,o,0,u,[m,A,y,x])}T=m-g;let C=Math.cos(g),k=Math.sin(g),E=Math.cos(m),v=Math.sin(m),S=Math.tan(T/4),w=4/3*i*S,L=4/3*a*S,O=[e,t],F=[e+w*k,t-L*C],N=[r+w*v,n-L*E],G=[r,n];if(F[0]=2*O[0]-F[0],F[1]=2*O[1]-F[1],h)return[F,N,G].concat(p);{p=[F,N,G].concat(p);let A=[];for(let M=0;M<p.length;M+=3){let I=k1(p[M][0],p[M][1],d),P=k1(p[M+1][0],p[M+1][1],d),B=k1(p[M+2][0],p[M+2][1],d);A.push([I[0],I[1],P[0],P[1],B[0],B[1]])}return A}}function EY(e,t,r,n,i){return{type:"path",ops:Ru(e,t,r,n,i)}}function jC(e,t,r){let n=(e||[]).length;if(n>2){let i=[];for(let a=0;a<n-1;a++)i.push(...Ru(e[a][0],e[a][1],e[a+1][0],e[a+1][1],r));return t&&i.push(...Ru(e[n-1][0],e[n-1][1],e[0][0],e[0][1],r)),{type:"path",ops:i}}return n===2?EY(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function pMe(e,t,r,n,i){return(function(a,o){return jC(a,!0,o)})([[e,t],[e+r,t],[e+r,t+n],[e,t+n]],i)}function mY(e,t){if(e.length){let r=typeof e[0][0]=="number"?[e]:e,n=WC(r[0],1*(1+.2*t.roughness),t),i=t.disableMultiStroke?[]:WC(r[0],1.5*(1+.22*t.roughness),xY(t));for(let a=1;a<r.length;a++){let o=r[a];if(o.length){let l=WC(o,1*(1+.2*t.roughness),t),u=t.disableMultiStroke?[]:WC(o,1.5*(1+.22*t.roughness),xY(t));for(let h of l)h.op!=="move"&&n.push(h);for(let h of u)h.op!=="move"&&i.push(h)}}return{type:"path",ops:n.concat(i)}}return{type:"path",ops:[]}}function wY(e,t,r){let n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*n)),a=2*Math.PI/i,o=Math.abs(e/2),l=Math.abs(t/2),u=1-r.curveFitting;return o+=tr(o*u,r),l+=tr(l*u,r),{increment:a,rx:o,ry:l}}function eI(e,t,r,n){let[i,a]=bY(n.increment,e,t,n.rx,n.ry,1,n.increment*UC(.1,UC(.4,1,r),r),r),o=YC(i,null,r);if(!r.disableMultiStroke&&r.roughness!==0){let[l]=bY(n.increment,e,t,n.rx,n.ry,1.5,0,r),u=YC(l,null,r);o=o.concat(u)}return{estimatedPoints:a,opset:{type:"path",ops:o}}}function gY(e,t,r,n,i,a,o,l,u){let h=e,d=t,f=Math.abs(r/2),p=Math.abs(n/2);f+=tr(.01*f,u),p+=tr(.01*p,u);let g=i,m=a;for(;g<0;)g+=2*Math.PI,m+=2*Math.PI;m-g>2*Math.PI&&(g=0,m=2*Math.PI);let y=2*Math.PI/u.curveStepCount,x=Math.min(y/2,(m-g)/2),T=TY(x,h,d,f,p,g,m,1,u);if(!u.disableMultiStroke){let C=TY(x,h,d,f,p,g,m,1.5,u);T.push(...C)}return o&&(l?T.push(...Ru(h,d,h+f*Math.cos(g),d+p*Math.sin(g),u),...Ru(h,d,h+f*Math.cos(m),d+p*Math.sin(m),u)):T.push({op:"lineTo",data:[h,d]},{op:"lineTo",data:[h+f*Math.cos(g),d+p*Math.sin(g)]})),{type:"path",ops:T}}function yY(e,t){let r=SY(kY(sI(e))),n=[],i=[0,0],a=[0,0];for(let{key:o,data:l}of r)switch(o){case"M":a=[l[0],l[1]],i=[l[0],l[1]];break;case"L":n.push(...Ru(a[0],a[1],l[0],l[1],t)),a=[l[0],l[1]];break;case"C":{let[u,h,d,f,p,g]=l;n.push(...mMe(u,h,d,f,p,g,a,t)),a=[p,g];break}case"Z":n.push(...Ru(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:"path",ops:n}}function H4(e,t){let r=[];for(let n of e)if(n.length){let i=t.maxRandomnessOffset||0,a=n.length;if(a>2){r.push({op:"move",data:[n[0][0]+tr(i,t),n[0][1]+tr(i,t)]});for(let o=1;o<a;o++)r.push({op:"lineTo",data:[n[o][0]+tr(i,t),n[o][1]+tr(i,t)]})}}return{type:"fillPath",ops:r}}function gm(e,t){return(function(r,n){let i=r.fillStyle||"hachure";if(!Ms[i])switch(i){case"zigzag":Ms[i]||(Ms[i]=new Y4(n));break;case"cross-hatch":Ms[i]||(Ms[i]=new K4(n));break;case"dots":Ms[i]||(Ms[i]=new X4(n));break;case"dashed":Ms[i]||(Ms[i]=new Q4(n));break;case"zigzag-line":Ms[i]||(Ms[i]=new Z4(n));break;default:i="hachure",Ms[i]||(Ms[i]=new v1(n))}return Ms[i]})(t,fMe).fillPolygons(e,t)}function xY(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function _Y(e){return e.randomizer||(e.randomizer=new J4(e.seed||0)),e.randomizer.next()}function UC(e,t,r,n=1){return r.roughness*n*(_Y(r)*(t-e)+e)}function tr(e,t,r=1){return UC(-e,e,t,r)}function Ru(e,t,r,n,i,a=!1){let o=a?i.disableMultiStrokeFill:i.disableMultiStroke,l=tI(e,t,r,n,i,!0,!1);if(o)return l;let u=tI(e,t,r,n,i,!0,!0);return l.concat(u)}function tI(e,t,r,n,i,a,o){let l=Math.pow(e-r,2)+Math.pow(t-n,2),u=Math.sqrt(l),h=1;h=u<200?1:u>500?.4:-.0016668*u+1.233334;let d=i.maxRandomnessOffset||0;d*d*100>l&&(d=u/10);let f=d/2,p=.2+.2*_Y(i),g=i.bowing*i.maxRandomnessOffset*(n-t)/200,m=i.bowing*i.maxRandomnessOffset*(e-r)/200;g=tr(g,i,h),m=tr(m,i,h);let y=[],x=s(()=>tr(f,i,h),"M"),T=s(()=>tr(d,i,h),"k"),C=i.preserveVertices;return a&&(o?y.push({op:"move",data:[e+(C?0:x()),t+(C?0:x())]}):y.push({op:"move",data:[e+(C?0:tr(d,i,h)),t+(C?0:tr(d,i,h))]})),o?y.push({op:"bcurveTo",data:[g+e+(r-e)*p+x(),m+t+(n-t)*p+x(),g+e+2*(r-e)*p+x(),m+t+2*(n-t)*p+x(),r+(C?0:x()),n+(C?0:x())]}):y.push({op:"bcurveTo",data:[g+e+(r-e)*p+T(),m+t+(n-t)*p+T(),g+e+2*(r-e)*p+T(),m+t+2*(n-t)*p+T(),r+(C?0:T()),n+(C?0:T())]}),y}function WC(e,t,r){if(!e.length)return[];let n=[];n.push([e[0][0]+tr(t,r),e[0][1]+tr(t,r)]),n.push([e[0][0]+tr(t,r),e[0][1]+tr(t,r)]);for(let i=1;i<e.length;i++)n.push([e[i][0]+tr(t,r),e[i][1]+tr(t,r)]),i===e.length-1&&n.push([e[i][0]+tr(t,r),e[i][1]+tr(t,r)]);return YC(n,null,r)}function YC(e,t,r){let n=e.length,i=[];if(n>3){let a=[],o=1-r.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let l=1;l+2<n;l++){let u=e[l];a[0]=[u[0],u[1]],a[1]=[u[0]+(o*e[l+1][0]-o*e[l-1][0])/6,u[1]+(o*e[l+1][1]-o*e[l-1][1])/6],a[2]=[e[l+1][0]+(o*e[l][0]-o*e[l+2][0])/6,e[l+1][1]+(o*e[l][1]-o*e[l+2][1])/6],a[3]=[e[l+1][0],e[l+1][1]],i.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(t&&t.length===2){let l=r.maxRandomnessOffset;i.push({op:"lineTo",data:[t[0]+tr(l,r),t[1]+tr(l,r)]})}}else n===3?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):n===2&&i.push(...tI(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return i}function bY(e,t,r,n,i,a,o,l){let u=[],h=[];if(l.roughness===0){e/=4,h.push([t+n*Math.cos(-e),r+i*Math.sin(-e)]);for(let d=0;d<=2*Math.PI;d+=e){let f=[t+n*Math.cos(d),r+i*Math.sin(d)];u.push(f),h.push(f)}h.push([t+n*Math.cos(0),r+i*Math.sin(0)]),h.push([t+n*Math.cos(e),r+i*Math.sin(e)])}else{let d=tr(.5,l)-Math.PI/2;h.push([tr(a,l)+t+.9*n*Math.cos(d-e),tr(a,l)+r+.9*i*Math.sin(d-e)]);let f=2*Math.PI+d-.01;for(let p=d;p<f;p+=e){let g=[tr(a,l)+t+n*Math.cos(p),tr(a,l)+r+i*Math.sin(p)];u.push(g),h.push(g)}h.push([tr(a,l)+t+n*Math.cos(d+2*Math.PI+.5*o),tr(a,l)+r+i*Math.sin(d+2*Math.PI+.5*o)]),h.push([tr(a,l)+t+.98*n*Math.cos(d+o),tr(a,l)+r+.98*i*Math.sin(d+o)]),h.push([tr(a,l)+t+.9*n*Math.cos(d+.5*o),tr(a,l)+r+.9*i*Math.sin(d+.5*o)])}return[h,u]}function TY(e,t,r,n,i,a,o,l,u){let h=a+tr(.1,u),d=[];d.push([tr(l,u)+t+.9*n*Math.cos(h-e),tr(l,u)+r+.9*i*Math.sin(h-e)]);for(let f=h;f<=o;f+=e)d.push([tr(l,u)+t+n*Math.cos(f),tr(l,u)+r+i*Math.sin(f)]);return d.push([t+n*Math.cos(o),r+i*Math.sin(o)]),d.push([t+n*Math.cos(o),r+i*Math.sin(o)]),YC(d,null,u)}function mMe(e,t,r,n,i,a,o,l){let u=[],h=[l.maxRandomnessOffset||1,(l.maxRandomnessOffset||1)+.3],d=[0,0],f=l.disableMultiStroke?1:2,p=l.preserveVertices;for(let g=0;g<f;g++)g===0?u.push({op:"move",data:[o[0],o[1]]}):u.push({op:"move",data:[o[0]+(p?0:tr(h[0],l)),o[1]+(p?0:tr(h[0],l))]}),d=p?[i,a]:[i+tr(h[g],l),a+tr(h[g],l)],u.push({op:"bcurveTo",data:[e+tr(h[g],l),t+tr(h[g],l),r+tr(h[g],l),n+tr(h[g],l),d[0],d[1]]});return u}function S1(e){return[...e]}function CY(e,t=0){let r=e.length;if(r<3)throw new Error("A curve must have at least three points.");let n=[];if(r===3)n.push(S1(e[0]),S1(e[1]),S1(e[2]),S1(e[2]));else{let i=[];i.push(e[0],e[0]);for(let l=1;l<e.length;l++)i.push(e[l]),l===e.length-1&&i.push(e[l]);let a=[],o=1-t;n.push(S1(i[0]));for(let l=1;l+2<i.length;l++){let u=i[l];a[0]=[u[0],u[1]],a[1]=[u[0]+(o*i[l+1][0]-o*i[l-1][0])/6,u[1]+(o*i[l+1][1]-o*i[l-1][1])/6],a[2]=[i[l+1][0]+(o*i[l][0]-o*i[l+2][0])/6,i[l+1][1]+(o*i[l][1]-o*i[l+2][1])/6],a[3]=[i[l+1][0],i[l+1][1]],n.push(a[1],a[2],a[3])}}return n}function HC(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function gMe(e,t,r){let n=HC(t,r);if(n===0)return HC(e,t);let i=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/n;return i=Math.max(0,Math.min(1,i)),HC(e,Ad(t,r,i))}function Ad(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function rI(e,t,r,n){let i=n||[];if((function(l,u){let h=l[u+0],d=l[u+1],f=l[u+2],p=l[u+3],g=3*d[0]-2*h[0]-p[0];g*=g;let m=3*d[1]-2*h[1]-p[1];m*=m;let y=3*f[0]-2*p[0]-h[0];y*=y;let x=3*f[1]-2*p[1]-h[1];return x*=x,g<y&&(g=y),m<x&&(m=x),g+m})(e,t)<r){let l=e[t+0];i.length?(a=i[i.length-1],o=l,Math.sqrt(HC(a,o))>1&&i.push(l)):i.push(l),i.push(e[t+3])}else{let u=e[t+0],h=e[t+1],d=e[t+2],f=e[t+3],p=Ad(u,h,.5),g=Ad(h,d,.5),m=Ad(d,f,.5),y=Ad(p,g,.5),x=Ad(g,m,.5),T=Ad(y,x,.5);rI([u,p,y,T],0,r,i),rI([T,x,m,f],0,r,i)}var a,o;return i}function yMe(e,t){return KC(e,0,e.length,t)}function KC(e,t,r,n,i){let a=i||[],o=e[t],l=e[r-1],u=0,h=1;for(let d=t+1;d<r-1;++d){let f=gMe(e[d],o,l);f>u&&(u=f,h=d)}return Math.sqrt(u)>n?(KC(e,t,h+1,n,a),KC(e,h,r,n,a)):(a.length||a.push(o),a.push(l)),a}function U4(e,t=.15,r){let n=[],i=(e.length-1)/3;for(let a=0;a<i;a++)rI(e,3*a,t,n);return r&&r>0?KC(n,0,n.length,r):n}var v1,Y4,K4,X4,Q4,Z4,Ms,J4,dMe,q4,pY,VC,fMe,da,ym,nI,qC,iI,Xe,At=_(()=>{"use strict";s(W4,"t");s(uMe,"e");s(hMe,"s");s(E1,"n");v1=class{static{s(this,"o")}constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){let n=E1(t,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(t,r){let n=[];for(let i of t)n.push(...this.helper.doubleLineOps(i[0][0],i[0][1],i[1][0],i[1][1],r));return n}};s(XC,"a");Y4=class extends v1{static{s(this,"h")}fillPolygons(t,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);let i=E1(t,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,o=[],l=.5*n*Math.cos(a),u=.5*n*Math.sin(a);for(let[h,d]of i)XC([h,d])&&o.push([[h[0]-l,h[1]+u],[...d]],[[h[0]+l,h[1]-u],[...d]]);return{type:"fillSketch",ops:this.renderLines(o,r)}}},K4=class extends v1{static{s(this,"r")}fillPolygons(t,r){let n=this._fillPolygons(t,r),i=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(t,i);return n.ops=n.ops.concat(a.ops),n}},X4=class{static{s(this,"i")}constructor(t){this.helper=t}fillPolygons(t,r){let n=E1(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(t,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 o=i/4;for(let l of t){let u=XC(l),h=u/i,d=Math.ceil(h)-1,f=u-d*i,p=(l[0][0]+l[1][0])/2-i/4,g=Math.min(l[0][1],l[1][1]);for(let m=0;m<d;m++){let y=g+f+m*i,x=p-o+2*Math.random()*o,T=y-o+2*Math.random()*o,C=this.helper.ellipse(x,T,a,a,r);n.push(...C.ops)}}return{type:"fillSketch",ops:n}}},Q4=class{static{s(this,"c")}constructor(t){this.helper=t}fillPolygons(t,r){let n=E1(t,r);return{type:"fillSketch",ops:this.dashedLine(n,r)}}dashedLine(t,r){let n=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,i=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,a=[];return t.forEach((o=>{let l=XC(o),u=Math.floor(l/(n+i)),h=(l+i-u*(n+i))/2,d=o[0],f=o[1];d[0]>f[0]&&(d=o[1],f=o[0]);let p=Math.atan((f[1]-d[1])/(f[0]-d[0]));for(let g=0;g<u;g++){let m=g*(n+i),y=m+n,x=[d[0]+m*Math.cos(p)+h*Math.cos(p),d[1]+m*Math.sin(p)+h*Math.sin(p)],T=[d[0]+y*Math.cos(p)+h*Math.cos(p),d[1]+y*Math.sin(p)+h*Math.sin(p)];a.push(...this.helper.doubleLineOps(x[0],x[1],T[0],T[1],r))}})),a}},Z4=class{static{s(this,"l")}constructor(t){this.helper=t}fillPolygons(t,r){let n=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,i=r.zigzagOffset<0?n:r.zigzagOffset,a=E1(t,r=Object.assign({},r,{hachureGap:n+i}));return{type:"fillSketch",ops:this.zigzagLines(a,i,r)}}zigzagLines(t,r,n){let i=[];return t.forEach((a=>{let o=XC(a),l=Math.round(o/(2*r)),u=a[0],h=a[1];u[0]>h[0]&&(u=a[1],h=a[0]);let d=Math.atan((h[1]-u[1])/(h[0]-u[0]));for(let f=0;f<l;f++){let p=2*f*r,g=2*(f+1)*r,m=Math.sqrt(2*Math.pow(r,2)),y=[u[0]+p*Math.cos(d),u[1]+p*Math.sin(d)],x=[u[0]+g*Math.cos(d),u[1]+g*Math.sin(d)],T=[y[0]+m*Math.cos(d+Math.PI/4),y[1]+m*Math.sin(d+Math.PI/4)];i.push(...this.helper.doubleLineOps(y[0],y[1],T[0],T[1],n),...this.helper.doubleLineOps(T[0],T[1],x[0],x[1],n))}})),i}},Ms={},J4=class{static{s(this,"p")}constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},dMe=0,q4=1,pY=2,VC={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};s(j4,"k");s(sI,"b");s(kY,"y");s(SY,"m");s(k1,"w");s(vY,"x");fMe={randOffset:s(function(e,t){return tr(e,t)},"randOffset"),randOffsetWithRange:s(function(e,t,r){return UC(e,t,r)},"randOffsetWithRange"),ellipse:s(function(e,t,r,n,i){let a=wY(r,n,i);return eI(e,t,i,a).opset},"ellipse"),doubleLineOps:s(function(e,t,r,n,i){return Ru(e,t,r,n,i,!0)},"doubleLineOps")};s(EY,"v");s(jC,"S");s(pMe,"O");s(mY,"L");s(wY,"T");s(eI,"D");s(gY,"A");s(yY,"_");s(H4,"I");s(gm,"C");s(xY,"z");s(_Y,"W");s(UC,"E");s(tr,"G");s(Ru,"$");s(tI,"R");s(WC,"j");s(YC,"q");s(bY,"F");s(TY,"V");s(mMe,"Z");s(S1,"Q");s(CY,"H");s(HC,"N");s(gMe,"B");s(Ad,"J");s(rI,"K");s(yMe,"U");s(KC,"X");s(U4,"Y");da="none",ym=class{static{s(this,"et")}constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,n){return{shape:t,sets:r||[],options:n||this.defaultOptions}}line(t,r,n,i,a){let o=this._o(a);return this._d("line",[EY(t,r,n,i,o)],o)}rectangle(t,r,n,i,a){let o=this._o(a),l=[],u=pMe(t,r,n,i,o);if(o.fill){let h=[[t,r],[t+n,r],[t+n,r+i],[t,r+i]];o.fillStyle==="solid"?l.push(H4([h],o)):l.push(gm([h],o))}return o.stroke!==da&&l.push(u),this._d("rectangle",l,o)}ellipse(t,r,n,i,a){let o=this._o(a),l=[],u=wY(n,i,o),h=eI(t,r,o,u);if(o.fill)if(o.fillStyle==="solid"){let d=eI(t,r,o,u).opset;d.type="fillPath",l.push(d)}else l.push(gm([h.estimatedPoints],o));return o.stroke!==da&&l.push(h.opset),this._d("ellipse",l,o)}circle(t,r,n,i){let a=this.ellipse(t,r,n,n,i);return a.shape="circle",a}linearPath(t,r){let n=this._o(r);return this._d("linearPath",[jC(t,!1,n)],n)}arc(t,r,n,i,a,o,l=!1,u){let h=this._o(u),d=[],f=gY(t,r,n,i,a,o,l,!0,h);if(l&&h.fill)if(h.fillStyle==="solid"){let p=Object.assign({},h);p.disableMultiStroke=!0;let g=gY(t,r,n,i,a,o,!0,!1,p);g.type="fillPath",d.push(g)}else d.push((function(p,g,m,y,x,T,C){let k=p,E=g,v=Math.abs(m/2),S=Math.abs(y/2);v+=tr(.01*v,C),S+=tr(.01*S,C);let w=x,L=T;for(;w<0;)w+=2*Math.PI,L+=2*Math.PI;L-w>2*Math.PI&&(w=0,L=2*Math.PI);let O=(L-w)/C.curveStepCount,F=[];for(let N=w;N<=L;N+=O)F.push([k+v*Math.cos(N),E+S*Math.sin(N)]);return F.push([k+v*Math.cos(L),E+S*Math.sin(L)]),F.push([k,E]),gm([F],C)})(t,r,n,i,a,o,h));return h.stroke!==da&&d.push(f),this._d("arc",d,h)}curve(t,r){let n=this._o(r),i=[],a=mY(t,n);if(n.fill&&n.fill!==da)if(n.fillStyle==="solid"){let o=mY(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(o.ops)})}else{let o=[],l=t;if(l.length){let u=typeof l[0][0]=="number"?[l]:l;for(let h of u)h.length<3?o.push(...h):h.length===3?o.push(...U4(CY([h[0],h[0],h[1],h[2]]),10,(1+n.roughness)/2)):o.push(...U4(CY(h),10,(1+n.roughness)/2))}o.length&&i.push(gm([o],n))}return n.stroke!==da&&i.push(a),this._d("curve",i,n)}polygon(t,r){let n=this._o(r),i=[],a=jC(t,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(H4([t],n)):i.push(gm([t],n))),n.stroke!==da&&i.push(a),this._d("polygon",i,n)}path(t,r){let n=this._o(r),i=[];if(!t)return this._d("path",i,n);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let a=n.fill&&n.fill!=="transparent"&&n.fill!==da,o=n.stroke!==da,l=!!(n.simplification&&n.simplification<1),u=(function(d,f,p){let g=SY(kY(sI(d))),m=[],y=[],x=[0,0],T=[],C=s(()=>{T.length>=4&&y.push(...U4(T,f)),T=[]},"i"),k=s(()=>{C(),y.length&&(m.push(y),y=[])},"c");for(let{key:v,data:S}of g)switch(v){case"M":k(),x=[S[0],S[1]],y.push(x);break;case"L":C(),y.push([S[0],S[1]]);break;case"C":if(!T.length){let w=y.length?y[y.length-1]:x;T.push([w[0],w[1]])}T.push([S[0],S[1]]),T.push([S[2],S[3]]),T.push([S[4],S[5]]);break;case"Z":C(),y.push([x[0],x[1]])}if(k(),!p)return m;let E=[];for(let v of m){let S=yMe(v,p);S.length&&E.push(S)}return E})(t,1,l?4-4*(n.simplification||1):(1+n.roughness)/2),h=yY(t,n);if(a)if(n.fillStyle==="solid")if(u.length===1){let d=yY(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(d.ops)})}else i.push(H4(u,n));else i.push(gm(u,n));return o&&(l?u.forEach((d=>{i.push(jC(d,!1,n))})):i.push(h)),this._d("path",i,n)}opsToPath(t,r){let n="";for(let i of t.ops){let a=typeof r=="number"&&r>=0?i.data.map((o=>+o.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(t){let r=t.sets||[],n=t.options||this.defaultOptions,i=[];for(let a of r){let o=null;switch(a.type){case"path":o={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:da};break;case"fillPath":o={d:this.opsToPath(a),stroke:da,strokeWidth:0,fill:n.fill||da};break;case"fillSketch":o=this.fillSketch(a,n)}o&&i.push(o)}return i}fillSketch(t,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||da,strokeWidth:n,fill:da}}_mergedShape(t){return t.filter(((r,n)=>n===0||r.op!=="move"))}},nI=class{static{s(this,"st")}constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new ym(r)}draw(t){let r=t.sets||[],n=t.options||this.getDefaultOptions(),i=this.ctx,a=t.options.fixedDecimalPlaceDigits;for(let o of r)switch(o.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,o,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";let l=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,o,a,l),i.restore();break}case"fillSketch":this.fillSketch(i,o,n)}}fillSketch(t,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2),t.save(),n.fillLineDash&&t.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(t.lineDashOffset=n.fillLineDashOffset),t.strokeStyle=n.fill||"",t.lineWidth=i,this._drawToContext(t,r,n.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,n,i="nonzero"){t.beginPath();for(let a of r.ops){let o=typeof n=="number"&&n>=0?a.data.map((l=>+l.toFixed(n))):a.data;switch(a.op){case"move":t.moveTo(o[0],o[1]);break;case"bcurveTo":t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":t.lineTo(o[0],o[1])}}r.type==="fillPath"?t.fill(i):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,n,i,a){let o=this.gen.line(t,r,n,i,a);return this.draw(o),o}rectangle(t,r,n,i,a){let o=this.gen.rectangle(t,r,n,i,a);return this.draw(o),o}ellipse(t,r,n,i,a){let o=this.gen.ellipse(t,r,n,i,a);return this.draw(o),o}circle(t,r,n,i){let a=this.gen.circle(t,r,n,i);return this.draw(a),a}linearPath(t,r){let n=this.gen.linearPath(t,r);return this.draw(n),n}polygon(t,r){let n=this.gen.polygon(t,r);return this.draw(n),n}arc(t,r,n,i,a,o,l=!1,u){let h=this.gen.arc(t,r,n,i,a,o,l,u);return this.draw(h),h}curve(t,r){let n=this.gen.curve(t,r);return this.draw(n),n}path(t,r){let n=this.gen.path(t,r);return this.draw(n),n}},qC="http://www.w3.org/2000/svg",iI=class{static{s(this,"ot")}constructor(t,r){this.svg=t,this.gen=new ym(r)}draw(t){let r=t.sets||[],n=t.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(qC,"g"),o=t.options.fixedDecimalPlaceDigits;for(let l of r){let u=null;switch(l.type){case"path":u=i.createElementNS(qC,"path"),u.setAttribute("d",this.opsToPath(l,o)),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(qC,"path"),u.setAttribute("d",this.opsToPath(l,o)),u.setAttribute("stroke","none"),u.setAttribute("stroke-width","0"),u.setAttribute("fill",n.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||u.setAttribute("fill-rule","evenodd");break;case"fillSketch":u=this.fillSketch(i,l,n)}u&&a.appendChild(u)}return a}fillSketch(t,r,n){let i=n.fillWeight;i<0&&(i=n.strokeWidth/2);let a=t.createElementNS(qC,"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(t,r){return this.gen.opsToPath(t,r)}line(t,r,n,i,a){let o=this.gen.line(t,r,n,i,a);return this.draw(o)}rectangle(t,r,n,i,a){let o=this.gen.rectangle(t,r,n,i,a);return this.draw(o)}ellipse(t,r,n,i,a){let o=this.gen.ellipse(t,r,n,i,a);return this.draw(o)}circle(t,r,n,i){let a=this.gen.circle(t,r,n,i);return this.draw(a)}linearPath(t,r){let n=this.gen.linearPath(t,r);return this.draw(n)}polygon(t,r){let n=this.gen.polygon(t,r);return this.draw(n)}arc(t,r,n,i,a,o,l=!1,u){let h=this.gen.arc(t,r,n,i,a,o,l,u);return this.draw(h)}curve(t,r){let n=this.gen.curve(t,r);return this.draw(n)}path(t,r){let n=this.gen.path(t,r);return this.draw(n)}},Xe={canvas:s((e,t)=>new nI(e,t),"canvas"),svg:s((e,t)=>new iI(e,t),"svg"),generator:s(e=>new ym(e),"generator"),newSeed:s(()=>ym.newSeed(),"newSeed")}});function AY(e,t){let{labelStyles:r}=Ke(t);t.labelStyle=r;let n=st(t),i=n;n||(i="anchor");let a=e.insert("g").attr("class",i).attr("id",t.domId||t.id),o=1,{cssStyles:l}=t,u=Xe.svg(a),h=Je(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);let d=u.circle(0,0,o*2,h),f=a.insert(()=>d,":first-child");return f.attr("class","anchor").attr("style",$r(l)),Ze(t,f),t.intersect=function(p){return Y.info("Circle intersect",t,o,p),je.circle(t,o,p)},a}var RY=_(()=>{"use strict";ft();Ct();Lt();_t();At();Pt();s(AY,"anchor")});function LY(e,t,r,n,i,a,o){let u=(e+r)/2,h=(t+n)/2,d=Math.atan2(n-t,r-e),f=(r-e)/2,p=(n-t)/2,g=f/i,m=p/a,y=Math.sqrt(g**2+m**2);if(y>1)throw new Error("The given radii are too small to create an arc between the points.");let x=Math.sqrt(1-y**2),T=u+x*a*Math.sin(d)*(o?-1:1),C=h-x*i*Math.cos(d)*(o?-1:1),k=Math.atan2((t-C)/a,(e-T)/i),v=Math.atan2((n-C)/a,(r-T)/i)-k;o&&v<0&&(v+=2*Math.PI),!o&&v>0&&(v-=2*Math.PI);let S=[];for(let w=0;w<20;w++){let L=w/19,O=k+L*v,F=T+i*Math.cos(O),N=C+a*Math.sin(O);S.push({x:F,y:N})}return S}function xMe(e,t,r){let[n,i]=[t,r].sort((a,o)=>o-a);return i*(1-Math.sqrt(1-(e/n/2)**2))}async function DY(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i,l=s(O=>O+o,"calcTotalHeight"),u=s(O=>{let F=O/2;return[F/(2.5+O/50),F]},"calcEllipseRadius"),{shapeSvg:h,bbox:d}=await it(e,t,st(t)),f=l(t?.height?t?.height:d.height),[p,g]=u(f),m=xMe(f,p,g),x=(t?.width?t?.width:d.width)+a*2+m-m,T=f,{cssStyles:C}=t,k=[{x:x/2,y:-T/2},{x:-x/2,y:-T/2},...LY(-x/2,-T/2,-x/2,T/2,p,g,!1),{x:x/2,y:T/2},...LY(x/2,T/2,x/2,-T/2,p,g,!0)],E=Xe.svg(h),v=Je(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let S=Gt(k),w=E.path(S,v),L=h.insert(()=>w,":first-child");return L.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",C),n&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",n),L.attr("transform",`translate(${p/2}, 0)`),Ze(t,L),t.intersect=function(O){return je.polygon(t,k,O)},h}var IY=_(()=>{"use strict";Ct();Lt();_t();At();s(LY,"generateArcPoints");s(xMe,"calculateArcSagitta");s(DY,"bowTieRect")});async function NY(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=Ke(t);t.labelStyle=n;let{shapeSvg:a,bbox:o,label:l}=await it(e,t,st(t)),u=r?.nodeBorder??r?.lineColor??"currentColor",h=t.padding??12,d=Math.max(o.width+h*2,t.width??0,80),f=Math.max(Math.min(d*.08,12),5),p=Math.max(o.height+h*2+f,t.height??0),g=-p/2+f,m=p/2,y=d*.72,x=[`M${-d/2},${g}`,`L${-y/2},${m}`,`A${y/2},${f} 0 0 0 ${y/2},${m}`,`L${d/2},${g}`,`A${d/2},${f} 0 0 0 ${-d/2},${g}`,"Z"].join(" "),{cssStyles:T}=t,C=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let L=Xe.svg(a).path(x,Je(t,{}));C.node()?.appendChild(L),T&&C.attr("style",T)}else C.append("path").attr("d",x).attr("style",i);C.append("ellipse").attr("cx",0).attr("cy",g).attr("rx",d/2).attr("ry",f).attr("style",`fill:none;stroke:${u};stroke-width:1px`),Ze(t,C);let k=g+(m-g)/2;l.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${k-o.height/2-(o.y-(o.top??0))})`);let E=12,v=s((w,L,O)=>Array.from({length:E+1},(F,N)=>{let G=Math.PI-N*Math.PI/E;return{x:w*Math.cos(G),y:L+O*f*Math.sin(G)}}),"arc"),S=[...v(d/2,g,-1),...v(y/2,m,1).reverse()];return t.intersect=function(w){return je.polygon(t,S,w)},a}var PY=_(()=>{"use strict";Ct();Lt();_t();At();s(NY,"bucket")});var Gn,go=_(()=>{"use strict";Gn=s((e,t,r,n,i)=>["M",e+i,t,"H",e+r-i,"A",i,i,0,0,1,e+r,t+i,"V",t+n-i,"A",i,i,0,0,1,e+r-i,t+n,"H",e+i,"A",i,i,0,0,1,e,t+n-i,"V",t+i,"A",i,i,0,0,1,e+i,t,"Z"].join(" "),"createRoundedRectPathD")});async function MY(e,t){let{themeVariables:r}=xe(),n=r.clusterBkg,i=r.clusterBorder,{nodeStyles:a}=Ke(t),{shapeSvg:o,bbox:l}=await it(e,t,st(t)),u=t.padding??8,h=l.height,d=Math.max(l.width+u*2,bMe,t?.width??0),f=Math.max(h+oI+aI+u*2,t?.height??0),p=-d/2,g=-f/2,m=-(oI+aI)/2,y=o.select(".label");y&&(t.useHtmlLabels??vn(xe())?y.attr("transform",`translate(${-l.width/2}, ${-l.height/2+m})`):y.attr("transform",`translate(0, ${-l.height/2+m})`));let x;if(t.look==="handDrawn"){let v=Xe.svg(o),S=Je(t,{fill:n,stroke:i,fillStyle:"solid"}),w=v.path(Gn(p,g,d,f,lI),S);x=o.insert(()=>w,":first-child"),x.attr("class","basic label-container collapsed-group").attr("style",$r(t.cssStyles))}else x=o.insert("rect",":first-child"),x.attr("class","basic label-container collapsed-group").attr("style",a).attr("rx",lI).attr("ry",lI).attr("x",p).attr("y",g).attr("width",d).attr("height",f).attr("fill",n).attr("stroke",i);let T=g+u+h+oI;o.append("line").attr("class","collapsed-separator").attr("x1",p+8).attr("y1",T).attr("x2",p+d-8).attr("y2",T).attr("stroke",i).attr("stroke-dasharray","3, 3");let C=T+aI/2,k=2.5,E=10;for(let v=-1;v<=1;v++)o.append("circle").attr("class","collapsed-indicator").attr("cx",v*E).attr("cy",C).attr("r",k).attr("fill",i);return Ze(t,x),t.calcIntersect=function(v,S){return je.rect(v,S)},t.intersect=function(v){return je.rect(t,v)},o}var aI,oI,bMe,lI,OY=_(()=>{"use strict";Nt();ir();Ct();Lt();go();_t();At();Pt();aI=20,oI=8,bMe=80,lI=8;s(MY,"collapsedGroup")});function Ii(e,t,r,n){return e.insert("polygon",":first-child").attr("points",n.map(function(i){return i.x+","+i.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}var al=_(()=>{"use strict";s(Ii,"insertPolygonShape")});async function BY(e,t){let r=t,{shapeSvg:n,bbox:i}=await it(e,r,st(r)),a=r.padding??0,o=i.height+2*a,l=o/2,u=i.width+2*l+a,h=r.width??0,f=r.positioned&&(r.widthInColumns??1)>1&&h>u?h:u,p=SMe(r.directions??[],i,r,f),g=Ii(n,f,o,p);return g.attr("style",r.style??null),Ze(r,g),r.intersect=function(m){return je.polygon(r,p,m)},n}var TMe,cI,CMe,kMe,$Y,SMe,FY=_(()=>{"use strict";Lt();al();Ct();TMe=["right","left","up","down"],cI="point",CMe=s(e=>{let t=new Set;for(let r of e)switch(r){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(r);break}return t},"expandAndDeduplicateDirections"),kMe=s(e=>TMe.filter(t=>e.has(t)).join("|")||cI,"getDirectionKey"),$Y={"right|left|up|down":s(({height:e,midpoint:t,padding:r,width:n})=>[{x:0,y:0},{x:t,y:0},{x:n/2,y:2*r},{x:n-t,y:0},{x:n,y:0},{x:n,y:-e/3},{x:n+2*r,y:-e/2},{x:n,y:-2*e/3},{x:n,y:-e},{x:n-t,y:-e},{x:n/2,y:-e-2*r},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*r,y:-e/2},{x:0,y:-e/3}],"right|left|up|down"),"right|left|up":s(({height:e,midpoint:t,width:r})=>[{x:t,y:0},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],"right|left|up"),"right|left|down":s(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:t,y:-e},{x:r-t,y:-e},{x:r,y:0}],"right|left|down"),"right|up|down":s(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:r,y:-e+t},{x:0,y:-e}],"right|up|down"),"left|up|down":s(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:r,y:-e}],"left|up|down"),"right|left":s(({height:e,midpoint:t,padding:r,width:n})=>[{x:t,y:0},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:n-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"right|left"),"up|down":s(({height:e,midpoint:t,padding:r,width:n})=>[{x:n/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:n/2,y:-e},{x:n,y:-e+r},{x:n-t,y:-e+r},{x:n-t,y:-r},{x:n,y:-r}],"up|down"),"right|up":s(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:0,y:-e}],"right|up"),"right|down":s(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],"right|down"),"left|up":s(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:r,y:-e}],"left|up"),"left|down":s(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],"left|down"),right:s(({height:e,midpoint:t,padding:r,width:n})=>[{x:t,y:-r},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:n-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e+r}],"right"),left:s(({height:e,midpoint:t,padding:r,width:n})=>[{x:t,y:0},{x:t,y:-r},{x:n-t,y:-r},{x:n-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"left"),up:s(({height:e,midpoint:t,padding:r,width:n})=>[{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:n/2,y:-e},{x:n,y:-e+r},{x:n-t,y:-e+r},{x:n-t,y:-r}],"up"),down:s(({height:e,midpoint:t,padding:r,width:n})=>[{x:n/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:n-t,y:-e+r},{x:n-t,y:-r},{x:n,y:-r}],"down"),[cI]:()=>[{x:0,y:0}]},SMe=s((e,t,r,n)=>{let i=CMe(e),a=(r.padding??0)/2,o=t.height+4*a,l=o/2,u=n??t.width+2*l+2*a,h=kMe(i);return($Y[h]??$Y[cI])({height:o,midpoint:l,padding:a,width:u})},"getArrowPoints");s(BY,"block_arrow")});async function GY(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=Ke(t);t.labelStyle=n;let{shapeSvg:a,bbox:o,label:l}=await it(e,t,st(t)),u=r?.nodeBorder??r?.lineColor??"currentColor",h=t.padding??12,d=18,f=12,p=Math.max(o.width+h*2,t.width??0,90),g=Math.max(o.height+h*2+d,t.height??0),m=-g/2,{cssStyles:y}=t,x=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let k=Xe.svg(a).path(Gn(-p/2,m,p,g,f),Je(t,{}));x.node()?.appendChild(k),y&&x.attr("style",y)}else x.append("rect").attr("x",-p/2).attr("y",m).attr("width",p).attr("height",g).attr("rx",f).attr("ry",f).attr("style",i);x.append("line").attr("x1",-p/2).attr("y1",m+d).attr("x2",p/2).attr("y2",m+d).attr("style",`stroke:${u};stroke-width:1px`);for(let C=0;C<3;C++)x.append("circle").attr("cx",-p/2+12+C*9).attr("cy",m+d/2).attr("r",2.5).attr("style",`fill:${u};stroke:none`);x.append("rect").attr("class","browser-address-bar").attr("x",-p/2+44).attr("y",m+4).attr("width",Math.max(p-56,10)).attr("height",d-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${u};stroke-width:1px;opacity:0.6`),Ze(t,x);let T=m+d+(g-d)/2;return l.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${T-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(C){return je.rect(t,C)},a}var zY=_(()=>{"use strict";Ct();Lt();go();_t();At();s(GY,"browser")});async function VY(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?28:i,o=t.look==="neo"?24:i,{shapeSvg:l,bbox:u}=await it(e,t,st(t)),h=(t?.width??u.width)+(t.look==="neo"?a*2:a+QC),d=(t?.height??u.height)+(t.look==="neo"?o*2:o),f=0,p=h,g=-d,m=0,y=[{x:f+QC,y:g},{x:p,y:g},{x:p,y:m},{x:f,y:m},{x:f,y:g+QC},{x:f+QC,y:g}],x,{cssStyles:T}=t;if(t.look==="handDrawn"){let C=Xe.svg(l),k=Je(t,{}),E=Gt(y),v=C.path(E,k);x=l.insert(()=>v,":first-child").attr("transform",`translate(${-h/2}, ${d/2})`),T&&x.attr("style",T)}else x=Ii(l,h,d,y);return n&&x.attr("style",n),Ze(t,x),t.intersect=function(C){return je.polygon(t,y,C)},l}var QC,WY=_(()=>{"use strict";Ct();Lt();_t();At();al();Ct();QC=12;s(VY,"card")});function qY(e,t){let{nodeStyles:r}=Ke(t);t.label="";let n=e.insert("g").attr("class",st(t)).attr("id",t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],l=Xe.svg(n),u=Je(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let h=Gt(o),d=l.path(h,u),f=n.insert(()=>d,":first-child");return i&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",i),r&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(p){return je.polygon(t,o,p)},n}var jY=_(()=>{"use strict";Lt();At();_t();Ct();s(qY,"choice")});async function ZC(e,t,r){let{labelStyles:n,nodeStyles:i}=Ke(t);t.labelStyle=n;let{shapeSvg:a,bbox:o,halfPadding:l}=await it(e,t,st(t)),u=16,h=r?.padding??l,d=t.look==="neo"?o.width/2+u*2:o.width/2+h,f,{cssStyles:p}=t;if(t.look==="handDrawn"){let g=Xe.svg(a),m=Je(t,{}),y=g.circle(0,0,d*2,m);f=a.insert(()=>y,":first-child"),f.attr("class","basic label-container").attr("style",$r(p))}else f=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",i).attr("r",d).attr("cx",0).attr("cy",0);return Ze(t,f),t.calcIntersect=function(g,m){let y=g.width/2;return je.circle(g,y,m)},t.intersect=function(g){return Y.info("Circle intersect",t,d,g),je.circle(t,d,g)},a}var uI=_(()=>{"use strict";At();ft();Pt();Lt();_t();Ct();s(ZC,"circle")});async function HY(e,t){let r=t,n=["node",r.cssClasses,r.class].filter(Boolean).join(" "),{shapeSvg:i,bbox:a,halfPadding:o}=await it(e,r,n),l=i.insert("rect",":first-child"),u=r.padding??0,h=r.positioned?r.width??0:a.width+u,d=r.positioned?r.height??0:a.height+u,f=r.positioned?-h/2:-a.width/2-o,p=r.positioned?-d/2:-a.height/2-o;return l.attr("class","basic cluster composite label-container").attr("style",r.style??null).attr("rx",r.rx??null).attr("ry",r.ry??null).attr("x",f).attr("y",p).attr("width",h).attr("height",d),Ze(r,l),r.intersect=function(g){return je.rect(r,g)},i}var UY=_(()=>{"use strict";Lt();Ct();s(HY,"composite")});async function YY(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=Ke(t);t.labelStyle=n;let{shapeSvg:a,bbox:o,label:l}=await it(e,t,st(t)),u=r?.nodeBorder??r?.lineColor??"currentColor",h=t.padding??12,d=20,f=12,p=Math.max(o.width+h*2,t.width??0,90),g=Math.max(o.height+h*2+d,t.height??0),m=-g/2,{cssStyles:y}=t,x=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){let k=Xe.svg(a).path(Gn(-p/2,m,p,g,f),Je(t,{}));x.node()?.appendChild(k),y&&x.attr("style",y)}else x.append("rect").attr("x",-p/2).attr("y",m).attr("width",p).attr("height",g).attr("rx",f).attr("ry",f).attr("style",i);x.append("text").attr("x",-p/2+12).attr("y",m+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${u}`).text(">_"),Ze(t,x);let T=m+d+(g-d)/2;return l.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${T-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(C){return je.rect(t,C)},a}var KY=_(()=>{"use strict";Ct();Lt();go();_t();At();s(YY,"consoleWindow")});function vMe(e){let t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=e*2,i={x:n/2*t,y:n/2*r},a={x:-(n/2)*t,y:n/2*r},o={x:-(n/2)*t,y:-(n/2)*r},l={x:n/2*t,y:-(n/2)*r};return`M ${a.x},${a.y} L ${l.x},${l.y}
203
203
  M ${i.x},${i.y} L ${o.x},${o.y}`}function XY(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r,t.label="";let i=e.insert("g").attr("class",st(t)).attr("id",t.domId??t.id),a=Math.max(30,t?.width??0),{cssStyles:o}=t,l=Xe.svg(i),u=Je(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");let h=l.circle(0,0,a*2,u),d=vMe(a),f=l.path(d,u),p=i.insert(()=>h,":first-child");return p.insert(()=>f),p.attr("class","outer-path"),o&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",o),n&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",n),Ze(t,p),t.intersect=function(g){return Y.info("crossedCircle intersect",t,{radius:a,point:g}),je.circle(t,a,g)},i}var QY=_(()=>{"use strict";ft();Ct();_t();At();Lt();s(vMe,"createLine");s(XY,"crossedCircle")});function Lu(e,t,r,n=100,i=0,a=180){let o=[],l=i*Math.PI/180,d=(a*Math.PI/180-l)/(n-1);for(let f=0;f<n;f++){let p=l+f*d,g=e+r*Math.cos(p),m=t+r*Math.sin(p);o.push({x:-g,y:-m})}return o}async function ZY(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,label:o}=await it(e,t,st(t)),l=t.look==="neo"?18:t.padding??0,u=t.look==="neo"?12:t.padding??0,h=a.width+l,d=a.height+u,f=Math.max(5,d*.1),{cssStyles:p}=t,g=[...Lu(h/2,-d/2,f,30,-90,0),{x:-h/2-f,y:f},...Lu(h/2+f*2,-f,f,20,-180,-270),...Lu(h/2+f*2,f,f,20,-90,-180),{x:-h/2-f,y:-d/2},...Lu(h/2,d/2,f,20,0,90)],m=[{x:h/2,y:-d/2-f},{x:-h/2,y:-d/2-f},...Lu(h/2,-d/2,f,20,-90,0),{x:-h/2-f,y:-f},...Lu(h/2+h*.1,-f,f,20,-180,-270),...Lu(h/2+h*.1,f,f,20,-90,-180),{x:-h/2-f,y:d/2},...Lu(h/2,d/2,f,20,0,90),{x:-h/2,y:d/2+f},{x:h/2,y:d/2+f}],y=Xe.svg(i),x=Je(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let C=Gt(g).replace("Z",""),k=y.path(C,x),E=Gt(m),v=y.path(E,{...x}),S=i.insert("g",":first-child");return S.insert(()=>v,":first-child").attr("stroke-opacity",0),S.insert(()=>k,":first-child"),S.attr("class","text"),p&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${f}, 0)`),o.attr("transform",`translate(${-h/2+f-(a.x-(a.left??0))},${-d/2+(t.padding??0)/2-(a.y-(a.top??0))})`),Ze(t,S),t.intersect=function(w){return je.polygon(t,m,w)},i}var JY=_(()=>{"use strict";Ct();Lt();_t();At();s(Lu,"generateCirclePoints");s(ZY,"curlyBraceLeft")});function Du(e,t,r,n=100,i=0,a=180){let o=[],l=i*Math.PI/180,d=(a*Math.PI/180-l)/(n-1);for(let f=0;f<n;f++){let p=l+f*d,g=e+r*Math.cos(p),m=t+r*Math.sin(p);o.push({x:g,y:m})}return o}async function eK(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,label:o}=await it(e,t,st(t)),l=t.look==="neo"?18:t.padding??0,u=t.look==="neo"?12:t.padding??0,h=a.width+(t.look==="neo"?l*2:l),d=a.height+(t.look==="neo"?u*2:u),f=Math.max(5,d*.1),{cssStyles:p}=t,g=[...Du(h/2,-d/2,f,20,-90,0),{x:h/2+f,y:-f},...Du(h/2+f*2,-f,f,20,-180,-270),...Du(h/2+f*2,f,f,20,-90,-180),{x:h/2+f,y:d/2},...Du(h/2,d/2,f,20,0,90)],m=[{x:-h/2,y:-d/2-f},{x:h/2,y:-d/2-f},...Du(h/2,-d/2,f,20,-90,0),{x:h/2+f,y:-f},...Du(h/2+f*2,-f,f,20,-180,-270),...Du(h/2+f*2,f,f,20,-90,-180),{x:h/2+f,y:d/2},...Du(h/2,d/2,f,20,0,90),{x:h/2,y:d/2+f},{x:-h/2,y:d/2+f}],y=Xe.svg(i),x=Je(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let C=Gt(g).replace("Z",""),k=y.path(C,x),E=Gt(m),v=y.path(E,{...x}),S=i.insert("g",":first-child");return S.insert(()=>v,":first-child").attr("stroke-opacity",0),S.insert(()=>k,":first-child"),S.attr("class","text"),p&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",n),S.attr("transform",`translate(${-f}, 0)`),o.attr("transform",`translate(${-h/2+(t.padding??0)/2-(a.x-(a.left??0))},${-d/2+(t.padding??0)/2-(a.y-(a.top??0))})`),Ze(t,S),t.intersect=function(w){return je.polygon(t,m,w)},i}var tK=_(()=>{"use strict";Ct();Lt();_t();At();s(Du,"generateCirclePoints");s(eK,"curlyBraceRight")});function rs(e,t,r,n=100,i=0,a=180){let o=[],l=i*Math.PI/180,d=(a*Math.PI/180-l)/(n-1);for(let f=0;f<n;f++){let p=l+f*d,g=e+r*Math.cos(p),m=t+r*Math.sin(p);o.push({x:-g,y:-m})}return o}async function rK(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,label:o}=await it(e,t,st(t)),l=t.look==="neo"?18:t.padding??0,u=t.look==="neo"?12:t.padding??0,h=a.width+(t.look==="neo"?l*2:l),d=a.height+(t.look==="neo"?u*2:u),f=Math.max(5,d*.1),{cssStyles:p}=t,g=[...rs(h/2,-d/2,f,30,-90,0),{x:-h/2-f,y:f},...rs(h/2+f*2,-f,f,20,-180,-270),...rs(h/2+f*2,f,f,20,-90,-180),{x:-h/2-f,y:-d/2},...rs(h/2,d/2,f,20,0,90)],m=[...rs(-h/2+f+f/2,-d/2,f,20,-90,-180),{x:h/2-f/2,y:f},...rs(-h/2-f/2,-f,f,20,0,90),...rs(-h/2-f/2,f,f,20,-90,0),{x:h/2-f/2,y:-f},...rs(-h/2+f+f/2,d/2,f,30,-180,-270)],y=[{x:h/2,y:-d/2-f},{x:-h/2,y:-d/2-f},...rs(h/2,-d/2,f,20,-90,0),{x:-h/2-f,y:-f},...rs(h/2+f*2,-f,f,20,-180,-270),...rs(h/2+f*2,f,f,20,-90,-180),{x:-h/2-f,y:d/2},...rs(h/2,d/2,f,20,0,90),{x:-h/2,y:d/2+f},{x:h/2-f-f/2,y:d/2+f},...rs(-h/2+f+f/2,-d/2,f,20,-90,-180),{x:h/2-f/2,y:f},...rs(-h/2-f/2,-f,f,20,0,90),...rs(-h/2-f/2,f,f,20,-90,0),{x:h/2-f/2,y:-f},...rs(-h/2+f+f/2,d/2,f,30,-180,-270)],x=Xe.svg(i),T=Je(t,{fill:"none"});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let k=Gt(g).replace("Z",""),E=x.path(k,T),S=Gt(m).replace("Z",""),w=x.path(S,T),L=Gt(y),O=x.path(L,{...T}),F=i.insert("g",":first-child");return F.insert(()=>O,":first-child").attr("stroke-opacity",0),F.insert(()=>E,":first-child"),F.insert(()=>w,":first-child"),F.attr("class","text"),p&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",p),n&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",n),F.attr("transform",`translate(${f-f/4}, 0)`),o.attr("transform",`translate(${-h/2+(t.padding??0)/2-(a.x-(a.left??0))},${-d/2+(t.padding??0)/2-(a.y-(a.top??0))})`),Ze(t,F),t.intersect=function(N){return je.polygon(t,y,N)},i}var nK=_(()=>{"use strict";Ct();Lt();_t();At();s(rs,"generateCirclePoints");s(rK,"curlyBraces")});async function iK(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i,l=20,u=5,{shapeSvg:h,bbox:d}=await it(e,t,st(t)),f=Math.max(l,(d.width+a*2)*1.25,t?.width??0),p=Math.max(u,d.height+o*2,t?.height??0),g=p/2,{cssStyles:m}=t,y=Xe.svg(h),x=Je(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let T=f,C=p,k=T-g,E=C/4,v=[{x:k,y:0},{x:E,y:0},{x:0,y:C/2},{x:E,y:C},{x:k,y:C},...ha(-k,-C/2,g,50,270,90)],S=Gt(v),w=y.path(S,x),L=h.insert(()=>w,":first-child");return L.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&L.selectChildren("path").attr("style",m),n&&t.look!=="handDrawn"&&L.selectChildren("path").attr("style",n),L.attr("transform",`translate(${-f/2}, ${-p/2})`),Ze(t,L),t.intersect=function(O){return je.polygon(t,v,O)},h}var sK=_(()=>{"use strict";Ct();Lt();_t();At();s(iK,"curvedTrapezoid")});async function aK(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,label:o}=await it(e,t,st(t)),l=t.padding??20,u=Math.max(a.width+l*2,t.width??0,100),h=Math.min(Math.max(u*.23,16),56),d=h*.27,f=Math.max(a.height+l*2,t.height?t.height-(2*h-d):0),p=Math.min(u*.177,f*.45),g=f+2*h-d,m=-g/2,y=m+2*h-d,x=i.insert("g",":first-child").attr("class","basic label-container"),{cssStyles:T}=t;if(t.look==="handDrawn"){let L=Xe.svg(i),O=Je(t,{}),F=L.path(Gn(-u/2,y,u,f,p),O),N=L.circle(0,m+h,h*2,O);x.insert(()=>N,":first-child"),x.insert(()=>F,":first-child"),T&&x.attr("style",T)}else x.append("rect").attr("x",-u/2).attr("y",y).attr("width",u).attr("height",f).attr("rx",p).attr("ry",p).attr("style",n),x.append("circle").attr("cx",0).attr("cy",m+h).attr("r",h).attr("style",n);Ze(t,x);let C=y+f/2;o.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${C-a.height/2-(a.y-(a.top??0))})`);let k=m+h,E=Math.asin(Math.min(1,(y-k)/h))*180/Math.PI,w=[...ha(0,-k,h,24,180+E,-E),...ha(-(-u/2+p),-(y+p),p,12,90,0),...ha(-(-u/2+p),-(g/2-p),p,12,360,270),...ha(-(u/2-p),-(g/2-p),p,12,270,180),...ha(-(u/2-p),-(y+p),p,12,180,90)];return t.intersect=function(L){return je.polygon(t,w,L)},i}var oK=_(()=>{"use strict";Ct();Lt();_t();At();go();s(aK,"person")});async function uK(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?24:i,o=t.look==="neo"?24:i,l=t.width??0;if(t.width&&(t.width=t.width-o,t.width<cK&&(t.width=cK)),t.height){let C=l/2/(2.5+l/50);t.height=t.height-a-C*3,t.height<lK&&(t.height=lK)}let{shapeSvg:u,bbox:h,label:d}=await it(e,t,st(t)),f=Math.max(t.width??0,h.width)+o,p=f/2,g=p/(2.5+f/50),m=Math.max(t.height??0,h.height)+a+g,y,{cssStyles:x}=t;if(t.look==="handDrawn"){let T=Xe.svg(u),C=wMe(0,0,f,m,p,g),k=_Me(0,g,f,m,p,g),E=Je(t,{}),v=T.path(C,E),S=T.path(k,Je(t,{fill:"none"}));y=u.insert(()=>S,":first-child"),y=u.insert(()=>v,":first-child"),y.attr("class","basic label-container"),x&&y.attr("style",x)}else{let T=EMe(0,0,f,m,p,g);y=u.insert("path",":first-child").attr("d",T).attr("class","basic label-container outer-path").attr("style",$r(x)).attr("style",n)}return y.attr("label-offset-y",g),y.attr("transform",`translate(${-f/2}, ${-(m/2+g)})`),Ze(t,y),d.attr("transform",`translate(${-(h.width/2)-(h.x-(h.left??0))}, ${-(h.height/2)+(t.padding??0)/1.5-(h.y-(h.top??0))})`),t.intersect=function(T){let C=je.rect(t,T),k=C.x-(t.x??0);if(p!=0&&(Math.abs(k)<(t.width??0)/2||Math.abs(k)==(t.width??0)/2&&Math.abs(C.y-(t.y??0))>(t.height??0)/2-g)){let E=g*g*(1-k*k/(p*p));E>0&&(E=Math.sqrt(E)),E=g-E,T.y-(t.y??0)>0&&(E=-E),C.y+=E}return C},u}var EMe,wMe,_Me,lK,cK,hK=_(()=>{"use strict";Ct();Lt();_t();At();Pt();EMe=s((e,t,r,n,i,a)=>[`M${e},${t+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"),wMe=s((e,t,r,n,i,a)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),_Me=s((e,t,r,n,i,a)=>[`M${e-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),lK=8,cK=8;s(uK,"cylinder")});async function yo(e,t,r){let{labelStyles:n,nodeStyles:i}=Ke(t);t.labelStyle=n;let{shapeSvg:a,bbox:o}=await it(e,t,st(t)),l=Math.max(o.width+r.labelPaddingX*2,t?.width||0),u=Math.max(o.height+r.labelPaddingY*2,t?.height||0),h=-l/2,d=-u/2,f,{rx:p,ry:g}=t,{cssStyles:m}=t;if(r?.rx&&r.ry&&(p=r.rx,g=r.ry),t.look==="handDrawn"){let y=Xe.svg(a),x=Je(t,{}),T=p||g?y.path(Gn(h,d,l,u,p||0),x):y.rectangle(h,d,l,u,x);f=a.insert(()=>T,":first-child"),f.attr("class","basic label-container").attr("style",$r(m))}else f=a.insert("rect",":first-child"),f.attr("class","basic label-container").attr("style",i).attr("rx",$r(p)).attr("ry",$r(g)).attr("x",h).attr("y",d).attr("width",l).attr("height",u);return Ze(t,f,t.look==="handDrawn"?void 0:{width:l,height:u}),t.calcIntersect=function(y,x){return je.rect(y,x)},t.intersect=function(y){return je.rect(t,y)},a}var Rd=_(()=>{"use strict";Ct();Lt();go();_t();At();Pt();s(yo,"drawRect")});async function dK(e,t){let{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:o,height:l}=t,u={rx:0,ry:0,classes:r??"",labelPaddingX:n??(a??0)*2,labelPaddingY:i??a??0},h=await yo(e,t,u);if(t.look==="handDrawn"){let g=Xe.svg(h),m=Je(t,{}),y=h.select(".basic.label-container > path:nth-child(2)"),x=y.node();if(!x)return h;let T=null;if(x instanceof SVGGraphicsElement)T=x.getBBox();else return h;return h.insert(()=>g.line(T.x,T.y,T.x+T.width,T.y,m),".basic.label-container g.label"),h.insert(()=>g.line(T.x,T.y+T.height,T.x+T.width,T.y+T.height,m),".basic.label-container g.label"),y.remove(),h}let d=h.select(".basic.label-container"),f=(Number(d.attr("width"))||o)??0,p=(Number(d.attr("height"))||l)??0;return f>0&&p>0&&d.attr("stroke-dasharray",`${f} ${p}`),h}var fK=_(()=>{"use strict";Rd();_t();At();s(dK,"datastore")});async function pK(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?16:t.padding??0,{shapeSvg:o,bbox:l,label:u}=await it(e,t,st(t)),h=l.width+i,d=l.height+a,f=d*.2,p=-h/2,g=-d/2-f/2,{cssStyles:m}=t,y=Xe.svg(o),x=Je(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let T=[{x:p,y:g+f},{x:-p,y:g+f},{x:-p,y:-g},{x:p,y:-g},{x:p,y:g},{x:-p,y:g},{x:-p,y:g+f}],C=y.polygon(T.map(E=>[E.x,E.y]),x),k=o.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",n),u.attr("transform",`translate(${p+(t.padding??0)/2-(l.x-(l.left??0))}, ${g+f+(t.padding??0)/2-(l.y-(l.top??0))})`),Ze(t,k),t.intersect=function(E){return je.rect(t,E)},o}var mK=_(()=>{"use strict";Ct();Lt();_t();At();s(pK,"dividedRectangle")});async function gK(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t),i=t.look==="neo"?12:5;t.labelStyle=r;let a=t.padding??0,o=t.look==="neo"?16:a,{shapeSvg:l,bbox:u}=await it(e,t,st(t)),h=(t?.width?t?.width/2:u.width/2)+(o??0),d=h-i,f,{cssStyles:p}=t;if(t.look==="handDrawn"){let g=Xe.svg(l),m=Je(t,{roughness:.2,strokeWidth:2.5}),y=Je(t,{roughness:.2,strokeWidth:1.5}),x=g.circle(0,0,h*2,m),T=g.circle(0,0,d*2,y);f=l.insert("g",":first-child"),f.attr("class",$r(t.cssClasses)).attr("style",$r(p)),f.node()?.appendChild(x),f.node()?.appendChild(T)}else{f=l.insert("g",":first-child");let g=f.insert("circle",":first-child"),m=f.insert("circle");f.attr("class","basic label-container").attr("style",n),g.attr("class","outer-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0),m.attr("class","inner-circle").attr("style",n).attr("r",d).attr("cx",0).attr("cy",0)}return Ze(t,f),t.intersect=function(g){return Y.info("DoubleCircle intersect",t,h,g),je.circle(t,h,g)},l}var yK=_(()=>{"use strict";ft();Ct();Lt();_t();At();Pt();s(gK,"doublecircle")});function xK(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=Ke(t);t.label="",t.labelStyle=n;let a=e.insert("g").attr("class",st(t)).attr("id",t.domId??t.id),o=7,{cssStyles:l}=t,u=Xe.svg(a),{nodeBorder:h}=r,d=Je(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(d.roughness=0);let f=u.circle(0,0,o*2,d),p=a.insert(()=>f,":first-child");return p.selectAll("path").attr("style",`fill: ${h} !important;`),l&&l.length>0&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",l),i&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",i),Ze(t,p),t.intersect=function(g){return Y.info("filledCircle intersect",t,{radius:o,point:g}),je.circle(t,o,g)},a}var bK=_(()=>{"use strict";At();ft();Lt();_t();Ct();s(xK,"filledCircle")});async function kK(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?i*2:i;(t.width||t.height)&&(t.height=t?.height??0,t.height<TK&&(t.height=TK),t.width=(t?.width??0)-a-a/2,t.width<CK&&(t.width=CK));let{shapeSvg:o,bbox:l,label:u}=await it(e,t,st(t)),h=(t?.width?t?.width:l.width)+(a??0),d=t?.height?t?.height:h+l.height,f=d,p=[{x:0,y:-d},{x:f,y:-d},{x:f/2,y:0}],{cssStyles:g}=t,m=Xe.svg(o),y=Je(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let x=Gt(p),T=m.path(x,y),C=o.insert(()=>T,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",g),n&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",n),t.width=h,t.height=d,Ze(t,C),u.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))}, ${-d/2+(t.padding??0)/2+(l.y-(l.top??0))})`),t.intersect=function(k){return Y.info("Triangle intersect",t,p,k),je.polygon(t,p,k)},o}var TK,CK,SK=_(()=>{"use strict";ft();Ct();Lt();_t();At();Ct();TK=10,CK=10;s(kK,"flippedTriangle")});async function vK(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,label:o}=await it(e,t,st(t)),l=t.padding??12,u=Math.max(a.width+l*2,t.width??0,90),h=a.height+l*2,d=Math.max(Math.min(h*.16,14),8),f=Math.max(h+d,t.height??0),p=f-d,g=Math.max(u*.38,28),m=-f/2,y=[{x:-u/2,y:m},{x:-u/2+g,y:m},{x:-u/2+g,y:m+d},{x:u/2,y:m+d},{x:u/2,y:f/2},{x:-u/2,y:f/2}],x=[`M${y[0].x},${y[0].y}`,...y.slice(1).map(E=>`L${E.x},${E.y}`),"Z"].join(" "),{cssStyles:T}=t,C;if(t.look==="handDrawn"){let v=Xe.svg(i).path(x,Je(t,{}));C=i.insert(()=>v,":first-child").attr("class","basic label-container"),T&&C.attr("style",T)}else C=i.insert("path",":first-child").attr("d",x).attr("class","basic label-container").attr("style",n);t.look==="handDrawn"?Ze(t,C):Ze(t,C,{width:u,height:f});let k=m+d+p/2;return o.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${k-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(E){return je.polygon(t,y,E)},i}var EK=_(()=>{"use strict";Ct();Lt();_t();At();s(vK,"folder")});function wK(e,t,{dir:r,config:{state:n,themeVariables:i}}){let{nodeStyles:a}=Ke(t);t.label="";let o=e.insert("g").attr("class",st(t)).attr("id",t.domId??t.id),{cssStyles:l}=t,u=Math.max(70,t?.width??0),h=Math.max(10,t?.height??0);r==="LR"&&(u=Math.max(10,t?.width??0),h=Math.max(70,t?.height??0));let d=-1*u/2,f=-1*h/2,p=Xe.svg(o),g=Je(t,{stroke:i.lineColor,fill:i.lineColor});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");let m=p.rectangle(d,f,u,h,g),y=o.insert(()=>m,":first-child");l&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",l),a&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",a),Ze(t,y);let x=n?.padding??0;return t.width&&t.height&&(t.width+=x/2||0,t.height+=x/2||0),t.intersect=function(T){return je.rect(t,T)},o}var _K=_(()=>{"use strict";At();Lt();_t();Ct();s(wK,"forkJoin")});async function AK(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=15,a=10,o=t.look==="neo"?16:t.padding??0,l=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-l*2,t.height<a&&(t.height=a),t.width=(t?.width??0)-o*2,t.width<i&&(t.width=i));let{shapeSvg:u,bbox:h}=await it(e,t,st(t)),d=(t?.width?t?.width:Math.max(i,h.width))+o*2,f=(t?.height?t?.height:Math.max(a,h.height))+l*2,p=f/2,{cssStyles:g}=t,m=Xe.svg(u),y=Je(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let x=[{x:-d/2,y:-f/2},{x:d/2-p,y:-f/2},...ha(-d/2+p,0,p,50,90,270),{x:d/2-p,y:f/2},{x:-d/2,y:f/2}],T=Gt(x),C=m.path(T,y),k=u.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",g),n&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",n),Ze(t,k),t.intersect=function(E){return Y.info("Pill intersect",t,{radius:p,point:E}),je.polygon(t,x,E)},u}var RK=_(()=>{"use strict";ft();Ct();Lt();_t();At();s(AK,"halfRoundedRectangle")});async function LK(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t),i=t.look==="neo"?3.5:4;t.labelStyle=r;let a=t.padding??0,o=70,l=32,u=t.look==="neo"?o:a,h=t.look==="neo"?l:a;if(t.width||t.height){let k=(t.height??0)/i;t.width=(t?.width??0)-2*k-h,t.height=(t.height??0)-u}let{shapeSvg:d,bbox:f}=await it(e,t,st(t)),p=(t?.height?t?.height:f.height)+u,g=p/i,m=(t?.width?t?.width:f.width)+2*g+h,y=[{x:g,y:0},{x:m-g,y:0},{x:m,y:-p/2},{x:m-g,y:-p},{x:g,y:-p},{x:0,y:-p/2}],x,{cssStyles:T}=t;if(t.look==="handDrawn"){let C=Xe.svg(d),k=Je(t,{}),E=AMe(0,0,m,p,g),v=C.path(E,k);x=d.insert(()=>v,":first-child").attr("transform",`translate(${-m/2}, ${p/2})`),T&&x.attr("style",T)}else x=Ii(d,m,p,y);return n&&x.attr("style",n),t.width=m,t.height=p,Ze(t,x),t.intersect=function(C){return je.polygon(t,y,C)},d}var AMe,DK=_(()=>{"use strict";Ct();Lt();_t();At();al();AMe=s((e,t,r,n,i)=>[`M${e+i},${t}`,`L${e+r-i},${t}`,`L${e+r},${t-n/2}`,`L${e+r-i},${t-n}`,`L${e+i},${t-n}`,`L${e},${t-n/2}`,"Z"].join(" "),"createHexagonPathD");s(LK,"hexagon")});async function IK(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.label="",t.labelStyle=r;let{shapeSvg:i}=await it(e,t,st(t)),a=Math.max(30,t?.width??0),o=Math.max(30,t?.height??0),{cssStyles:l}=t,u=Xe.svg(i),h=Je(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let d=[{x:0,y:0},{x:a,y:0},{x:0,y:o},{x:a,y:o}],f=Gt(d),p=u.path(f,h),g=i.insert(()=>p,":first-child");return g.attr("class","basic label-container outer-path"),l&&t.look!=="handDrawn"&&g.selectChildren("path").attr("style",l),n&&t.look!=="handDrawn"&&g.selectChildren("path").attr("style",n),g.attr("transform",`translate(${-a/2}, ${-o/2})`),Ze(t,g),t.intersect=function(m){return Y.info("Pill intersect",t,{points:d}),je.polygon(t,d,m)},i}var NK=_(()=>{"use strict";ft();Ct();Lt();_t();At();s(IK,"hourglass")});async function PK(e,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=Ke(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,l=Math.max(a,o),u=n?.wrappingWidth;t.width=Math.max(l,u??0);let{shapeSvg:h,bbox:d,label:f}=await it(e,t,"icon-shape default"),p=t.pos==="t",g=l,m=l,{nodeBorder:y}=r,{stylesMap:x}=sl(t),T=-m/2,C=-g/2,k=t.label?8:0,E=Xe.svg(h),v=Je(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");let S=E.rectangle(T,C,m,g,v),w=Math.max(m,d.width),L=g+d.height+k,O=E.rectangle(-w/2,-L/2,w,L,{...v,fill:"transparent",stroke:"none"}),F=h.insert(()=>S,":first-child"),N=h.insert(()=>O);if(t.icon){let G=h.append("g");G.html(`<g>${await Ia(t.icon,{height:l,width:l,fallbackPrefix:""})}</g>`);let A=G.node().getBBox(),M=A.width,I=A.height,P=A.x,B=A.y;G.attr("transform",`translate(${-M/2-P},${p?d.height/2+k/2-I/2-B:-d.height/2-k/2-I/2-B})`),G.attr("style",`color: ${x.get("stroke")??y};`)}return f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${p?-L/2:L/2-d.height})`),F.attr("transform",`translate(0,${p?d.height/2+k/2:-d.height/2-k/2})`),Ze(t,N),t.intersect=function(G){if(Y.info("iconSquare intersect",t,G),!t.label)return je.rect(t,G);let A=t.x??0,M=t.y??0,I=t.height??0,P=[];return p?P=[{x:A-d.width/2,y:M-I/2},{x:A+d.width/2,y:M-I/2},{x:A+d.width/2,y:M-I/2+d.height+k},{x:A+m/2,y:M-I/2+d.height+k},{x:A+m/2,y:M+I/2},{x:A-m/2,y:M+I/2},{x:A-m/2,y:M-I/2+d.height+k},{x:A-d.width/2,y:M-I/2+d.height+k}]:P=[{x:A-m/2,y:M-I/2},{x:A+m/2,y:M-I/2},{x:A+m/2,y:M-I/2+g},{x:A+d.width/2,y:M-I/2+g},{x:A+d.width/2/2,y:M+I/2},{x:A-d.width/2,y:M+I/2},{x:A-d.width/2,y:M-I/2+g},{x:A-m/2,y:M-I/2+g}],je.polygon(t,P,G)},h}var MK=_(()=>{"use strict";At();ft();cu();Lt();_t();Ct();s(PK,"icon")});async function OK(e,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=Ke(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,l=Math.max(a,o),u=n?.wrappingWidth;t.width=Math.max(l,u??0);let{shapeSvg:h,bbox:d,label:f}=await it(e,t,"icon-shape default"),p=20,g=t.label?8:0,m=t.pos==="t",{nodeBorder:y,mainBkg:x}=r,{stylesMap:T}=sl(t),C=Xe.svg(h),k=Je(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let E=T.get("fill");k.stroke=E??x;let v=h.append("g");t.icon&&v.html(`<g>${await Ia(t.icon,{height:l,width:l,fallbackPrefix:""})}</g>`);let S=v.node().getBBox(),w=S.width,L=S.height,O=S.x,F=S.y,N=Math.max(w,L)*Math.SQRT2+p*2,G=C.circle(0,0,N,k),A=Math.max(N,d.width),M=N+d.height+g,I=C.rectangle(-A/2,-M/2,A,M,{...k,fill:"transparent",stroke:"none"}),P=h.insert(()=>G,":first-child"),B=h.insert(()=>I);return v.attr("transform",`translate(${-w/2-O},${m?d.height/2+g/2-L/2-F:-d.height/2-g/2-L/2-F})`),v.attr("style",`color: ${T.get("stroke")??y};`),f.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${m?-M/2:M/2-d.height})`),P.attr("transform",`translate(0,${m?d.height/2+g/2:-d.height/2-g/2})`),Ze(t,B),t.intersect=function(D){return Y.info("iconSquare intersect",t,D),je.rect(t,D)},h}var $K=_(()=>{"use strict";At();ft();cu();Lt();_t();Ct();s(OK,"iconCircle")});async function BK(e,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=Ke(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,l=Math.max(a,o),u=n?.wrappingWidth;t.width=Math.max(l,u??0);let{shapeSvg:h,bbox:d,halfPadding:f,label:p}=await it(e,t,"icon-shape default"),g=t.pos==="t",m=l+f*2,y=l+f*2,{nodeBorder:x,mainBkg:T}=r,{stylesMap:C}=sl(t),k=-y/2,E=-m/2,v=t.label?8:0,S=Xe.svg(h),w=Je(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let L=C.get("fill");w.stroke=L??T;let O=S.path(Gn(k,E,y,m,5),w),F=Math.max(y,d.width),N=m+d.height+v,G=S.rectangle(-F/2,-N/2,F,N,{...w,fill:"transparent",stroke:"none"}),A=h.insert(()=>O,":first-child").attr("class","icon-shape2"),M=h.insert(()=>G);if(t.icon){let I=h.append("g");I.html(`<g>${await Ia(t.icon,{height:l,width:l,fallbackPrefix:""})}</g>`);let P=I.node().getBBox(),B=P.width,D=P.height,$=P.x,W=P.y;I.attr("transform",`translate(${-B/2-$},${g?d.height/2+v/2-D/2-W:-d.height/2-v/2-D/2-W})`),I.attr("style",`color: ${C.get("stroke")??x};`)}return p.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${g?-N/2:N/2-d.height})`),A.attr("transform",`translate(0,${g?d.height/2+v/2:-d.height/2-v/2})`),Ze(t,M),t.intersect=function(I){if(Y.info("iconSquare intersect",t,I),!t.label)return je.rect(t,I);let P=t.x??0,B=t.y??0,D=t.height??0,$=[];return g?$=[{x:P-d.width/2,y:B-D/2},{x:P+d.width/2,y:B-D/2},{x:P+d.width/2,y:B-D/2+d.height+v},{x:P+y/2,y:B-D/2+d.height+v},{x:P+y/2,y:B+D/2},{x:P-y/2,y:B+D/2},{x:P-y/2,y:B-D/2+d.height+v},{x:P-d.width/2,y:B-D/2+d.height+v}]:$=[{x:P-y/2,y:B-D/2},{x:P+y/2,y:B-D/2},{x:P+y/2,y:B-D/2+m},{x:P+d.width/2,y:B-D/2+m},{x:P+d.width/2/2,y:B+D/2},{x:P-d.width/2,y:B+D/2},{x:P-d.width/2,y:B-D/2+m},{x:P-y/2,y:B-D/2+m}],je.polygon(t,$,I)},h}var FK=_(()=>{"use strict";At();ft();cu();Lt();_t();go();Ct();s(BK,"iconRounded")});async function GK(e,t,{config:{themeVariables:r,flowchart:n}}){let{labelStyles:i}=Ke(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,l=Math.max(a,o),u=n?.wrappingWidth;t.width=Math.max(l,u??0);let{shapeSvg:h,bbox:d,halfPadding:f,label:p}=await it(e,t,"icon-shape default"),g=t.pos==="t",m=l+f*2,y=l+f*2,{nodeBorder:x,mainBkg:T}=r,{stylesMap:C}=sl(t),k=-y/2,E=-m/2,v=t.label?8:0,S=Xe.svg(h),w=Je(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");let L=C.get("fill");w.stroke=L??T;let O=S.path(Gn(k,E,y,m,.1),w),F=Math.max(y,d.width),N=m+d.height+v,G=S.rectangle(-F/2,-N/2,F,N,{...w,fill:"transparent",stroke:"none"}),A=h.insert(()=>O,":first-child"),M=h.insert(()=>G);if(t.icon){let I=h.append("g");I.html(`<g>${await Ia(t.icon,{height:l,width:l,fallbackPrefix:""})}</g>`);let P=I.node().getBBox(),B=P.width,D=P.height,$=P.x,W=P.y;I.attr("transform",`translate(${-B/2-$},${g?d.height/2+v/2-D/2-W:-d.height/2-v/2-D/2-W})`),I.attr("style",`color: ${C.get("stroke")??x};`)}return p.attr("transform",`translate(${-d.width/2-(d.x-(d.left??0))},${g?-N/2:N/2-d.height})`),A.attr("transform",`translate(0,${g?d.height/2+v/2:-d.height/2-v/2})`),Ze(t,M),t.intersect=function(I){if(Y.info("iconSquare intersect",t,I),!t.label)return je.rect(t,I);let P=t.x??0,B=t.y??0,D=t.height??0,$=[];return g?$=[{x:P-d.width/2,y:B-D/2},{x:P+d.width/2,y:B-D/2},{x:P+d.width/2,y:B-D/2+d.height+v},{x:P+y/2,y:B-D/2+d.height+v},{x:P+y/2,y:B+D/2},{x:P-y/2,y:B+D/2},{x:P-y/2,y:B-D/2+d.height+v},{x:P-d.width/2,y:B-D/2+d.height+v}]:$=[{x:P-y/2,y:B-D/2},{x:P+y/2,y:B-D/2},{x:P+y/2,y:B-D/2+m},{x:P+d.width/2,y:B-D/2+m},{x:P+d.width/2/2,y:B+D/2},{x:P-d.width/2,y:B+D/2},{x:P-d.width/2,y:B-D/2+m},{x:P-y/2,y:B-D/2+m}],je.polygon(t,$,I)},h}var zK=_(()=>{"use strict";At();ft();cu();Lt();go();_t();Ct();s(GK,"iconSquare")});async function VK(e,t,{config:{flowchart:r}}){let n=new Image;n.src=t?.img??"",await n.decode();let i=Number(n.naturalWidth.toString().replace("px","")),a=Number(n.naturalHeight.toString().replace("px",""));t.imageAspectRatio=i/a;let{labelStyles:o}=Ke(t);t.labelStyle=o;let l=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;let u=Math.max(t.label?l??0:0,t?.assetWidth??i),h=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:u,d=t.constraint==="on"?h/t.imageAspectRatio:t?.assetHeight??a;t.width=Math.max(h,l??0);let{shapeSvg:f,bbox:p,label:g}=await it(e,t,"image-shape default"),m=t.pos==="t",y=-h/2,x=-d/2,T=t.label?8:0,C=Xe.svg(f),k=Je(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let E=C.rectangle(y,x,h,d,k),v=Math.max(h,p.width),S=d+p.height+T,w=C.rectangle(-v/2,-S/2,v,S,{...k,fill:"none",stroke:"none"}),L=f.insert(()=>E,":first-child"),O=f.insert(()=>w);if(t.img){let F=f.append("image");F.attr("href",t.img),F.attr("width",h),F.attr("height",d),F.attr("preserveAspectRatio","none"),F.attr("transform",`translate(${-h/2},${m?S/2-d:-S/2})`)}return g.attr("transform",`translate(${-p.width/2-(p.x-(p.left??0))},${m?-d/2-p.height/2-T/2:d/2-p.height/2+T/2})`),L.attr("transform",`translate(0,${m?p.height/2+T/2:-p.height/2-T/2})`),Ze(t,O),t.intersect=function(F){if(Y.info("iconSquare intersect",t,F),!t.label)return je.rect(t,F);let N=t.x??0,G=t.y??0,A=t.height??0,M=[];return m?M=[{x:N-p.width/2,y:G-A/2},{x:N+p.width/2,y:G-A/2},{x:N+p.width/2,y:G-A/2+p.height+T},{x:N+h/2,y:G-A/2+p.height+T},{x:N+h/2,y:G+A/2},{x:N-h/2,y:G+A/2},{x:N-h/2,y:G-A/2+p.height+T},{x:N-p.width/2,y:G-A/2+p.height+T}]:M=[{x:N-h/2,y:G-A/2},{x:N+h/2,y:G-A/2},{x:N+h/2,y:G-A/2+d},{x:N+p.width/2,y:G-A/2+d},{x:N+p.width/2/2,y:G+A/2},{x:N-p.width/2,y:G+A/2},{x:N-p.width/2,y:G-A/2+d},{x:N-h/2,y:G-A/2+d}],je.polygon(t,M,F)},f}var WK=_(()=>{"use strict";At();ft();Lt();_t();Ct();s(VK,"imageSquare")});async function qK(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=i,o=t.look==="neo"?i*2:i,{shapeSvg:l,bbox:u}=await it(e,t,st(t)),h=Math.max(u.height+a*2,t.height??0),d=Math.max(u.width+o*2,(t.width??0)-h),f=[{x:0,y:0},{x:d,y:0},{x:d+3*h/6,y:-h},{x:-3*h/6,y:-h}],p,{cssStyles:g}=t;if(t.look==="handDrawn"){let m=Xe.svg(l),y=Je(t,{}),x=Gt(f),T=m.path(x,y);p=l.insert(()=>T,":first-child").attr("transform",`translate(${-d/2}, ${h/2})`),g&&p.attr("style",g)}else p=Ii(l,d,h,f);return n&&p.attr("style",n),t.width=d,t.height=h,Ze(t,p),t.intersect=function(m){return je.polygon(t,f,m)},l}var jK=_(()=>{"use strict";Ct();Lt();_t();At();al();s(qK,"inv_trapezoid")});async function HK(e,t){let{shapeSvg:r,bbox:n,label:i}=await it(e,t,"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))})`),Ze(t,a),t.intersect=function(u){return je.rect(t,u)},r}var UK=_(()=>{"use strict";Rd();Ct();Lt();s(HK,"labelRect")});async function YK(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=i,o=t.look==="neo"?i*2:i,{shapeSvg:l,bbox:u}=await it(e,t,st(t)),h=Math.max(u.height+a,t.height??0),d=Math.max(u.width+o,(t.width??0)-h),f=[{x:0,y:0},{x:d+3*h/6,y:0},{x:d,y:-h},{x:-(3*h)/6,y:-h}],p,{cssStyles:g}=t;if(t.look==="handDrawn"){let m=Xe.svg(l),y=Je(t,{}),x=Gt(f),T=m.path(x,y);p=l.insert(()=>T,":first-child").attr("transform",`translate(${-d/2}, ${h/2})`),g&&p.attr("style",g)}else p=Ii(l,d,h,f);return n&&p.attr("style",n),t.width=d,t.height=h,Ze(t,p),t.intersect=function(m){return je.polygon(t,f,m)},l}var KK=_(()=>{"use strict";Ct();Lt();_t();At();al();s(YK,"lean_left")});async function XK(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=i,o=t.look==="neo"?i*2:i,{shapeSvg:l,bbox:u}=await it(e,t,st(t)),h=Math.max(u.height+a,t.height??0),d=Math.max(u.width+o,(t.width??0)-h),f=[{x:-3*h/6,y:0},{x:d,y:0},{x:d+3*h/6,y:-h},{x:0,y:-h}],p,{cssStyles:g}=t;if(t.look==="handDrawn"){let m=Xe.svg(l),y=Je(t,{}),x=Gt(f),T=m.path(x,y);p=l.insert(()=>T,":first-child").attr("transform",`translate(${-d/2}, ${h/2})`),g&&p.attr("style",g)}else p=Ii(l,d,h,f);return n&&p.attr("style",n),t.width=d,t.height=h,Ze(t,p),t.intersect=function(m){return je.polygon(t,f,m)},l}var QK=_(()=>{"use strict";Ct();Lt();_t();At();al();s(XK,"lean_right")});function ZK(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.label="",t.labelStyle=r;let i=e.insert("g").attr("class",st(t)).attr("id",t.domId??t.id),{cssStyles:a}=t,o=Math.max(35,t?.width??0),l=Math.max(35,t?.height??0),u=7,h=[{x:o,y:0},{x:0,y:l+u/2},{x:o-2*u,y:l+u/2},{x:0,y:2*l},{x:o,y:l-u/2},{x:2*u,y:l-u/2}],d=Xe.svg(i),f=Je(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let p=Gt(h),g=d.path(p,f),m=i.insert(()=>g,":first-child");return m.attr("class","outer-path"),a&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",a),n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),m.attr("transform",`translate(-${o/2},${-l})`),Ze(t,m),t.intersect=function(y){return Y.info("lightningBolt intersect",t,y),je.polygon(t,h,y)},i}var JK=_(()=>{"use strict";ft();Ct();_t();At();Lt();Ct();s(ZK,"lightningBolt")});async function rX(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?24:i;if(t.width||t.height){let T=t.width??0;t.width=(t.width??0)-a,t.width<tX&&(t.width=tX);let k=T/2/(2.5+T/50);t.height=(t.height??0)-o-k*3,t.height<eX&&(t.height=eX)}let{shapeSvg:l,bbox:u,label:h}=await it(e,t,st(t)),d=(t?.width?t?.width:u.width)+a*2,f=d/2,p=f/(2.5+d/50),g=(t?.height?t?.height:u.height)+p+o*2,m=g*.1,y,{cssStyles:x}=t;if(t.look==="handDrawn"){let T=Xe.svg(l),C=LMe(0,0,d,g,f,p,m),k=DMe(0,p,d,g,f,p),E=Je(t,{}),v=T.path(C,E),S=T.path(k,E);l.insert(()=>S,":first-child").attr("class","line"),y=l.insert(()=>v,":first-child"),y.attr("class","basic label-container"),x&&y.attr("style",x)}else{let T=RMe(0,0,d,g,f,p,m);y=l.insert("path",":first-child").attr("d",T).attr("class","basic label-container outer-path").attr("style",$r(x)).attr("style",n)}return y.attr("label-offset-y",p),y.attr("transform",`translate(${-d/2}, ${-(g/2+p)})`),Ze(t,y),h.attr("transform",`translate(${-(u.width/2)-(u.x-(u.left??0))}, ${-(u.height/2)+p-(u.y-(u.top??0))})`),t.intersect=function(T){let C=je.rect(t,T),k=C.x-(t.x??0);if(f!=0&&(Math.abs(k)<(t.width??0)/2||Math.abs(k)==(t.width??0)/2&&Math.abs(C.y-(t.y??0))>(t.height??0)/2-p)){let E=p*p*(1-k*k/(f*f));E>0&&(E=Math.sqrt(E)),E=p-E,T.y-(t.y??0)>0&&(E=-E),C.y+=E}return C},l}var RMe,LMe,DMe,eX,tX,nX=_(()=>{"use strict";Ct();Lt();_t();At();Pt();RMe=s((e,t,r,n,i,a,o)=>[`M${e},${t+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${e},${t+a+o}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),LMe=s((e,t,r,n,i,a,o)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${i},${a} 0,0,0 ${-r},0`,`l0,${n}`,`a${i},${a} 0,0,0 ${r},0`,`l0,${-n}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),DMe=s((e,t,r,n,i,a)=>[`M${e-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),eX=10,tX=10;s(rX,"linedCylinder")});async function iX(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i;if(t.width||t.height){let E=t.width;t.width=(E??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10)}let{shapeSvg:l,bbox:u,label:h}=await it(e,t,st(t)),d=(t?.width?t?.width:u.width)+(a??0)*2,f=(t?.height?t?.height:u.height)+(o??0)*2,p=t.look==="neo"?f/4:f/8,g=f+p,{cssStyles:m}=t,y=Xe.svg(l),x=Je(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");let T=[{x:-d/2-d/2*.1,y:-g/2},{x:-d/2-d/2*.1,y:g/2},...Ma(-d/2-d/2*.1,g/2,d/2+d/2*.1,g/2,p,.8),{x:d/2+d/2*.1,y:-g/2},{x:-d/2-d/2*.1,y:-g/2},{x:-d/2,y:-g/2},{x:-d/2,y:g/2*1.1},{x:-d/2,y:-g/2}],C=y.polygon(T.map(E=>[E.x,E.y]),x),k=l.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",n),k.attr("transform",`translate(0,${-p/2})`),h.attr("transform",`translate(${-d/2+(t.padding??0)+d/2*.1/2-(u.x-(u.left??0))},${-f/2+(t.padding??0)-p/2-(u.y-(u.top??0))})`),Ze(t,k),t.intersect=function(E){return je.polygon(t,T,E)},l}var sX=_(()=>{"use strict";Ct();Lt();At();_t();s(iX,"linedWaveEdgedRect")});async function aX(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i,l=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*l,10),t.height=Math.max((t?.height??0)-o*2-2*l,10));let{shapeSvg:u,bbox:h,label:d}=await it(e,t,st(t)),f=(t?.width?t?.width:h.width)+a*2+2*l,p=(t?.height?t?.height:h.height)+o*2+2*l,g=f-2*l,m=p-2*l,y=-g/2,x=-m/2,{cssStyles:T}=t,C=Xe.svg(u),k=Je(t,{}),E=[{x:y-l,y:x+l},{x:y-l,y:x+m+l},{x:y+g-l,y:x+m+l},{x:y+g-l,y:x+m},{x:y+g,y:x+m},{x:y+g,y:x+m-l},{x:y+g+l,y:x+m-l},{x:y+g+l,y:x-l},{x:y+l,y:x-l},{x:y+l,y:x},{x:y,y:x},{x:y,y:x+l}],v=[{x:y,y:x+l},{x:y+g-l,y:x+l},{x:y+g-l,y:x+m},{x:y+g,y:x+m},{x:y+g,y:x},{x:y,y:x}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let S=Gt(E),w=C.path(S,k),L=Gt(v),O=C.path(L,k);t.look!=="handDrawn"&&(w=z4(w),O=z4(O));let F=u.insert("g",":first-child");return F.insert(()=>w),F.insert(()=>O),F.attr("class","basic label-container outer-path"),T&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",T),n&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",n),d.attr("transform",`translate(${-(h.width/2)-l-(h.x-(h.left??0))}, ${-(h.height/2)+l-(h.y-(h.top??0))})`),Ze(t,F),t.intersect=function(N){return je.polygon(t,E,N)},u}var oX=_(()=>{"use strict";Ct();_t();At();Lt();s(aX,"multiRect")});async function lX(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,label:o}=await it(e,t,st(t)),l=t.padding??0,u=t.look==="neo"?16:l,h=t.look==="neo"?12:l,d=!0;(t.width||t.height)&&(d=!1,t.width=(t?.width??0)-u*2,t.height=(t?.height??0)-h*3);let f=Math.max(a.width,t?.width??0)+u*2,p=Math.max(a.height,t?.height??0)+h*3,g=t.look==="neo"?p/4:p/8,m=p+(d?g/2:-g/2),y=-f/2,x=-m/2,T=10,{cssStyles:C}=t,k=Ma(y-T,x+m+T,y+f-T,x+m+T,g,.8),E=k?.[k.length-1],v=[{x:y-T,y:x+T},{x:y-T,y:x+m+T},...k,{x:y+f-T,y:E.y-T},{x:y+f,y:E.y-T},{x:y+f,y:E.y-2*T},{x:y+f+T,y:E.y-2*T},{x:y+f+T,y:x-T},{x:y+T,y:x-T},{x:y+T,y:x},{x:y,y:x},{x:y,y:x+T}],S=[{x:y,y:x+T},{x:y+f-T,y:x+T},{x:y+f-T,y:E.y-T},{x:y+f,y:E.y-T},{x:y+f,y:x},{x:y,y:x}],w=Xe.svg(i),L=Je(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");let O=Gt(v),F=w.path(O,L),N=Gt(S),G=w.path(N,L),A=i.insert(()=>F,":first-child");return A.insert(()=>G),A.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",C),n&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",n),A.attr("transform",`translate(0,${-g/2})`),o.attr("transform",`translate(${-(a.width/2)-T-(a.x-(a.left??0))}, ${-(a.height/2)+T-g/2-(a.y-(a.top??0))})`),Ze(t,A),t.intersect=function(M){return je.polygon(t,v,M)},i}var cX=_(()=>{"use strict";Ct();Lt();At();_t();s(lX,"multiWaveEdgedRectangle")});async function uX(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=Ke(t);t.labelStyle=n,t.useHtmlLabels||vn(mt())||(t.centerLabel=!0);let{shapeSvg:o,bbox:l,label:u}=await it(e,t,st(t)),h=Math.max(l.width+(t.padding??0)*2,t?.width??0),d=Math.max(l.height+(t.padding??0)*2,t?.height??0),f=-h/2,p=-d/2,{cssStyles:g}=t,m=Xe.svg(o),y=Je(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let x=m.rectangle(f,p,h,d,y),T=o.insert(()=>x,":first-child");return T.attr("class","basic label-container outer-path"),u.attr("class","label noteLabel"),g&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&T.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))})`),Ze(t,T),t.intersect=function(C){return je.rect(t,C)},o}var hX=_(()=>{"use strict";At();Lt();_t();Ct();ir();ir();s(uX,"note")});async function dX(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let{shapeSvg:i,bbox:a}=await it(e,t,st(t)),o=a.width+(t.padding??0),l=a.height+(t.padding??0),u=o+l,h=.5,d=[{x:u/2,y:0},{x:u,y:-u/2},{x:u/2,y:-u},{x:0,y:-u/2}],f,{cssStyles:p}=t;if(t.look==="handDrawn"){let g=Xe.svg(i),m=Je(t,{}),y=IMe(0,0,u),x=g.path(y,m);f=i.insert(()=>x,":first-child").attr("transform",`translate(${-u/2+h}, ${u/2})`),p&&f.attr("style",p)}else f=Ii(i,u,u,d),f.attr("transform",`translate(${-u/2+h}, ${u/2})`);return n&&f.attr("style",n),Ze(t,f),t.calcIntersect=function(g,m){let y=g.width,x=[{x:y/2,y:0},{x:y,y:-y/2},{x:y/2,y:-y},{x:0,y:-y/2}],T=je.polygon(g,x,m);return{x:T.x-.5,y:T.y-.5}},t.intersect=function(g){return this.calcIntersect(t,g)},i}var IMe,fX=_(()=>{"use strict";Ct();Lt();_t();At();al();IMe=s((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");s(dX,"question")});async function pX(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?21:i??0,o=t.look==="neo"?12:i??0,{shapeSvg:l,bbox:u,label:h}=await it(e,t,st(t)),d=u.width+(t.look==="neo"?a*2:a),f=Math.max(u.height+(t.look==="neo"?o*2:o),t.height??0),p=f/4,m=-Math.max(d,(t.width??0)-p)/2,y=-f/2,x=y/2,T=[{x:m+x,y},{x:m,y:0},{x:m+x,y:-y},{x:-m,y:-y},{x:-m,y}],{cssStyles:C}=t,k=Xe.svg(l),E=Je(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");let v=Gt(T),S=k.path(v,E),w=l.insert(()=>S,":first-child");return w.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",C),n&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",n),w.attr("transform",`translate(${-x/2},0)`),h.attr("transform",`translate(${-x/2-u.width/2-(u.x-(u.left??0))}, ${-(u.height/2)-(u.y-(u.top??0))})`),Ze(t,w),t.intersect=function(L){return je.polygon(t,T,L)},l}var mX=_(()=>{"use strict";Ct();Lt();_t();At();s(pX,"rect_left_inv_arrow")});var NMe,xo,JC=_(()=>{"use strict";ir();Nt();mo();NMe=s(async(e,t,r,n=!1,i=!1)=>{let a=t||"";typeof a=="object"&&(a=a[0]);let o=xe(),l=vn(o);return await si(e,a,{style:r,isTitle:n,useHtmlLabels:l,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},o)},"createLabel"),xo=NMe});async function gX(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i;t.cssClasses?i="node "+t.cssClasses:i="node default";let a=e.insert("g").attr("class",i).attr("id",t.domId||t.id),o=a.insert("g"),l=a.insert("g").attr("class","label").attr("style",n),u=t.description,h=t.label,d=await xo(l,h,t.labelStyle,!0,!0),f={width:0,height:0};if(vn(xe())){let L=d.children[0],O=et(d);f=L.getBoundingClientRect(),O.attr("width",f.width),O.attr("height",f.height)}Y.info("Text 2",u);let p=u||[],g=d.getBBox(),m=await xo(l,Array.isArray(p)?p.join("<br/>"):p,t.labelStyle,!0,!0),y=m.children[0],x=et(m);f=y.getBoundingClientRect(),x.attr("width",f.width),x.attr("height",f.height);let T=(t.padding||0)/2;et(m).attr("transform","translate( "+(f.width>g.width?0:(g.width-f.width)/2)+", "+(g.height+T+5)+")"),et(d).attr("transform","translate( "+(f.width<g.width?0:-(g.width-f.width)/2)+", 0)"),f=l.node().getBBox(),l.attr("transform","translate("+-f.width/2+", "+(-f.height/2-T+3)+")");let C=f.width+(t.padding||0),k=f.height+(t.padding||0),E=-f.width/2-T,v=-f.height/2-T,S,w;if(t.look==="handDrawn"){let L=Xe.svg(a),O=Je(t,{}),F=L.path(Gn(E,v,C,k,t.rx||0),O),N=L.line(-f.width/2-T,-f.height/2-T+g.height+T,f.width/2+T,-f.height/2-T+g.height+T,O);w=a.insert(()=>(Y.debug("Rough node insert CXC",F),N),":first-child"),S=a.insert(()=>(Y.debug("Rough node insert CXC",F),F),":first-child")}else S=o.insert("rect",":first-child"),w=o.insert("line"),S.attr("class","outer title-state").attr("style",n).attr("x",-f.width/2-T).attr("y",-f.height/2-T).attr("width",f.width+(t.padding||0)).attr("height",f.height+(t.padding||0)),w.attr("class","divider").attr("x1",-f.width/2-T).attr("x2",f.width/2+T).attr("y1",-f.height/2-T+g.height+T).attr("y2",-f.height/2-T+g.height+T);return Ze(t,S),t.intersect=function(L){return je.rect(t,L)},a}var yX=_(()=>{"use strict";Sr();Ct();JC();Lt();_t();At();Nt();go();ft();ir();s(gX,"rectWithTitle")});async function xX(e,t,{config:{themeVariables:r}}){let n=r?.radius??5,i={rx:n,ry:n,classes:"",labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return yo(e,t,i)}var bX=_(()=>{"use strict";Rd();s(xX,"roundedRect")});async function TX(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?12:t.padding??0,{shapeSvg:o,bbox:l,label:u}=await it(e,t,st(t)),h=(t?.width??l.width)+i*2+(t.look==="neo"?Ld:Ld*2),d=(t?.height??l.height)+a*2,f=h-Ld,p=d,g=Ld-h/2,m=-d/2,{cssStyles:y}=t,x=Xe.svg(o),T=Je(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");let C=[{x:g,y:m},{x:g+f,y:m},{x:g+f,y:m+p},{x:g-Ld,y:m+p},{x:g-Ld,y:m},{x:g,y:m},{x:g,y:m+p}],k=x.polygon(C.map(v=>[v.x,v.y]),T),E=o.insert(()=>k,":first-child");return E.attr("class","basic label-container outer-path").attr("style",$r(y)),n&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",n),y&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",n),u.attr("transform",`translate(${Ld/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),Ze(t,E),t.intersect=function(v){return je.rect(t,v)},o}var Ld,CX=_(()=>{"use strict";Ct();Lt();_t();At();Pt();Ld=8;s(TX,"shadedProcess")});async function kX(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-o*2,10));let{shapeSvg:l,bbox:u,label:h}=await it(e,t,st(t)),d=(t?.width?t?.width:u.width)+a*2,f=((t?.height?t?.height:u.height)+o*2)*1.5,p=d,g=f/1.5,m=-p/2,y=-g/2,{cssStyles:x}=t,T=Xe.svg(l),C=Je(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");let k=[{x:m,y},{x:m,y:y+g},{x:m+p,y:y+g},{x:m+p,y:y-g/2}],E=Gt(k),v=T.path(E,C),S=l.insert(()=>v,":first-child");return S.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",x),n&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",n),S.attr("transform",`translate(0, ${g/4})`),h.attr("transform",`translate(${-p/2+(t.padding??0)-(u.x-(u.left??0))}, ${-g/4+(t.padding??0)-(u.y-(u.top??0))})`),Ze(t,S),t.intersect=function(w){return je.polygon(t,k,w)},l}var SX=_(()=>{"use strict";Ct();Lt();_t();At();s(kX,"slopedRect")});async function vX(e,t){let r=t.padding??0,n=t.look==="neo"?16:r*2,i=t.look==="neo"?12:r,a={rx:0,ry:0,classes:"",labelPaddingX:t.labelPaddingX??n,labelPaddingY:i};return yo(e,t,a)}var EX=_(()=>{"use strict";Rd();s(vX,"squareRect")});async function wX(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?20:i,o=t.look==="neo"?12:i,{shapeSvg:l,bbox:u}=await it(e,t,st(t)),h=u.height+(t.look==="neo"?o*2:o),d=u.width+h/4+(t.look==="neo"?a*2:a),f=h/2,{cssStyles:p}=t,g=Xe.svg(l),m=Je(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let y=[{x:-d/2+f,y:-h/2},{x:d/2-f,y:-h/2},...ha(-d/2+f,0,f,50,90,270),{x:d/2-f,y:h/2},...ha(d/2-f,0,f,50,270,450)],x=Gt(y),T=g.path(x,m),C=l.insert(()=>T,":first-child");return C.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",p),n&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",n),Ze(t,C),t.intersect=function(k){return je.polygon(t,y,k)},l}var _X=_(()=>{"use strict";Ct();Lt();_t();At();s(wX,"stadium")});async function AX(e,t){let r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5,classes:"flowchart-node"};return yo(e,t,r)}var RX=_(()=>{"use strict";Rd();s(AX,"state")});function LX(e,t,{config:{themeVariables:r}}){let{labelStyles:n,nodeStyles:i}=Ke(t);t.labelStyle=n;let{cssStyles:a}=t,{lineColor:o,stateBorder:l,nodeBorder:u,nodeShadow:h}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);let d=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),f=Xe.svg(d),p=Je(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let g=f.circle(0,0,t.width,{...p,stroke:o,strokeWidth:2}),m=l??u,y=(t.width??0)*5/14,x=f.circle(0,0,y,{...p,fill:m,stroke:m,strokeWidth:2,fillStyle:"solid"}),T=d.insert(()=>g,":first-child");if(T.insert(()=>x),t.look!=="handDrawn"&&T.attr("class","outer-path"),a&&T.selectAll("path").attr("style",a),i&&T.selectAll("path").attr("style",i),t.width<25&&h&&t.look!=="handDrawn"){let C=e.node()?.ownerSVGElement?.id??"",k=C?`${C}-drop-shadow-small`:"drop-shadow-small";T.attr("style",`filter:url(#${k})`)}return Ze(t,T),t.intersect=function(C){return je.circle(t,(t.width??0)/2,C)},d}var DX=_(()=>{"use strict";At();Lt();_t();Ct();s(LX,"stateEnd")});function IX(e,t,{config:{themeVariables:r}}){let{lineColor:n,nodeShadow:i}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);let a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),o;if(t.look==="handDrawn"){let u=Xe.svg(a).circle(0,0,t.width,fY(n));o=a.insert(()=>u),o.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else o=a.insert("circle",":first-child"),o.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&i&&t.look!=="handDrawn"){let l=e.node()?.ownerSVGElement?.id??"",u=l?`${l}-drop-shadow-small`:"drop-shadow-small";o.attr("style",`filter:url(#${u})`)}return Ze(t,o),t.intersect=function(l){return je.circle(t,(t.width??7)/2,l)},a}var NX=_(()=>{"use strict";At();Lt();_t();Ct();s(IX,"stateStart")});async function PX(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t?.padding??8,a=t.look==="neo"?28:i,o=t.look==="neo"?12:i,{shapeSvg:l,bbox:u}=await it(e,t,st(t)),h=Math.max(u.width+2*xm+a,t.width??0),d=Math.max(u.height+o,t.height??0),f=h-2*xm,p=d,g=-h/2,m=-d/2,y=[{x:0,y:0},{x:f,y:0},{x:f,y:-p},{x:0,y:-p},{x:0,y:0},{x:-8,y:0},{x:f+8,y:0},{x:f+8,y:-p},{x:-8,y:-p},{x:-8,y:0}];if(t.look==="handDrawn"){let x=Xe.svg(l),T=Je(t,{}),C=x.rectangle(g,m,f+16,p,T),k=x.line(g+xm,m,g+xm,m+p,T),E=x.line(g+xm+f,m,g+xm+f,m+p,T);l.insert(()=>k,":first-child"),l.insert(()=>E,":first-child");let v=l.insert(()=>C,":first-child"),{cssStyles:S}=t;v.attr("class","basic label-container").attr("style",$r(S)),Ze(t,v)}else{let x=Ii(l,f,p,y);n&&x.attr("style",n),Ze(t,x)}return t.intersect=function(x){return je.polygon(t,y,x)},l}var xm,MX=_(()=>{"use strict";Ct();Lt();_t();At();al();Pt();xm=8;s(PX,"subroutine")});async function OX(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?16:i,o=t.look==="neo"?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-o*2,10),t.width=Math.max((t?.width??0)-a*2-hI*(t.height+o*2),10));let{shapeSvg:l,bbox:u}=await it(e,t,st(t)),h=(t?.height?t?.height:u.height)+o*2,d=hI*h,f=hI*h,g=(t?.width?t?.width:u.width)+a*2+d-d,m=h,y=-g/2,x=-m/2,{cssStyles:T}=t,C=Xe.svg(l),k=Je(t,{}),E=[{x:y-d/2,y:x},{x:y+g+d/2,y:x},{x:y+g+d/2,y:x+m},{x:y-d/2,y:x+m}],v=[{x:y+g-d/2,y:x+m},{x:y+g+d/2,y:x+m},{x:y+g+d/2,y:x+m-f}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");let S=Gt(E),w=C.path(S,k),L=Gt(v),O=C.path(L,{...k,fillStyle:"solid"}),F=l.insert(()=>O,":first-child");return F.insert(()=>w,":first-child"),F.attr("class","basic label-container outer-path"),T&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",T),n&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",n),Ze(t,F),t.intersect=function(N){return je.polygon(t,E,N)},l}var hI,$X=_(()=>{"use strict";Ct();_t();At();Lt();hI=.2;s(OX,"taggedRect")});async function BX(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let{shapeSvg:i,bbox:a,label:o}=await it(e,t,st(t)),l=Math.max(a.width+(t.padding??0)*2,t?.width??0),u=Math.max(a.height+(t.padding??0)*2,t?.height??0),h=u/8,d=.2*l,f=.2*u,p=u+h,{cssStyles:g}=t,m=Xe.svg(i),y=Je(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");let x=[{x:-l/2-l/2*.1,y:p/2},...Ma(-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}],T=-l/2+l/2*.1,C=-p/2-f*.4,k=[{x:T+l-d,y:(C+u)*1.3},{x:T+l,y:C+u-f},{x:T+l,y:(C+u)*.9},...Ma(T+l,(C+u)*1.25,T+l-d,(C+u)*1.3,-u*.02,.5)],E=Gt(x),v=m.path(E,y),S=Gt(k),w=m.path(S,{...y,fillStyle:"solid"}),L=i.insert(()=>w,":first-child");return L.insert(()=>v,":first-child"),L.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",g),n&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",n),L.attr("transform",`translate(0,${-h/2})`),o.attr("transform",`translate(${-l/2+(t.padding??0)-(a.x-(a.left??0))},${-u/2+(t.padding??0)-h/2-(a.y-(a.top??0))})`),Ze(t,L),t.intersect=function(O){return je.polygon(t,x,O)},i}var FX=_(()=>{"use strict";Ct();Lt();At();_t();s(BX,"taggedWaveEdgedRectangle")});async function GX(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let{shapeSvg:i,bbox:a}=await it(e,t,st(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),l=Math.max(a.height+(t.padding??0),t?.height||0),u=-o/2,h=-l/2,d=i.insert("rect",":first-child");return d.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",u).attr("y",h).attr("width",o).attr("height",l),Ze(t,d),t.intersect=function(f){return je.rect(t,f)},i}var zX=_(()=>{"use strict";Ct();Lt();_t();s(GX,"text")});async function qX(e,t){let{labelStyles:r,nodeStyles:n}=Ke(t);t.labelStyle=r;let i=t.padding??0,a=t.look==="neo"?12:i/2,o=t.height??0;if(t.height&&(t.height=t.height-a,t.height<VX&&(t.height=VX)),t.width){let T=o/2/(2.5+o/50);t.width=t.width-a-T*3,t.width<WX&&(t.width=WX)}let{shapeSvg:l,bbox:u,label:h}=await it(e,t,st(t)),d=Math.max(t.height??0,u.height)+a,f=d/2,p=f/(2.5+d/50),g=Math.max(t.width??0,u.width)+p+a,{cssStyles:m}=t,y;if(t.look==="handDrawn"){let x=Xe.svg(l),T=MMe(0,0,g,d,p,f),C=OMe(0,0,g,d,p,f),k=x.path(T,Je(t,{})),E=x.path(C,Je(t,{fill:"none"}));y=l.insert(()=>E,":first-child"),y=l.insert(()=>k,":first-child"),y.attr("class","basic label-container"),m&&y.attr("style",m)}else{let x=PMe(0,0,g,d,p,f);y=l.insert("path",":first-child").attr("d",x).attr("class","basic label-container").attr("style",$r(m)).attr("style",n),y.attr("class","basic label-container outer-path"),m&&y.selectAll("path").attr("style",m),n&&y.selectAll("path").attr("style",n)}return y.attr("label-offset-x",p),y.attr("transform",`translate(${-g/2}, ${d/2} )`),h.attr("transform",`translate(${-(u.width/2)-p-(u.x-(u.left??0))}, ${-(u.height/2)-(u.y-(u.top??0))})`),Ze(t,y),t.intersect=function(x){let T=je.rect(t,x),C=T.y-(t.y??0);if(f!=0&&(Math.abs(C)<(t.height??0)/2||Math.abs(C)==(t.height??0)/2&&Math.abs(T.x-(t.x??0))>(t.width??0)/2-p)){let k=p*p*(1-C*C/(f*f));k!=0&&(k=Math.sqrt(Math.abs(k))),k=p-k,x.x-(t.x??0)>0&&(k=-k),T.x+=k}return T},l}var PMe,MMe,OMe,VX,WX,jX=_(()=>{"use strict";Ct();_t();At();Lt();Pt();PMe=s((e,t,r,n,i,a)=>`M${e},${t}
204
204
  a${i},${a} 0,0,1 0,${-n}
205
205
  l${r},0
@@ -334,13 +334,13 @@ You cannot set this config via configuration inside the diagram as it is a secur
334
334
  You have to call mermaid.initialize.`)}isLinkData(t){return t!==null&&typeof t=="object"&&"id"in t&&typeof t.id=="string"}addLink(t,r,n){let i=this.isLinkData(n)?n.id.replace("@",""):void 0;Y.info("addLink",t,r,i);for(let a of t)for(let o of r){let l=a===t[t.length-1],u=o===r[0];l&&u?this.addSingleLink(a,o,n,i):this.addSingleLink(a,o,n,void 0)}}updateLinkInterpolate(t,r){t.forEach(n=>{n==="default"?this.edges.defaultInterpolate=r:this.edges[n].interpolate=r})}updateLink(t,r){t.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(t,r){let n=r.join().replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/§§§/g,",").split(";");t.split(",").forEach(i=>{let a=this.classes.get(i);a===void 0&&(a={id:i,styles:[],textStyles:[]},this.classes.set(i,a)),n?.forEach(o=>{if(/color/.exec(o)){let l=o.replace("fill","bgFill");a.textStyles.push(l)}a.styles.push(o)})})}setDirection(t){this.direction=t.trim(),/.*</.exec(this.direction)&&(this.direction="RL"),/.*\^/.exec(this.direction)&&(this.direction="BT"),/.*>/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(t,r){for(let n of t.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 o=this.subGraphLookup.get(n);o&&o.classes.push(r)}}setTooltip(t,r){if(r!==void 0){r=this.sanitizeText(r);for(let n of t.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}}setClickFun(t,r,n){if(xe().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let o=0;o<i.length;o++){let l=i[o].trim();l.startsWith('"')&&l.endsWith('"')&&(l=l.substr(1,l.length-2)),i[o]=l}}i.length===0&&i.push(t);let a=this.vertices.get(t);a&&(a.haveCallback=!0,this.funs.push(()=>{let o=this.lookUpDomId(t),l=document.querySelector(`[id="${o}"]`);l!==null&&l.addEventListener("click",()=>{Bt.runFunc(r,...i)},!1)}))}setLink(t,r,n){t.split(",").forEach(i=>{let a=this.vertices.get(i);a!==void 0&&(a.link=Bt.formatUrl(r,this.config),a.linkTarget=n)}),this.setClass(t,"clickable")}getTooltip(t){return this.tooltips.get(t)}setClickEvent(t,r,n){t.split(",").forEach(i=>{this.setClickFun(i,r,n)}),this.setClass(t,"clickable")}bindFunctions(t){this.funs.forEach(r=>{r(t)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(t){let r=hm();et(t).select("svg").selectAll("g.node").on("mouseover",a=>{let o=et(a.currentTarget),l=o.attr("title");if(l===null)return;let u=a.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(o.attr("title")).style("left",window.scrollX+u.left+(u.right-u.left)/2+"px").style("top",window.scrollY+u.bottom+"px"),r.html(Ds.sanitize(l)),o.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),et(a.currentTarget).classed("hover",!1)})}clear(t="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=t,this.config=xe(),er()}setGen(t){this.version=t||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(t,r,n){let i=t.text.trim(),a=n.text;t===n&&/\s/.exec(n.text)&&(i=void 0);let l=s(p=>{let g={boolean:{},number:{},string:{}},m=[],y;return{nodeList:p.filter(function(T){let C=typeof T;return T.stmt&&T.stmt==="dir"?(y=T.value,!1):T.trim()===""?!1:C in g?g[C].hasOwnProperty(T)?!1:g[C][T]=!0:m.includes(T)?!1:m.push(T)}),dir:y}},"uniq")(r.flat()),u=l.nodeList,h=l.dir,d=xe().flowchart??{};if(h=h??(d.inheritDir?this.getDirection()??xe().direction??void 0:void 0),this.version==="gen-1")for(let p=0;p<u.length;p++)u[p]=this.lookUpDomId(u[p]);i=i??"subGraph"+this.subCount,a=a||"",a=this.sanitizeText(a),this.subCount=this.subCount+1;let f={id:i,nodes:u,title:a.trim(),classes:[],dir:h,labelType:this.sanitizeNodeLabelType(n?.type)};return Y.info("Adding",f.id,f.nodes,f.dir),f.nodes=this.makeUniq(f,this.subGraphs).nodes,this.subGraphs.push(f),this.subGraphLookup.set(i,f),i}getPosForId(t){for(let[r,n]of this.subGraphs.entries())if(n.id===t)return r;return-1}indexNodes2(t,r){let n=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===t)return{result:!0,count:0};let i=0,a=1;for(;i<n.length;){let o=this.getPosForId(n[i]);if(o>=0){let l=this.indexNodes2(t,o);if(l.result)return{result:!0,count:a+l.count};a=a+l.count}i=i+1}return{result:!1,count:a}}getDepthFirstPos(t){return this.posCrossRef[t]}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(t){let r=t.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(t,r){let n=r.length,i=0;for(let a=0;a<n;++a)r[a]===t&&++i;return i}destructEndLink(t){let r=t.trim(),n=r.slice(0,-1),i="arrow_open";switch(r.slice(-1)){case"x":i="arrow_cross",r.startsWith("x")&&(i="double_"+i,n=n.slice(1));break;case">":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",o=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");let l=this.countChar(".",n);return l&&(a="dotted",o=l),{type:i,stroke:a,length:o}}destructLink(t,r){let n=this.destructEndLink(t),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(t,r){for(let n of t)if(n.nodes.includes(r))return!0;return!1}makeUniq(t,r){let n=[];return t.nodes.forEach((i,a)=>{this.exists(r,i)||n.push(t.nodes[a])}),{nodes:n}}getTypeFromVertex(t){if(t.img)return"imageSquare";if(t.icon)return t.form==="circle"?"iconCircle":t.form==="square"?"iconSquare":t.form==="rounded"?"iconRounded":"icon";switch(t.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return t.type}}findNode(t,r){return t.find(n=>n.id===r)}destructEdgeType(t){let r="none",n="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":n=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=t.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(t,r,n,i,a,o){let l=n.get(t.id),u=i.get(t.id)??!1,h=this.findNode(r,t.id);if(h)h.cssStyles=t.styles,h.cssCompiledStyles=this.getCompiledStyles(t.classes),h.cssClasses=t.classes.join(" ");else{let d={id:t.id,label:t.text,labelType:t.labelType,labelStyle:"",parentId:l,padding:a.flowchart?.padding||8,cssStyles:t.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),dir:t.dir,domId:t.domId,look:o,link:t.link,linkTarget:t.linkTarget,tooltip:this.getTooltip(t.id),icon:t.icon,pos:t.pos,img:t.img,assetWidth:t.assetWidth,assetHeight:t.assetHeight,constraint:t.constraint};u?r.push({...d,isGroup:!0,shape:"rect"}):r.push({...d,isGroup:!1,shape:this.getTypeFromVertex(t)})}}getCompiledStyles(t){let r=[];for(let n of t){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 t=xe(),r=[],n=[],i=this.getSubGraphs(),a=new Map,o=new Map,l=new Map;for(let m of i)for(let y of m.nodes)this.subGraphLookup.has(y)&&l.set(y,m.id);let u=s(m=>this.subGraphLookup.get(m)?.metadata?.view==="collapsed","isCollapsed"),h=s(m=>{let y,x=new Set,T=m;for(;T!==void 0&&!x.has(T);)x.add(T),u(T)&&(y=T),T=l.get(T);return y},"outermostCollapsed"),d=new Set,f=new Map;for(let m of i){let y=h(m.id);if(y!==void 0){m.id!==y&&(d.add(m.id),f.set(m.id,y));for(let x of m.nodes)x!==y&&(d.add(x),f.set(x,y))}}for(let m=i.length-1;m>=0;m--){let y=i[m];if(!d.has(y.id)){y.nodes.length>0&&o.set(y.id,!0);for(let x of y.nodes)a.set(x,y.id)}}for(let m=i.length-1;m>=0;m--){let y=i[m];d.has(y.id)||(y.metadata?.view==="collapsed"?r.push({id:y.id,label:y.title,labelStyle:"",labelType:y.labelType,parentId:a.get(y.id),padding:8,cssCompiledStyles:this.getCompiledStyles(y.classes),cssClasses:y.classes.join(" "),shape:"collapsedGroup",dir:y.dir,isGroup:!1,look:t.look}):r.push({id:y.id,label:y.title,labelStyle:"",labelType:y.labelType,parentId:a.get(y.id),padding:8,cssCompiledStyles:this.getCompiledStyles(y.classes),cssClasses:y.classes.join(" "),shape:"rect",dir:y.dir,isGroup:!0,look:t.look}))}this.getVertices().forEach(m=>{d.has(m.id)||this.addNodeFromVertex(m,r,a,o,t,t.look||"classic")});let g=this.getEdges();return g.forEach((m,y)=>{let{arrowTypeStart:x,arrowTypeEnd:T}=this.destructEdgeType(m.type),C=[...g.defaultStyle??[]],k=f.get(m.start)??m.start,E=f.get(m.end)??m.end;if(k===E&&(f.has(m.start)||f.has(m.end)))return;m.style&&C.push(...m.style);let v={id:Au(k,E,{counter:y,prefix:"L"},m.id),isUserDefinedId:m.isUserDefinedId,start:k,end:E,type:m.type??"normal",label:m.text,labelType:m.labelType,labelpos:"c",thickness:m.stroke,minlen:m.length,classes:m?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:m?.stroke==="invisible"||m?.type==="arrow_open"?"none":x,arrowTypeEnd:m?.stroke==="invisible"||m?.type==="arrow_open"?"none":T,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(m.classes),labelStyle:C,style:C,pattern:m.stroke,look:t.look,animate:m.animate,animation:m.animation,curve:m.interpolate||this.edges.defaultInterpolate||t.flowchart?.curve};n.push(v)}),{nodes:r,edges:n,other:{},config:t}}defaultConfig(){return zT.flowchart}}});var ol,bm=_(()=>{"use strict";Sr();ol=s((e,t)=>{let r;return t==="sandbox"&&(r=et("#i"+e)),(t==="sandbox"?et(r.nodes()[0].contentDocument.body):et("body")).select(`[id="${e}"]`)},"getDiagramElement")});var pc,P1=_(()=>{"use strict";pc=s(({flowchart:e})=>{let t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,n=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins")});var wZ,_Z=_(()=>{"use strict";Nt();ir();ft();Sr();At();mo();zC();_t();wZ=s(async(e,t)=>{let r=xe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:o}=n,l=o,{labelStyles:u,nodeStyles:h,borderStyles:d,backgroundStyles:f}=Ke(t),p=e.insert("g").attr("class","cluster swimlane "+(t.cssClasses||"")).attr("id",t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look),g=Ei(r.flowchart.htmlLabels),m=t.direction==="LR",y=p.insert("g").attr("class","cluster-label swimlane-label"),x=await si(y,t.label,{style:t.labelStyle,useHtmlLabels:g,isNode:!0,width:t.width}),T=x.getBBox();if(g){let A=x.children[0],M=et(x);T=A.getBoundingClientRect(),M.attr("width",T.width),M.attr("height",T.height)}let C=t.padding??0,k=t.width<=T.width+C?T.width+C:t.width;t.width<=T.width+C?t.diff=(k-t.width)/2-C:t.diff=-C;let E=t.height,v=t.y-E/2,S=t.y+E/2,w=t.x-k/2,L=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:v+E/3,O=m?4:0,F=T.height+2*O,N,G;if(m){let A=Math.max(F,T.height+2*O),M=w+A,I=Math.max(0,k-A);if(t.look==="handDrawn"){let D=Xe.svg(p),$=Je(t,{roughness:.7,fill:a,stroke:l,fillWeight:3,seed:i}),W=Je(t,{roughness:.7,fill:"none",stroke:l,seed:i}),q=D.rectangle(w,v,A,E,$);N=p.insert(()=>q,":first-child");let z=D.rectangle(M,v,I,E,W);G=p.insert(()=>z,":first-child"),N.select("path:nth-child(2)").attr("style",d.join(";")),N.select("path").attr("style",f.join(";").replace("fill","stroke"))}else N=p.insert("rect",":first-child"),G=p.insert("rect",":first-child"),N.attr("class","swimlane-title").attr("style",h).attr("x",w).attr("y",v).attr("width",A).attr("height",E).attr("fill",a).attr("stroke",l),G.attr("class","swimlane-body").attr("style",h).attr("x",M).attr("y",v).attr("width",I).attr("height",E).attr("fill","none").attr("stroke",l);let P=w+A/2,B=t.y;y.attr("transform",`translate(${P}, ${B}) rotate(-90) translate(${-T.width/2}, ${-T.height/2})`)}else{let A=Math.max(0,L-v),M=Math.min(F,A),I=v+M,P=Math.max(0,S-I),B=t.x-k/2;if(t.look==="handDrawn"){let W=Xe.svg(p),q=Je(t,{roughness:.7,fill:a,stroke:l,fillWeight:3,seed:i}),z=Je(t,{roughness:.7,fill:"none",stroke:l,seed:i}),j=W.rectangle(B,v,k,M,q);N=p.insert(()=>j,":first-child");let J=W.rectangle(B,I,k,P,z);G=p.insert(()=>J,":first-child"),N.select("path:nth-child(2)").attr("style",d.join(";")),N.select("path").attr("style",f.join(";").replace("fill","stroke"))}else N=p.insert("rect",":first-child"),G=p.insert("rect",":first-child"),N.attr("class","swimlane-title").attr("style",h).attr("x",B).attr("y",v).attr("width",k).attr("height",M).attr("fill",a).attr("stroke",l),G.attr("class","swimlane-body").attr("style",h).attr("x",B).attr("y",I).attr("width",k).attr("height",P).attr("fill","none").attr("stroke",l);let D=t.x-T.width/2,$=v+(M-T.height)/2;y.attr("transform",`translate(${D}, ${$})`)}if(Y.trace("Swimlane data ",t,JSON.stringify(t)),u){let A=y.select("span");A&&A.attr("style",u)}return t.offsetX=0,t.width=k,t.height=E,t.offsetY=T.height-C/2,t.intersect=function(A){return il(t,A)},{cluster:p,labelBBox:T}},"swimlane")});var AZ,mOe,gOe,yOe,xOe,bOe,TOe,RZ,Mu,LZ,M1=_(()=>{"use strict";Nt();ir();ft();P1();Sr();At();mo();zC();JC();go();_t();_Z();AZ=s(async(e,t)=>{Y.info("Creating subgraph rect for ",t.id,t);let r=xe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:o}=n,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=Ke(t),f=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),p=vn(r),g=f.insert("g").attr("class","cluster-label "),m;t.labelType==="markdown"?m=await si(g,t.label,{style:t.labelStyle,useHtmlLabels:p,isNode:!0,width:t.width}):m=await xo(g,t.label,t.labelStyle||"",!1,!0);let y=m.getBBox();if(vn(r)){let w=m.children[0],L=et(m);y=w.getBoundingClientRect(),L.attr("width",y.width),L.attr("height",y.height)}let x=t.width<=y.width+t.padding?y.width+t.padding:t.width;t.width<=y.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;let T=t.height,C=t.x-x/2,k=t.y-T/2;Y.trace("Data ",t,JSON.stringify(t));let E;if(t.look==="handDrawn"){let w=Xe.svg(f),L=Je(t,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),O=w.path(Gn(C,k,x,T,0),L);E=f.insert(()=>(Y.debug("Rough node insert CXC",O),O),":first-child"),E.select("path:nth-child(2)").attr("style",h.join(";")),E.select("path").attr("style",d.join(";").replace("fill","stroke"))}else E=f.insert("rect",":first-child"),E.attr("style",u).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",k).attr("width",x).attr("height",T);let{subGraphTitleTopMargin:v}=pc(r);if(g.attr("transform",`translate(${t.x-y.width/2}, ${t.y-t.height/2+v})`),l){let w=g.select("span");w&&w.attr("style",l)}let S=E.node().getBBox();return t.offsetX=0,t.width=S.width,t.height=S.height,t.offsetY=y.height-t.padding/2,t.intersect=function(w){return il(t,w)},{cluster:f,labelBBox:y}},"rect"),mOe=s((e,t)=>{let r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),n=r.insert("rect",":first-child"),i=0*t.padding,a=i/2;n.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+i).attr("height",t.height+i).attr("fill","none");let o=n.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(l){return il(t,l)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),gOe=s(async(e,t)=>{let r=xe(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:o,compositeTitleBackground:l,nodeBorder:u}=n,h=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),d=h.insert("g",":first-child"),f=h.insert("g").attr("class","cluster-label"),p=h.append("rect"),g=await xo(f,t.label,t.labelStyle,void 0,!0),m=g.getBBox();if(vn(r)){let O=g.children[0],F=et(g);m=O.getBoundingClientRect(),F.attr("width",m.width),F.attr("height",m.height)}let y=0*t.padding,x=y/2,T=(t.width<=m.width+t.padding?m.width+t.padding:t.width)+y;t.width<=m.width+t.padding?t.diff=(T-t.width)/2-t.padding:t.diff=-t.padding;let C=t.height+y,k=t.height+y-m.height-6,E=t.x-T/2,v=t.y-C/2;t.width=T;let S=t.y-t.height/2-x+m.height+2,w;if(t.look==="handDrawn"){let O=t.cssClasses.includes("statediagram-cluster-alt"),F=Xe.svg(h),N=t.rx||t.ry?F.path(Gn(E,v,T,C,10),{roughness:.7,fill:l,fillStyle:"solid",stroke:u,seed:i}):F.rectangle(E,v,T,C,{seed:i});w=h.insert(()=>N,":first-child");let G=F.rectangle(E,S,T,k,{fill:O?a:o,fillStyle:O?"hachure":"solid",stroke:u,seed:i});w=h.insert(()=>N,":first-child"),p=h.insert(()=>G)}else w=d.insert("rect",":first-child"),w.attr("class","outer").attr("x",E).attr("y",v).attr("width",T).attr("height",C).attr("data-look",t.look),p.attr("class","inner").attr("x",E).attr("y",S).attr("width",T).attr("height",k);f.attr("transform",`translate(${t.x-m.width/2}, ${v+1-(vn(r)?0:3)})`);let L=w.node().getBBox();return t.height=L.height,t.offsetX=0,t.offsetY=m.height-t.padding/2,t.labelBBox=m,t.intersect=function(O){return il(t,O)},{cluster:h,labelBBox:m}},"roundedWithTitle"),yOe=s(async(e,t)=>{Y.info("Creating subgraph rect for ",t.id,t);let r=xe(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:o}=n,{labelStyles:l,nodeStyles:u,borderStyles:h,backgroundStyles:d}=Ke(t),f=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),p=vn(r),g=f.insert("g").attr("class","cluster-label "),m=await si(g,t.label,{style:t.labelStyle,useHtmlLabels:p,isNode:!0,width:t.width}),y=m.getBBox();if(vn(r)){let w=m.children[0],L=et(m);y=w.getBoundingClientRect(),L.attr("width",y.width),L.attr("height",y.height)}let x=t.width<=y.width+t.padding?y.width+t.padding:t.width;t.width<=y.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;let T=t.height,C=t.x-x/2,k=t.y-T/2;Y.trace("Data ",t,JSON.stringify(t));let E;if(t.look==="handDrawn"){let w=Xe.svg(f),L=Je(t,{roughness:.7,fill:a,stroke:o,fillWeight:4,seed:i}),O=w.path(Gn(C,k,x,T,t.rx),L);E=f.insert(()=>(Y.debug("Rough node insert CXC",O),O),":first-child"),E.select("path:nth-child(2)").attr("style",h.join(";")),E.select("path").attr("style",d.join(";").replace("fill","stroke"))}else E=f.insert("rect",":first-child"),E.attr("style",u).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",k).attr("width",x).attr("height",T);let{subGraphTitleTopMargin:v}=pc(r);if(g.attr("transform",`translate(${t.x-y.width/2}, ${t.y-t.height/2+v})`),l){let w=g.select("span");w&&w.attr("style",l)}let S=E.node().getBBox();return t.offsetX=0,t.width=S.width,t.height=S.height,t.offsetY=y.height-t.padding/2,t.intersect=function(w){return il(t,w)},{cluster:f,labelBBox:y}},"kanbanSection"),xOe=s((e,t)=>{let r=xe(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,o=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),l=o.insert("g",":first-child"),u=0*t.padding,h=t.width+u;t.diff=-t.padding;let d=t.height+u,f=t.x-h/2,p=t.y-d/2;t.width=h;let g;if(t.look==="handDrawn"){let x=Xe.svg(o).rectangle(f,p,h,d,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});g=o.insert(()=>x,":first-child")}else{g=l.insert("rect",":first-child");let y="outer";t.look,y="divider",g.attr("class",y).attr("x",f).attr("y",p).attr("width",h).attr("height",d).attr("data-look",t.look)}let m=g.node().getBBox();return t.height=m.height,t.offsetX=0,t.offsetY=0,t.intersect=function(y){return il(t,y)},{cluster:o,labelBBox:{}}},"divider"),bOe=AZ,TOe={rect:AZ,squareRect:bOe,roundedWithTitle:gOe,noteGroup:mOe,divider:xOe,kanbanSection:yOe,swimlane:wZ},RZ=new Map,Mu=s(async(e,t)=>{let r=t.shape||"rect",n=await TOe[r](e,t);return RZ.set(t.id,n),n},"insertCluster"),LZ=s(()=>{RZ=new Map},"clear")});var Tm,DZ=_(()=>{"use strict";Tm=s((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";let r=e.x??0,n=e.y??0;return"translate("+-(r+e.width/2)+", "+-(n+e.height/2)+")"},"computeLabelTransform")});function ok(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=Dn(e),t=Dn(t);let[r,n]=[e.x,e.y],[i,a]=[t.x,t.y],o=i-r,l=a-n;return{angle:Math.atan(l/o),deltaX:o,deltaY:l}}var ai,qI,Dn,IZ,jI=_(()=>{"use strict";ai={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},qI={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};s(ok,"calculateDeltaAndAngle");Dn=s(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),IZ=s(e=>({x:s(function(t,r,n){let i=0,a=Dn(n[0]).x<Dn(n[n.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(ai,e.arrowTypeStart)){let{angle:g,deltaX:m}=ok(n[0],n[1]);i=ai[e.arrowTypeStart]*Math.cos(g)*(m>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(ai,e.arrowTypeEnd)){let{angle:g,deltaX:m}=ok(n[n.length-1],n[n.length-2]);i=ai[e.arrowTypeEnd]*Math.cos(g)*(m>=0?1:-1)}let o=Math.abs(Dn(t).x-Dn(n[n.length-1]).x),l=Math.abs(Dn(t).y-Dn(n[n.length-1]).y),u=Math.abs(Dn(t).x-Dn(n[0]).x),h=Math.abs(Dn(t).y-Dn(n[0]).y),d=ai[e.arrowTypeStart],f=ai[e.arrowTypeEnd],p=1;if(o<f&&o>0&&l<f){let g=f+p-o;g*=a==="right"?-1:1,i-=g}if(u<d&&u>0&&h<d){let g=d+p-u;g*=a==="right"?-1:1,i+=g}return Dn(t).x+i},"x"),y:s(function(t,r,n){let i=0,a=Dn(n[0]).y<Dn(n[n.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(ai,e.arrowTypeStart)){let{angle:g,deltaY:m}=ok(n[0],n[1]);i=ai[e.arrowTypeStart]*Math.abs(Math.sin(g))*(m>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(ai,e.arrowTypeEnd)){let{angle:g,deltaY:m}=ok(n[n.length-1],n[n.length-2]);i=ai[e.arrowTypeEnd]*Math.abs(Math.sin(g))*(m>=0?1:-1)}let o=Math.abs(Dn(t).y-Dn(n[n.length-1]).y),l=Math.abs(Dn(t).x-Dn(n[n.length-1]).x),u=Math.abs(Dn(t).y-Dn(n[0]).y),h=Math.abs(Dn(t).x-Dn(n[0]).x),d=ai[e.arrowTypeStart],f=ai[e.arrowTypeEnd],p=1;if(o<f&&o>0&&l<f){let g=f+p-o;g*=a==="up"?-1:1,i-=g}if(u<d&&u>0&&h<d){let g=d+p-u;g*=a==="up"?-1:1,i+=g}return Dn(t).y+i},"y")}),"getLineFunctionsWithOffset")});var PZ,COe,kOe,NZ,MZ=_(()=>{"use strict";ft();PZ=s((e,t,r,n,i,a=!1,o)=>{t.arrowTypeStart&&NZ(e,"start",t.arrowTypeStart,r,n,i,a,o),t.arrowTypeEnd&&NZ(e,"end",t.arrowTypeEnd,r,n,i,a,o)},"addEdgeMarkers"),COe={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{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}},kOe=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],NZ=s((e,t,r,n,i,a,o=!1,l)=>{if(!r||r==="none")return;let u=COe[r],h=u&&kOe.includes(u.type);if(!u){Y.warn(`Unknown arrow type: ${r}`);return}let d=u.type,g=`${i}_${a}-${d}${t==="start"?"Start":"End"}${o&&h?"-margin":""}`;if(l&&l.trim()!==""){let m=l.replace(/[^\dA-Za-z]/g,"_"),y=`${g}_${m}`;if(!document.getElementById(y)){let x=document.getElementById(g);if(x){let T=x.cloneNode(!0);T.id=y,T.querySelectorAll("path, circle, line").forEach(k=>{k.setAttribute("stroke",l),u.fill&&k.setAttribute("fill",l)}),x.parentNode?.appendChild(T)}}e.attr(`marker-${t}`,`url(${n}#${y})`)}else e.attr(`marker-${t}`,`url(${n}#${g})`)},"addEdgeMarker")});function lk(e,t){vn(xe())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}function _Oe(e){let t=[],r=[];for(let n=1;n<e.length-1;n++){let i=e[n-1],a=e[n],o=e[n+1];(i.x===a.x&&a.y===o.y&&Math.abs(a.x-o.x)>5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===o.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-o.y)>5)&&(t.push(a),r.push(n))}return{cornerPoints:t,cornerPointPositions:r}}function LOe(e,t){if(e.length<2)return"";let r="",n=e.length,i=1e-5;for(let a=0;a<n;a++){let o=e[a],l=e[a-1],u=e[a+1];if(a===0)r+=`M${o.x},${o.y}`;else if(a===n-1)r+=`L${o.x},${o.y}`;else{let h=o.x-l.x,d=o.y-l.y,f=u.x-o.x,p=u.y-o.y,g=Math.hypot(h,d),m=Math.hypot(f,p);if(g<i||m<i){r+=`L${o.x},${o.y}`;continue}let y=h/g,x=d/g,T=f/m,C=p/m,k=y*T+x*C,E=Math.max(-1,Math.min(1,k)),v=Math.acos(E);if(v<i||Math.abs(Math.PI-v)<i){r+=`L${o.x},${o.y}`;continue}let S=Math.min(t/Math.sin(v/2),g/2,m/2),w=o.x-y*S,L=o.y-x*S,O=o.x+T*S,F=o.y+C*S;r+=`L${w},${L}`,r+=`Q${o.x},${o.y} ${O},${F}`}}return r}function BZ(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};let r=t.x-e.x,n=t.y-e.y;return{angle:Math.atan2(n,r),deltaX:r,deltaY:n}}function DOe(e,t){let r=e.map(i=>({...i}));if(e.length>=2&&ai[t.arrowTypeStart]){let i=ai[t.arrowTypeStart],a=e[0],o=e[1],{angle:l}=BZ(a,o),u=i*Math.cos(l),h=i*Math.sin(l);r[0].x=a.x+u,r[0].y=a.y+h}let n=e.length;if(n>=2&&ai[t.arrowTypeEnd]){let i=ai[t.arrowTypeEnd],a=e[n-1],o=e[n-2],{angle:l}=BZ(o,a),u=i*Math.cos(l),h=i*Math.sin(l);r[n-1].x=a.x-u,r[n-1].y=a.y-h}return r}var SOe,Id,Vn,FZ,ck,O1,bo,Cm,vOe,EOe,wOe,OZ,$Z,AOe,ROe,Ou,km=_(()=>{"use strict";Nt();ir();ft();mo();$C();DZ();Pt();jI();P1();Sr();At();JC();MZ();_t();SOe=s(e=>typeof e=="string"?e:xe()?.flowchart?.curve,"resolveEdgeCurveType"),Id=new Map,Vn=new Map,FZ=s(()=>{Id.clear(),Vn.clear()},"clear"),ck=s(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),"hasEdgeLabel"),O1=s(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),bo=s(async(e,t)=>{let r=xe(),n=vn(r),{labelStyles:i}=Ke(t);t.labelStyle=i;let a=e.insert("g").attr("class","edgeLabel"),o=a.insert("g").attr("class","label").attr("data-id",t.id),l=t.labelType==="markdown",h=await si(e,t.label,{style:O1(t.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:l,width:l?void 0:void 0},r);o.node().appendChild(h),Y.info("abc82",t,t.labelType);let d,f;if(n){let g=h.children[0],m=et(h);d=await nl.measure(()=>g.getBoundingClientRect()),f=d,m.attr("width",d.width),m.attr("height",d.height)}else{let g=et(h).select("text").node();await nl.measure(()=>{d=h.getBBox(),g&&typeof g.getBBox=="function"?f=g.getBBox():f=d})}o.attr("transform",Tm(f,n)),Id.set(t.id,a),t.width=d.width,t.height=d.height;let p;if(t.startLabelLeft){let g=e.insert("g").attr("class","edgeTerminals"),m=g.insert("g").attr("class","inner"),y=await xo(m,t.startLabelLeft,O1(t.labelStyle)||"",!1,!1);p=y;let x=y.getBBox();if(n){let T=y.children[0],C=et(y);x=T.getBoundingClientRect(),C.attr("width",x.width),C.attr("height",x.height)}m.attr("transform",Tm(x,n)),Vn.get(t.id)||Vn.set(t.id,{}),Vn.get(t.id).startLeft=g,lk(p,t.startLabelLeft)}if(t.startLabelRight){let g=e.insert("g").attr("class","edgeTerminals"),m=g.insert("g").attr("class","inner"),y=await xo(m,t.startLabelRight,O1(t.labelStyle)||"",!1,!1);p=y;let x=y.getBBox();if(n){let T=y.children[0],C=et(y);x=T.getBoundingClientRect(),C.attr("width",x.width),C.attr("height",x.height)}m.attr("transform",Tm(x,n)),Vn.get(t.id)||Vn.set(t.id,{}),Vn.get(t.id).startRight=g,lk(p,t.startLabelRight)}if(t.endLabelLeft){let g=e.insert("g").attr("class","edgeTerminals"),m=g.insert("g").attr("class","inner"),y=await xo(g,t.endLabelLeft,O1(t.labelStyle)||"",!1,!1);p=y;let x=y.getBBox();if(n){let T=y.children[0],C=et(y);x=T.getBoundingClientRect(),C.attr("width",x.width),C.attr("height",x.height)}m.attr("transform",Tm(x,n)),Vn.get(t.id)||Vn.set(t.id,{}),Vn.get(t.id).endLeft=g,lk(p,t.endLabelLeft)}if(t.endLabelRight){let g=e.insert("g").attr("class","edgeTerminals"),m=g.insert("g").attr("class","inner"),y=await xo(g,t.endLabelRight,O1(t.labelStyle)||"",!1,!1);p=y;let x=y.getBBox();if(n){let T=y.children[0],C=et(y);x=T.getBoundingClientRect(),C.attr("width",x.width),C.attr("height",x.height)}m.attr("transform",Tm(x,n)),Vn.get(t.id)||Vn.set(t.id,{}),Vn.get(t.id).endRight=g,lk(p,t.endLabelRight)}return h},"insertEdgeLabel");s(lk,"setTerminalWidth");Cm=s((e,t)=>{Y.debug("Moving label abc88 ",e.id,e.label,Id.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath,n=xe(),{subGraphTitleTotalMargin:i}=pc(n);if(e.label){let a=Id.get(e.id),o=e.x,l=e.y;if(r){let u=Bt.calcLabelPosition(r);Y.debug("Moving label "+e.label+" from (",o,",",l,") to (",u.x,",",u.y,") abc88"),t.updatedPath&&(o=u.x,l=u.y)}a.attr("transform",`translate(${o}, ${l+i/2})`)}if(e.startLabelLeft){let a=Vn.get(e.id).startLeft,o=e.x,l=e.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.startLabelRight){let a=Vn.get(e.id).startRight,o=e.x,l=e.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.endLabelLeft){let a=Vn.get(e.id).endLeft,o=e.x,l=e.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.endLabelRight){let a=Vn.get(e.id).endRight,o=e.x,l=e.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}},"positionEdgeLabel"),vOe=s((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;let[r,n]=t,i=Math.abs(n.x-r.x),a=Math.abs(n.y-r.y);return i<.001||a<.001?t:a>=i?[r,{x:r.x,y:n.y},n]:[r,{x:n.x,y:r.y},n]},"orthogonalizeToLabelClippedPoints"),EOe=s((e,t)=>{let r=e.x,n=e.y,i=Math.abs(t.x-r),a=Math.abs(t.y-n),o=e.width/2,l=e.height/2;return i>=o||a>=l},"outsideNode"),wOe=s((e,t,r)=>{Y.debug(`intersection calc abc89:
335
335
  outsidePoint: ${JSON.stringify(t)}
336
336
  insidePoint : ${JSON.stringify(r)}
337
- node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);let n=e.x,i=e.y,a=Math.abs(n-r.x),o=e.width/2,l=r.x<t.x?o-a:o+a,u=e.height/2,h=Math.abs(t.y-r.y),d=Math.abs(t.x-r.x);if(Math.abs(i-t.y)*o>Math.abs(n-t.x)*u){let f=r.y<t.y?t.y-u-i:i-u-t.y;l=d*f/h;let p={x:r.x<t.x?r.x+l:r.x-d+l,y:r.y<t.y?r.y+h-f:r.y-h+f};return l===0&&(p.x=t.x,p.y=t.y),d===0&&(p.x=t.x),h===0&&(p.y=t.y),Y.debug(`abc89 top/bottom calc, Q ${h}, q ${f}, R ${d}, r ${l}`,p),p}else{r.x<t.x?l=t.x-o-n:l=n-o-t.x;let f=h*l/d,p=r.x<t.x?r.x+d-l:r.x-d+l,g=r.y<t.y?r.y+f:r.y-f;return Y.debug(`sides calc abc89, Q ${h}, q ${f}, R ${d}, r ${l}`,{_x:p,_y:g}),l===0&&(p=t.x,g=t.y),d===0&&(p=t.x),h===0&&(g=t.y),{x:p,y:g}}},"intersection"),OZ=s((e,t)=>{Y.warn("abc88 cutPathAtIntersect",e,t);let r=[],n=e[0],i=!1;return e.forEach(a=>{if(Y.info("abc88 checking point",a,t),!EOe(t,a)&&!i){let o=wOe(t,n,a);Y.debug("abc88 inside",a,n,o),Y.debug("abc88 intersection",o,t);let l=!1;r.forEach(u=>{l=l||u.x===o.x&&u.y===o.y}),r.some(u=>u.x===o.x&&u.y===o.y)?Y.warn("abc88 no intersect",o,r):r.push(o),i=!0}else Y.warn("abc88 outside",a,n),n=a,i||r.push(a)}),Y.debug("returning points",r),r},"cutPathAtIntersect");s(_Oe,"extractCornerPoints");$Z=s(function(e,t,r){let n=t.x-e.x,i=t.y-e.y,a=Math.sqrt(n*n+i*i),o=r/a;return{x:t.x-o*n,y:t.y-o*i}},"findAdjacentPoint"),AOe=s(function(e){let{cornerPointPositions:t}=_Oe(e),r=[];for(let n=0;n<e.length;n++)if(t.includes(n)){let i=e[n-1],a=e[n+1],o=e[n],l=$Z(i,o,5),u=$Z(a,o,5),h=u.x-l.x,d=u.y-l.y;r.push(l);let f=Math.sqrt(2)*2,p={x:o.x,y:o.y};if(Math.abs(a.x-i.x)>10&&Math.abs(a.y-i.y)>=10){Y.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));let g=5;o.x===l.x?p={x:h<0?l.x-g+f:l.x+g-f,y:d<0?l.y-f:l.y+f}:p={x:h<0?l.x-f:l.x+f,y:d<0?l.y-g+f:l.y+g-f}}else Y.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(p,u)}else r.push(e[n]);return r},"fixCorners"),ROe=s((e,t,r)=>{let n=e-t-r,i=2,a=2,o=i+a,l=Math.floor(n/o),u=Number.isFinite(l)?Math.max(0,l):0,h=Array(u).fill(`${i} ${a}`).join(" ");return`0 ${t} ${h} ${r}`},"generateDashArray"),Ou=s(function(e,t,r,n,i,a,o,l=!1){if(!o)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);let{handDrawnSeed:u,layout:h}=xe(),d=t.points,f=!1,p=i;var g=a;let m=[];for(let D in t.cssCompiledStyles)C1(D)||m.push(t.cssCompiledStyles[D]);if(h==="swimlane"){if(g.intersect&&p.intersect&&Array.isArray(d)&&d.length>=2)if(d.length===2)d=[p.intersect(d[0]),g.intersect(d[1])];else{let D=d.slice(1,-1),$=D[0],W=D[D.length-1],q=.5,z=Math.abs(d[d.length-1].x-W.x)<q&&Math.abs(d[d.length-1].y-W.y)<q,j=p.intersect($),J=z?W:g.intersect(W),ee=Math.abs(J.x-W.x)<q&&Math.abs(J.y-W.y)<q,se=Math.abs(j.x-$.x)<q&&Math.abs(j.y-$.y)<q?[]:[j],Ce=ee?[]:[J];d=[...se,...D,...Ce]}d=vOe(t,d)}else g.intersect&&p.intersect&&!l&&(d=d.slice(1,t.points.length-1),d.unshift(p.intersect(d[0])),d.push(g.intersect(d[d.length-1])));let y=btoa(JSON.stringify(d));t.toCluster&&(Y.info("to cluster abc88",r.get(t.toCluster)),d=OZ(t.points,r.get(t.toCluster).node),f=!0),t.fromCluster&&(Y.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(d,null,2)),d=OZ(d.reverse(),r.get(t.fromCluster).node).reverse(),f=!0);let x=d.filter(D=>!Number.isNaN(D.y)),T=SOe(t.curve);T!=="rounded"&&(x=AOe(x));let C=el;switch(T){case"linear":C=el;break;case"basis":C=cc;break;case"cardinal":C=Y0;break;case"bumpX":C=W0;break;case"bumpY":C=q0;break;case"catmullRom":C=Q0;break;case"monotoneX":C=Z0;break;case"monotoneY":C=J0;break;case"natural":C=cm;break;case"step":C=um;break;case"stepAfter":C=t1;break;case"stepBefore":C=e1;break;case"rounded":C=el;break;default:C=cc}let{x:k,y:E}=IZ(t),v=lc().x(k).y(E).curve(C),S;switch(t.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(t.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let w,L=T==="rounded"?LOe(DOe(x,t),5):v(x),O=Array.isArray(t.style)?t.style:[t.style],F=O.find(D=>D?.startsWith("stroke:")),N="";t.animate&&(N="edge-animation-fast"),t.animation&&(N="edge-animation-"+t.animation);let G=!1;if(t.look==="handDrawn"){let D=Xe.svg(e);Object.assign([],x);let $=D.path(L,{roughness:.3,seed:u});S+=" transition",w=et($).select("path").attr("id",`${o}-${t.id}`).attr("class"," "+S+(t.classes?" "+t.classes:"")+(N?" "+N:"")).attr("style",O?O.reduce((q,z)=>q+";"+z,""):"");let W=w.attr("d");w.attr("d",W),e.node().appendChild(w.node())}else{let D=m.join(";"),$=O?O.reduce((ee,le)=>ee+le+";",""):"",W=(D?D+";"+$+";":$)+";"+(O?O.reduce((ee,le)=>ee+";"+le,""):"");w=e.append("path").attr("d",L).attr("id",`${o}-${t.id}`).attr("class"," "+S+(t.classes?" "+t.classes:"")+(N?" "+N:"")).attr("style",W),F=W.match(/stroke:([^;]+)/)?.[1],G=t.animate===!0||!!t.animation||D.includes("animation");let q=w.node(),z=typeof q.getTotalLength=="function"?q.getTotalLength():0,j=qI[t.arrowTypeStart]||0,J=qI[t.arrowTypeEnd]||0;if(t.look==="neo"&&!G){let le=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?ROe(z,j,J):`0 ${j} ${z-j-J} ${J}`}; stroke-dashoffset: 0;`;w.attr("style",le+w.attr("style"))}}w.attr("data-edge",!0),w.attr("data-et","edge"),w.attr("data-id",t.id),w.attr("data-points",y),w.attr("data-look",$r(t.look)),t.showPoints&&x.forEach(D=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",D.x).attr("cy",D.y)});let A="";(xe().flowchart.arrowMarkerAbsolute||xe().state.arrowMarkerAbsolute)&&(A=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,A=A.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),Y.info("arrowTypeStart",t.arrowTypeStart),Y.info("arrowTypeEnd",t.arrowTypeEnd);let M=!G&&t?.look==="neo";PZ(w,t,A,o,n,M,F);let I=Math.floor(d.length/2),P=d[I];Bt.isLabelCoordinateInPath(P,w.attr("d"))||(f=!0);let B={};return f&&(B.updatedPath=d),B.originalPath=t.points,B},"insertEdge");s(LOe,"generateRoundedPath");s(BZ,"calculateDeltaAndAngle");s(DOe,"applyMarkerOffsetsToPoints")});var IOe,NOe,POe,MOe,OOe,$Oe,BOe,FOe,GOe,zOe,VOe,WOe,qOe,jOe,HOe,UOe,YOe,KOe,XOe,QOe,ZOe,JOe,e6e,t6e,Sm,uk=_(()=>{"use strict";ft();ir();IOe=s((e,t,r,n)=>{t.forEach(i=>{t6e[i](e,r,n)})},"insertMarkers"),NOe=s((e,t,r)=>{Y.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).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"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),POe=s((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).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"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).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"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),MOe=s((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).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"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).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"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),OOe=s((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).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"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).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"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),$Oe=s((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),BOe=s((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).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"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).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"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),FOe=s((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).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"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).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"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),GOe=s((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).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"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).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"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),zOe=s((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-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"),VOe=s((e,t,r)=>{let n=mt(),{themeVariables:i}=n,{transitionColor:a}=i;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),WOe=s((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).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"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).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"),qOe=s((e,t,r)=>{let n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).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=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).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"),jOe=s((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).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"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).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"),HOe=s((e,t,r)=>{let n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).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=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).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"),UOe=s((e,t,r)=>{let n=mt(),{themeVariables:i}=n,{strokeWidth:a}=i;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),YOe=s((e,t,r)=>{let n=mt(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:o}=i,l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",o??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);let u=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");u.append("circle").attr("fill",o??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),u.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),KOe=s((e,t,r)=>{let n=mt(),{themeVariables:i}=n,{strokeWidth:a}=i;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),XOe=s((e,t,r)=>{let n=mt(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:o}=i,l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",o??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);let u=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");u.append("circle").attr("fill",o??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),u.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),QOe=s((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
337
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);let n=e.x,i=e.y,a=Math.abs(n-r.x),o=e.width/2,l=r.x<t.x?o-a:o+a,u=e.height/2,h=Math.abs(t.y-r.y),d=Math.abs(t.x-r.x);if(Math.abs(i-t.y)*o>Math.abs(n-t.x)*u){let f=r.y<t.y?t.y-u-i:i-u-t.y;l=d*f/h;let p={x:r.x<t.x?r.x+l:r.x-d+l,y:r.y<t.y?r.y+h-f:r.y-h+f};return l===0&&(p.x=t.x,p.y=t.y),d===0&&(p.x=t.x),h===0&&(p.y=t.y),Y.debug(`abc89 top/bottom calc, Q ${h}, q ${f}, R ${d}, r ${l}`,p),p}else{r.x<t.x?l=t.x-o-n:l=n-o-t.x;let f=h*l/d,p=r.x<t.x?r.x+d-l:r.x-d+l,g=r.y<t.y?r.y+f:r.y-f;return Y.debug(`sides calc abc89, Q ${h}, q ${f}, R ${d}, r ${l}`,{_x:p,_y:g}),l===0&&(p=t.x,g=t.y),d===0&&(p=t.x),h===0&&(g=t.y),{x:p,y:g}}},"intersection"),OZ=s((e,t)=>{Y.warn("abc88 cutPathAtIntersect",e,t);let r=[],n=e[0],i=!1;return e.forEach(a=>{if(Y.info("abc88 checking point",a,t),!EOe(t,a)&&!i){let o=wOe(t,n,a);Y.debug("abc88 inside",a,n,o),Y.debug("abc88 intersection",o,t);let l=!1;r.forEach(u=>{l=l||u.x===o.x&&u.y===o.y}),r.some(u=>u.x===o.x&&u.y===o.y)?Y.warn("abc88 no intersect",o,r):r.push(o),i=!0}else Y.warn("abc88 outside",a,n),n=a,i||r.push(a)}),Y.debug("returning points",r),r},"cutPathAtIntersect");s(_Oe,"extractCornerPoints");$Z=s(function(e,t,r){let n=t.x-e.x,i=t.y-e.y,a=Math.sqrt(n*n+i*i),o=r/a;return{x:t.x-o*n,y:t.y-o*i}},"findAdjacentPoint"),AOe=s(function(e){let{cornerPointPositions:t}=_Oe(e),r=[];for(let n=0;n<e.length;n++)if(t.includes(n)){let i=e[n-1],a=e[n+1],o=e[n],l=$Z(i,o,5),u=$Z(a,o,5),h=u.x-l.x,d=u.y-l.y;r.push(l);let f=Math.sqrt(2)*2,p={x:o.x,y:o.y};if(Math.abs(a.x-i.x)>10&&Math.abs(a.y-i.y)>=10){Y.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));let g=5;o.x===l.x?p={x:h<0?l.x-g+f:l.x+g-f,y:d<0?l.y-f:l.y+f}:p={x:h<0?l.x-f:l.x+f,y:d<0?l.y-g+f:l.y+g-f}}else Y.debug("Corner point skipping fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));r.push(p,u)}else r.push(e[n]);return r},"fixCorners"),ROe=s((e,t,r)=>{let n=e-t-r,i=2,a=2,o=i+a,l=Math.floor(n/o),u=Number.isFinite(l)?Math.max(0,l):0,h=Array(u).fill(`${i} ${a}`).join(" ");return`0 ${t} ${h} ${r}`},"generateDashArray"),Ou=s(function(e,t,r,n,i,a,o,l=!1){if(!o)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);let{handDrawnSeed:u,layout:h}=xe(),d=t.points,f=!1,p=i;var g=a;let m=[];for(let D in t.cssCompiledStyles)C1(D)||m.push(t.cssCompiledStyles[D]);if(h==="swimlane"){if(g.intersect&&p.intersect&&Array.isArray(d)&&d.length>=2)if(d.length===2)d=[p.intersect(d[0]),g.intersect(d[1])];else{let D=d.slice(1,-1),$=D[0],W=D[D.length-1],q=.5,z=Math.abs(d[d.length-1].x-W.x)<q&&Math.abs(d[d.length-1].y-W.y)<q,j=p.intersect($),J=z?W:g.intersect(W),ee=Math.abs(J.x-W.x)<q&&Math.abs(J.y-W.y)<q,se=Math.abs(j.x-$.x)<q&&Math.abs(j.y-$.y)<q?[]:[j],Ce=ee?[]:[J];d=[...se,...D,...Ce]}d=vOe(t,d)}else g.intersect&&p.intersect&&!l&&(d=d.slice(1,t.points.length-1),d.unshift(p.intersect(d[0])),d.push(g.intersect(d[d.length-1])));let y=btoa(JSON.stringify(d));t.toCluster&&(Y.info("to cluster abc88",r.get(t.toCluster)),d=OZ(t.points,r.get(t.toCluster).node),f=!0),t.fromCluster&&(Y.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(d,null,2)),d=OZ(d.reverse(),r.get(t.fromCluster).node).reverse(),f=!0);let x=d.filter(D=>!Number.isNaN(D.y)),T=SOe(t.curve);T!=="rounded"&&(x=AOe(x));let C=el;switch(T){case"linear":C=el;break;case"basis":C=cc;break;case"cardinal":C=Y0;break;case"bumpX":C=W0;break;case"bumpY":C=q0;break;case"catmullRom":C=Q0;break;case"monotoneX":C=Z0;break;case"monotoneY":C=J0;break;case"natural":C=cm;break;case"step":C=um;break;case"stepAfter":C=t1;break;case"stepBefore":C=e1;break;case"rounded":C=el;break;default:C=cc}let{x:k,y:E}=IZ(t),v=lc().x(k).y(E).curve(C),S;switch(t.thickness){case"normal":S="edge-thickness-normal";break;case"thick":S="edge-thickness-thick";break;case"invisible":S="edge-thickness-invisible";break;default:S="edge-thickness-normal"}switch(t.pattern){case"solid":S+=" edge-pattern-solid";break;case"dotted":S+=" edge-pattern-dotted";break;case"dashed":S+=" edge-pattern-dashed";break;default:S+=" edge-pattern-solid"}let w,L=T==="rounded"?LOe(DOe(x,t),5):v(x),O=Array.isArray(t.style)?t.style:[t.style],F=O.find(D=>D?.startsWith("stroke:")),N="";t.animate&&(N="edge-animation-fast"),t.animation&&(N="edge-animation-"+t.animation);let G=!1;if(t.look==="handDrawn"){let D=Xe.svg(e);Object.assign([],x);let $=D.path(L,{roughness:.3,seed:u});S+=" transition",w=et($).select("path").attr("id",`${o}-${t.id}`).attr("class"," "+S+(t.classes?" "+t.classes:"")+(N?" "+N:"")).attr("style",O?O.reduce((q,z)=>q+";"+z,""):"");let W=w.attr("d");w.attr("d",W),e.node().appendChild(w.node())}else{let D=m.join(";"),$=O?O.reduce((ee,le)=>ee+le+";",""):"",W=(D?D+";"+$+";":$)+";"+(O?O.reduce((ee,le)=>ee+";"+le,""):"");w=e.append("path").attr("d",L).attr("id",`${o}-${t.id}`).attr("class"," "+S+(t.classes?" "+t.classes:"")+(N?" "+N:"")).attr("style",W),F=W.match(/stroke:([^;]+)/)?.[1],G=t.animate===!0||!!t.animation||D.includes("animation");let q=w.node(),z=typeof q.getTotalLength=="function"?q.getTotalLength():0,j=qI[t.arrowTypeStart]||0,J=qI[t.arrowTypeEnd]||0;if(t.look==="neo"&&!G){let le=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?ROe(z,j,J):`0 ${j} ${z-j-J} ${J}`}; stroke-dashoffset: 0;`;w.attr("style",le+w.attr("style"))}}w.attr("data-edge",!0),w.attr("data-et","edge"),w.attr("data-id",t.id),w.attr("data-points",y),w.attr("data-look",$r(t.look)),t.showPoints&&x.forEach(D=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",D.x).attr("cy",D.y)});let A="";(xe().flowchart.arrowMarkerAbsolute||xe().state.arrowMarkerAbsolute)&&(A=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,A=A.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),Y.info("arrowTypeStart",t.arrowTypeStart),Y.info("arrowTypeEnd",t.arrowTypeEnd);let M=!G&&t?.look==="neo";PZ(w,t,A,o,n,M,F);let I=Math.floor(d.length/2),P=d[I];Bt.isLabelCoordinateInPath(P,w.attr("d"))||(f=!0);let B={};return f&&(B.updatedPath=d),B.originalPath=t.points,B},"insertEdge");s(LOe,"generateRoundedPath");s(BZ,"calculateDeltaAndAngle");s(DOe,"applyMarkerOffsetsToPoints")});var IOe,NOe,POe,MOe,OOe,$Oe,BOe,FOe,GOe,zOe,VOe,WOe,qOe,jOe,HOe,UOe,YOe,KOe,XOe,QOe,ZOe,JOe,e6e,t6e,Sm,uk=_(()=>{"use strict";ft();ir();IOe=s((e,t,r,n)=>{t.forEach(i=>{t6e[i](e,r,n)})},"insertMarkers"),NOe=s((e,t,r)=>{Y.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),POe=s((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),MOe=s((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),OOe=s((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),$Oe=s((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),BOe=s((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).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"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).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"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),FOe=s((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).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"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).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"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),GOe=s((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).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"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).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"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),zOe=s((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-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"),VOe=s((e,t,r)=>{let n=mt(),{themeVariables:i}=n,{transitionColor:a}=i;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),WOe=s((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).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"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).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"),qOe=s((e,t,r)=>{let n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).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=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).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"),jOe=s((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).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"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).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"),HOe=s((e,t,r)=>{let n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).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=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).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"),UOe=s((e,t,r)=>{let n=mt(),{themeVariables:i}=n,{strokeWidth:a}=i;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),YOe=s((e,t,r)=>{let n=mt(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:o}=i,l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",o??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);let u=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");u.append("circle").attr("fill",o??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),u.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),KOe=s((e,t,r)=>{let n=mt(),{themeVariables:i}=n,{strokeWidth:a}=i;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),XOe=s((e,t,r)=>{let n=mt(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:o}=i,l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",o??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);let u=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");u.append("circle").attr("fill",o??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),u.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),QOe=s((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
338
338
  L20,10
339
339
  M20,10
340
340
  L0,20`)},"requirement_arrow"),ZOe=s((e,t,r)=>{let n=mt(),{themeVariables:i}=n,{strokeWidth:a}=i;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
341
341
  L20,10
342
342
  M20,10
343
- L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),JOe=s((e,t,r)=>{let n=e.append("defs").append("marker").attr("id",r+"_"+t+"-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"),e6e=s((e,t,r)=>{let n=mt(),{themeVariables:i}=n,{strokeWidth:a}=i,o=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");o.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),o.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),o.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),o.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),t6e={extension:NOe,composition:POe,aggregation:MOe,dependency:OOe,lollipop:$Oe,point:BOe,circle:FOe,cross:GOe,barb:zOe,barbNeo:VOe,only_one:WOe,zero_or_one:qOe,one_or_more:jOe,zero_or_more:HOe,only_one_neo:UOe,zero_or_one_neo:YOe,one_or_more_neo:KOe,zero_or_more_neo:XOe,requirement_arrow:QOe,requirement_contains:JOe,requirement_arrow_neo:ZOe,requirement_contains_neo:e6e},Sm=IOe});async function mc(e,t,r){let n,i;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");let a=t.shape?A1[t.shape]:void 0;if(!a)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let o;r.config.securityLevel==="sandbox"?o="_top":t.linkTarget&&(o=t.linkTarget||"_blank"),n=e.insert("svg:a").attr("xlink:href",t.link).attr("target",o??null),i=await a(n,t,r)}else i=await a(e,t,r),n=i;return n.attr("data-look",$r(t.look)),t.tooltip&&i.attr("title",t.tooltip),hk.set(t.id,n),t.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}var hk,GZ,zZ,ll,Nd=_(()=>{"use strict";ft();tk();Pt();hk=new Map;s(mc,"insertNode");GZ=s((e,t)=>{hk.set(t.id,e)},"setNodeElem"),zZ=s(()=>{hk.clear()},"clear"),ll=s(e=>{let t=hk.get(e.id);Y.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");let r=8,n=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+n-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),n},"positionNode")});var VZ,WZ=_(()=>{"use strict";ir();vr();ft();M1();km();uk();Nd();Ct();Pt();VZ={common:ot,getConfig:mt,insertCluster:Mu,insertEdge:Ou,insertEdgeLabel:bo,insertMarkers:Sm,insertNode:mc,interpolateToCurve:g4,labelHelper:it,log:Y,positionEdgeLabel:Cm}});var r6e,dk,HI=_(()=>{"use strict";r6e=typeof global=="object"&&global&&global.Object===Object&&global,dk=r6e});var n6e,i6e,Wn,Oa=_(()=>{"use strict";HI();n6e=typeof self=="object"&&self&&self.Object===Object&&self,i6e=dk||n6e||Function("return this")(),Wn=i6e});var s6e,Ni,Pd=_(()=>{"use strict";Oa();s6e=Wn.Symbol,Ni=s6e});function l6e(e){var t=a6e.call(e,$1),r=e[$1];try{e[$1]=void 0;var n=!0}catch{}var i=o6e.call(e);return n&&(t?e[$1]=r:delete e[$1]),i}var qZ,a6e,o6e,$1,jZ,HZ=_(()=>{"use strict";Pd();qZ=Object.prototype,a6e=qZ.hasOwnProperty,o6e=qZ.toString,$1=Ni?Ni.toStringTag:void 0;s(l6e,"getRawTag");jZ=l6e});function h6e(e){return u6e.call(e)}var c6e,u6e,UZ,YZ=_(()=>{"use strict";c6e=Object.prototype,u6e=c6e.toString;s(h6e,"objectToString");UZ=h6e});function p6e(e){return e==null?e===void 0?f6e:d6e:KZ&&KZ in Object(e)?jZ(e):UZ(e)}var d6e,f6e,KZ,ys,$u=_(()=>{"use strict";Pd();HZ();YZ();d6e="[object Null]",f6e="[object Undefined]",KZ=Ni?Ni.toStringTag:void 0;s(p6e,"baseGetTag");ys=p6e});function m6e(e){return e!=null&&typeof e=="object"}var Xn,To=_(()=>{"use strict";s(m6e,"isObjectLike");Xn=m6e});function y6e(e){return typeof e=="symbol"||Xn(e)&&ys(e)==g6e}var g6e,fa,Md=_(()=>{"use strict";$u();To();g6e="[object Symbol]";s(y6e,"isSymbol");fa=y6e});function x6e(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var cl,B1=_(()=>{"use strict";s(x6e,"arrayMap");cl=x6e});var b6e,wr,oi=_(()=>{"use strict";b6e=Array.isArray,wr=b6e});function ZZ(e){if(typeof e=="string")return e;if(wr(e))return cl(e,ZZ)+"";if(fa(e))return QZ?QZ.call(e):"";var t=e+"";return t=="0"&&1/e==-T6e?"-0":t}var T6e,XZ,QZ,JZ,eJ=_(()=>{"use strict";Pd();B1();oi();Md();T6e=1/0,XZ=Ni?Ni.prototype:void 0,QZ=XZ?XZ.toString:void 0;s(ZZ,"baseToString");JZ=ZZ});function k6e(e){for(var t=e.length;t--&&C6e.test(e.charAt(t)););return t}var C6e,tJ,rJ=_(()=>{"use strict";C6e=/\s/;s(k6e,"trimmedEndIndex");tJ=k6e});function v6e(e){return e&&e.slice(0,tJ(e)+1).replace(S6e,"")}var S6e,nJ,iJ=_(()=>{"use strict";rJ();S6e=/^\s+/;s(v6e,"baseTrim");nJ=v6e});function E6e(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var In,$a=_(()=>{"use strict";s(E6e,"isObject");In=E6e});function L6e(e){if(typeof e=="number")return e;if(fa(e))return sJ;if(In(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=In(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=nJ(e);var r=_6e.test(e);return r||A6e.test(e)?R6e(e.slice(2),r?2:8):w6e.test(e)?sJ:+e}var sJ,w6e,_6e,A6e,R6e,aJ,oJ=_(()=>{"use strict";iJ();$a();Md();sJ=NaN,w6e=/^[-+]0x[0-9a-f]+$/i,_6e=/^0b[01]+$/i,A6e=/^0o[0-7]+$/i,R6e=parseInt;s(L6e,"toNumber");aJ=L6e});function I6e(e){if(!e)return e===0?e:0;if(e=aJ(e),e===lJ||e===-lJ){var t=e<0?-1:1;return t*D6e}return e===e?e:0}var lJ,D6e,vm,UI=_(()=>{"use strict";oJ();lJ=1/0,D6e=17976931348623157e292;s(I6e,"toFinite");vm=I6e});function N6e(e){var t=vm(e),r=t%1;return t===t?r?t-r:t:0}var cJ,uJ=_(()=>{"use strict";UI();s(N6e,"toInteger");cJ=N6e});function P6e(e){return e}var Os,Bu=_(()=>{"use strict";s(P6e,"identity");Os=P6e});function F6e(e){if(!In(e))return!1;var t=ys(e);return t==O6e||t==$6e||t==M6e||t==B6e}var M6e,O6e,$6e,B6e,ul,F1=_(()=>{"use strict";$u();$a();M6e="[object AsyncFunction]",O6e="[object Function]",$6e="[object GeneratorFunction]",B6e="[object Proxy]";s(F6e,"isFunction");ul=F6e});var G6e,fk,hJ=_(()=>{"use strict";Oa();G6e=Wn["__core-js_shared__"],fk=G6e});function z6e(e){return!!dJ&&dJ in e}var dJ,fJ,pJ=_(()=>{"use strict";hJ();dJ=(function(){var e=/[^.]+$/.exec(fk&&fk.keys&&fk.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();s(z6e,"isMasked");fJ=z6e});function q6e(e){if(e!=null){try{return W6e.call(e)}catch{}try{return e+""}catch{}}return""}var V6e,W6e,gc,YI=_(()=>{"use strict";V6e=Function.prototype,W6e=V6e.toString;s(q6e,"toSource");gc=q6e});function Z6e(e){if(!In(e)||fJ(e))return!1;var t=ul(e)?Q6e:H6e;return t.test(gc(e))}var j6e,H6e,U6e,Y6e,K6e,X6e,Q6e,mJ,gJ=_(()=>{"use strict";F1();pJ();$a();YI();j6e=/[\\^$.*+?()[\]{}|]/g,H6e=/^\[object .+?Constructor\]$/,U6e=Function.prototype,Y6e=Object.prototype,K6e=U6e.toString,X6e=Y6e.hasOwnProperty,Q6e=RegExp("^"+K6e.call(X6e).replace(j6e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");s(Z6e,"baseIsNative");mJ=Z6e});function J6e(e,t){return e?.[t]}var yJ,xJ=_(()=>{"use strict";s(J6e,"getValue");yJ=J6e});function e$e(e,t){var r=yJ(e,t);return mJ(r)?r:void 0}var $s,Fu=_(()=>{"use strict";gJ();xJ();s(e$e,"getNative");$s=e$e});var t$e,pk,bJ=_(()=>{"use strict";Fu();Oa();t$e=$s(Wn,"WeakMap"),pk=t$e});var TJ,r$e,CJ,kJ=_(()=>{"use strict";$a();TJ=Object.create,r$e=(function(){function e(){}return s(e,"object"),function(t){if(!In(t))return{};if(TJ)return TJ(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})(),CJ=r$e});function n$e(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var SJ,vJ=_(()=>{"use strict";s(n$e,"apply");SJ=n$e});function i$e(){}var EJ,wJ=_(()=>{"use strict";s(i$e,"noop");EJ=i$e});function s$e(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var mk,KI=_(()=>{"use strict";s(s$e,"copyArray");mk=s$e});function c$e(e){var t=0,r=0;return function(){var n=l$e(),i=o$e-(n-r);if(r=n,i>0){if(++t>=a$e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var a$e,o$e,l$e,_J,AJ=_(()=>{"use strict";a$e=800,o$e=16,l$e=Date.now;s(c$e,"shortOut");_J=c$e});function u$e(e){return function(){return e}}var Bs,XI=_(()=>{"use strict";s(u$e,"constant");Bs=u$e});var h$e,Em,QI=_(()=>{"use strict";Fu();h$e=(function(){try{var e=$s(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Em=h$e});var d$e,RJ,LJ=_(()=>{"use strict";XI();QI();Bu();d$e=Em?function(e,t){return Em(e,"toString",{configurable:!0,enumerable:!1,value:Bs(t),writable:!0})}:Os,RJ=d$e});var f$e,gk,ZI=_(()=>{"use strict";LJ();AJ();f$e=_J(RJ),gk=f$e});function p$e(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var yk,JI=_(()=>{"use strict";s(p$e,"arrayEach");yk=p$e});function m$e(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}var xk,e5=_(()=>{"use strict";s(m$e,"baseFindIndex");xk=m$e});function g$e(e){return e!==e}var DJ,IJ=_(()=>{"use strict";s(g$e,"baseIsNaN");DJ=g$e});function y$e(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var NJ,PJ=_(()=>{"use strict";s(y$e,"strictIndexOf");NJ=y$e});function x$e(e,t,r){return t===t?NJ(e,t,r):xk(e,DJ,r)}var MJ,OJ=_(()=>{"use strict";e5();IJ();PJ();s(x$e,"baseIndexOf");MJ=x$e});function b$e(e,t){var r=e==null?0:e.length;return!!r&&MJ(e,t,0)>-1}var $J,BJ=_(()=>{"use strict";OJ();s(b$e,"arrayIncludes");$J=b$e});function k$e(e,t){var r=typeof e;return t=t??T$e,!!t&&(r=="number"||r!="symbol"&&C$e.test(e))&&e>-1&&e%1==0&&e<t}var T$e,C$e,Gu,G1=_(()=>{"use strict";T$e=9007199254740991,C$e=/^(?:0|[1-9]\d*)$/;s(k$e,"isIndex");Gu=k$e});function S$e(e,t,r){t=="__proto__"&&Em?Em(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var zu,z1=_(()=>{"use strict";QI();s(S$e,"baseAssignValue");zu=S$e});function v$e(e,t){return e===t||e!==e&&t!==t}var Ba,Od=_(()=>{"use strict";s(v$e,"eq");Ba=v$e});function _$e(e,t,r){var n=e[t];(!(w$e.call(e,t)&&Ba(n,r))||r===void 0&&!(t in e))&&zu(e,t,r)}var E$e,w$e,Vu,V1=_(()=>{"use strict";z1();Od();E$e=Object.prototype,w$e=E$e.hasOwnProperty;s(_$e,"assignValue");Vu=_$e});function A$e(e,t,r,n){var i=!r;r||(r={});for(var a=-1,o=t.length;++a<o;){var l=t[a],u=n?n(r[l],e[l],l,r,e):void 0;u===void 0&&(u=e[l]),i?zu(r,l,u):Vu(r,l,u)}return r}var hl,wm=_(()=>{"use strict";V1();z1();s(A$e,"copyObject");hl=A$e});function R$e(e,t,r){return t=FJ(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=FJ(n.length-t,0),o=Array(a);++i<a;)o[i]=n[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=n[i];return l[t]=r(o),SJ(e,this,l)}}var FJ,bk,t5=_(()=>{"use strict";vJ();FJ=Math.max;s(R$e,"overRest");bk=R$e});function L$e(e,t){return gk(bk(e,t,Os),e+"")}var Wu,W1=_(()=>{"use strict";Bu();t5();ZI();s(L$e,"baseRest");Wu=L$e});function I$e(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=D$e}var D$e,_m,Tk=_(()=>{"use strict";D$e=9007199254740991;s(I$e,"isLength");_m=I$e});function N$e(e){return e!=null&&_m(e.length)&&!ul(e)}var Pi,dl=_(()=>{"use strict";F1();Tk();s(N$e,"isArrayLike");Pi=N$e});function P$e(e,t,r){if(!In(r))return!1;var n=typeof t;return(n=="number"?Pi(r)&&Gu(t,r.length):n=="string"&&t in r)?Ba(r[t],e):!1}var yc,q1=_(()=>{"use strict";Od();dl();G1();$a();s(P$e,"isIterateeCall");yc=P$e});function M$e(e){return Wu(function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,o&&yc(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var l=r[n];l&&e(t,l,n,a)}return t})}var GJ,zJ=_(()=>{"use strict";W1();q1();s(M$e,"createAssigner");GJ=M$e});function $$e(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||O$e;return e===r}var O$e,qu,j1=_(()=>{"use strict";O$e=Object.prototype;s($$e,"isPrototype");qu=$$e});function B$e(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var VJ,WJ=_(()=>{"use strict";s(B$e,"baseTimes");VJ=B$e});function G$e(e){return Xn(e)&&ys(e)==F$e}var F$e,r5,qJ=_(()=>{"use strict";$u();To();F$e="[object Arguments]";s(G$e,"baseIsArguments");r5=G$e});var jJ,z$e,V$e,W$e,Co,Am=_(()=>{"use strict";qJ();To();jJ=Object.prototype,z$e=jJ.hasOwnProperty,V$e=jJ.propertyIsEnumerable,W$e=r5((function(){return arguments})())?r5:function(e){return Xn(e)&&z$e.call(e,"callee")&&!V$e.call(e,"callee")},Co=W$e});function q$e(){return!1}var HJ,UJ=_(()=>{"use strict";s(q$e,"stubFalse");HJ=q$e});var XJ,YJ,j$e,KJ,H$e,U$e,ko,Rm=_(()=>{"use strict";Oa();UJ();XJ=typeof exports=="object"&&exports&&!exports.nodeType&&exports,YJ=XJ&&typeof module=="object"&&module&&!module.nodeType&&module,j$e=YJ&&YJ.exports===XJ,KJ=j$e?Wn.Buffer:void 0,H$e=KJ?KJ.isBuffer:void 0,U$e=H$e||HJ,ko=U$e});function xBe(e){return Xn(e)&&_m(e.length)&&!!wn[ys(e)]}var Y$e,K$e,X$e,Q$e,Z$e,J$e,eBe,tBe,rBe,nBe,iBe,sBe,aBe,oBe,lBe,cBe,uBe,hBe,dBe,fBe,pBe,mBe,gBe,yBe,wn,QJ,ZJ=_(()=>{"use strict";$u();Tk();To();Y$e="[object Arguments]",K$e="[object Array]",X$e="[object Boolean]",Q$e="[object Date]",Z$e="[object Error]",J$e="[object Function]",eBe="[object Map]",tBe="[object Number]",rBe="[object Object]",nBe="[object RegExp]",iBe="[object Set]",sBe="[object String]",aBe="[object WeakMap]",oBe="[object ArrayBuffer]",lBe="[object DataView]",cBe="[object Float32Array]",uBe="[object Float64Array]",hBe="[object Int8Array]",dBe="[object Int16Array]",fBe="[object Int32Array]",pBe="[object Uint8Array]",mBe="[object Uint8ClampedArray]",gBe="[object Uint16Array]",yBe="[object Uint32Array]",wn={};wn[cBe]=wn[uBe]=wn[hBe]=wn[dBe]=wn[fBe]=wn[pBe]=wn[mBe]=wn[gBe]=wn[yBe]=!0;wn[Y$e]=wn[K$e]=wn[oBe]=wn[X$e]=wn[lBe]=wn[Q$e]=wn[Z$e]=wn[J$e]=wn[eBe]=wn[tBe]=wn[rBe]=wn[nBe]=wn[iBe]=wn[sBe]=wn[aBe]=!1;s(xBe,"baseIsTypedArray");QJ=xBe});function bBe(e){return function(t){return e(t)}}var ju,H1=_(()=>{"use strict";s(bBe,"baseUnary");ju=bBe});var JJ,U1,TBe,n5,CBe,xc,Ck=_(()=>{"use strict";HI();JJ=typeof exports=="object"&&exports&&!exports.nodeType&&exports,U1=JJ&&typeof module=="object"&&module&&!module.nodeType&&module,TBe=U1&&U1.exports===JJ,n5=TBe&&dk.process,CBe=(function(){try{var e=U1&&U1.require&&U1.require("util").types;return e||n5&&n5.binding&&n5.binding("util")}catch{}})(),xc=CBe});var eee,kBe,Hu,Y1=_(()=>{"use strict";ZJ();H1();Ck();eee=xc&&xc.isTypedArray,kBe=eee?ju(eee):QJ,Hu=kBe});function EBe(e,t){var r=wr(e),n=!r&&Co(e),i=!r&&!n&&ko(e),a=!r&&!n&&!i&&Hu(e),o=r||n||i||a,l=o?VJ(e.length,String):[],u=l.length;for(var h in e)(t||vBe.call(e,h))&&!(o&&(h=="length"||i&&(h=="offset"||h=="parent")||a&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Gu(h,u)))&&l.push(h);return l}var SBe,vBe,kk,i5=_(()=>{"use strict";WJ();Am();oi();Rm();G1();Y1();SBe=Object.prototype,vBe=SBe.hasOwnProperty;s(EBe,"arrayLikeKeys");kk=EBe});function wBe(e,t){return function(r){return e(t(r))}}var Sk,s5=_(()=>{"use strict";s(wBe,"overArg");Sk=wBe});var _Be,tee,ree=_(()=>{"use strict";s5();_Be=Sk(Object.keys,Object),tee=_Be});function LBe(e){if(!qu(e))return tee(e);var t=[];for(var r in Object(e))RBe.call(e,r)&&r!="constructor"&&t.push(r);return t}var ABe,RBe,Lm,vk=_(()=>{"use strict";j1();ree();ABe=Object.prototype,RBe=ABe.hasOwnProperty;s(LBe,"baseKeys");Lm=LBe});function DBe(e){return Pi(e)?kk(e):Lm(e)}var qn,bc=_(()=>{"use strict";i5();vk();dl();s(DBe,"keys");qn=DBe});function IBe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var nee,iee=_(()=>{"use strict";s(IBe,"nativeKeysIn");nee=IBe});function MBe(e){if(!In(e))return nee(e);var t=qu(e),r=[];for(var n in e)n=="constructor"&&(t||!PBe.call(e,n))||r.push(n);return r}var NBe,PBe,see,aee=_(()=>{"use strict";$a();j1();iee();NBe=Object.prototype,PBe=NBe.hasOwnProperty;s(MBe,"baseKeysIn");see=MBe});function OBe(e){return Pi(e)?kk(e,!0):see(e)}var Fs,Uu=_(()=>{"use strict";i5();aee();dl();s(OBe,"keysIn");Fs=OBe});function FBe(e,t){if(wr(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||fa(e)?!0:BBe.test(e)||!$Be.test(e)||t!=null&&e in Object(t)}var $Be,BBe,Dm,Ek=_(()=>{"use strict";oi();Md();$Be=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,BBe=/^\w*$/;s(FBe,"isKey");Dm=FBe});var GBe,Tc,K1=_(()=>{"use strict";Fu();GBe=$s(Object,"create"),Tc=GBe});function zBe(){this.__data__=Tc?Tc(null):{},this.size=0}var oee,lee=_(()=>{"use strict";K1();s(zBe,"hashClear");oee=zBe});function VBe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var cee,uee=_(()=>{"use strict";s(VBe,"hashDelete");cee=VBe});function HBe(e){var t=this.__data__;if(Tc){var r=t[e];return r===WBe?void 0:r}return jBe.call(t,e)?t[e]:void 0}var WBe,qBe,jBe,hee,dee=_(()=>{"use strict";K1();WBe="__lodash_hash_undefined__",qBe=Object.prototype,jBe=qBe.hasOwnProperty;s(HBe,"hashGet");hee=HBe});function KBe(e){var t=this.__data__;return Tc?t[e]!==void 0:YBe.call(t,e)}var UBe,YBe,fee,pee=_(()=>{"use strict";K1();UBe=Object.prototype,YBe=UBe.hasOwnProperty;s(KBe,"hashHas");fee=KBe});function QBe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Tc&&t===void 0?XBe:t,this}var XBe,mee,gee=_(()=>{"use strict";K1();XBe="__lodash_hash_undefined__";s(QBe,"hashSet");mee=QBe});function Im(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var a5,yee=_(()=>{"use strict";lee();uee();dee();pee();gee();s(Im,"Hash");Im.prototype.clear=oee;Im.prototype.delete=cee;Im.prototype.get=hee;Im.prototype.has=fee;Im.prototype.set=mee;a5=Im});function ZBe(){this.__data__=[],this.size=0}var xee,bee=_(()=>{"use strict";s(ZBe,"listCacheClear");xee=ZBe});function JBe(e,t){for(var r=e.length;r--;)if(Ba(e[r][0],t))return r;return-1}var Yu,X1=_(()=>{"use strict";Od();s(JBe,"assocIndexOf");Yu=JBe});function r8e(e){var t=this.__data__,r=Yu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():t8e.call(t,r,1),--this.size,!0}var e8e,t8e,Tee,Cee=_(()=>{"use strict";X1();e8e=Array.prototype,t8e=e8e.splice;s(r8e,"listCacheDelete");Tee=r8e});function n8e(e){var t=this.__data__,r=Yu(t,e);return r<0?void 0:t[r][1]}var kee,See=_(()=>{"use strict";X1();s(n8e,"listCacheGet");kee=n8e});function i8e(e){return Yu(this.__data__,e)>-1}var vee,Eee=_(()=>{"use strict";X1();s(i8e,"listCacheHas");vee=i8e});function s8e(e,t){var r=this.__data__,n=Yu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var wee,_ee=_(()=>{"use strict";X1();s(s8e,"listCacheSet");wee=s8e});function Nm(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var Ku,Q1=_(()=>{"use strict";bee();Cee();See();Eee();_ee();s(Nm,"ListCache");Nm.prototype.clear=xee;Nm.prototype.delete=Tee;Nm.prototype.get=kee;Nm.prototype.has=vee;Nm.prototype.set=wee;Ku=Nm});var a8e,Xu,wk=_(()=>{"use strict";Fu();Oa();a8e=$s(Wn,"Map"),Xu=a8e});function o8e(){this.size=0,this.__data__={hash:new a5,map:new(Xu||Ku),string:new a5}}var Aee,Ree=_(()=>{"use strict";yee();Q1();wk();s(o8e,"mapCacheClear");Aee=o8e});function l8e(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Lee,Dee=_(()=>{"use strict";s(l8e,"isKeyable");Lee=l8e});function c8e(e,t){var r=e.__data__;return Lee(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Qu,Z1=_(()=>{"use strict";Dee();s(c8e,"getMapData");Qu=c8e});function u8e(e){var t=Qu(this,e).delete(e);return this.size-=t?1:0,t}var Iee,Nee=_(()=>{"use strict";Z1();s(u8e,"mapCacheDelete");Iee=u8e});function h8e(e){return Qu(this,e).get(e)}var Pee,Mee=_(()=>{"use strict";Z1();s(h8e,"mapCacheGet");Pee=h8e});function d8e(e){return Qu(this,e).has(e)}var Oee,$ee=_(()=>{"use strict";Z1();s(d8e,"mapCacheHas");Oee=d8e});function f8e(e,t){var r=Qu(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var Bee,Fee=_(()=>{"use strict";Z1();s(f8e,"mapCacheSet");Bee=f8e});function Pm(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var $d,_k=_(()=>{"use strict";Ree();Nee();Mee();$ee();Fee();s(Pm,"MapCache");Pm.prototype.clear=Aee;Pm.prototype.delete=Iee;Pm.prototype.get=Pee;Pm.prototype.has=Oee;Pm.prototype.set=Bee;$d=Pm});function o5(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(p8e);var r=s(function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o},"memoized");return r.cache=new(o5.Cache||$d),r}var p8e,Gee,zee=_(()=>{"use strict";_k();p8e="Expected a function";s(o5,"memoize");o5.Cache=$d;Gee=o5});function g8e(e){var t=Gee(e,function(n){return r.size===m8e&&r.clear(),n}),r=t.cache;return t}var m8e,Vee,Wee=_(()=>{"use strict";zee();m8e=500;s(g8e,"memoizeCapped");Vee=g8e});var y8e,x8e,b8e,qee,jee=_(()=>{"use strict";Wee();y8e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,x8e=/\\(\\)?/g,b8e=Vee(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(y8e,function(r,n,i,a){t.push(i?a.replace(x8e,"$1"):n||r)}),t}),qee=b8e});function T8e(e){return e==null?"":JZ(e)}var Ak,l5=_(()=>{"use strict";eJ();s(T8e,"toString");Ak=T8e});function C8e(e,t){return wr(e)?e:Dm(e,t)?[e]:qee(Ak(e))}var Zu,J1=_(()=>{"use strict";oi();Ek();jee();l5();s(C8e,"castPath");Zu=C8e});function S8e(e){if(typeof e=="string"||fa(e))return e;var t=e+"";return t=="0"&&1/e==-k8e?"-0":t}var k8e,fl,Mm=_(()=>{"use strict";Md();k8e=1/0;s(S8e,"toKey");fl=S8e});function v8e(e,t){t=Zu(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[fl(t[r++])];return r&&r==n?e:void 0}var Ju,ex=_(()=>{"use strict";J1();Mm();s(v8e,"baseGet");Ju=v8e});function E8e(e,t,r){var n=e==null?void 0:Ju(e,t);return n===void 0?r:n}var Hee,Uee=_(()=>{"use strict";ex();s(E8e,"get");Hee=E8e});function w8e(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Om,Rk=_(()=>{"use strict";s(w8e,"arrayPush");Om=w8e});function _8e(e){return wr(e)||Co(e)||!!(Yee&&e&&e[Yee])}var Yee,Kee,Xee=_(()=>{"use strict";Pd();Am();oi();Yee=Ni?Ni.isConcatSpreadable:void 0;s(_8e,"isFlattenable");Kee=_8e});function Qee(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=Kee),i||(i=[]);++a<o;){var l=e[a];t>0&&r(l)?t>1?Qee(l,t-1,r,n,i):Om(i,l):n||(i[i.length]=l)}return i}var $m,Lk=_(()=>{"use strict";Rk();Xee();s(Qee,"baseFlatten");$m=Qee});function A8e(e){var t=e==null?0:e.length;return t?$m(e,1):[]}var Fa,c5=_(()=>{"use strict";Lk();s(A8e,"flatten");Fa=A8e});function R8e(e){return gk(bk(e,void 0,Fa),e+"")}var Zee,Jee=_(()=>{"use strict";c5();t5();ZI();s(R8e,"flatRest");Zee=R8e});var L8e,Bm,Dk=_(()=>{"use strict";s5();L8e=Sk(Object.getPrototypeOf,Object),Bm=L8e});function O8e(e){if(!Xn(e)||ys(e)!=D8e)return!1;var t=Bm(e);if(t===null)return!0;var r=P8e.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&ete.call(r)==M8e}var D8e,I8e,N8e,ete,P8e,M8e,tte,rte=_(()=>{"use strict";$u();Dk();To();D8e="[object Object]",I8e=Function.prototype,N8e=Object.prototype,ete=I8e.toString,P8e=N8e.hasOwnProperty,M8e=ete.call(Object);s(O8e,"isPlainObject");tte=O8e});function j8e(e){return q8e.test(e)}var $8e,B8e,F8e,G8e,z8e,V8e,W8e,q8e,nte,ite=_(()=>{"use strict";$8e="\\ud800-\\udfff",B8e="\\u0300-\\u036f",F8e="\\ufe20-\\ufe2f",G8e="\\u20d0-\\u20ff",z8e=B8e+F8e+G8e,V8e="\\ufe0e\\ufe0f",W8e="\\u200d",q8e=RegExp("["+W8e+$8e+z8e+V8e+"]");s(j8e,"hasUnicode");nte=j8e});function H8e(e,t,r,n){var i=-1,a=e==null?0:e.length;for(n&&a&&(r=e[++i]);++i<a;)r=t(r,e[i],i,e);return r}var ste,ate=_(()=>{"use strict";s(H8e,"arrayReduce");ste=H8e});function U8e(){this.__data__=new Ku,this.size=0}var ote,lte=_(()=>{"use strict";Q1();s(U8e,"stackClear");ote=U8e});function Y8e(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var cte,ute=_(()=>{"use strict";s(Y8e,"stackDelete");cte=Y8e});function K8e(e){return this.__data__.get(e)}var hte,dte=_(()=>{"use strict";s(K8e,"stackGet");hte=K8e});function X8e(e){return this.__data__.has(e)}var fte,pte=_(()=>{"use strict";s(X8e,"stackHas");fte=X8e});function Z8e(e,t){var r=this.__data__;if(r instanceof Ku){var n=r.__data__;if(!Xu||n.length<Q8e-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new $d(n)}return r.set(e,t),this.size=r.size,this}var Q8e,mte,gte=_(()=>{"use strict";Q1();wk();_k();Q8e=200;s(Z8e,"stackSet");mte=Z8e});function Fm(e){var t=this.__data__=new Ku(e);this.size=t.size}var pl,tx=_(()=>{"use strict";Q1();lte();ute();dte();pte();gte();s(Fm,"Stack");Fm.prototype.clear=ote;Fm.prototype.delete=cte;Fm.prototype.get=hte;Fm.prototype.has=fte;Fm.prototype.set=mte;pl=Fm});function J8e(e,t){return e&&hl(t,qn(t),e)}var yte,xte=_(()=>{"use strict";wm();bc();s(J8e,"baseAssign");yte=J8e});function e7e(e,t){return e&&hl(t,Fs(t),e)}var bte,Tte=_(()=>{"use strict";wm();Uu();s(e7e,"baseAssignIn");bte=e7e});function r7e(e,t){if(t)return e.slice();var r=e.length,n=Ste?Ste(r):new e.constructor(r);return e.copy(n),n}var vte,Cte,t7e,kte,Ste,Ik,u5=_(()=>{"use strict";Oa();vte=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Cte=vte&&typeof module=="object"&&module&&!module.nodeType&&module,t7e=Cte&&Cte.exports===vte,kte=t7e?Wn.Buffer:void 0,Ste=kte?kte.allocUnsafe:void 0;s(r7e,"cloneBuffer");Ik=r7e});function n7e(e,t){for(var r=-1,n=e==null?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}var Nk,h5=_(()=>{"use strict";s(n7e,"arrayFilter");Nk=n7e});function i7e(){return[]}var Pk,d5=_(()=>{"use strict";s(i7e,"stubArray");Pk=i7e});var s7e,a7e,Ete,o7e,Gm,Mk=_(()=>{"use strict";h5();d5();s7e=Object.prototype,a7e=s7e.propertyIsEnumerable,Ete=Object.getOwnPropertySymbols,o7e=Ete?function(e){return e==null?[]:(e=Object(e),Nk(Ete(e),function(t){return a7e.call(e,t)}))}:Pk,Gm=o7e});function l7e(e,t){return hl(e,Gm(e),t)}var wte,_te=_(()=>{"use strict";wm();Mk();s(l7e,"copySymbols");wte=l7e});var c7e,u7e,Ok,f5=_(()=>{"use strict";Rk();Dk();Mk();d5();c7e=Object.getOwnPropertySymbols,u7e=c7e?function(e){for(var t=[];e;)Om(t,Gm(e)),e=Bm(e);return t}:Pk,Ok=u7e});function h7e(e,t){return hl(e,Ok(e),t)}var Ate,Rte=_(()=>{"use strict";wm();f5();s(h7e,"copySymbolsIn");Ate=h7e});function d7e(e,t,r){var n=t(e);return wr(e)?n:Om(n,r(e))}var $k,p5=_(()=>{"use strict";Rk();oi();s(d7e,"baseGetAllKeys");$k=d7e});function f7e(e){return $k(e,qn,Gm)}var rx,m5=_(()=>{"use strict";p5();Mk();bc();s(f7e,"getAllKeys");rx=f7e});function p7e(e){return $k(e,Fs,Ok)}var Lte,Dte=_(()=>{"use strict";p5();f5();Uu();s(p7e,"getAllKeysIn");Lte=p7e});var m7e,Bk,Ite=_(()=>{"use strict";Fu();Oa();m7e=$s(Wn,"DataView"),Bk=m7e});var g7e,Fk,Nte=_(()=>{"use strict";Fu();Oa();g7e=$s(Wn,"Promise"),Fk=g7e});var y7e,eh,g5=_(()=>{"use strict";Fu();Oa();y7e=$s(Wn,"Set"),eh=y7e});var Pte,x7e,Mte,Ote,$te,Bte,b7e,T7e,C7e,k7e,S7e,Bd,pa,Fd=_(()=>{"use strict";Ite();wk();Nte();g5();bJ();$u();YI();Pte="[object Map]",x7e="[object Object]",Mte="[object Promise]",Ote="[object Set]",$te="[object WeakMap]",Bte="[object DataView]",b7e=gc(Bk),T7e=gc(Xu),C7e=gc(Fk),k7e=gc(eh),S7e=gc(pk),Bd=ys;(Bk&&Bd(new Bk(new ArrayBuffer(1)))!=Bte||Xu&&Bd(new Xu)!=Pte||Fk&&Bd(Fk.resolve())!=Mte||eh&&Bd(new eh)!=Ote||pk&&Bd(new pk)!=$te)&&(Bd=s(function(e){var t=ys(e),r=t==x7e?e.constructor:void 0,n=r?gc(r):"";if(n)switch(n){case b7e:return Bte;case T7e:return Pte;case C7e:return Mte;case k7e:return Ote;case S7e:return $te}return t},"getTag"));pa=Bd});function w7e(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&E7e.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var v7e,E7e,Fte,Gte=_(()=>{"use strict";v7e=Object.prototype,E7e=v7e.hasOwnProperty;s(w7e,"initCloneArray");Fte=w7e});var _7e,zm,y5=_(()=>{"use strict";Oa();_7e=Wn.Uint8Array,zm=_7e});function A7e(e){var t=new e.constructor(e.byteLength);return new zm(t).set(new zm(e)),t}var Vm,Gk=_(()=>{"use strict";y5();s(A7e,"cloneArrayBuffer");Vm=A7e});function R7e(e,t){var r=t?Vm(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var zte,Vte=_(()=>{"use strict";Gk();s(R7e,"cloneDataView");zte=R7e});function D7e(e){var t=new e.constructor(e.source,L7e.exec(e));return t.lastIndex=e.lastIndex,t}var L7e,Wte,qte=_(()=>{"use strict";L7e=/\w*$/;s(D7e,"cloneRegExp");Wte=D7e});function I7e(e){return Hte?Object(Hte.call(e)):{}}var jte,Hte,Ute,Yte=_(()=>{"use strict";Pd();jte=Ni?Ni.prototype:void 0,Hte=jte?jte.valueOf:void 0;s(I7e,"cloneSymbol");Ute=I7e});function N7e(e,t){var r=t?Vm(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var zk,x5=_(()=>{"use strict";Gk();s(N7e,"cloneTypedArray");zk=N7e});function J7e(e,t,r){var n=e.constructor;switch(t){case V7e:return Vm(e);case P7e:case M7e:return new n(+e);case W7e:return zte(e,r);case q7e:case j7e:case H7e:case U7e:case Y7e:case K7e:case X7e:case Q7e:case Z7e:return zk(e,r);case O7e:return new n;case $7e:case G7e:return new n(e);case B7e:return Wte(e);case F7e:return new n;case z7e:return Ute(e)}}var P7e,M7e,O7e,$7e,B7e,F7e,G7e,z7e,V7e,W7e,q7e,j7e,H7e,U7e,Y7e,K7e,X7e,Q7e,Z7e,Kte,Xte=_(()=>{"use strict";Gk();Vte();qte();Yte();x5();P7e="[object Boolean]",M7e="[object Date]",O7e="[object Map]",$7e="[object Number]",B7e="[object RegExp]",F7e="[object Set]",G7e="[object String]",z7e="[object Symbol]",V7e="[object ArrayBuffer]",W7e="[object DataView]",q7e="[object Float32Array]",j7e="[object Float64Array]",H7e="[object Int8Array]",U7e="[object Int16Array]",Y7e="[object Int32Array]",K7e="[object Uint8Array]",X7e="[object Uint8ClampedArray]",Q7e="[object Uint16Array]",Z7e="[object Uint32Array]";s(J7e,"initCloneByTag");Kte=J7e});function eFe(e){return typeof e.constructor=="function"&&!qu(e)?CJ(Bm(e)):{}}var Vk,b5=_(()=>{"use strict";kJ();Dk();j1();s(eFe,"initCloneObject");Vk=eFe});function rFe(e){return Xn(e)&&pa(e)==tFe}var tFe,Qte,Zte=_(()=>{"use strict";Fd();To();tFe="[object Map]";s(rFe,"baseIsMap");Qte=rFe});var Jte,nFe,ere,tre=_(()=>{"use strict";Zte();H1();Ck();Jte=xc&&xc.isMap,nFe=Jte?ju(Jte):Qte,ere=nFe});function sFe(e){return Xn(e)&&pa(e)==iFe}var iFe,rre,nre=_(()=>{"use strict";Fd();To();iFe="[object Set]";s(sFe,"baseIsSet");rre=sFe});var ire,aFe,sre,are=_(()=>{"use strict";nre();H1();Ck();ire=xc&&xc.isSet,aFe=ire?ju(ire):rre,sre=aFe});function Wk(e,t,r,n,i,a){var o,l=t&oFe,u=t&lFe,h=t&cFe;if(r&&(o=i?r(e,n,i,a):r(e)),o!==void 0)return o;if(!In(e))return e;var d=wr(e);if(d){if(o=Fte(e),!l)return mk(e,o)}else{var f=pa(e),p=f==lre||f==pFe;if(ko(e))return Ik(e,l);if(f==cre||f==ore||p&&!i){if(o=u||p?{}:Vk(e),!l)return u?Ate(e,bte(o,e)):wte(e,yte(o,e))}else{if(!yn[f])return i?e:{};o=Kte(e,f,l)}}a||(a=new pl);var g=a.get(e);if(g)return g;a.set(e,o),sre(e)?e.forEach(function(x){o.add(Wk(x,t,r,x,e,a))}):ere(e)&&e.forEach(function(x,T){o.set(T,Wk(x,t,r,T,e,a))});var m=h?u?Lte:rx:u?Fs:qn,y=d?void 0:m(e);return yk(y||e,function(x,T){y&&(T=x,x=e[T]),Vu(o,T,Wk(x,t,r,T,e,a))}),o}var oFe,lFe,cFe,ore,uFe,hFe,dFe,fFe,lre,pFe,mFe,gFe,cre,yFe,xFe,bFe,TFe,CFe,kFe,SFe,vFe,EFe,wFe,_Fe,AFe,RFe,LFe,DFe,IFe,yn,ure,hre=_(()=>{"use strict";tx();JI();V1();xte();Tte();u5();KI();_te();Rte();m5();Dte();Fd();Gte();Xte();b5();oi();Rm();tre();$a();are();bc();Uu();oFe=1,lFe=2,cFe=4,ore="[object Arguments]",uFe="[object Array]",hFe="[object Boolean]",dFe="[object Date]",fFe="[object Error]",lre="[object Function]",pFe="[object GeneratorFunction]",mFe="[object Map]",gFe="[object Number]",cre="[object Object]",yFe="[object RegExp]",xFe="[object Set]",bFe="[object String]",TFe="[object Symbol]",CFe="[object WeakMap]",kFe="[object ArrayBuffer]",SFe="[object DataView]",vFe="[object Float32Array]",EFe="[object Float64Array]",wFe="[object Int8Array]",_Fe="[object Int16Array]",AFe="[object Int32Array]",RFe="[object Uint8Array]",LFe="[object Uint8ClampedArray]",DFe="[object Uint16Array]",IFe="[object Uint32Array]",yn={};yn[ore]=yn[uFe]=yn[kFe]=yn[SFe]=yn[hFe]=yn[dFe]=yn[vFe]=yn[EFe]=yn[wFe]=yn[_Fe]=yn[AFe]=yn[mFe]=yn[gFe]=yn[cre]=yn[yFe]=yn[xFe]=yn[bFe]=yn[TFe]=yn[RFe]=yn[LFe]=yn[DFe]=yn[IFe]=!0;yn[fFe]=yn[lre]=yn[CFe]=!1;s(Wk,"baseClone");ure=Wk});function MFe(e){return ure(e,NFe|PFe)}var NFe,PFe,T5,dre=_(()=>{"use strict";hre();NFe=1,PFe=4;s(MFe,"cloneDeep");T5=MFe});function $Fe(e){return this.__data__.set(e,OFe),this}var OFe,fre,pre=_(()=>{"use strict";OFe="__lodash_hash_undefined__";s($Fe,"setCacheAdd");fre=$Fe});function BFe(e){return this.__data__.has(e)}var mre,gre=_(()=>{"use strict";s(BFe,"setCacheHas");mre=BFe});function qk(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new $d;++t<r;)this.add(e[t])}var jk,C5=_(()=>{"use strict";_k();pre();gre();s(qk,"SetCache");qk.prototype.add=qk.prototype.push=fre;qk.prototype.has=mre;jk=qk});function FFe(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var yre,xre=_(()=>{"use strict";s(FFe,"arraySome");yre=FFe});function GFe(e,t){return e.has(t)}var Hk,k5=_(()=>{"use strict";s(GFe,"cacheHas");Hk=GFe});function WFe(e,t,r,n,i,a){var o=r&zFe,l=e.length,u=t.length;if(l!=u&&!(o&&u>l))return!1;var h=a.get(e),d=a.get(t);if(h&&d)return h==t&&d==e;var f=-1,p=!0,g=r&VFe?new jk:void 0;for(a.set(e,t),a.set(t,e);++f<l;){var m=e[f],y=t[f];if(n)var x=o?n(y,m,f,t,e,a):n(m,y,f,e,t,a);if(x!==void 0){if(x)continue;p=!1;break}if(g){if(!yre(t,function(T,C){if(!Hk(g,C)&&(m===T||i(m,T,r,n,a)))return g.push(C)})){p=!1;break}}else if(!(m===y||i(m,y,r,n,a))){p=!1;break}}return a.delete(e),a.delete(t),p}var zFe,VFe,Uk,S5=_(()=>{"use strict";C5();xre();k5();zFe=1,VFe=2;s(WFe,"equalArrays");Uk=WFe});function qFe(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var bre,Tre=_(()=>{"use strict";s(qFe,"mapToArray");bre=qFe});function jFe(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Wm,Yk=_(()=>{"use strict";s(jFe,"setToArray");Wm=jFe});function s9e(e,t,r,n,i,a,o){switch(r){case i9e:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case n9e:return!(e.byteLength!=t.byteLength||!a(new zm(e),new zm(t)));case YFe:case KFe:case ZFe:return Ba(+e,+t);case XFe:return e.name==t.name&&e.message==t.message;case JFe:case t9e:return e==t+"";case QFe:var l=bre;case e9e:var u=n&HFe;if(l||(l=Wm),e.size!=t.size&&!u)return!1;var h=o.get(e);if(h)return h==t;n|=UFe,o.set(e,t);var d=Uk(l(e),l(t),n,i,a,o);return o.delete(e),d;case r9e:if(v5)return v5.call(e)==v5.call(t)}return!1}var HFe,UFe,YFe,KFe,XFe,QFe,ZFe,JFe,e9e,t9e,r9e,n9e,i9e,Cre,v5,kre,Sre=_(()=>{"use strict";Pd();y5();Od();S5();Tre();Yk();HFe=1,UFe=2,YFe="[object Boolean]",KFe="[object Date]",XFe="[object Error]",QFe="[object Map]",ZFe="[object Number]",JFe="[object RegExp]",e9e="[object Set]",t9e="[object String]",r9e="[object Symbol]",n9e="[object ArrayBuffer]",i9e="[object DataView]",Cre=Ni?Ni.prototype:void 0,v5=Cre?Cre.valueOf:void 0;s(s9e,"equalByTag");kre=s9e});function c9e(e,t,r,n,i,a){var o=r&a9e,l=rx(e),u=l.length,h=rx(t),d=h.length;if(u!=d&&!o)return!1;for(var f=u;f--;){var p=l[f];if(!(o?p in t:l9e.call(t,p)))return!1}var g=a.get(e),m=a.get(t);if(g&&m)return g==t&&m==e;var y=!0;a.set(e,t),a.set(t,e);for(var x=o;++f<u;){p=l[f];var T=e[p],C=t[p];if(n)var k=o?n(C,T,p,t,e,a):n(T,C,p,e,t,a);if(!(k===void 0?T===C||i(T,C,r,n,a):k)){y=!1;break}x||(x=p=="constructor")}if(y&&!x){var E=e.constructor,v=t.constructor;E!=v&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof v=="function"&&v instanceof v)&&(y=!1)}return a.delete(e),a.delete(t),y}var a9e,o9e,l9e,vre,Ere=_(()=>{"use strict";m5();a9e=1,o9e=Object.prototype,l9e=o9e.hasOwnProperty;s(c9e,"equalObjects");vre=c9e});function d9e(e,t,r,n,i,a){var o=wr(e),l=wr(t),u=o?_re:pa(e),h=l?_re:pa(t);u=u==wre?Kk:u,h=h==wre?Kk:h;var d=u==Kk,f=h==Kk,p=u==h;if(p&&ko(e)){if(!ko(t))return!1;o=!0,d=!1}if(p&&!d)return a||(a=new pl),o||Hu(e)?Uk(e,t,r,n,i,a):kre(e,t,u,r,n,i,a);if(!(r&u9e)){var g=d&&Are.call(e,"__wrapped__"),m=f&&Are.call(t,"__wrapped__");if(g||m){var y=g?e.value():e,x=m?t.value():t;return a||(a=new pl),i(y,x,r,n,a)}}return p?(a||(a=new pl),vre(e,t,r,n,i,a)):!1}var u9e,wre,_re,Kk,h9e,Are,Rre,Lre=_(()=>{"use strict";tx();S5();Sre();Ere();Fd();oi();Rm();Y1();u9e=1,wre="[object Arguments]",_re="[object Array]",Kk="[object Object]",h9e=Object.prototype,Are=h9e.hasOwnProperty;s(d9e,"baseIsEqualDeep");Rre=d9e});function Dre(e,t,r,n,i){return e===t?!0:e==null||t==null||!Xn(e)&&!Xn(t)?e!==e&&t!==t:Rre(e,t,r,n,Dre,i)}var Xk,E5=_(()=>{"use strict";Lre();To();s(Dre,"baseIsEqual");Xk=Dre});function m9e(e,t,r,n){var i=r.length,a=i,o=!n;if(e==null)return!a;for(e=Object(e);i--;){var l=r[i];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<a;){l=r[i];var u=l[0],h=e[u],d=l[1];if(o&&l[2]){if(h===void 0&&!(u in e))return!1}else{var f=new pl;if(n)var p=n(h,d,u,e,t,f);if(!(p===void 0?Xk(d,h,f9e|p9e,n,f):p))return!1}}return!0}var f9e,p9e,Ire,Nre=_(()=>{"use strict";tx();E5();f9e=1,p9e=2;s(m9e,"baseIsMatch");Ire=m9e});function g9e(e){return e===e&&!In(e)}var Qk,w5=_(()=>{"use strict";$a();s(g9e,"isStrictComparable");Qk=g9e});function y9e(e){for(var t=qn(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Qk(i)]}return t}var Pre,Mre=_(()=>{"use strict";w5();bc();s(y9e,"getMatchData");Pre=y9e});function x9e(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var Zk,_5=_(()=>{"use strict";s(x9e,"matchesStrictComparable");Zk=x9e});function b9e(e){var t=Pre(e);return t.length==1&&t[0][2]?Zk(t[0][0],t[0][1]):function(r){return r===e||Ire(r,e,t)}}var Ore,$re=_(()=>{"use strict";Nre();Mre();_5();s(b9e,"baseMatches");Ore=b9e});function T9e(e,t){return e!=null&&t in Object(e)}var Bre,Fre=_(()=>{"use strict";s(T9e,"baseHasIn");Bre=T9e});function C9e(e,t,r){t=Zu(t,e);for(var n=-1,i=t.length,a=!1;++n<i;){var o=fl(t[n]);if(!(a=e!=null&&r(e,o)))break;e=e[o]}return a||++n!=i?a:(i=e==null?0:e.length,!!i&&_m(i)&&Gu(o,i)&&(wr(e)||Co(e)))}var Jk,A5=_(()=>{"use strict";J1();Am();oi();G1();Tk();Mm();s(C9e,"hasPath");Jk=C9e});function k9e(e,t){return e!=null&&Jk(e,t,Bre)}var eS,R5=_(()=>{"use strict";Fre();A5();s(k9e,"hasIn");eS=k9e});function E9e(e,t){return Dm(e)&&Qk(t)?Zk(fl(e),t):function(r){var n=Hee(r,e);return n===void 0&&n===t?eS(r,e):Xk(t,n,S9e|v9e)}}var S9e,v9e,Gre,zre=_(()=>{"use strict";E5();Uee();R5();Ek();w5();_5();Mm();S9e=1,v9e=2;s(E9e,"baseMatchesProperty");Gre=E9e});function w9e(e){return function(t){return t?.[e]}}var tS,L5=_(()=>{"use strict";s(w9e,"baseProperty");tS=w9e});function _9e(e){return function(t){return Ju(t,e)}}var Vre,Wre=_(()=>{"use strict";ex();s(_9e,"basePropertyDeep");Vre=_9e});function A9e(e){return Dm(e)?tS(fl(e)):Vre(e)}var qre,jre=_(()=>{"use strict";L5();Wre();Ek();Mm();s(A9e,"property");qre=A9e});function R9e(e){return typeof e=="function"?e:e==null?Os:typeof e=="object"?wr(e)?Gre(e[0],e[1]):Ore(e):qre(e)}var is,Cc=_(()=>{"use strict";$re();zre();Bu();oi();jre();s(R9e,"baseIteratee");is=R9e});function L9e(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),l=o.length;l--;){var u=o[e?l:++i];if(r(a[u],u,a)===!1)break}return t}}var Hre,Ure=_(()=>{"use strict";s(L9e,"createBaseFor");Hre=L9e});var D9e,qm,rS=_(()=>{"use strict";Ure();D9e=Hre(),qm=D9e});function I9e(e,t){return e&&qm(e,t,qn)}var jm,nS=_(()=>{"use strict";rS();bc();s(I9e,"baseForOwn");jm=I9e});function N9e(e,t){return function(r,n){if(r==null)return r;if(!Pi(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++a<i)&&n(o[a],a,o)!==!1;);return r}}var Yre,Kre=_(()=>{"use strict";dl();s(N9e,"createBaseEach");Yre=N9e});var P9e,th,nx=_(()=>{"use strict";nS();Kre();P9e=Yre(jm),th=P9e});var M9e,iS,Xre=_(()=>{"use strict";Oa();M9e=s(function(){return Wn.Date.now()},"now"),iS=M9e});var Qre,O9e,$9e,D5,Zre=_(()=>{"use strict";W1();Od();q1();Uu();Qre=Object.prototype,O9e=Qre.hasOwnProperty,$9e=Wu(function(e,t){e=Object(e);var r=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&yc(t[0],t[1],i)&&(n=1);++r<n;)for(var a=t[r],o=Fs(a),l=-1,u=o.length;++l<u;){var h=o[l],d=e[h];(d===void 0||Ba(d,Qre[h])&&!O9e.call(e,h))&&(e[h]=a[h])}return e}),D5=$9e});function B9e(e,t,r){(r!==void 0&&!Ba(e[t],r)||r===void 0&&!(t in e))&&zu(e,t,r)}var ix,I5=_(()=>{"use strict";z1();Od();s(B9e,"assignMergeValue");ix=B9e});function F9e(e){return Xn(e)&&Pi(e)}var sS,N5=_(()=>{"use strict";dl();To();s(F9e,"isArrayLikeObject");sS=F9e});function G9e(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var sx,P5=_(()=>{"use strict";s(G9e,"safeGet");sx=G9e});function z9e(e){return hl(e,Fs(e))}var Jre,ene=_(()=>{"use strict";wm();Uu();s(z9e,"toPlainObject");Jre=z9e});function V9e(e,t,r,n,i,a,o){var l=sx(e,r),u=sx(t,r),h=o.get(u);if(h){ix(e,r,h);return}var d=a?a(l,u,r+"",e,t,o):void 0,f=d===void 0;if(f){var p=wr(u),g=!p&&ko(u),m=!p&&!g&&Hu(u);d=u,p||g||m?wr(l)?d=l:sS(l)?d=mk(l):g?(f=!1,d=Ik(u,!0)):m?(f=!1,d=zk(u,!0)):d=[]:tte(u)||Co(u)?(d=l,Co(l)?d=Jre(l):(!In(l)||ul(l))&&(d=Vk(u))):f=!1}f&&(o.set(u,d),i(d,u,n,a,o),o.delete(u)),ix(e,r,d)}var tne,rne=_(()=>{"use strict";I5();u5();x5();KI();b5();Am();oi();N5();Rm();F1();$a();rte();Y1();P5();ene();s(V9e,"baseMergeDeep");tne=V9e});function nne(e,t,r,n,i){e!==t&&qm(t,function(a,o){if(i||(i=new pl),In(a))tne(e,t,o,r,nne,n,i);else{var l=n?n(sx(e,o),a,o+"",e,t,i):void 0;l===void 0&&(l=a),ix(e,o,l)}},Fs)}var ine,sne=_(()=>{"use strict";tx();I5();rS();rne();$a();Uu();P5();s(nne,"baseMerge");ine=nne});function W9e(e,t,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}var ane,one=_(()=>{"use strict";s(W9e,"arrayIncludesWith");ane=W9e});function q9e(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var rh,lne=_(()=>{"use strict";s(q9e,"last");rh=q9e});function j9e(e){return typeof e=="function"?e:Os}var Hm,aS=_(()=>{"use strict";Bu();s(j9e,"castFunction");Hm=j9e});function H9e(e,t){var r=wr(e)?yk:th;return r(e,Hm(t))}var He,M5=_(()=>{"use strict";JI();nx();aS();oi();s(H9e,"forEach");He=H9e});var cne=_(()=>{"use strict";M5()});function U9e(e,t){var r=[];return th(e,function(n,i,a){t(n,i,a)&&r.push(n)}),r}var une,hne=_(()=>{"use strict";nx();s(U9e,"baseFilter");une=U9e});function Y9e(e,t){var r=wr(e)?Nk:une;return r(e,is(t,3))}var xs,dne=_(()=>{"use strict";h5();hne();Cc();oi();s(Y9e,"filter");xs=Y9e});function K9e(e){return function(t,r,n){var i=Object(t);if(!Pi(t)){var a=is(r,3);t=qn(t),r=s(function(l){return a(i[l],l,i)},"predicate")}var o=e(t,r,n);return o>-1?i[a?t[o]:o]:void 0}}var fne,pne=_(()=>{"use strict";Cc();dl();bc();s(K9e,"createFind");fne=K9e});function Q9e(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:cJ(r);return i<0&&(i=X9e(n+i,0)),xk(e,is(t,3),i)}var X9e,mne,gne=_(()=>{"use strict";e5();Cc();uJ();X9e=Math.max;s(Q9e,"findIndex");mne=Q9e});var Z9e,Um,yne=_(()=>{"use strict";pne();gne();Z9e=fne(mne),Um=Z9e});function J9e(e,t){var r=-1,n=Pi(e)?Array(e.length):[];return th(e,function(i,a,o){n[++r]=t(i,a,o)}),n}var oS,O5=_(()=>{"use strict";nx();dl();s(J9e,"baseMap");oS=J9e});function eGe(e,t){var r=wr(e)?cl:oS;return r(e,is(t,3))}var an,xne=_(()=>{"use strict";B1();Cc();O5();oi();s(eGe,"map");an=eGe});function tGe(e,t){return e==null?e:qm(e,Hm(t),Fs)}var $5,bne=_(()=>{"use strict";rS();aS();Uu();s(tGe,"forIn");$5=tGe});function rGe(e,t){return e&&jm(e,Hm(t))}var B5,Tne=_(()=>{"use strict";nS();aS();s(rGe,"forOwn");B5=rGe});function nGe(e,t){return e>t}var Cne,kne=_(()=>{"use strict";s(nGe,"baseGt");Cne=nGe});function aGe(e,t){return e!=null&&sGe.call(e,t)}var iGe,sGe,Sne,vne=_(()=>{"use strict";iGe=Object.prototype,sGe=iGe.hasOwnProperty;s(aGe,"baseHas");Sne=aGe});function oGe(e,t){return e!=null&&Jk(e,t,Sne)}var ax,Ene=_(()=>{"use strict";vne();A5();s(oGe,"has");ax=oGe});function cGe(e){return typeof e=="string"||!wr(e)&&Xn(e)&&ys(e)==lGe}var lGe,wne,_ne=_(()=>{"use strict";$u();oi();To();lGe="[object String]";s(cGe,"isString");wne=cGe});function uGe(e,t){return cl(t,function(r){return e[r]})}var Ane,Rne=_(()=>{"use strict";B1();s(uGe,"baseValues");Ane=uGe});function hGe(e){return e==null?[]:Ane(e,qn(e))}var ma,Lne=_(()=>{"use strict";Rne();bc();s(hGe,"values");ma=hGe});function gGe(e){if(e==null)return!0;if(Pi(e)&&(wr(e)||typeof e=="string"||typeof e.splice=="function"||ko(e)||Hu(e)||Co(e)))return!e.length;var t=pa(e);if(t==dGe||t==fGe)return!e.size;if(qu(e))return!Lm(e).length;for(var r in e)if(mGe.call(e,r))return!1;return!0}var dGe,fGe,pGe,mGe,lS,Dne=_(()=>{"use strict";vk();Fd();Am();oi();dl();Rm();j1();Y1();dGe="[object Map]",fGe="[object Set]",pGe=Object.prototype,mGe=pGe.hasOwnProperty;s(gGe,"isEmpty");lS=gGe});function yGe(e){return e===void 0}var jn,Ine=_(()=>{"use strict";s(yGe,"isUndefined");jn=yGe});function xGe(e,t){return e<t}var cS,F5=_(()=>{"use strict";s(xGe,"baseLt");cS=xGe});function bGe(e,t){var r={};return t=is(t,3),jm(e,function(n,i,a){zu(r,i,t(n,i,a))}),r}var Gd,Nne=_(()=>{"use strict";z1();nS();Cc();s(bGe,"mapValues");Gd=bGe});function TGe(e,t,r){for(var n=-1,i=e.length;++n<i;){var a=e[n],o=t(a);if(o!=null&&(l===void 0?o===o&&!fa(o):r(o,l)))var l=o,u=a}return u}var Ym,uS=_(()=>{"use strict";Md();s(TGe,"baseExtremum");Ym=TGe});function CGe(e){return e&&e.length?Ym(e,Os,Cne):void 0}var Gs,Pne=_(()=>{"use strict";uS();kne();Bu();s(CGe,"max");Gs=CGe});var kGe,Km,Mne=_(()=>{"use strict";sne();zJ();kGe=GJ(function(e,t,r){ine(e,t,r)}),Km=kGe});function SGe(e){return e&&e.length?Ym(e,Os,cS):void 0}var kc,One=_(()=>{"use strict";uS();F5();Bu();s(SGe,"min");kc=SGe});function vGe(e,t){return e&&e.length?Ym(e,is(t,2),cS):void 0}var zd,$ne=_(()=>{"use strict";uS();Cc();F5();s(vGe,"minBy");zd=vGe});function EGe(e,t,r,n){if(!In(e))return e;t=Zu(t,e);for(var i=-1,a=t.length,o=a-1,l=e;l!=null&&++i<a;){var u=fl(t[i]),h=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return e;if(i!=o){var d=l[u];h=n?n(d,u,l):void 0,h===void 0&&(h=In(d)?d:Gu(t[i+1])?[]:{})}Vu(l,u,h),l=l[u]}return e}var Bne,Fne=_(()=>{"use strict";V1();J1();G1();$a();Mm();s(EGe,"baseSet");Bne=EGe});function wGe(e,t,r){for(var n=-1,i=t.length,a={};++n<i;){var o=t[n],l=Ju(e,o);r(l,o)&&Bne(a,Zu(o,e),l)}return a}var Gne,zne=_(()=>{"use strict";ex();Fne();J1();s(wGe,"basePickBy");Gne=wGe});function _Ge(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}var Vne,Wne=_(()=>{"use strict";s(_Ge,"baseSortBy");Vne=_Ge});function AGe(e,t){if(e!==t){var r=e!==void 0,n=e===null,i=e===e,a=fa(e),o=t!==void 0,l=t===null,u=t===t,h=fa(t);if(!l&&!h&&!a&&e>t||a&&o&&u&&!l&&!h||n&&o&&u||!r&&u||!i)return 1;if(!n&&!a&&!h&&e<t||h&&r&&i&&!n&&!a||l&&r&&i||!o&&i||!u)return-1}return 0}var qne,jne=_(()=>{"use strict";Md();s(AGe,"compareAscending");qne=AGe});function RGe(e,t,r){for(var n=-1,i=e.criteria,a=t.criteria,o=i.length,l=r.length;++n<o;){var u=qne(i[n],a[n]);if(u){if(n>=l)return u;var h=r[n];return u*(h=="desc"?-1:1)}}return e.index-t.index}var Hne,Une=_(()=>{"use strict";jne();s(RGe,"compareMultiple");Hne=RGe});function LGe(e,t,r){t.length?t=cl(t,function(a){return wr(a)?function(o){return Ju(o,a.length===1?a[0]:a)}:a}):t=[Os];var n=-1;t=cl(t,ju(is));var i=oS(e,function(a,o,l){var u=cl(t,function(h){return h(a)});return{criteria:u,index:++n,value:a}});return Vne(i,function(a,o){return Hne(a,o,r)})}var Yne,Kne=_(()=>{"use strict";B1();ex();Cc();O5();Wne();H1();Une();Bu();oi();s(LGe,"baseOrderBy");Yne=LGe});var DGe,Xne,Qne=_(()=>{"use strict";L5();DGe=tS("length"),Xne=DGe});function WGe(e){for(var t=Zne.lastIndex=0;Zne.test(e);)++t;return t}var Jne,IGe,NGe,PGe,MGe,OGe,$Ge,G5,z5,BGe,eie,tie,rie,FGe,nie,iie,GGe,zGe,VGe,Zne,sie,aie=_(()=>{"use strict";Jne="\\ud800-\\udfff",IGe="\\u0300-\\u036f",NGe="\\ufe20-\\ufe2f",PGe="\\u20d0-\\u20ff",MGe=IGe+NGe+PGe,OGe="\\ufe0e\\ufe0f",$Ge="["+Jne+"]",G5="["+MGe+"]",z5="\\ud83c[\\udffb-\\udfff]",BGe="(?:"+G5+"|"+z5+")",eie="[^"+Jne+"]",tie="(?:\\ud83c[\\udde6-\\uddff]){2}",rie="[\\ud800-\\udbff][\\udc00-\\udfff]",FGe="\\u200d",nie=BGe+"?",iie="["+OGe+"]?",GGe="(?:"+FGe+"(?:"+[eie,tie,rie].join("|")+")"+iie+nie+")*",zGe=iie+nie+GGe,VGe="(?:"+[eie+G5+"?",G5,tie,rie,$Ge].join("|")+")",Zne=RegExp(z5+"(?="+z5+")|"+VGe+zGe,"g");s(WGe,"unicodeSize");sie=WGe});function qGe(e){return nte(e)?sie(e):Xne(e)}var oie,lie=_(()=>{"use strict";Qne();ite();aie();s(qGe,"stringSize");oie=qGe});function jGe(e,t){return Gne(e,t,function(r,n){return eS(e,n)})}var cie,uie=_(()=>{"use strict";zne();R5();s(jGe,"basePick");cie=jGe});var HGe,Vd,hie=_(()=>{"use strict";uie();Jee();HGe=Zee(function(e,t){return e==null?{}:cie(e,t)}),Vd=HGe});function KGe(e,t,r,n){for(var i=-1,a=YGe(UGe((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var UGe,YGe,die,fie=_(()=>{"use strict";UGe=Math.ceil,YGe=Math.max;s(KGe,"baseRange");die=KGe});function XGe(e){return function(t,r,n){return n&&typeof n!="number"&&yc(t,r,n)&&(r=n=void 0),t=vm(t),r===void 0?(r=t,t=0):r=vm(r),n=n===void 0?t<r?1:-1:vm(n),die(t,r,n,e)}}var pie,mie=_(()=>{"use strict";fie();q1();UI();s(XGe,"createRange");pie=XGe});var QGe,Ga,gie=_(()=>{"use strict";mie();QGe=pie(),Ga=QGe});function ZGe(e,t,r,n,i){return i(e,function(a,o,l){r=n?(n=!1,a):t(r,a,o,l)}),r}var yie,xie=_(()=>{"use strict";s(ZGe,"baseReduce");yie=ZGe});function JGe(e,t,r){var n=wr(e)?ste:yie,i=arguments.length<3;return n(e,is(t,4),r,i,th)}var ml,bie=_(()=>{"use strict";ate();nx();Cc();xie();oi();s(JGe,"reduce");ml=JGe});function rze(e){if(e==null)return 0;if(Pi(e))return wne(e)?oie(e):e.length;var t=pa(e);return t==eze||t==tze?e.size:Lm(e).length}var eze,tze,V5,Tie=_(()=>{"use strict";vk();Fd();dl();_ne();lie();eze="[object Map]",tze="[object Set]";s(rze,"size");V5=rze});var nze,gl,Cie=_(()=>{"use strict";Lk();Kne();W1();q1();nze=Wu(function(e,t){if(e==null)return[];var r=t.length;return r>1&&yc(e,t[0],t[1])?t=[]:r>2&&yc(t[0],t[1],t[2])&&(t=[t[0]]),Yne(e,$m(t,1),[])}),gl=nze});var ize,sze,kie,Sie=_(()=>{"use strict";g5();wJ();Yk();ize=1/0,sze=eh&&1/Wm(new eh([,-0]))[1]==ize?function(e){return new eh(e)}:EJ,kie=sze});function oze(e,t,r){var n=-1,i=$J,a=e.length,o=!0,l=[],u=l;if(r)o=!1,i=ane;else if(a>=aze){var h=t?null:kie(e);if(h)return Wm(h);o=!1,i=Hk,u=new jk}else u=t?[]:l;e:for(;++n<a;){var d=e[n],f=t?t(d):d;if(d=r||d!==0?d:0,o&&f===f){for(var p=u.length;p--;)if(u[p]===f)continue e;t&&u.push(f),l.push(d)}else i(u,f,r)||(u!==l&&u.push(f),l.push(d))}return l}var aze,vie,Eie=_(()=>{"use strict";C5();BJ();one();k5();Sie();Yk();aze=200;s(oze,"baseUniq");vie=oze});var lze,W5,wie=_(()=>{"use strict";Lk();W1();Eie();N5();lze=Wu(function(e){return vie($m(e,1,sS,!0))}),W5=lze});function uze(e){var t=++cze;return Ak(e)+t}var cze,Wd,_ie=_(()=>{"use strict";l5();cze=0;s(uze,"uniqueId");Wd=uze});function hze(e,t,r){for(var n=-1,i=e.length,a=t.length,o={};++n<i;){var l=n<a?t[n]:void 0;r(o,e[n],l)}return o}var Aie,Rie=_(()=>{"use strict";s(hze,"baseZipObject");Aie=hze});function dze(e,t){return Aie(e||[],t||[],Vu)}var hS,Lie=_(()=>{"use strict";V1();Rie();s(dze,"zipObject");hS=dze});var on=_(()=>{"use strict";dre();XI();Zre();cne();dne();yne();c5();M5();bne();Tne();Ene();oi();Dne();F1();Ine();bc();lne();xne();Nne();Pne();Mne();One();$ne();Xre();hie();gie();bie();Tie();Cie();wie();_ie();Lne();Lie();});function Iie(e,t){e[t]?e[t]++:e[t]=1}function Nie(e,t){--e[t]||delete e[t]}function ox(e,t,r,n){var i=""+t,a=""+r;if(!e&&i>a){var o=i;i=a,a=o}return i+Die+a+Die+(jn(n)?fze:n)}function pze(e,t,r,n){var i=""+t,a=""+r;if(!e&&i>a){var o=i;i=a,a=o}var l={v:i,w:a};return n&&(l.name=n),l}function q5(e,t){return ox(e,t.v,t.w,t.name)}var fze,qd,Die,Qr,j5=_(()=>{"use strict";on();fze="\0",qd="\0",Die="",Qr=class{static{s(this,"Graph")}constructor(t={}){this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=Bs(void 0),this._defaultEdgeLabelFn=Bs(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[qd]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return ul(t)||(t=Bs(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return qn(this._nodes)}sources(){var t=this;return xs(this.nodes(),function(r){return lS(t._in[r])})}sinks(){var t=this;return xs(this.nodes(),function(r){return lS(t._out[r])})}setNodes(t,r){var n=arguments,i=this;return He(t,function(a){n.length>1?i.setNode(a,r):i.setNode(a)}),this}setNode(t,r){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=qd,this._children[t]={},this._children[qd][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var r=s(n=>this.removeEdge(this._edgeObjs[n]),"removeEdge");delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],He(this.children(t),n=>{this.setParent(n)}),delete this._children[t]),He(qn(this._in[t]),r),delete this._in[t],delete this._preds[t],He(qn(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(jn(r))r=qd;else{r+="";for(var n=r;!jn(n);n=this.parent(n))if(n===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==qd)return r}}children(t){if(jn(t)&&(t=qd),this._isCompound){var r=this._children[t];if(r)return qn(r)}else{if(t===qd)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return qn(r)}successors(t){var r=this._sucs[t];if(r)return qn(r)}neighbors(t){var r=this.predecessors(t);if(r)return W5(r,this.successors(t))}isLeaf(t){var r;return this.isDirected()?r=this.successors(t):r=this.neighbors(t),r.length===0}filterNodes(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;He(this._nodes,function(o,l){t(l)&&r.setNode(l,o)}),He(this._edgeObjs,function(o){r.hasNode(o.v)&&r.hasNode(o.w)&&r.setEdge(o,n.edge(o))});var i={};function a(o){var l=n.parent(o);return l===void 0||r.hasNode(l)?(i[o]=l,l):l in i?i[l]:a(l)}return s(a,"findParent"),this._isCompound&&He(r.nodes(),function(o){r.setParent(o,a(o))}),r}setDefaultEdgeLabel(t){return ul(t)||(t=Bs(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return ma(this._edgeObjs)}setPath(t,r){var n=this,i=arguments;return ml(t,function(a,o){return i.length>1?n.setEdge(a,o,r):n.setEdge(a,o),o}),this}setEdge(){var t,r,n,i,a=!1,o=arguments[0];typeof o=="object"&&o!==null&&"v"in o?(t=o.v,r=o.w,n=o.name,arguments.length===2&&(i=arguments[1],a=!0)):(t=o,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),t=""+t,r=""+r,jn(n)||(n=""+n);var l=ox(this._isDirected,t,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,l))return a&&(this._edgeLabels[l]=i),this;if(!jn(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[l]=a?i:this._defaultEdgeLabelFn(t,r,n);var u=pze(this._isDirected,t,r,n);return t=u.v,r=u.w,Object.freeze(u),this._edgeObjs[l]=u,Iie(this._preds[r],t),Iie(this._sucs[t],r),this._in[r][l]=u,this._out[t][l]=u,this._edgeCount++,this}edge(t,r,n){var i=arguments.length===1?q5(this._isDirected,arguments[0]):ox(this._isDirected,t,r,n);return this._edgeLabels[i]}hasEdge(t,r,n){var i=arguments.length===1?q5(this._isDirected,arguments[0]):ox(this._isDirected,t,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(t,r,n){var i=arguments.length===1?q5(this._isDirected,arguments[0]):ox(this._isDirected,t,r,n),a=this._edgeObjs[i];return a&&(t=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Nie(this._preds[r],t),Nie(this._sucs[t],r),delete this._in[r][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,r){var n=this._in[t];if(n){var i=ma(n);return r?xs(i,function(a){return a.v===r}):i}}outEdges(t,r){var n=this._out[t];if(n){var i=ma(n);return r?xs(i,function(a){return a.w===r}):i}}nodeEdges(t,r){var n=this.inEdges(t,r);if(n)return n.concat(this.outEdges(t,r))}};Qr.prototype._nodeCount=0;Qr.prototype._edgeCount=0;s(Iie,"incrementOrInitEntry");s(Nie,"decrementOrRemoveEntry");s(ox,"edgeArgsToId");s(pze,"edgeArgsToObj");s(q5,"edgeObjToId")});var ga=_(()=>{"use strict";j5()});function Pie(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function mze(e,t){if(e!=="_next"&&e!=="_prev")return t}var dS,Mie=_(()=>{"use strict";dS=class{static{s(this,"List")}constructor(){var t={};t._next=t._prev=t,this._sentinel=t}dequeue(){var t=this._sentinel,r=t._prev;if(r!==t)return Pie(r),r}enqueue(t){var r=this._sentinel;t._prev&&t._next&&Pie(t),t._next=r._next,r._next._prev=t,r._next=t,t._prev=r}toString(){for(var t=[],r=this._sentinel,n=r._prev;n!==r;)t.push(JSON.stringify(n,mze)),n=n._prev;return"["+t.join(", ")+"]"}};s(Pie,"unlink");s(mze,"filterOutLinks")});function Oie(e,t){if(e.nodeCount()<=1)return[];var r=xze(e,t||gze),n=yze(r.graph,r.buckets,r.zeroIdx);return Fa(an(n,function(i){return e.outEdges(i.v,i.w)}))}function yze(e,t,r){for(var n=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)H5(e,t,r,o);for(;o=i.dequeue();)H5(e,t,r,o);if(e.nodeCount()){for(var l=t.length-2;l>0;--l)if(o=t[l].dequeue(),o){n=n.concat(H5(e,t,r,o,!0));break}}}return n}function H5(e,t,r,n,i){var a=i?[]:void 0;return He(e.inEdges(n.v),function(o){var l=e.edge(o),u=e.node(o.v);i&&a.push({v:o.v,w:o.w}),u.out-=l,U5(t,r,u)}),He(e.outEdges(n.v),function(o){var l=e.edge(o),u=o.w,h=e.node(u);h.in-=l,U5(t,r,h)}),e.removeNode(n.v),a}function xze(e,t){var r=new Qr,n=0,i=0;He(e.nodes(),function(l){r.setNode(l,{v:l,in:0,out:0})}),He(e.edges(),function(l){var u=r.edge(l.v,l.w)||0,h=t(l),d=u+h;r.setEdge(l.v,l.w,d),i=Math.max(i,r.node(l.v).out+=h),n=Math.max(n,r.node(l.w).in+=h)});var a=Ga(i+n+3).map(function(){return new dS}),o=n+1;return He(r.nodes(),function(l){U5(a,o,r.node(l))}),{graph:r,buckets:a,zeroIdx:o}}function U5(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}var gze,$ie=_(()=>{"use strict";on();ga();Mie();gze=Bs(1);s(Oie,"greedyFAS");s(yze,"doGreedyFAS");s(H5,"removeNode");s(xze,"buildState");s(U5,"assignBucket")});function Bie(e){var t=e.graph().acyclicer==="greedy"?Oie(e,r(e)):bze(e);He(t,function(n){var i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,Wd("rev"))});function r(n){return function(i){return n.edge(i).weight}}s(r,"weightFn")}function bze(e){var t=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,He(e.outEdges(a),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?t.push(o):i(o.w)}),delete r[a])}return s(i,"dfs"),He(e.nodes(),i),t}function Fie(e){He(e.edges(),function(t){var r=e.edge(t);if(r.reversed){e.removeEdge(t);var n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}var Y5=_(()=>{"use strict";on();$ie();s(Bie,"run");s(bze,"dfsFAS");s(Fie,"undo")});function yl(e,t,r,n){var i;do i=Wd(n);while(e.hasNode(i));return r.dummy=t,e.setNode(i,r),i}function zie(e){var t=new Qr().setGraph(e.graph());return He(e.nodes(),function(r){t.setNode(r,e.node(r))}),He(e.edges(),function(r){var n=t.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),t}function fS(e){var t=new Qr({multigraph:e.isMultigraph()}).setGraph(e.graph());return He(e.nodes(),function(r){e.children(r).length||t.setNode(r,e.node(r))}),He(e.edges(),function(r){t.setEdge(r,e.edge(r))}),t}function K5(e,t){var r=e.x,n=e.y,i=t.x-r,a=t.y-n,o=e.width/2,l=e.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var u,h;return Math.abs(a)*o>Math.abs(i)*l?(a<0&&(l=-l),u=l*i/a,h=l):(i<0&&(o=-o),u=o,h=o*a/i),{x:r+u,y:n+h}}function nh(e){var t=an(Ga(Q5(e)+1),function(){return[]});return He(e.nodes(),function(r){var n=e.node(r),i=n.rank;jn(i)||(t[i][n.order]=r)}),t}function Vie(e){var t=kc(an(e.nodes(),function(r){return e.node(r).rank}));He(e.nodes(),function(r){var n=e.node(r);ax(n,"rank")&&(n.rank-=t)})}function Wie(e){var t=kc(an(e.nodes(),function(a){return e.node(a).rank})),r=[];He(e.nodes(),function(a){var o=e.node(a).rank-t;r[o]||(r[o]=[]),r[o].push(a)});var n=0,i=e.graph().nodeRankFactor;He(r,function(a,o){jn(a)&&o%i!==0?--n:n&&He(a,function(l){e.node(l).rank+=n})})}function X5(e,t,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),yl(e,"border",i,t)}function Q5(e){return Gs(an(e.nodes(),function(t){var r=e.node(t).rank;if(!jn(r))return r}))}function qie(e,t){var r={lhs:[],rhs:[]};return He(e,function(n){t(n)?r.lhs.push(n):r.rhs.push(n)}),r}function jie(e,t){var r=iS();try{return t()}finally{console.log(e+" time: "+(iS()-r)+"ms")}}function Hie(e,t){return t()}var xl=_(()=>{"use strict";on();ga();s(yl,"addDummyNode");s(zie,"simplify");s(fS,"asNonCompoundGraph");s(K5,"intersectRect");s(nh,"buildLayerMatrix");s(Vie,"normalizeRanks");s(Wie,"removeEmptyRanks");s(X5,"addBorderNode");s(Q5,"maxRank");s(qie,"partition");s(jie,"time");s(Hie,"notime")});function Yie(e){function t(r){var n=e.children(r),i=e.node(r);if(n.length&&He(n,t),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)Uie(e,"borderLeft","_bl",r,i,a),Uie(e,"borderRight","_br",r,i,a)}}s(t,"dfs"),He(e.children(),t)}function Uie(e,t,r,n,i,a){var o={width:0,height:0,rank:a,borderType:t},l=i[t][a-1],u=yl(e,"border",o,r);i[t][a]=u,e.setParent(u,n),l&&e.setEdge(l,u,{weight:1})}var Kie=_(()=>{"use strict";on();xl();s(Yie,"addBorderSegments");s(Uie,"addBorderNode")});function Qie(e){var t=e.graph().rankdir.toLowerCase();(t==="lr"||t==="rl")&&Jie(e)}function Zie(e){var t=e.graph().rankdir.toLowerCase();(t==="bt"||t==="rl")&&Tze(e),(t==="lr"||t==="rl")&&(Cze(e),Jie(e))}function Jie(e){He(e.nodes(),function(t){Xie(e.node(t))}),He(e.edges(),function(t){Xie(e.edge(t))})}function Xie(e){var t=e.width;e.width=e.height,e.height=t}function Tze(e){He(e.nodes(),function(t){Z5(e.node(t))}),He(e.edges(),function(t){var r=e.edge(t);He(r.points,Z5),Object.prototype.hasOwnProperty.call(r,"y")&&Z5(r)})}function Z5(e){e.y=-e.y}function Cze(e){He(e.nodes(),function(t){J5(e.node(t))}),He(e.edges(),function(t){var r=e.edge(t);He(r.points,J5),Object.prototype.hasOwnProperty.call(r,"x")&&J5(r)})}function J5(e){var t=e.x;e.x=e.y,e.y=t}var ese=_(()=>{"use strict";on();s(Qie,"adjust");s(Zie,"undo");s(Jie,"swapWidthHeight");s(Xie,"swapWidthHeightOne");s(Tze,"reverseY");s(Z5,"reverseYOne");s(Cze,"swapXY");s(J5,"swapXYOne")});function tse(e){e.graph().dummyChains=[],He(e.edges(),function(t){Sze(e,t)})}function Sze(e,t){var r=t.v,n=e.node(r).rank,i=t.w,a=e.node(i).rank,o=t.name,l=e.edge(t),u=l.labelRank;if(a!==n+1){e.removeEdge(t);var h=void 0,d,f;for(f=0,++n;n<a;++f,++n)l.points=[],h={width:0,height:0,edgeLabel:l,edgeObj:t,rank:n},d=yl(e,"edge",h,"_d"),n===u&&(h.width=l.width,h.height=l.height,h.dummy="edge-label",h.labelpos=l.labelpos),e.setEdge(r,d,{weight:l.weight},o),f===0&&e.graph().dummyChains.push(d),r=d;e.setEdge(r,i,{weight:l.weight},o)}}function rse(e){He(e.graph().dummyChains,function(t){var r=e.node(t),n=r.edgeLabel,i;for(e.setEdge(r.edgeObj,n);r.dummy;)i=e.successors(t)[0],e.removeNode(t),n.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),t=i,r=e.node(t)})}var eN=_(()=>{"use strict";on();xl();s(tse,"run");s(Sze,"normalizeEdge");s(rse,"undo")});function cx(e){var t={};function r(n){var i=e.node(n);if(Object.prototype.hasOwnProperty.call(t,n))return i.rank;t[n]=!0;var a=kc(an(e.outEdges(n),function(o){return r(o.w)-e.edge(o).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),i.rank=a}s(r,"dfs"),He(e.sources(),r)}function jd(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var pS=_(()=>{"use strict";on();s(cx,"longestPath");s(jd,"slack")});function mS(e){var t=new Qr({directed:!1}),r=e.nodes()[0],n=e.nodeCount();t.setNode(r,{});for(var i,a;vze(t,e)<n;)i=Eze(t,e),a=t.hasNode(i.v)?jd(e,i):-jd(e,i),wze(t,e,a);return t}function vze(e,t){function r(n){He(t.nodeEdges(n),function(i){var a=i.v,o=n===a?i.w:a;!e.hasNode(o)&&!jd(t,i)&&(e.setNode(o,{}),e.setEdge(n,o,{}),r(o))})}return s(r,"dfs"),He(e.nodes(),r),e.nodeCount()}function Eze(e,t){return zd(t.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return jd(t,r)})}function wze(e,t,r){He(e.nodes(),function(n){t.node(n).rank+=r})}var tN=_(()=>{"use strict";on();ga();pS();s(mS,"feasibleTree");s(vze,"tightTree");s(Eze,"findMinSlackEdge");s(wze,"shiftRanks")});var ise=_(()=>{"use strict"});var rN=_(()=>{"use strict"});var Olr,nN=_(()=>{"use strict";on();rN();Olr=Bs(1)});var sse=_(()=>{"use strict";nN()});var iN=_(()=>{"use strict"});var ase=_(()=>{"use strict";iN()});var Ulr,ose=_(()=>{"use strict";on();Ulr=Bs(1)});function sN(e){var t={},r={},n=[];function i(a){if(Object.prototype.hasOwnProperty.call(r,a))throw new ux;Object.prototype.hasOwnProperty.call(t,a)||(r[a]=!0,t[a]=!0,He(e.predecessors(a),i),delete r[a],n.push(a))}if(s(i,"visit"),He(e.sinks(),i),V5(t)!==e.nodeCount())throw new ux;return n}function ux(){}var aN=_(()=>{"use strict";on();sN.CycleException=ux;s(sN,"topsort");s(ux,"CycleException");ux.prototype=new Error});var lse=_(()=>{"use strict";aN()});function gS(e,t,r){wr(t)||(t=[t]);var n=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return He(t,function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);cse(e,o,r==="post",a,n,i)}),i}function cse(e,t,r,n,i,a){Object.prototype.hasOwnProperty.call(n,t)||(n[t]=!0,r||a.push(t),He(i(t),function(o){cse(e,o,r,n,i,a)}),r&&a.push(t))}var oN=_(()=>{"use strict";on();s(gS,"dfs");s(cse,"doDfs")});function lN(e,t){return gS(e,t,"post")}var use=_(()=>{"use strict";oN();s(lN,"postorder")});function cN(e,t){return gS(e,t,"pre")}var hse=_(()=>{"use strict";oN();s(cN,"preorder")});var dse=_(()=>{"use strict";rN();j5()});var fse=_(()=>{"use strict";ise();nN();sse();ase();ose();lse();use();hse();dse();iN();aN()});function sh(e){e=zie(e),cx(e);var t=mS(e);hN(t),uN(t,e);for(var r,n;r=yse(t);)n=xse(t,e,r),bse(t,e,r,n)}function uN(e,t){var r=lN(e,e.nodes());r=r.slice(0,r.length-1),He(r,function(n){Dze(e,t,n)})}function Dze(e,t,r){var n=e.node(r),i=n.parent;e.edge(r,i).cutvalue=mse(e,t,r)}function mse(e,t,r){var n=e.node(r),i=n.parent,a=!0,o=t.edge(r,i),l=0;return o||(a=!1,o=t.edge(i,r)),l=o.weight,He(t.nodeEdges(r),function(u){var h=u.v===r,d=h?u.w:u.v;if(d!==i){var f=h===a,p=t.edge(u).weight;if(l+=f?p:-p,Nze(e,r,d)){var g=e.edge(r,d).cutvalue;l+=f?-g:g}}}),l}function hN(e,t){arguments.length<2&&(t=e.nodes()[0]),gse(e,{},1,t)}function gse(e,t,r,n,i){var a=r,o=e.node(n);return t[n]=!0,He(e.neighbors(n),function(l){Object.prototype.hasOwnProperty.call(t,l)||(r=gse(e,t,r,l,n))}),o.low=a,o.lim=r++,i?o.parent=i:delete o.parent,r}function yse(e){return Um(e.edges(),function(t){return e.edge(t).cutvalue<0})}function xse(e,t,r){var n=r.v,i=r.w;t.hasEdge(n,i)||(n=r.w,i=r.v);var a=e.node(n),o=e.node(i),l=a,u=!1;a.lim>o.lim&&(l=o,u=!0);var h=xs(t.edges(),function(d){return u===pse(e,e.node(d.v),l)&&u!==pse(e,e.node(d.w),l)});return zd(h,function(d){return jd(t,d)})}function bse(e,t,r,n){var i=r.v,a=r.w;e.removeEdge(i,a),e.setEdge(n.v,n.w,{}),hN(e),uN(e,t),Ize(e,t)}function Ize(e,t){var r=Um(e.nodes(),function(i){return!t.node(i).parent}),n=cN(e,r);n=n.slice(1),He(n,function(i){var a=e.node(i).parent,o=t.edge(i,a),l=!1;o||(o=t.edge(a,i),l=!0),t.node(i).rank=t.node(a).rank+(l?o.minlen:-o.minlen)})}function Nze(e,t,r){return e.hasEdge(t,r)}function pse(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}var Tse=_(()=>{"use strict";on();fse();xl();tN();pS();sh.initLowLimValues=hN;sh.initCutValues=uN;sh.calcCutValue=mse;sh.leaveEdge=yse;sh.enterEdge=xse;sh.exchangeEdges=bse;s(sh,"networkSimplex");s(uN,"initCutValues");s(Dze,"assignCutValue");s(mse,"calcCutValue");s(hN,"initLowLimValues");s(gse,"dfsAssignLowLim");s(yse,"leaveEdge");s(xse,"enterEdge");s(bse,"exchangeEdges");s(Ize,"updateRanks");s(Nze,"isTreeEdge");s(pse,"isDescendant")});function dN(e){switch(e.graph().ranker){case"network-simplex":Cse(e);break;case"tight-tree":Mze(e);break;case"longest-path":Pze(e);break;default:Cse(e)}}function Mze(e){cx(e),mS(e)}function Cse(e){sh(e)}var Pze,fN=_(()=>{"use strict";tN();Tse();pS();s(dN,"rank");Pze=cx;s(Mze,"tightTreeRanker");s(Cse,"networkSimplexRanker")});function kse(e){var t=yl(e,"root",{},"_root"),r=Oze(e),n=Gs(ma(r))-1,i=2*n+1;e.graph().nestingRoot=t,He(e.edges(),function(o){e.edge(o).minlen*=i});var a=$ze(e)+1;He(e.children(),function(o){Sse(e,t,i,a,n,r,o)}),e.graph().nodeRankFactor=i}function Sse(e,t,r,n,i,a,o){var l=e.children(o);if(!l.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:r});return}var u=X5(e,"_bt"),h=X5(e,"_bb"),d=e.node(o);e.setParent(u,o),d.borderTop=u,e.setParent(h,o),d.borderBottom=h,He(l,function(f){Sse(e,t,r,n,i,a,f);var p=e.node(f),g=p.borderTop?p.borderTop:f,m=p.borderBottom?p.borderBottom:f,y=p.borderTop?n:2*n,x=g!==m?1:i-a[o]+1;e.setEdge(u,g,{weight:y,minlen:x,nestingEdge:!0}),e.setEdge(m,h,{weight:y,minlen:x,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,u,{weight:0,minlen:i+a[o]})}function Oze(e){var t={};function r(n,i){var a=e.children(n);a&&a.length&&He(a,function(o){r(o,i+1)}),t[n]=i}return s(r,"dfs"),He(e.children(),function(n){r(n,1)}),t}function $ze(e){return ml(e.edges(),function(t,r){return t+e.edge(r).weight},0)}function vse(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,He(e.edges(),function(r){var n=e.edge(r);n.nestingEdge&&e.removeEdge(r)})}var Ese=_(()=>{"use strict";on();xl();s(kse,"run");s(Sse,"dfs");s(Oze,"treeDepths");s($ze,"sumWeights");s(vse,"cleanup")});function wse(e,t,r){var n={},i;He(r,function(a){for(var o=e.parent(a),l,u;o;){if(l=e.parent(o),l?(u=n[l],n[l]=o):(u=i,i=o),u&&u!==o){t.setEdge(u,o);return}o=l}})}var _se=_(()=>{"use strict";on();s(wse,"addSubgraphConstraints")});function Ase(e,t,r){var n=Fze(e),i=new Qr({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return e.node(a)});return He(e.nodes(),function(a){var o=e.node(a),l=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,l||n),He(e[r](a),function(u){var h=u.v===a?u.w:u.v,d=i.edge(h,a),f=jn(d)?0:d.weight;i.setEdge(h,a,{weight:e.edge(u).weight+f})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function Fze(e){for(var t;e.hasNode(t=Wd("_root")););return t}var Rse=_(()=>{"use strict";on();ga();s(Ase,"buildLayerGraph");s(Fze,"createRootNode")});function Lse(e,t){for(var r=0,n=1;n<t.length;++n)r+=Gze(e,t[n-1],t[n]);return r}function Gze(e,t,r){for(var n=hS(r,an(r,function(h,d){return d})),i=Fa(an(t,function(h){return gl(an(e.outEdges(h),function(d){return{pos:n[d.w],weight:e.edge(d).weight}}),"pos")})),a=1;a<r.length;)a<<=1;var o=2*a-1;a-=1;var l=an(new Array(o),function(){return 0}),u=0;return He(i.forEach(function(h){var d=h.pos+a;l[d]+=h.weight;for(var f=0;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=h.weight;u+=h.weight*f})),u}var Dse=_(()=>{"use strict";on();s(Lse,"crossCount");s(Gze,"twoLayerCrossCount")});function Ise(e){var t={},r=xs(e.nodes(),function(l){return!e.children(l).length}),n=Gs(an(r,function(l){return e.node(l).rank})),i=an(Ga(n+1),function(){return[]});function a(l){if(!ax(t,l)){t[l]=!0;var u=e.node(l);i[u.rank].push(l),He(e.successors(l),a)}}s(a,"dfs");var o=gl(r,function(l){return e.node(l).rank});return He(o,a),i}var Nse=_(()=>{"use strict";on();s(Ise,"initOrder")});function Pse(e,t){return an(t,function(r){var n=e.inEdges(r);if(n.length){var i=ml(n,function(a,o){var l=e.edge(o),u=e.node(o.v);return{sum:a.sum+l.weight*u.order,weight:a.weight+l.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}var Mse=_(()=>{"use strict";on();s(Pse,"barycenter")});function Ose(e,t){var r={};He(e,function(i,a){var o=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};jn(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),He(t.edges(),function(i){var a=r[i.v],o=r[i.w];!jn(a)&&!jn(o)&&(o.indegree++,a.out.push(r[i.w]))});var n=xs(r,function(i){return!i.indegree});return zze(n)}function zze(e){var t=[];function r(a){return function(o){o.merged||(jn(o.barycenter)||jn(a.barycenter)||o.barycenter>=a.barycenter)&&Vze(a,o)}}s(r,"handleIn");function n(a){return function(o){o.in.push(a),--o.indegree===0&&e.push(o)}}for(s(n,"handleOut");e.length;){var i=e.pop();t.push(i),He(i.in.reverse(),r(i)),He(i.out,n(i))}return an(xs(t,function(a){return!a.merged}),function(a){return Vd(a,["vs","i","barycenter","weight"])})}function Vze(e,t){var r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}var $se=_(()=>{"use strict";on();s(Ose,"resolveConflicts");s(zze,"doResolveConflicts");s(Vze,"mergeEntries")});function Fse(e,t){var r=qie(e,function(d){return Object.prototype.hasOwnProperty.call(d,"barycenter")}),n=r.lhs,i=gl(r.rhs,function(d){return-d.i}),a=[],o=0,l=0,u=0;n.sort(Wze(!!t)),u=Bse(a,i,u),He(n,function(d){u+=d.vs.length,a.push(d.vs),o+=d.barycenter*d.weight,l+=d.weight,u=Bse(a,i,u)});var h={vs:Fa(a)};return l&&(h.barycenter=o/l,h.weight=l),h}function Bse(e,t,r){for(var n;t.length&&(n=rh(t)).i<=r;)t.pop(),e.push(n.vs),r++;return r}function Wze(e){return function(t,r){return t.barycenter<r.barycenter?-1:t.barycenter>r.barycenter?1:e?r.i-t.i:t.i-r.i}}var Gse=_(()=>{"use strict";on();xl();s(Fse,"sort");s(Bse,"consumeUnsortable");s(Wze,"compareWithBias")});function pN(e,t,r,n){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,l=a?a.borderRight:void 0,u={};o&&(i=xs(i,function(m){return m!==o&&m!==l}));var h=Pse(e,i);He(h,function(m){if(e.children(m.v).length){var y=pN(e,m.v,r,n);u[m.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter")&&jze(m,y)}});var d=Ose(h,r);qze(d,u);var f=Fse(d,n);if(o&&(f.vs=Fa([o,f.vs,l]),e.predecessors(o).length)){var p=e.node(e.predecessors(o)[0]),g=e.node(e.predecessors(l)[0]);Object.prototype.hasOwnProperty.call(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+g.order)/(f.weight+2),f.weight+=2}return f}function qze(e,t){He(e,function(r){r.vs=Fa(r.vs.map(function(n){return t[n]?t[n].vs:n}))})}function jze(e,t){jn(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}var zse=_(()=>{"use strict";on();Mse();$se();Gse();s(pN,"sortSubgraph");s(qze,"expandSubgraphs");s(jze,"mergeBarycenters")});function qse(e){var t=Q5(e),r=Vse(e,Ga(1,t+1),"inEdges"),n=Vse(e,Ga(t-1,-1,-1),"outEdges"),i=Ise(e);Wse(e,i);for(var a=Number.POSITIVE_INFINITY,o,l=0,u=0;u<4;++l,++u){Hze(l%2?r:n,l%4>=2),i=nh(e);var h=Lse(e,i);h<a&&(u=0,o=T5(i),a=h)}Wse(e,o)}function Vse(e,t,r){return an(t,function(n){return Ase(e,n,r)})}function Hze(e,t){var r=new Qr;He(e,function(n){var i=n.graph().root,a=pN(n,i,r,t);He(a.vs,function(o,l){n.node(o).order=l}),wse(n,r,a.vs)})}function Wse(e,t){He(t,function(r){He(r,function(n,i){e.node(n).order=i})})}var jse=_(()=>{"use strict";on();ga();xl();_se();Rse();Dse();Nse();zse();s(qse,"order");s(Vse,"buildLayerGraphs");s(Hze,"sweepLayerGraphs");s(Wse,"assignOrder")});function Hse(e){var t=Yze(e);He(e.graph().dummyChains,function(r){for(var n=e.node(r),i=n.edgeObj,a=Uze(e,t,i.v,i.w),o=a.path,l=a.lca,u=0,h=o[u],d=!0;r!==i.w;){if(n=e.node(r),d){for(;(h=o[u])!==l&&e.node(h).maxRank<n.rank;)u++;h===l&&(d=!1)}if(!d){for(;u<o.length-1&&e.node(h=o[u+1]).minRank<=n.rank;)u++;h=o[u]}e.setParent(r,h),r=e.successors(r)[0]}})}function Uze(e,t,r,n){var i=[],a=[],o=Math.min(t[r].low,t[n].low),l=Math.max(t[r].lim,t[n].lim),u,h;u=r;do u=e.parent(u),i.push(u);while(u&&(t[u].low>o||l>t[u].lim));for(h=u,u=n;(u=e.parent(u))!==h;)a.push(u);return{path:i.concat(a.reverse()),lca:h}}function Yze(e){var t={},r=0;function n(i){var a=r;He(e.children(i),n),t[i]={low:a,lim:r++}}return s(n,"dfs"),He(e.children(),n),t}var Use=_(()=>{"use strict";on();s(Hse,"parentDummyChains");s(Uze,"findPath");s(Yze,"postorder")});function Kze(e,t){var r={};function n(i,a){var o=0,l=0,u=i.length,h=rh(a);return He(a,function(d,f){var p=Qze(e,d),g=p?e.node(p).order:u;(p||d===h)&&(He(a.slice(l,f+1),function(m){He(e.predecessors(m),function(y){var x=e.node(y),T=x.order;(T<o||g<T)&&!(x.dummy&&e.node(m).dummy)&&Yse(r,y,m)})}),l=f+1,o=g)}),a}return s(n,"visitLayer"),ml(t,n),r}function Xze(e,t){var r={};function n(a,o,l,u,h){var d;He(Ga(o,l),function(f){d=a[f],e.node(d).dummy&&He(e.predecessors(d),function(p){var g=e.node(p);g.dummy&&(g.order<u||g.order>h)&&Yse(r,p,d)})})}s(n,"scan");function i(a,o){var l=-1,u,h=0;return He(o,function(d,f){if(e.node(d).dummy==="border"){var p=e.predecessors(d);p.length&&(u=e.node(p[0]).order,n(o,h,f,l,u),h=f,l=u)}n(o,h,o.length,u,a.length)}),o}return s(i,"visitLayer"),ml(t,i),r}function Qze(e,t){if(e.node(t).dummy)return Um(e.predecessors(t),function(r){return e.node(r).dummy})}function Yse(e,t,r){if(t>r){var n=t;t=r,r=n}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Zze(e,t,r){if(t>r){var n=t;t=r,r=n}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],r)}function Jze(e,t,r,n){var i={},a={},o={};return He(t,function(l){He(l,function(u,h){i[u]=u,a[u]=u,o[u]=h})}),He(t,function(l){var u=-1;He(l,function(h){var d=n(h);if(d.length){d=gl(d,function(y){return o[y]});for(var f=(d.length-1)/2,p=Math.floor(f),g=Math.ceil(f);p<=g;++p){var m=d[p];a[h]===h&&u<o[m]&&!Zze(r,h,m)&&(a[m]=h,a[h]=i[h]=i[m],u=o[m])}}})}),{root:i,align:a}}function eVe(e,t,r,n,i){var a={},o=tVe(e,t,r,i),l=i?"borderLeft":"borderRight";function u(f,p){for(var g=o.nodes(),m=g.pop(),y={};m;)y[m]?f(m):(y[m]=!0,g.push(m),g=g.concat(p(m))),m=g.pop()}s(u,"iterate");function h(f){a[f]=o.inEdges(f).reduce(function(p,g){return Math.max(p,a[g.v]+o.edge(g))},0)}s(h,"pass1");function d(f){var p=o.outEdges(f).reduce(function(m,y){return Math.min(m,a[y.w]-o.edge(y))},Number.POSITIVE_INFINITY),g=e.node(f);p!==Number.POSITIVE_INFINITY&&g.borderType!==l&&(a[f]=Math.max(a[f],p))}return s(d,"pass2"),u(h,o.predecessors.bind(o)),u(d,o.successors.bind(o)),He(n,function(f){a[f]=a[r[f]]}),a}function tVe(e,t,r,n){var i=new Qr,a=e.graph(),o=sVe(a.nodesep,a.edgesep,n);return He(t,function(l){var u;He(l,function(h){var d=r[h];if(i.setNode(d),u){var f=r[u],p=i.edge(f,d);i.setEdge(f,d,Math.max(o(e,h,u),p||0))}u=h})}),i}function rVe(e,t){return zd(ma(t),function(r){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return $5(r,function(a,o){var l=aVe(e,o)/2;n=Math.max(a+l,n),i=Math.min(a-l,i)}),n-i})}function nVe(e,t){var r=ma(t),n=kc(r),i=Gs(r);He(["u","d"],function(a){He(["l","r"],function(o){var l=a+o,u=e[l],h;if(u!==t){var d=ma(u);h=o==="l"?n-kc(d):i-Gs(d),h&&(e[l]=Gd(u,function(f){return f+h}))}})})}function iVe(e,t){return Gd(e.ul,function(r,n){if(t)return e[t.toLowerCase()][n];var i=gl(an(e,n));return(i[1]+i[2])/2})}function Kse(e){var t=nh(e),r=Km(Kze(e,t),Xze(e,t)),n={},i;He(["u","d"],function(o){i=o==="u"?t:ma(t).reverse(),He(["l","r"],function(l){l==="r"&&(i=an(i,function(f){return ma(f).reverse()}));var u=(o==="u"?e.predecessors:e.successors).bind(e),h=Jze(e,i,r,u),d=eVe(e,i,h.root,h.align,l==="r");l==="r"&&(d=Gd(d,function(f){return-f})),n[o+l]=d})});var a=rVe(e,n);return nVe(n,a),iVe(n,e.graph().align)}function sVe(e,t,r){return function(n,i,a){var o=n.node(i),l=n.node(a),u=0,h;if(u+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":h=-o.width/2;break;case"r":h=o.width/2;break}if(h&&(u+=r?h:-h),h=0,u+=(o.dummy?t:e)/2,u+=(l.dummy?t:e)/2,u+=l.width/2,Object.prototype.hasOwnProperty.call(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":h=l.width/2;break;case"r":h=-l.width/2;break}return h&&(u+=r?h:-h),h=0,u}}function aVe(e,t){return e.node(t).width}var Xse=_(()=>{"use strict";on();ga();xl();s(Kze,"findType1Conflicts");s(Xze,"findType2Conflicts");s(Qze,"findOtherInnerSegmentNode");s(Yse,"addConflict");s(Zze,"hasConflict");s(Jze,"verticalAlignment");s(eVe,"horizontalCompaction");s(tVe,"buildBlockGraph");s(rVe,"findSmallestWidthAlignment");s(nVe,"alignCoordinates");s(iVe,"balance");s(Kse,"positionX");s(sVe,"sep");s(aVe,"width")});function Qse(e){e=fS(e),oVe(e),B5(Kse(e),function(t,r){e.node(r).x=t})}function oVe(e){var t=nh(e),r=e.graph().ranksep,n=0;He(t,function(i){var a=Gs(an(i,function(o){return e.node(o).height}));He(i,function(o){e.node(o).y=n+a/2}),n+=a+r})}var Zse=_(()=>{"use strict";on();xl();Xse();s(Qse,"position");s(oVe,"positionY")});function hx(e,t){var r=t&&t.debugTiming?jie:Hie;r("layout",()=>{var n=r(" buildLayoutGraph",()=>xVe(e));r(" runLayout",()=>lVe(n,r)),r(" updateInputGraph",()=>cVe(e,n))})}function lVe(e,t){t(" makeSpaceForEdgeLabels",()=>bVe(e)),t(" removeSelfEdges",()=>AVe(e)),t(" acyclic",()=>Bie(e)),t(" nestingGraph.run",()=>kse(e)),t(" rank",()=>dN(fS(e))),t(" injectEdgeLabelProxies",()=>TVe(e)),t(" removeEmptyRanks",()=>Wie(e)),t(" nestingGraph.cleanup",()=>vse(e)),t(" normalizeRanks",()=>Vie(e)),t(" assignRankMinMax",()=>CVe(e)),t(" removeEdgeLabelProxies",()=>kVe(e)),t(" normalize.run",()=>tse(e)),t(" parentDummyChains",()=>Hse(e)),t(" addBorderSegments",()=>Yie(e)),t(" order",()=>qse(e)),t(" insertSelfEdges",()=>RVe(e)),t(" adjustCoordinateSystem",()=>Qie(e)),t(" position",()=>Qse(e)),t(" positionSelfEdges",()=>LVe(e)),t(" removeBorderNodes",()=>_Ve(e)),t(" normalize.undo",()=>rse(e)),t(" fixupEdgeLabelCoords",()=>EVe(e)),t(" undoCoordinateSystem",()=>Zie(e)),t(" translateGraph",()=>SVe(e)),t(" assignNodeIntersects",()=>vVe(e)),t(" reversePoints",()=>wVe(e)),t(" acyclic.undo",()=>Fie(e))}function cVe(e,t){He(e.nodes(),function(r){var n=e.node(r),i=t.node(r);n&&(n.x=i.x,n.y=i.y,t.children(r).length&&(n.width=i.width,n.height=i.height))}),He(e.edges(),function(r){var n=e.edge(r),i=t.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}function xVe(e){var t=new Qr({multigraph:!0,compound:!0}),r=gN(e.graph());return t.setGraph(Km({},hVe,mN(r,uVe),Vd(r,dVe))),He(e.nodes(),function(n){var i=gN(e.node(n));t.setNode(n,D5(mN(i,fVe),pVe)),t.setParent(n,e.parent(n))}),He(e.edges(),function(n){var i=gN(e.edge(n));t.setEdge(n,Km({},gVe,mN(i,mVe),Vd(i,yVe)))}),t}function bVe(e){var t=e.graph();t.ranksep/=2,He(e.edges(),function(r){var n=e.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function TVe(e){He(e.edges(),function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v),i=e.node(t.w),a={rank:(i.rank-n.rank)/2+n.rank,e:t};yl(e,"edge-proxy",a,"_ep")}})}function CVe(e){var t=0;He(e.nodes(),function(r){var n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=Gs(t,n.maxRank))}),e.graph().maxRank=t}function kVe(e){He(e.nodes(),function(t){var r=e.node(t);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}function SVe(e){var t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=e.graph(),o=a.marginx||0,l=a.marginy||0;function u(h){var d=h.x,f=h.y,p=h.width,g=h.height;t=Math.min(t,d-p/2),r=Math.max(r,d+p/2),n=Math.min(n,f-g/2),i=Math.max(i,f+g/2)}s(u,"getExtremes"),He(e.nodes(),function(h){u(e.node(h))}),He(e.edges(),function(h){var d=e.edge(h);Object.prototype.hasOwnProperty.call(d,"x")&&u(d)}),t-=o,n-=l,He(e.nodes(),function(h){var d=e.node(h);d.x-=t,d.y-=n}),He(e.edges(),function(h){var d=e.edge(h);He(d.points,function(f){f.x-=t,f.y-=n}),Object.prototype.hasOwnProperty.call(d,"x")&&(d.x-=t),Object.prototype.hasOwnProperty.call(d,"y")&&(d.y-=n)}),a.width=r-t+o,a.height=i-n+l}function vVe(e){He(e.edges(),function(t){var r=e.edge(t),n=e.node(t.v),i=e.node(t.w),a,o;r.points?(a=r.points[0],o=r.points[r.points.length-1]):(r.points=[],a=i,o=n),r.points.unshift(K5(n,a)),r.points.push(K5(i,o))})}function EVe(e){He(e.edges(),function(t){var r=e.edge(t);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function wVe(e){He(e.edges(),function(t){var r=e.edge(t);r.reversed&&r.points.reverse()})}function _Ve(e){He(e.nodes(),function(t){if(e.children(t).length){var r=e.node(t),n=e.node(r.borderTop),i=e.node(r.borderBottom),a=e.node(rh(r.borderLeft)),o=e.node(rh(r.borderRight));r.width=Math.abs(o.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),He(e.nodes(),function(t){e.node(t).dummy==="border"&&e.removeNode(t)})}function AVe(e){He(e.edges(),function(t){if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function RVe(e){var t=nh(e);He(t,function(r){var n=0;He(r,function(i,a){var o=e.node(i);o.order=a+n,He(o.selfEdges,function(l){yl(e,"selfedge",{width:l.label.width,height:l.label.height,rank:o.rank,order:a+ ++n,e:l.e,label:l.label},"_se")}),delete o.selfEdges})})}function LVe(e){He(e.nodes(),function(t){var r=e.node(t);if(r.dummy==="selfedge"){var n=e.node(r.e.v),i=n.x+n.width/2,a=n.y,o=r.x-i,l=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*o/3,y:a-l},{x:i+5*o/6,y:a-l},{x:i+o,y:a},{x:i+5*o/6,y:a+l},{x:i+2*o/3,y:a+l}],r.label.x=r.x,r.label.y=r.y}})}function mN(e,t){return Gd(Vd(e,t),Number)}function gN(e){var t={};return He(e,function(r,n){t[n.toLowerCase()]=r}),t}var uVe,hVe,dVe,fVe,pVe,mVe,gVe,yVe,Jse=_(()=>{"use strict";on();ga();Kie();ese();Y5();eN();fN();Ese();jse();Use();Zse();xl();s(hx,"layout");s(lVe,"runLayout");s(cVe,"updateInputGraph");uVe=["nodesep","edgesep","ranksep","marginx","marginy"],hVe={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},dVe=["acyclicer","ranker","rankdir","align"],fVe=["width","height"],pVe={width:0,height:0},mVe=["minlen","weight","width","height","labeloffset"],gVe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},yVe=["labelpos"];s(xVe,"buildLayoutGraph");s(bVe,"makeSpaceForEdgeLabels");s(TVe,"injectEdgeLabelProxies");s(CVe,"assignRankMinMax");s(kVe,"removeEdgeLabelProxies");s(SVe,"translateGraph");s(vVe,"assignNodeIntersects");s(EVe,"fixupEdgeLabelCoords");s(wVe,"reversePointsForReversedEdges");s(_Ve,"removeBorderNodes");s(AVe,"removeSelfEdges");s(RVe,"insertSelfEdges");s(LVe,"positionSelfEdges");s(mN,"selectNumberAttrs");s(gN,"canonicalize")});var yN=_(()=>{"use strict";Y5();Jse();eN();fN()});var eae=_(()=>{"use strict"});var rae={};jt(rae,{captureNodeSizes:()=>MVe,shouldCaptureSizes:()=>IVe});function tae(){if(!(typeof globalThis>"u"))return globalThis}function IVe(){return!!tae()?.mermaidCaptureSizes}function NVe(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}function PVe(e,t){let r=tae();if(!r)return;let n=t.node(),a=((n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n)?.id??"(unknown)";r.mermaidCapturedSizes??=[];let o={svgId:a,sizes:e};r.mermaidCapturedSizes.push(o),r.mermaidLastCapturedSizes=o}function MVe(e,t){let r=[];for(let n of t.nodes)n.isGroup||r.push({id:n.id,width:n.width??0,height:n.height??0});r.length!==0&&PVe({metadata:{captureVersion:1,capturedAt:new Date().toISOString(),capturedFrom:NVe()},nodes:r},e)}var nae=_(()=>{"use strict";eae();s(tae,"getCaptureGlobal");s(IVe,"shouldCaptureSizes");s(NVe,"capturedFromLocation");s(PVe,"emitCapturedSizes");s(MVe,"captureNodeSizes")});function xN(e,{edgePathsClass:t="edges edgePath"}={}){let r=e.insert("g").attr("class","root"),n=r.insert("g").attr("class","clusters"),i=r.insert("g").attr("class",t),a=r.insert("g").attr("class","edgeLabels"),o=r.insert("g").attr("class","nodes");return{clusters:n,edgePaths:i,edgeLabels:a,nodes:o,rootGroups:r}}async function OVe(e,t){if(t.label){let{shapeSvg:r,bbox:n}=await it(e,t);t.labelBBox={width:n.width,height:n.height},r.remove()}else t.labelBBox={width:0,height:0}}async function bN(e,t,r){let n=await mc(e,t,r),i=n.node()?.getBBox()??{width:0,height:0};return t.width=i.width,t.height=i.height,n}async function iae(e,t){let r=new Qr({multigraph:!0,compound:!0}),n=[...t.edges],i=xe(),a=xN(e),{edgeLabels:o,nodes:l}=a,u=new Map,h=e.node()!=null;await Promise.all(t.nodes.map(async d=>{if(d.isGroup)h&&await OVe(l,d),r.setNode(d.id,{...d});else{if(h){let f=await bN(l,d,{config:i,dir:d.dir});u.set(d.id,f)}r.setNode(d.id,{...d})}}));for(let d of n)h&&ck(d)&&await bo(o,d),r.setEdge(d.start,d.end,{...d},d.id),t.edges.some(p=>p.id===d.id)||t.edges.push(d);if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:d}=await Promise.resolve().then(()=>(nae(),rae));d(e,t)}return{graph:r,groups:a,nodeElements:u}}var TN=_(()=>{"use strict";ga();Nt();km();Nd();Ct();s(xN,"createLayoutElementGroups");s(OVe,"measureGroupLabel");s(bN,"insertMeasuredNode");s(iae,"createGraphWithElements")});var br,Hd,aae,oae,dx,$Ve,lae,cae,BVe,Ud,sae,uae,hae,dae,yS,fae,FVe,CN=_(()=>{"use strict";ft();ga();br=new Map,Hd=new Map,aae=new Map,oae=s(()=>{Hd.clear(),aae.clear(),br.clear()},"clear"),dx=s((e,t)=>{let r=Hd.get(t)||[];return Y.trace("In isDescendant",t," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),$Ve=s((e,t)=>{let r=Hd.get(t)||[];return Y.info("Descendants of ",t," is ",r),Y.info("Edge is ",e),e.v===t||e.w===t?!1:r?r.includes(e.v)||dx(e.v,t)||dx(e.w,t)||r.includes(e.w):(Y.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),lae=s((e,t,r,n)=>{Y.debug("Copying children of ",e,"root",n,"data",t.node(e),n);let i=t.children(e)||[];e!==n&&i.push(e),Y.debug("Copying (nodes) clusterId",e,"nodes",i),i.forEach(a=>{if(t.children(a).length>0)lae(a,t,r,n);else{let o=t.node(a);Y.info("cp ",a," to ",n," with parent ",e),r.setNode(a,o),n!==t.parent(a)&&(Y.debug("Setting parent",a,t.parent(a)),r.setParent(a,t.parent(a))),e!==n&&a!==e?(Y.debug("Setting parent",a,e),r.setParent(a,e)):(Y.info("In copy ",e,"root",n,"data",t.node(e),n),Y.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==n,"node!==clusterId",a!==e));let l=t.edges(a);Y.debug("Copying Edges",l),l.forEach(u=>{Y.info("Edge",u);let h=t.edge(u.v,u.w,u.name);Y.info("Edge data",h,n);try{$Ve(u,n)?(Y.info("Copying as ",u.v,u.w,h,u.name),r.setEdge(u.v,u.w,h,u.name),Y.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):Y.info("Skipping copy of edge ",u.v,"-->",u.w," rootId: ",n," clusterId:",e)}catch(d){Y.error(d)}})}Y.debug("Removing node",a),t.removeNode(a)})},"copy"),cae=s((e,t)=>{let r=t.children(e),n=[...r];for(let i of r)aae.set(i,e),n=[...n,...cae(i,t)];return n},"extractDescendants"),BVe=s((e,t,r)=>{let n=e.edges().filter(u=>u.v===t||u.w===t),i=e.edges().filter(u=>u.v===r||u.w===r),a=n.map(u=>({v:u.v===t?r:u.v,w:u.w===t?t:u.w})),o=i.map(u=>({v:u.v,w:u.w}));return a.filter(u=>o.some(h=>u.v===h.v&&u.w===h.w))},"findCommonEdges"),Ud=s((e,t,r)=>{let n=t.children(e);if(Y.trace("Searching children of id ",e,n),n.length<1)return e;let i;for(let a of n){let o=Ud(a,t,r),l=BVe(t,r,o);if(o)if(l.length>0)i=o;else return o}return i},"findNonClusterChild"),sae=s(e=>!br.has(e)||!br.get(e).externalConnections?e:br.has(e)?br.get(e).id:e,"getAnchorId"),uae=s((e,t)=>{if(!e||t>10){Y.debug("Opting out, no graph ");return}else Y.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(Y.debug("Cluster identified",r," Replacement id in edges: ",Ud(r,e,r)),Hd.set(r,cae(r,e)),br.set(r,{id:Ud(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){let n=e.children(r),i=e.edges();n.length>0?(Y.debug("Cluster identified",r,Hd),i.forEach(a=>{let o=dx(a.v,r),l=dx(a.w,r);o^l&&(Y.debug("Edge: ",a," leaves cluster ",r),Y.debug("Descendants of XXX ",r,": ",Hd.get(r)),br.get(r).externalConnections=!0)})):Y.debug("Not a cluster ",r,Hd)});for(let r of br.keys()){let n=br.get(r).id,i=e.parent(n);i!==r&&br.has(i)&&!br.get(i).externalConnections&&(br.get(r).id=i);let a=e.edges().some(o=>o.v===r);if(n&&br.get(r)?.externalConnections&&a&&fae(e,n,r)){let o=FVe(e,r,e.parent(n));o&&(br.get(r).id=o)}}e.edges().forEach(function(r){let n=e.edge(r);Y.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),Y.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let i=r.v,a=r.w;if(Y.debug("Fix XXX",br,"ids:",r.v,r.w,"Translating: ",br.get(r.v)," --- ",br.get(r.w)),br.get(r.v)||br.get(r.w)){if(Y.debug("Fixing and trying - removing XXX",r.v,r.w,r.name),i=sae(r.v),a=sae(r.w),e.removeEdge(r.v,r.w,r.name),i!==r.v){let o=e.parent(i);br.get(o).externalConnections=!0,n.fromCluster=r.v}if(a!==r.w){let o=e.parent(a);br.get(o).externalConnections=!0,n.toCluster=r.w}Y.debug("Fix Replacing with XXX",i,a,r.name),e.setEdge(i,a,n,r.name)}}),hae(e,0),Y.trace(br)},"adjustClustersAndEdges"),hae=s((e,t)=>{if(t>10){Y.error("Bailing out");return}let r=e.nodes(),n=!1;for(let i of r){let a=e.children(i);n=n||a.length>0}if(!n){Y.debug("Done, no node has children",e.nodes());return}Y.debug("Nodes = ",r,t);for(let i of r)if(Y.debug("Extracting node",i,br,br.has(i)&&!br.get(i).externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!br.has(i))Y.debug("Not a cluster",i,t);else if(!br.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){Y.debug("Cluster without external connections, without a parent and with children",i,t);let o=e.graph().rankdir==="TB"?"LR":"TB";br.get(i)?.clusterData?.dir&&(o=br.get(i).clusterData.dir,Y.debug("Fixing dir",br.get(i).clusterData.dir,o));let l=new Qr({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});lae(i,e,l,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:br.get(i).clusterData,label:br.get(i).label,graph:l})}else Y.debug("Cluster ** ",i," **not meeting the criteria !externalConnections:",!br.get(i).externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),Y.debug(br);r=e.nodes(),Y.debug("New list of nodes",r);for(let i of r){let a=e.node(i);Y.debug(" Now next level",i,a),a?.clusterNode&&hae(a.graph,t+1)}},"extractor"),dae=s((e,t)=>{if(t.length===0)return[];let r=Object.assign([],t);return t.forEach(n=>{let i=e.children(n),a=dae(e,i);r=[...r,...a]}),r},"sorter"),yS=s(e=>dae(e,e.children()),"sortNodesByHierarchy"),fae=s((e,t,r)=>{let n=e.parent(t);for(;n&&n!==r;){let i=br.get(n);if(i&&!i.externalConnections)return!0;n=e.parent(n)}return!1},"isNodeInExtractableCluster"),FVe=s((e,t,r)=>{let n=e.children(t)??[];for(let i of n){if(i===r||dx(i,r))continue;let a=Ud(i,e,t);if(a&&!fae(e,a,t))return a}return null},"findSafeAnchorNode")});function Xm({prepareLayout:e,measureLayout:t,runLayoutCore:r,paintLayout:n,afterPaint:i,paintOptions:a}){let o=t??SN;return s(async function(u,h,d,f){let p=h.select("g");Sm(p,u.markers,u.type,u.diagramId),kN();let g={element:p,helpers:d,options:f};g.preparedLayout=await e?.(u,g);let m=await o(u,g),y=await r(u,g),x={...g,measure:m};n?await n(u,x,y):await vN(u,x,a),await i?.(u,x,y)},"render")}function kN(){zZ(),FZ(),LZ(),oae()}async function SN(e,{element:t}){return await iae(t,e)}async function vN(e,t,r={}){let{measure:n}=t,{groups:i}=n;for(let o of r.getNodes?.(e,t)??e.nodes)r.skipNode?.(o,t)||await GVe(i,o,t,r);let a=VVe(e.nodes);for(let o of e.edges)WVe(o,r)||await qVe(i,o,a,e,r,t)}async function GVe(e,t,r,n){t.clusterNode?ll(t):zVe(t,r,n)?await Mu(e.clusters,t):ll(t)}function zVe(e,t,r){return e.isGroup===!0&&(r.isCluster?.(e,t)??!0)}function VVe(e){let t=new Map;for(let r of e)r?.id&&t.set(r.id,r);return t}function WVe(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}async function qVe(e,t,r,n,i,a){let o=Ou(e.edgePaths,{...t},i.clusterDb??new Map,n.type,pae(t.start,t,r,a,i),pae(t.end,t,r,a,i),n.diagramId,jVe(t,i));ck(t)&&(Id.has(t.id)||await bo(e.edgeLabels,t),HVe(t,o))}function pae(e,t,r,n,i){return i.getEdgeNode?.(e,t,n)??(e?r.get(e)??{}:{})}function jVe(e,t){return typeof t.skipIntersect=="function"?t.skipIntersect(e):t.skipIntersect??!1}function HVe(e,t){let r=t?.updatedPath??t?.originalPath,n=mt(),{subGraphTitleTotalMargin:i}=pc({flowchart:n.flowchart??{}});if(e.label){let a=Id.get(e.id),o=e.x,l=e.y;if(r){let u=Bt.calcLabelPosition(r);Y.debug("Moving label "+e.label+" from (",o,",",l,") to (",u.x,",",u.y,") abc88"),t?.updatedPath&&(o=u.x,l=u.y)}a.attr("transform",`translate(${o}, ${l+i/2})`)}if(e?.startLabelLeft){let a=Vn.get(e.id).startLeft,o=e?.x,l=e?.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.startLabelRight){let a=Vn.get(e.id).startRight,o=e.x,l=e.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.endLabelLeft){let a=Vn.get(e.id).endLeft,o=e.x,l=e.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.endLabelRight){let a=Vn.get(e.id).endRight,o=e.x,l=e.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}}var xS=_(()=>{"use strict";ft();mm();ir();Pt();P1();TN();M1();km();uk();Nd();CN();s(Xm,"createCommonLayoutRenderer");s(kN,"clearLayoutRenderState");s(SN,"defaultMeasureLayout");s(vN,"paintLayoutData");s(GVe,"paintLayoutNode");s(zVe,"shouldPaintAsCluster");s(VVe,"buildNodeLookup");s(WVe,"shouldSkipPaintEdge");s(qVe,"paintLayoutEdge");s(pae,"getRenderedNode");s(jVe,"shouldSkipIntersect");s(HVe,"positionRenderedEdgeLabel")});var Sae={};jt(Sae,{applyDagreLayoutResult:()=>Tae,getEdgesToRender:()=>EN,measureDagreLayout:()=>Cae,prepareLayoutForDagre:()=>wN,render:()=>iWe,runDagreLayoutCore:()=>kae});var mae,gae,UVe,YVe,KVe,XVe,QVe,EN,xae,bae,ZVe,yae,JVe,Tae,eWe,tWe,wN,Cae,kae,rWe,nWe,iWe,vae=_(()=>{"use strict";yN();ga();TN();xS();mm();Ct();CN();Nd();M1();km();ft();P1();Nt();mae=s((e,t,r)=>Math.max(t,Math.min(r,e)),"clamp"),gae=s((e="TB")=>{switch(e){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),UVe=s(e=>e==="flowchart"||e==="flowchart-v2"||e==="stateDiagram"||e==="er"||e==="classDiagram","shouldMergeSelfLoopSegments"),YVe=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],KVe=s((e,t,r,n,i)=>{let a=[],o=new Set;if(r.forEach(({start:d,end:f})=>{d!==n&&o.add(d),f!==n&&o.add(f)}),o.forEach(d=>{let f=e.node(d);typeof f?.x=="number"&&typeof f?.y=="number"&&a.push(f)}),a.length===0&&r.forEach(({edge:d})=>{(d.points??[]).forEach(f=>{typeof f?.x=="number"&&typeof f?.y=="number"&&a.push(f)})}),a.length===0)return gae(i);let l=a.reduce((d,f)=>({x:d.x+f.x/a.length,y:d.y+f.y/a.length}),{x:0,y:0}),u=l.x-t.x,h=l.y-t.y;return Math.abs(u)>Math.abs(h)?u>0?"right":"left":Math.abs(h)>0?h>0?"bottom":"top":gae(i)},"getSelfLoopSide"),XVe=s((e,t="top",r=0,n=0)=>{let i=e.x,a=e.y-r,o=e.width/2,l=e.height/2,u=Math.max(36,Math.min(100,e.width*.8)),h=mae(Math.max(n,e.width*.35),36,u),d=mae(Math.min(e.width,e.height)*.45,24,48);switch(t){case"bottom":{let f=a+l;return[{x:i-h/2,y:f},{x:i-h/2,y:f+d},{x:i+h/2,y:f+d},{x:i+h/2,y:f}]}case"right":{let f=i+o;return[{x:f,y:a-h/2},{x:f+d,y:a-h/2},{x:f+d,y:a+h/2},{x:f,y:a+h/2}]}case"left":{let f=i-o;return[{x:f,y:a-h/2},{x:f-d,y:a-h/2},{x:f-d,y:a+h/2},{x:f,y:a+h/2}]}case"top":default:{let f=a-l;return[{x:i-h/2,y:f},{x:i-h/2,y:f-d},{x:i+h/2,y:f-d},{x:i+h/2,y:f}]}}},"getSelfLoopPoints"),QVe=s((e,t,r="top",n=0,i={})=>{let o=e.x,l=e.y-n,u=i.width??0,h=i.height??0;switch(r){case"bottom":return{x:o,y:Math.max(...t.map(d=>d.y))+h/2+4};case"right":return{x:Math.max(...t.map(d=>d.x))+u/2+4,y:l};case"left":return{x:Math.min(...t.map(d=>d.x))-u/2-4,y:l};case"top":default:return{x:o,y:Math.min(...t.map(d=>d.y))-h/2-4}}},"getSelfLoopLabelPosition"),EN=s((e,t=0,{mergeSelfLoops:r=!0}={})=>{let n=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(o=>{let l=e.edge(o);if(r&&l.selfLoop){let u=l.selfLoop.id;n.has(u)||n.set(u,[]),n.get(u).push({edge:l,start:o.v,end:o.w})}else i.push({edge:l,start:o.v,end:o.w})}),n.forEach(o=>{if(o.length!==3){o.forEach(T=>i.push(T));return}o.sort((T,C)=>T.edge.selfLoop.order-C.edge.selfLoop.order);let[l,u,h]=o,d=l.edge.originalEdge??u.edge.originalEdge??h.edge.originalEdge??u.edge,f=e.node(d.start);if(!f){o.forEach(T=>i.push(T));return}let p={width:u.edge.width,height:u.edge.height},g=KVe(e,f,o,d.start,a),m=XVe(f,g,t,p.width??0),y=QVe(f,m,g,t,p),x={...u.edge,...d,id:d.id,points:m,start:d.start,end:d.end,x:y.x,y:y.y,width:p.width,height:p.height,labelStyle:u.edge.labelStyle,fromCluster:l.edge.fromCluster??u.edge.fromCluster??h.edge.fromCluster,toCluster:l.edge.toCluster??u.edge.toCluster??h.edge.toCluster};delete x.selfLoop,delete x.originalEdge,i.push({edge:x,start:x.start,end:x.end})}),i},"getEdgesToRender"),xae=s(async({element:e,graph:t,diagramType:r,id:n,parentCluster:i,siteConfig:a})=>{let o=t.graph().rankdir;Y.trace("Dir in recursive render - dir:",o);let{clusters:l,edgePaths:u,edgeLabels:h,nodes:d,rootGroups:f}=xN(e,{edgePathsClass:"edgePaths"});t.nodes()?Y.info("Recursive render XXX",t.nodes()):Y.info("No nodes found for",t),t.edges().length>0&&Y.info("Recursive edges",t.edge(t.edges()[0]));let p=UVe(r);await Promise.all(t.nodes().map(async function(y){let x=t.node(y);if(i!==void 0){let T=JSON.parse(JSON.stringify(i.clusterData));Y.trace(`Setting data for parent cluster XXX
343
+ L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),JOe=s((e,t,r)=>{let n=e.append("defs").append("marker").attr("id",r+"_"+t+"-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"),e6e=s((e,t,r)=>{let n=mt(),{themeVariables:i}=n,{strokeWidth:a}=i,o=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");o.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),o.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),o.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),o.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),t6e={extension:NOe,composition:POe,aggregation:MOe,dependency:OOe,lollipop:$Oe,point:BOe,circle:FOe,cross:GOe,barb:zOe,barbNeo:VOe,only_one:WOe,zero_or_one:qOe,one_or_more:jOe,zero_or_more:HOe,only_one_neo:UOe,zero_or_one_neo:YOe,one_or_more_neo:KOe,zero_or_more_neo:XOe,requirement_arrow:QOe,requirement_contains:JOe,requirement_arrow_neo:ZOe,requirement_contains_neo:e6e},Sm=IOe});async function mc(e,t,r){let n,i;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");let a=t.shape?A1[t.shape]:void 0;if(!a)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let o;r.config.securityLevel==="sandbox"?o="_top":t.linkTarget&&(o=t.linkTarget||"_blank"),n=e.insert("svg:a").attr("xlink:href",t.link).attr("target",o??null),i=await a(n,t,r)}else i=await a(e,t,r),n=i;return n.attr("data-look",$r(t.look)),t.tooltip&&i.attr("title",t.tooltip),hk.set(t.id,n),t.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}var hk,GZ,zZ,ll,Nd=_(()=>{"use strict";ft();tk();Pt();hk=new Map;s(mc,"insertNode");GZ=s((e,t)=>{hk.set(t.id,e)},"setNodeElem"),zZ=s(()=>{hk.clear()},"clear"),ll=s(e=>{let t=hk.get(e.id);Y.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");let r=8,n=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+n-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),n},"positionNode")});var VZ,WZ=_(()=>{"use strict";ir();vr();ft();M1();km();uk();Nd();Ct();Pt();VZ={common:ot,getConfig:mt,insertCluster:Mu,insertEdge:Ou,insertEdgeLabel:bo,insertMarkers:Sm,insertNode:mc,interpolateToCurve:g4,labelHelper:it,log:Y,positionEdgeLabel:Cm}});var r6e,dk,HI=_(()=>{"use strict";r6e=typeof global=="object"&&global&&global.Object===Object&&global,dk=r6e});var n6e,i6e,Wn,Oa=_(()=>{"use strict";HI();n6e=typeof self=="object"&&self&&self.Object===Object&&self,i6e=dk||n6e||Function("return this")(),Wn=i6e});var s6e,Ni,Pd=_(()=>{"use strict";Oa();s6e=Wn.Symbol,Ni=s6e});function l6e(e){var t=a6e.call(e,$1),r=e[$1];try{e[$1]=void 0;var n=!0}catch{}var i=o6e.call(e);return n&&(t?e[$1]=r:delete e[$1]),i}var qZ,a6e,o6e,$1,jZ,HZ=_(()=>{"use strict";Pd();qZ=Object.prototype,a6e=qZ.hasOwnProperty,o6e=qZ.toString,$1=Ni?Ni.toStringTag:void 0;s(l6e,"getRawTag");jZ=l6e});function h6e(e){return u6e.call(e)}var c6e,u6e,UZ,YZ=_(()=>{"use strict";c6e=Object.prototype,u6e=c6e.toString;s(h6e,"objectToString");UZ=h6e});function p6e(e){return e==null?e===void 0?f6e:d6e:KZ&&KZ in Object(e)?jZ(e):UZ(e)}var d6e,f6e,KZ,ys,$u=_(()=>{"use strict";Pd();HZ();YZ();d6e="[object Null]",f6e="[object Undefined]",KZ=Ni?Ni.toStringTag:void 0;s(p6e,"baseGetTag");ys=p6e});function m6e(e){return e!=null&&typeof e=="object"}var Xn,To=_(()=>{"use strict";s(m6e,"isObjectLike");Xn=m6e});function y6e(e){return typeof e=="symbol"||Xn(e)&&ys(e)==g6e}var g6e,fa,Md=_(()=>{"use strict";$u();To();g6e="[object Symbol]";s(y6e,"isSymbol");fa=y6e});function x6e(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var cl,B1=_(()=>{"use strict";s(x6e,"arrayMap");cl=x6e});var b6e,wr,oi=_(()=>{"use strict";b6e=Array.isArray,wr=b6e});function ZZ(e){if(typeof e=="string")return e;if(wr(e))return cl(e,ZZ)+"";if(fa(e))return QZ?QZ.call(e):"";var t=e+"";return t=="0"&&1/e==-T6e?"-0":t}var T6e,XZ,QZ,JZ,eJ=_(()=>{"use strict";Pd();B1();oi();Md();T6e=1/0,XZ=Ni?Ni.prototype:void 0,QZ=XZ?XZ.toString:void 0;s(ZZ,"baseToString");JZ=ZZ});function k6e(e){for(var t=e.length;t--&&C6e.test(e.charAt(t)););return t}var C6e,tJ,rJ=_(()=>{"use strict";C6e=/\s/;s(k6e,"trimmedEndIndex");tJ=k6e});function v6e(e){return e&&e.slice(0,tJ(e)+1).replace(S6e,"")}var S6e,nJ,iJ=_(()=>{"use strict";rJ();S6e=/^\s+/;s(v6e,"baseTrim");nJ=v6e});function E6e(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var In,$a=_(()=>{"use strict";s(E6e,"isObject");In=E6e});function L6e(e){if(typeof e=="number")return e;if(fa(e))return sJ;if(In(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=In(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=nJ(e);var r=_6e.test(e);return r||A6e.test(e)?R6e(e.slice(2),r?2:8):w6e.test(e)?sJ:+e}var sJ,w6e,_6e,A6e,R6e,aJ,oJ=_(()=>{"use strict";iJ();$a();Md();sJ=NaN,w6e=/^[-+]0x[0-9a-f]+$/i,_6e=/^0b[01]+$/i,A6e=/^0o[0-7]+$/i,R6e=parseInt;s(L6e,"toNumber");aJ=L6e});function I6e(e){if(!e)return e===0?e:0;if(e=aJ(e),e===lJ||e===-lJ){var t=e<0?-1:1;return t*D6e}return e===e?e:0}var lJ,D6e,vm,UI=_(()=>{"use strict";oJ();lJ=1/0,D6e=17976931348623157e292;s(I6e,"toFinite");vm=I6e});function N6e(e){var t=vm(e),r=t%1;return t===t?r?t-r:t:0}var cJ,uJ=_(()=>{"use strict";UI();s(N6e,"toInteger");cJ=N6e});function P6e(e){return e}var Os,Bu=_(()=>{"use strict";s(P6e,"identity");Os=P6e});function F6e(e){if(!In(e))return!1;var t=ys(e);return t==O6e||t==$6e||t==M6e||t==B6e}var M6e,O6e,$6e,B6e,ul,F1=_(()=>{"use strict";$u();$a();M6e="[object AsyncFunction]",O6e="[object Function]",$6e="[object GeneratorFunction]",B6e="[object Proxy]";s(F6e,"isFunction");ul=F6e});var G6e,fk,hJ=_(()=>{"use strict";Oa();G6e=Wn["__core-js_shared__"],fk=G6e});function z6e(e){return!!dJ&&dJ in e}var dJ,fJ,pJ=_(()=>{"use strict";hJ();dJ=(function(){var e=/[^.]+$/.exec(fk&&fk.keys&&fk.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();s(z6e,"isMasked");fJ=z6e});function q6e(e){if(e!=null){try{return W6e.call(e)}catch{}try{return e+""}catch{}}return""}var V6e,W6e,gc,YI=_(()=>{"use strict";V6e=Function.prototype,W6e=V6e.toString;s(q6e,"toSource");gc=q6e});function Z6e(e){if(!In(e)||fJ(e))return!1;var t=ul(e)?Q6e:H6e;return t.test(gc(e))}var j6e,H6e,U6e,Y6e,K6e,X6e,Q6e,mJ,gJ=_(()=>{"use strict";F1();pJ();$a();YI();j6e=/[\\^$.*+?()[\]{}|]/g,H6e=/^\[object .+?Constructor\]$/,U6e=Function.prototype,Y6e=Object.prototype,K6e=U6e.toString,X6e=Y6e.hasOwnProperty,Q6e=RegExp("^"+K6e.call(X6e).replace(j6e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");s(Z6e,"baseIsNative");mJ=Z6e});function J6e(e,t){return e?.[t]}var yJ,xJ=_(()=>{"use strict";s(J6e,"getValue");yJ=J6e});function e$e(e,t){var r=yJ(e,t);return mJ(r)?r:void 0}var $s,Fu=_(()=>{"use strict";gJ();xJ();s(e$e,"getNative");$s=e$e});var t$e,pk,bJ=_(()=>{"use strict";Fu();Oa();t$e=$s(Wn,"WeakMap"),pk=t$e});var TJ,r$e,CJ,kJ=_(()=>{"use strict";$a();TJ=Object.create,r$e=(function(){function e(){}return s(e,"object"),function(t){if(!In(t))return{};if(TJ)return TJ(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})(),CJ=r$e});function n$e(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var SJ,vJ=_(()=>{"use strict";s(n$e,"apply");SJ=n$e});function i$e(){}var EJ,wJ=_(()=>{"use strict";s(i$e,"noop");EJ=i$e});function s$e(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var mk,KI=_(()=>{"use strict";s(s$e,"copyArray");mk=s$e});function c$e(e){var t=0,r=0;return function(){var n=l$e(),i=o$e-(n-r);if(r=n,i>0){if(++t>=a$e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var a$e,o$e,l$e,_J,AJ=_(()=>{"use strict";a$e=800,o$e=16,l$e=Date.now;s(c$e,"shortOut");_J=c$e});function u$e(e){return function(){return e}}var Bs,XI=_(()=>{"use strict";s(u$e,"constant");Bs=u$e});var h$e,Em,QI=_(()=>{"use strict";Fu();h$e=(function(){try{var e=$s(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Em=h$e});var d$e,RJ,LJ=_(()=>{"use strict";XI();QI();Bu();d$e=Em?function(e,t){return Em(e,"toString",{configurable:!0,enumerable:!1,value:Bs(t),writable:!0})}:Os,RJ=d$e});var f$e,gk,ZI=_(()=>{"use strict";LJ();AJ();f$e=_J(RJ),gk=f$e});function p$e(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var yk,JI=_(()=>{"use strict";s(p$e,"arrayEach");yk=p$e});function m$e(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}var xk,e5=_(()=>{"use strict";s(m$e,"baseFindIndex");xk=m$e});function g$e(e){return e!==e}var DJ,IJ=_(()=>{"use strict";s(g$e,"baseIsNaN");DJ=g$e});function y$e(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var NJ,PJ=_(()=>{"use strict";s(y$e,"strictIndexOf");NJ=y$e});function x$e(e,t,r){return t===t?NJ(e,t,r):xk(e,DJ,r)}var MJ,OJ=_(()=>{"use strict";e5();IJ();PJ();s(x$e,"baseIndexOf");MJ=x$e});function b$e(e,t){var r=e==null?0:e.length;return!!r&&MJ(e,t,0)>-1}var $J,BJ=_(()=>{"use strict";OJ();s(b$e,"arrayIncludes");$J=b$e});function k$e(e,t){var r=typeof e;return t=t??T$e,!!t&&(r=="number"||r!="symbol"&&C$e.test(e))&&e>-1&&e%1==0&&e<t}var T$e,C$e,Gu,G1=_(()=>{"use strict";T$e=9007199254740991,C$e=/^(?:0|[1-9]\d*)$/;s(k$e,"isIndex");Gu=k$e});function S$e(e,t,r){t=="__proto__"&&Em?Em(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var zu,z1=_(()=>{"use strict";QI();s(S$e,"baseAssignValue");zu=S$e});function v$e(e,t){return e===t||e!==e&&t!==t}var Ba,Od=_(()=>{"use strict";s(v$e,"eq");Ba=v$e});function _$e(e,t,r){var n=e[t];(!(w$e.call(e,t)&&Ba(n,r))||r===void 0&&!(t in e))&&zu(e,t,r)}var E$e,w$e,Vu,V1=_(()=>{"use strict";z1();Od();E$e=Object.prototype,w$e=E$e.hasOwnProperty;s(_$e,"assignValue");Vu=_$e});function A$e(e,t,r,n){var i=!r;r||(r={});for(var a=-1,o=t.length;++a<o;){var l=t[a],u=n?n(r[l],e[l],l,r,e):void 0;u===void 0&&(u=e[l]),i?zu(r,l,u):Vu(r,l,u)}return r}var hl,wm=_(()=>{"use strict";V1();z1();s(A$e,"copyObject");hl=A$e});function R$e(e,t,r){return t=FJ(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=FJ(n.length-t,0),o=Array(a);++i<a;)o[i]=n[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=n[i];return l[t]=r(o),SJ(e,this,l)}}var FJ,bk,t5=_(()=>{"use strict";vJ();FJ=Math.max;s(R$e,"overRest");bk=R$e});function L$e(e,t){return gk(bk(e,t,Os),e+"")}var Wu,W1=_(()=>{"use strict";Bu();t5();ZI();s(L$e,"baseRest");Wu=L$e});function I$e(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=D$e}var D$e,_m,Tk=_(()=>{"use strict";D$e=9007199254740991;s(I$e,"isLength");_m=I$e});function N$e(e){return e!=null&&_m(e.length)&&!ul(e)}var Pi,dl=_(()=>{"use strict";F1();Tk();s(N$e,"isArrayLike");Pi=N$e});function P$e(e,t,r){if(!In(r))return!1;var n=typeof t;return(n=="number"?Pi(r)&&Gu(t,r.length):n=="string"&&t in r)?Ba(r[t],e):!1}var yc,q1=_(()=>{"use strict";Od();dl();G1();$a();s(P$e,"isIterateeCall");yc=P$e});function M$e(e){return Wu(function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,o&&yc(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var l=r[n];l&&e(t,l,n,a)}return t})}var GJ,zJ=_(()=>{"use strict";W1();q1();s(M$e,"createAssigner");GJ=M$e});function $$e(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||O$e;return e===r}var O$e,qu,j1=_(()=>{"use strict";O$e=Object.prototype;s($$e,"isPrototype");qu=$$e});function B$e(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var VJ,WJ=_(()=>{"use strict";s(B$e,"baseTimes");VJ=B$e});function G$e(e){return Xn(e)&&ys(e)==F$e}var F$e,r5,qJ=_(()=>{"use strict";$u();To();F$e="[object Arguments]";s(G$e,"baseIsArguments");r5=G$e});var jJ,z$e,V$e,W$e,Co,Am=_(()=>{"use strict";qJ();To();jJ=Object.prototype,z$e=jJ.hasOwnProperty,V$e=jJ.propertyIsEnumerable,W$e=r5((function(){return arguments})())?r5:function(e){return Xn(e)&&z$e.call(e,"callee")&&!V$e.call(e,"callee")},Co=W$e});function q$e(){return!1}var HJ,UJ=_(()=>{"use strict";s(q$e,"stubFalse");HJ=q$e});var XJ,YJ,j$e,KJ,H$e,U$e,ko,Rm=_(()=>{"use strict";Oa();UJ();XJ=typeof exports=="object"&&exports&&!exports.nodeType&&exports,YJ=XJ&&typeof module=="object"&&module&&!module.nodeType&&module,j$e=YJ&&YJ.exports===XJ,KJ=j$e?Wn.Buffer:void 0,H$e=KJ?KJ.isBuffer:void 0,U$e=H$e||HJ,ko=U$e});function xBe(e){return Xn(e)&&_m(e.length)&&!!wn[ys(e)]}var Y$e,K$e,X$e,Q$e,Z$e,J$e,eBe,tBe,rBe,nBe,iBe,sBe,aBe,oBe,lBe,cBe,uBe,hBe,dBe,fBe,pBe,mBe,gBe,yBe,wn,QJ,ZJ=_(()=>{"use strict";$u();Tk();To();Y$e="[object Arguments]",K$e="[object Array]",X$e="[object Boolean]",Q$e="[object Date]",Z$e="[object Error]",J$e="[object Function]",eBe="[object Map]",tBe="[object Number]",rBe="[object Object]",nBe="[object RegExp]",iBe="[object Set]",sBe="[object String]",aBe="[object WeakMap]",oBe="[object ArrayBuffer]",lBe="[object DataView]",cBe="[object Float32Array]",uBe="[object Float64Array]",hBe="[object Int8Array]",dBe="[object Int16Array]",fBe="[object Int32Array]",pBe="[object Uint8Array]",mBe="[object Uint8ClampedArray]",gBe="[object Uint16Array]",yBe="[object Uint32Array]",wn={};wn[cBe]=wn[uBe]=wn[hBe]=wn[dBe]=wn[fBe]=wn[pBe]=wn[mBe]=wn[gBe]=wn[yBe]=!0;wn[Y$e]=wn[K$e]=wn[oBe]=wn[X$e]=wn[lBe]=wn[Q$e]=wn[Z$e]=wn[J$e]=wn[eBe]=wn[tBe]=wn[rBe]=wn[nBe]=wn[iBe]=wn[sBe]=wn[aBe]=!1;s(xBe,"baseIsTypedArray");QJ=xBe});function bBe(e){return function(t){return e(t)}}var ju,H1=_(()=>{"use strict";s(bBe,"baseUnary");ju=bBe});var JJ,U1,TBe,n5,CBe,xc,Ck=_(()=>{"use strict";HI();JJ=typeof exports=="object"&&exports&&!exports.nodeType&&exports,U1=JJ&&typeof module=="object"&&module&&!module.nodeType&&module,TBe=U1&&U1.exports===JJ,n5=TBe&&dk.process,CBe=(function(){try{var e=U1&&U1.require&&U1.require("util").types;return e||n5&&n5.binding&&n5.binding("util")}catch{}})(),xc=CBe});var eee,kBe,Hu,Y1=_(()=>{"use strict";ZJ();H1();Ck();eee=xc&&xc.isTypedArray,kBe=eee?ju(eee):QJ,Hu=kBe});function EBe(e,t){var r=wr(e),n=!r&&Co(e),i=!r&&!n&&ko(e),a=!r&&!n&&!i&&Hu(e),o=r||n||i||a,l=o?VJ(e.length,String):[],u=l.length;for(var h in e)(t||vBe.call(e,h))&&!(o&&(h=="length"||i&&(h=="offset"||h=="parent")||a&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Gu(h,u)))&&l.push(h);return l}var SBe,vBe,kk,i5=_(()=>{"use strict";WJ();Am();oi();Rm();G1();Y1();SBe=Object.prototype,vBe=SBe.hasOwnProperty;s(EBe,"arrayLikeKeys");kk=EBe});function wBe(e,t){return function(r){return e(t(r))}}var Sk,s5=_(()=>{"use strict";s(wBe,"overArg");Sk=wBe});var _Be,tee,ree=_(()=>{"use strict";s5();_Be=Sk(Object.keys,Object),tee=_Be});function LBe(e){if(!qu(e))return tee(e);var t=[];for(var r in Object(e))RBe.call(e,r)&&r!="constructor"&&t.push(r);return t}var ABe,RBe,Lm,vk=_(()=>{"use strict";j1();ree();ABe=Object.prototype,RBe=ABe.hasOwnProperty;s(LBe,"baseKeys");Lm=LBe});function DBe(e){return Pi(e)?kk(e):Lm(e)}var qn,bc=_(()=>{"use strict";i5();vk();dl();s(DBe,"keys");qn=DBe});function IBe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var nee,iee=_(()=>{"use strict";s(IBe,"nativeKeysIn");nee=IBe});function MBe(e){if(!In(e))return nee(e);var t=qu(e),r=[];for(var n in e)n=="constructor"&&(t||!PBe.call(e,n))||r.push(n);return r}var NBe,PBe,see,aee=_(()=>{"use strict";$a();j1();iee();NBe=Object.prototype,PBe=NBe.hasOwnProperty;s(MBe,"baseKeysIn");see=MBe});function OBe(e){return Pi(e)?kk(e,!0):see(e)}var Fs,Uu=_(()=>{"use strict";i5();aee();dl();s(OBe,"keysIn");Fs=OBe});function FBe(e,t){if(wr(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||fa(e)?!0:BBe.test(e)||!$Be.test(e)||t!=null&&e in Object(t)}var $Be,BBe,Dm,Ek=_(()=>{"use strict";oi();Md();$Be=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,BBe=/^\w*$/;s(FBe,"isKey");Dm=FBe});var GBe,Tc,K1=_(()=>{"use strict";Fu();GBe=$s(Object,"create"),Tc=GBe});function zBe(){this.__data__=Tc?Tc(null):{},this.size=0}var oee,lee=_(()=>{"use strict";K1();s(zBe,"hashClear");oee=zBe});function VBe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var cee,uee=_(()=>{"use strict";s(VBe,"hashDelete");cee=VBe});function HBe(e){var t=this.__data__;if(Tc){var r=t[e];return r===WBe?void 0:r}return jBe.call(t,e)?t[e]:void 0}var WBe,qBe,jBe,hee,dee=_(()=>{"use strict";K1();WBe="__lodash_hash_undefined__",qBe=Object.prototype,jBe=qBe.hasOwnProperty;s(HBe,"hashGet");hee=HBe});function KBe(e){var t=this.__data__;return Tc?t[e]!==void 0:YBe.call(t,e)}var UBe,YBe,fee,pee=_(()=>{"use strict";K1();UBe=Object.prototype,YBe=UBe.hasOwnProperty;s(KBe,"hashHas");fee=KBe});function QBe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Tc&&t===void 0?XBe:t,this}var XBe,mee,gee=_(()=>{"use strict";K1();XBe="__lodash_hash_undefined__";s(QBe,"hashSet");mee=QBe});function Im(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var a5,yee=_(()=>{"use strict";lee();uee();dee();pee();gee();s(Im,"Hash");Im.prototype.clear=oee;Im.prototype.delete=cee;Im.prototype.get=hee;Im.prototype.has=fee;Im.prototype.set=mee;a5=Im});function ZBe(){this.__data__=[],this.size=0}var xee,bee=_(()=>{"use strict";s(ZBe,"listCacheClear");xee=ZBe});function JBe(e,t){for(var r=e.length;r--;)if(Ba(e[r][0],t))return r;return-1}var Yu,X1=_(()=>{"use strict";Od();s(JBe,"assocIndexOf");Yu=JBe});function r8e(e){var t=this.__data__,r=Yu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():t8e.call(t,r,1),--this.size,!0}var e8e,t8e,Tee,Cee=_(()=>{"use strict";X1();e8e=Array.prototype,t8e=e8e.splice;s(r8e,"listCacheDelete");Tee=r8e});function n8e(e){var t=this.__data__,r=Yu(t,e);return r<0?void 0:t[r][1]}var kee,See=_(()=>{"use strict";X1();s(n8e,"listCacheGet");kee=n8e});function i8e(e){return Yu(this.__data__,e)>-1}var vee,Eee=_(()=>{"use strict";X1();s(i8e,"listCacheHas");vee=i8e});function s8e(e,t){var r=this.__data__,n=Yu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var wee,_ee=_(()=>{"use strict";X1();s(s8e,"listCacheSet");wee=s8e});function Nm(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var Ku,Q1=_(()=>{"use strict";bee();Cee();See();Eee();_ee();s(Nm,"ListCache");Nm.prototype.clear=xee;Nm.prototype.delete=Tee;Nm.prototype.get=kee;Nm.prototype.has=vee;Nm.prototype.set=wee;Ku=Nm});var a8e,Xu,wk=_(()=>{"use strict";Fu();Oa();a8e=$s(Wn,"Map"),Xu=a8e});function o8e(){this.size=0,this.__data__={hash:new a5,map:new(Xu||Ku),string:new a5}}var Aee,Ree=_(()=>{"use strict";yee();Q1();wk();s(o8e,"mapCacheClear");Aee=o8e});function l8e(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Lee,Dee=_(()=>{"use strict";s(l8e,"isKeyable");Lee=l8e});function c8e(e,t){var r=e.__data__;return Lee(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Qu,Z1=_(()=>{"use strict";Dee();s(c8e,"getMapData");Qu=c8e});function u8e(e){var t=Qu(this,e).delete(e);return this.size-=t?1:0,t}var Iee,Nee=_(()=>{"use strict";Z1();s(u8e,"mapCacheDelete");Iee=u8e});function h8e(e){return Qu(this,e).get(e)}var Pee,Mee=_(()=>{"use strict";Z1();s(h8e,"mapCacheGet");Pee=h8e});function d8e(e){return Qu(this,e).has(e)}var Oee,$ee=_(()=>{"use strict";Z1();s(d8e,"mapCacheHas");Oee=d8e});function f8e(e,t){var r=Qu(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var Bee,Fee=_(()=>{"use strict";Z1();s(f8e,"mapCacheSet");Bee=f8e});function Pm(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var $d,_k=_(()=>{"use strict";Ree();Nee();Mee();$ee();Fee();s(Pm,"MapCache");Pm.prototype.clear=Aee;Pm.prototype.delete=Iee;Pm.prototype.get=Pee;Pm.prototype.has=Oee;Pm.prototype.set=Bee;$d=Pm});function o5(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(p8e);var r=s(function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o},"memoized");return r.cache=new(o5.Cache||$d),r}var p8e,Gee,zee=_(()=>{"use strict";_k();p8e="Expected a function";s(o5,"memoize");o5.Cache=$d;Gee=o5});function g8e(e){var t=Gee(e,function(n){return r.size===m8e&&r.clear(),n}),r=t.cache;return t}var m8e,Vee,Wee=_(()=>{"use strict";zee();m8e=500;s(g8e,"memoizeCapped");Vee=g8e});var y8e,x8e,b8e,qee,jee=_(()=>{"use strict";Wee();y8e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,x8e=/\\(\\)?/g,b8e=Vee(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(y8e,function(r,n,i,a){t.push(i?a.replace(x8e,"$1"):n||r)}),t}),qee=b8e});function T8e(e){return e==null?"":JZ(e)}var Ak,l5=_(()=>{"use strict";eJ();s(T8e,"toString");Ak=T8e});function C8e(e,t){return wr(e)?e:Dm(e,t)?[e]:qee(Ak(e))}var Zu,J1=_(()=>{"use strict";oi();Ek();jee();l5();s(C8e,"castPath");Zu=C8e});function S8e(e){if(typeof e=="string"||fa(e))return e;var t=e+"";return t=="0"&&1/e==-k8e?"-0":t}var k8e,fl,Mm=_(()=>{"use strict";Md();k8e=1/0;s(S8e,"toKey");fl=S8e});function v8e(e,t){t=Zu(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[fl(t[r++])];return r&&r==n?e:void 0}var Ju,ex=_(()=>{"use strict";J1();Mm();s(v8e,"baseGet");Ju=v8e});function E8e(e,t,r){var n=e==null?void 0:Ju(e,t);return n===void 0?r:n}var Hee,Uee=_(()=>{"use strict";ex();s(E8e,"get");Hee=E8e});function w8e(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Om,Rk=_(()=>{"use strict";s(w8e,"arrayPush");Om=w8e});function _8e(e){return wr(e)||Co(e)||!!(Yee&&e&&e[Yee])}var Yee,Kee,Xee=_(()=>{"use strict";Pd();Am();oi();Yee=Ni?Ni.isConcatSpreadable:void 0;s(_8e,"isFlattenable");Kee=_8e});function Qee(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=Kee),i||(i=[]);++a<o;){var l=e[a];t>0&&r(l)?t>1?Qee(l,t-1,r,n,i):Om(i,l):n||(i[i.length]=l)}return i}var $m,Lk=_(()=>{"use strict";Rk();Xee();s(Qee,"baseFlatten");$m=Qee});function A8e(e){var t=e==null?0:e.length;return t?$m(e,1):[]}var Fa,c5=_(()=>{"use strict";Lk();s(A8e,"flatten");Fa=A8e});function R8e(e){return gk(bk(e,void 0,Fa),e+"")}var Zee,Jee=_(()=>{"use strict";c5();t5();ZI();s(R8e,"flatRest");Zee=R8e});var L8e,Bm,Dk=_(()=>{"use strict";s5();L8e=Sk(Object.getPrototypeOf,Object),Bm=L8e});function O8e(e){if(!Xn(e)||ys(e)!=D8e)return!1;var t=Bm(e);if(t===null)return!0;var r=P8e.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&ete.call(r)==M8e}var D8e,I8e,N8e,ete,P8e,M8e,tte,rte=_(()=>{"use strict";$u();Dk();To();D8e="[object Object]",I8e=Function.prototype,N8e=Object.prototype,ete=I8e.toString,P8e=N8e.hasOwnProperty,M8e=ete.call(Object);s(O8e,"isPlainObject");tte=O8e});function j8e(e){return q8e.test(e)}var $8e,B8e,F8e,G8e,z8e,V8e,W8e,q8e,nte,ite=_(()=>{"use strict";$8e="\\ud800-\\udfff",B8e="\\u0300-\\u036f",F8e="\\ufe20-\\ufe2f",G8e="\\u20d0-\\u20ff",z8e=B8e+F8e+G8e,V8e="\\ufe0e\\ufe0f",W8e="\\u200d",q8e=RegExp("["+W8e+$8e+z8e+V8e+"]");s(j8e,"hasUnicode");nte=j8e});function H8e(e,t,r,n){var i=-1,a=e==null?0:e.length;for(n&&a&&(r=e[++i]);++i<a;)r=t(r,e[i],i,e);return r}var ste,ate=_(()=>{"use strict";s(H8e,"arrayReduce");ste=H8e});function U8e(){this.__data__=new Ku,this.size=0}var ote,lte=_(()=>{"use strict";Q1();s(U8e,"stackClear");ote=U8e});function Y8e(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var cte,ute=_(()=>{"use strict";s(Y8e,"stackDelete");cte=Y8e});function K8e(e){return this.__data__.get(e)}var hte,dte=_(()=>{"use strict";s(K8e,"stackGet");hte=K8e});function X8e(e){return this.__data__.has(e)}var fte,pte=_(()=>{"use strict";s(X8e,"stackHas");fte=X8e});function Z8e(e,t){var r=this.__data__;if(r instanceof Ku){var n=r.__data__;if(!Xu||n.length<Q8e-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new $d(n)}return r.set(e,t),this.size=r.size,this}var Q8e,mte,gte=_(()=>{"use strict";Q1();wk();_k();Q8e=200;s(Z8e,"stackSet");mte=Z8e});function Fm(e){var t=this.__data__=new Ku(e);this.size=t.size}var pl,tx=_(()=>{"use strict";Q1();lte();ute();dte();pte();gte();s(Fm,"Stack");Fm.prototype.clear=ote;Fm.prototype.delete=cte;Fm.prototype.get=hte;Fm.prototype.has=fte;Fm.prototype.set=mte;pl=Fm});function J8e(e,t){return e&&hl(t,qn(t),e)}var yte,xte=_(()=>{"use strict";wm();bc();s(J8e,"baseAssign");yte=J8e});function e7e(e,t){return e&&hl(t,Fs(t),e)}var bte,Tte=_(()=>{"use strict";wm();Uu();s(e7e,"baseAssignIn");bte=e7e});function r7e(e,t){if(t)return e.slice();var r=e.length,n=Ste?Ste(r):new e.constructor(r);return e.copy(n),n}var vte,Cte,t7e,kte,Ste,Ik,u5=_(()=>{"use strict";Oa();vte=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Cte=vte&&typeof module=="object"&&module&&!module.nodeType&&module,t7e=Cte&&Cte.exports===vte,kte=t7e?Wn.Buffer:void 0,Ste=kte?kte.allocUnsafe:void 0;s(r7e,"cloneBuffer");Ik=r7e});function n7e(e,t){for(var r=-1,n=e==null?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}var Nk,h5=_(()=>{"use strict";s(n7e,"arrayFilter");Nk=n7e});function i7e(){return[]}var Pk,d5=_(()=>{"use strict";s(i7e,"stubArray");Pk=i7e});var s7e,a7e,Ete,o7e,Gm,Mk=_(()=>{"use strict";h5();d5();s7e=Object.prototype,a7e=s7e.propertyIsEnumerable,Ete=Object.getOwnPropertySymbols,o7e=Ete?function(e){return e==null?[]:(e=Object(e),Nk(Ete(e),function(t){return a7e.call(e,t)}))}:Pk,Gm=o7e});function l7e(e,t){return hl(e,Gm(e),t)}var wte,_te=_(()=>{"use strict";wm();Mk();s(l7e,"copySymbols");wte=l7e});var c7e,u7e,Ok,f5=_(()=>{"use strict";Rk();Dk();Mk();d5();c7e=Object.getOwnPropertySymbols,u7e=c7e?function(e){for(var t=[];e;)Om(t,Gm(e)),e=Bm(e);return t}:Pk,Ok=u7e});function h7e(e,t){return hl(e,Ok(e),t)}var Ate,Rte=_(()=>{"use strict";wm();f5();s(h7e,"copySymbolsIn");Ate=h7e});function d7e(e,t,r){var n=t(e);return wr(e)?n:Om(n,r(e))}var $k,p5=_(()=>{"use strict";Rk();oi();s(d7e,"baseGetAllKeys");$k=d7e});function f7e(e){return $k(e,qn,Gm)}var rx,m5=_(()=>{"use strict";p5();Mk();bc();s(f7e,"getAllKeys");rx=f7e});function p7e(e){return $k(e,Fs,Ok)}var Lte,Dte=_(()=>{"use strict";p5();f5();Uu();s(p7e,"getAllKeysIn");Lte=p7e});var m7e,Bk,Ite=_(()=>{"use strict";Fu();Oa();m7e=$s(Wn,"DataView"),Bk=m7e});var g7e,Fk,Nte=_(()=>{"use strict";Fu();Oa();g7e=$s(Wn,"Promise"),Fk=g7e});var y7e,eh,g5=_(()=>{"use strict";Fu();Oa();y7e=$s(Wn,"Set"),eh=y7e});var Pte,x7e,Mte,Ote,$te,Bte,b7e,T7e,C7e,k7e,S7e,Bd,pa,Fd=_(()=>{"use strict";Ite();wk();Nte();g5();bJ();$u();YI();Pte="[object Map]",x7e="[object Object]",Mte="[object Promise]",Ote="[object Set]",$te="[object WeakMap]",Bte="[object DataView]",b7e=gc(Bk),T7e=gc(Xu),C7e=gc(Fk),k7e=gc(eh),S7e=gc(pk),Bd=ys;(Bk&&Bd(new Bk(new ArrayBuffer(1)))!=Bte||Xu&&Bd(new Xu)!=Pte||Fk&&Bd(Fk.resolve())!=Mte||eh&&Bd(new eh)!=Ote||pk&&Bd(new pk)!=$te)&&(Bd=s(function(e){var t=ys(e),r=t==x7e?e.constructor:void 0,n=r?gc(r):"";if(n)switch(n){case b7e:return Bte;case T7e:return Pte;case C7e:return Mte;case k7e:return Ote;case S7e:return $te}return t},"getTag"));pa=Bd});function w7e(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&E7e.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var v7e,E7e,Fte,Gte=_(()=>{"use strict";v7e=Object.prototype,E7e=v7e.hasOwnProperty;s(w7e,"initCloneArray");Fte=w7e});var _7e,zm,y5=_(()=>{"use strict";Oa();_7e=Wn.Uint8Array,zm=_7e});function A7e(e){var t=new e.constructor(e.byteLength);return new zm(t).set(new zm(e)),t}var Vm,Gk=_(()=>{"use strict";y5();s(A7e,"cloneArrayBuffer");Vm=A7e});function R7e(e,t){var r=t?Vm(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var zte,Vte=_(()=>{"use strict";Gk();s(R7e,"cloneDataView");zte=R7e});function D7e(e){var t=new e.constructor(e.source,L7e.exec(e));return t.lastIndex=e.lastIndex,t}var L7e,Wte,qte=_(()=>{"use strict";L7e=/\w*$/;s(D7e,"cloneRegExp");Wte=D7e});function I7e(e){return Hte?Object(Hte.call(e)):{}}var jte,Hte,Ute,Yte=_(()=>{"use strict";Pd();jte=Ni?Ni.prototype:void 0,Hte=jte?jte.valueOf:void 0;s(I7e,"cloneSymbol");Ute=I7e});function N7e(e,t){var r=t?Vm(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var zk,x5=_(()=>{"use strict";Gk();s(N7e,"cloneTypedArray");zk=N7e});function J7e(e,t,r){var n=e.constructor;switch(t){case V7e:return Vm(e);case P7e:case M7e:return new n(+e);case W7e:return zte(e,r);case q7e:case j7e:case H7e:case U7e:case Y7e:case K7e:case X7e:case Q7e:case Z7e:return zk(e,r);case O7e:return new n;case $7e:case G7e:return new n(e);case B7e:return Wte(e);case F7e:return new n;case z7e:return Ute(e)}}var P7e,M7e,O7e,$7e,B7e,F7e,G7e,z7e,V7e,W7e,q7e,j7e,H7e,U7e,Y7e,K7e,X7e,Q7e,Z7e,Kte,Xte=_(()=>{"use strict";Gk();Vte();qte();Yte();x5();P7e="[object Boolean]",M7e="[object Date]",O7e="[object Map]",$7e="[object Number]",B7e="[object RegExp]",F7e="[object Set]",G7e="[object String]",z7e="[object Symbol]",V7e="[object ArrayBuffer]",W7e="[object DataView]",q7e="[object Float32Array]",j7e="[object Float64Array]",H7e="[object Int8Array]",U7e="[object Int16Array]",Y7e="[object Int32Array]",K7e="[object Uint8Array]",X7e="[object Uint8ClampedArray]",Q7e="[object Uint16Array]",Z7e="[object Uint32Array]";s(J7e,"initCloneByTag");Kte=J7e});function eFe(e){return typeof e.constructor=="function"&&!qu(e)?CJ(Bm(e)):{}}var Vk,b5=_(()=>{"use strict";kJ();Dk();j1();s(eFe,"initCloneObject");Vk=eFe});function rFe(e){return Xn(e)&&pa(e)==tFe}var tFe,Qte,Zte=_(()=>{"use strict";Fd();To();tFe="[object Map]";s(rFe,"baseIsMap");Qte=rFe});var Jte,nFe,ere,tre=_(()=>{"use strict";Zte();H1();Ck();Jte=xc&&xc.isMap,nFe=Jte?ju(Jte):Qte,ere=nFe});function sFe(e){return Xn(e)&&pa(e)==iFe}var iFe,rre,nre=_(()=>{"use strict";Fd();To();iFe="[object Set]";s(sFe,"baseIsSet");rre=sFe});var ire,aFe,sre,are=_(()=>{"use strict";nre();H1();Ck();ire=xc&&xc.isSet,aFe=ire?ju(ire):rre,sre=aFe});function Wk(e,t,r,n,i,a){var o,l=t&oFe,u=t&lFe,h=t&cFe;if(r&&(o=i?r(e,n,i,a):r(e)),o!==void 0)return o;if(!In(e))return e;var d=wr(e);if(d){if(o=Fte(e),!l)return mk(e,o)}else{var f=pa(e),p=f==lre||f==pFe;if(ko(e))return Ik(e,l);if(f==cre||f==ore||p&&!i){if(o=u||p?{}:Vk(e),!l)return u?Ate(e,bte(o,e)):wte(e,yte(o,e))}else{if(!yn[f])return i?e:{};o=Kte(e,f,l)}}a||(a=new pl);var g=a.get(e);if(g)return g;a.set(e,o),sre(e)?e.forEach(function(x){o.add(Wk(x,t,r,x,e,a))}):ere(e)&&e.forEach(function(x,T){o.set(T,Wk(x,t,r,T,e,a))});var m=h?u?Lte:rx:u?Fs:qn,y=d?void 0:m(e);return yk(y||e,function(x,T){y&&(T=x,x=e[T]),Vu(o,T,Wk(x,t,r,T,e,a))}),o}var oFe,lFe,cFe,ore,uFe,hFe,dFe,fFe,lre,pFe,mFe,gFe,cre,yFe,xFe,bFe,TFe,CFe,kFe,SFe,vFe,EFe,wFe,_Fe,AFe,RFe,LFe,DFe,IFe,yn,ure,hre=_(()=>{"use strict";tx();JI();V1();xte();Tte();u5();KI();_te();Rte();m5();Dte();Fd();Gte();Xte();b5();oi();Rm();tre();$a();are();bc();Uu();oFe=1,lFe=2,cFe=4,ore="[object Arguments]",uFe="[object Array]",hFe="[object Boolean]",dFe="[object Date]",fFe="[object Error]",lre="[object Function]",pFe="[object GeneratorFunction]",mFe="[object Map]",gFe="[object Number]",cre="[object Object]",yFe="[object RegExp]",xFe="[object Set]",bFe="[object String]",TFe="[object Symbol]",CFe="[object WeakMap]",kFe="[object ArrayBuffer]",SFe="[object DataView]",vFe="[object Float32Array]",EFe="[object Float64Array]",wFe="[object Int8Array]",_Fe="[object Int16Array]",AFe="[object Int32Array]",RFe="[object Uint8Array]",LFe="[object Uint8ClampedArray]",DFe="[object Uint16Array]",IFe="[object Uint32Array]",yn={};yn[ore]=yn[uFe]=yn[kFe]=yn[SFe]=yn[hFe]=yn[dFe]=yn[vFe]=yn[EFe]=yn[wFe]=yn[_Fe]=yn[AFe]=yn[mFe]=yn[gFe]=yn[cre]=yn[yFe]=yn[xFe]=yn[bFe]=yn[TFe]=yn[RFe]=yn[LFe]=yn[DFe]=yn[IFe]=!0;yn[fFe]=yn[lre]=yn[CFe]=!1;s(Wk,"baseClone");ure=Wk});function MFe(e){return ure(e,NFe|PFe)}var NFe,PFe,T5,dre=_(()=>{"use strict";hre();NFe=1,PFe=4;s(MFe,"cloneDeep");T5=MFe});function $Fe(e){return this.__data__.set(e,OFe),this}var OFe,fre,pre=_(()=>{"use strict";OFe="__lodash_hash_undefined__";s($Fe,"setCacheAdd");fre=$Fe});function BFe(e){return this.__data__.has(e)}var mre,gre=_(()=>{"use strict";s(BFe,"setCacheHas");mre=BFe});function qk(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new $d;++t<r;)this.add(e[t])}var jk,C5=_(()=>{"use strict";_k();pre();gre();s(qk,"SetCache");qk.prototype.add=qk.prototype.push=fre;qk.prototype.has=mre;jk=qk});function FFe(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var yre,xre=_(()=>{"use strict";s(FFe,"arraySome");yre=FFe});function GFe(e,t){return e.has(t)}var Hk,k5=_(()=>{"use strict";s(GFe,"cacheHas");Hk=GFe});function WFe(e,t,r,n,i,a){var o=r&zFe,l=e.length,u=t.length;if(l!=u&&!(o&&u>l))return!1;var h=a.get(e),d=a.get(t);if(h&&d)return h==t&&d==e;var f=-1,p=!0,g=r&VFe?new jk:void 0;for(a.set(e,t),a.set(t,e);++f<l;){var m=e[f],y=t[f];if(n)var x=o?n(y,m,f,t,e,a):n(m,y,f,e,t,a);if(x!==void 0){if(x)continue;p=!1;break}if(g){if(!yre(t,function(T,C){if(!Hk(g,C)&&(m===T||i(m,T,r,n,a)))return g.push(C)})){p=!1;break}}else if(!(m===y||i(m,y,r,n,a))){p=!1;break}}return a.delete(e),a.delete(t),p}var zFe,VFe,Uk,S5=_(()=>{"use strict";C5();xre();k5();zFe=1,VFe=2;s(WFe,"equalArrays");Uk=WFe});function qFe(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var bre,Tre=_(()=>{"use strict";s(qFe,"mapToArray");bre=qFe});function jFe(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Wm,Yk=_(()=>{"use strict";s(jFe,"setToArray");Wm=jFe});function s9e(e,t,r,n,i,a,o){switch(r){case i9e:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case n9e:return!(e.byteLength!=t.byteLength||!a(new zm(e),new zm(t)));case YFe:case KFe:case ZFe:return Ba(+e,+t);case XFe:return e.name==t.name&&e.message==t.message;case JFe:case t9e:return e==t+"";case QFe:var l=bre;case e9e:var u=n&HFe;if(l||(l=Wm),e.size!=t.size&&!u)return!1;var h=o.get(e);if(h)return h==t;n|=UFe,o.set(e,t);var d=Uk(l(e),l(t),n,i,a,o);return o.delete(e),d;case r9e:if(v5)return v5.call(e)==v5.call(t)}return!1}var HFe,UFe,YFe,KFe,XFe,QFe,ZFe,JFe,e9e,t9e,r9e,n9e,i9e,Cre,v5,kre,Sre=_(()=>{"use strict";Pd();y5();Od();S5();Tre();Yk();HFe=1,UFe=2,YFe="[object Boolean]",KFe="[object Date]",XFe="[object Error]",QFe="[object Map]",ZFe="[object Number]",JFe="[object RegExp]",e9e="[object Set]",t9e="[object String]",r9e="[object Symbol]",n9e="[object ArrayBuffer]",i9e="[object DataView]",Cre=Ni?Ni.prototype:void 0,v5=Cre?Cre.valueOf:void 0;s(s9e,"equalByTag");kre=s9e});function c9e(e,t,r,n,i,a){var o=r&a9e,l=rx(e),u=l.length,h=rx(t),d=h.length;if(u!=d&&!o)return!1;for(var f=u;f--;){var p=l[f];if(!(o?p in t:l9e.call(t,p)))return!1}var g=a.get(e),m=a.get(t);if(g&&m)return g==t&&m==e;var y=!0;a.set(e,t),a.set(t,e);for(var x=o;++f<u;){p=l[f];var T=e[p],C=t[p];if(n)var k=o?n(C,T,p,t,e,a):n(T,C,p,e,t,a);if(!(k===void 0?T===C||i(T,C,r,n,a):k)){y=!1;break}x||(x=p=="constructor")}if(y&&!x){var E=e.constructor,v=t.constructor;E!=v&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof v=="function"&&v instanceof v)&&(y=!1)}return a.delete(e),a.delete(t),y}var a9e,o9e,l9e,vre,Ere=_(()=>{"use strict";m5();a9e=1,o9e=Object.prototype,l9e=o9e.hasOwnProperty;s(c9e,"equalObjects");vre=c9e});function d9e(e,t,r,n,i,a){var o=wr(e),l=wr(t),u=o?_re:pa(e),h=l?_re:pa(t);u=u==wre?Kk:u,h=h==wre?Kk:h;var d=u==Kk,f=h==Kk,p=u==h;if(p&&ko(e)){if(!ko(t))return!1;o=!0,d=!1}if(p&&!d)return a||(a=new pl),o||Hu(e)?Uk(e,t,r,n,i,a):kre(e,t,u,r,n,i,a);if(!(r&u9e)){var g=d&&Are.call(e,"__wrapped__"),m=f&&Are.call(t,"__wrapped__");if(g||m){var y=g?e.value():e,x=m?t.value():t;return a||(a=new pl),i(y,x,r,n,a)}}return p?(a||(a=new pl),vre(e,t,r,n,i,a)):!1}var u9e,wre,_re,Kk,h9e,Are,Rre,Lre=_(()=>{"use strict";tx();S5();Sre();Ere();Fd();oi();Rm();Y1();u9e=1,wre="[object Arguments]",_re="[object Array]",Kk="[object Object]",h9e=Object.prototype,Are=h9e.hasOwnProperty;s(d9e,"baseIsEqualDeep");Rre=d9e});function Dre(e,t,r,n,i){return e===t?!0:e==null||t==null||!Xn(e)&&!Xn(t)?e!==e&&t!==t:Rre(e,t,r,n,Dre,i)}var Xk,E5=_(()=>{"use strict";Lre();To();s(Dre,"baseIsEqual");Xk=Dre});function m9e(e,t,r,n){var i=r.length,a=i,o=!n;if(e==null)return!a;for(e=Object(e);i--;){var l=r[i];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<a;){l=r[i];var u=l[0],h=e[u],d=l[1];if(o&&l[2]){if(h===void 0&&!(u in e))return!1}else{var f=new pl;if(n)var p=n(h,d,u,e,t,f);if(!(p===void 0?Xk(d,h,f9e|p9e,n,f):p))return!1}}return!0}var f9e,p9e,Ire,Nre=_(()=>{"use strict";tx();E5();f9e=1,p9e=2;s(m9e,"baseIsMatch");Ire=m9e});function g9e(e){return e===e&&!In(e)}var Qk,w5=_(()=>{"use strict";$a();s(g9e,"isStrictComparable");Qk=g9e});function y9e(e){for(var t=qn(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Qk(i)]}return t}var Pre,Mre=_(()=>{"use strict";w5();bc();s(y9e,"getMatchData");Pre=y9e});function x9e(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var Zk,_5=_(()=>{"use strict";s(x9e,"matchesStrictComparable");Zk=x9e});function b9e(e){var t=Pre(e);return t.length==1&&t[0][2]?Zk(t[0][0],t[0][1]):function(r){return r===e||Ire(r,e,t)}}var Ore,$re=_(()=>{"use strict";Nre();Mre();_5();s(b9e,"baseMatches");Ore=b9e});function T9e(e,t){return e!=null&&t in Object(e)}var Bre,Fre=_(()=>{"use strict";s(T9e,"baseHasIn");Bre=T9e});function C9e(e,t,r){t=Zu(t,e);for(var n=-1,i=t.length,a=!1;++n<i;){var o=fl(t[n]);if(!(a=e!=null&&r(e,o)))break;e=e[o]}return a||++n!=i?a:(i=e==null?0:e.length,!!i&&_m(i)&&Gu(o,i)&&(wr(e)||Co(e)))}var Jk,A5=_(()=>{"use strict";J1();Am();oi();G1();Tk();Mm();s(C9e,"hasPath");Jk=C9e});function k9e(e,t){return e!=null&&Jk(e,t,Bre)}var eS,R5=_(()=>{"use strict";Fre();A5();s(k9e,"hasIn");eS=k9e});function E9e(e,t){return Dm(e)&&Qk(t)?Zk(fl(e),t):function(r){var n=Hee(r,e);return n===void 0&&n===t?eS(r,e):Xk(t,n,S9e|v9e)}}var S9e,v9e,Gre,zre=_(()=>{"use strict";E5();Uee();R5();Ek();w5();_5();Mm();S9e=1,v9e=2;s(E9e,"baseMatchesProperty");Gre=E9e});function w9e(e){return function(t){return t?.[e]}}var tS,L5=_(()=>{"use strict";s(w9e,"baseProperty");tS=w9e});function _9e(e){return function(t){return Ju(t,e)}}var Vre,Wre=_(()=>{"use strict";ex();s(_9e,"basePropertyDeep");Vre=_9e});function A9e(e){return Dm(e)?tS(fl(e)):Vre(e)}var qre,jre=_(()=>{"use strict";L5();Wre();Ek();Mm();s(A9e,"property");qre=A9e});function R9e(e){return typeof e=="function"?e:e==null?Os:typeof e=="object"?wr(e)?Gre(e[0],e[1]):Ore(e):qre(e)}var is,Cc=_(()=>{"use strict";$re();zre();Bu();oi();jre();s(R9e,"baseIteratee");is=R9e});function L9e(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),l=o.length;l--;){var u=o[e?l:++i];if(r(a[u],u,a)===!1)break}return t}}var Hre,Ure=_(()=>{"use strict";s(L9e,"createBaseFor");Hre=L9e});var D9e,qm,rS=_(()=>{"use strict";Ure();D9e=Hre(),qm=D9e});function I9e(e,t){return e&&qm(e,t,qn)}var jm,nS=_(()=>{"use strict";rS();bc();s(I9e,"baseForOwn");jm=I9e});function N9e(e,t){return function(r,n){if(r==null)return r;if(!Pi(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++a<i)&&n(o[a],a,o)!==!1;);return r}}var Yre,Kre=_(()=>{"use strict";dl();s(N9e,"createBaseEach");Yre=N9e});var P9e,th,nx=_(()=>{"use strict";nS();Kre();P9e=Yre(jm),th=P9e});var M9e,iS,Xre=_(()=>{"use strict";Oa();M9e=s(function(){return Wn.Date.now()},"now"),iS=M9e});var Qre,O9e,$9e,D5,Zre=_(()=>{"use strict";W1();Od();q1();Uu();Qre=Object.prototype,O9e=Qre.hasOwnProperty,$9e=Wu(function(e,t){e=Object(e);var r=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&yc(t[0],t[1],i)&&(n=1);++r<n;)for(var a=t[r],o=Fs(a),l=-1,u=o.length;++l<u;){var h=o[l],d=e[h];(d===void 0||Ba(d,Qre[h])&&!O9e.call(e,h))&&(e[h]=a[h])}return e}),D5=$9e});function B9e(e,t,r){(r!==void 0&&!Ba(e[t],r)||r===void 0&&!(t in e))&&zu(e,t,r)}var ix,I5=_(()=>{"use strict";z1();Od();s(B9e,"assignMergeValue");ix=B9e});function F9e(e){return Xn(e)&&Pi(e)}var sS,N5=_(()=>{"use strict";dl();To();s(F9e,"isArrayLikeObject");sS=F9e});function G9e(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var sx,P5=_(()=>{"use strict";s(G9e,"safeGet");sx=G9e});function z9e(e){return hl(e,Fs(e))}var Jre,ene=_(()=>{"use strict";wm();Uu();s(z9e,"toPlainObject");Jre=z9e});function V9e(e,t,r,n,i,a,o){var l=sx(e,r),u=sx(t,r),h=o.get(u);if(h){ix(e,r,h);return}var d=a?a(l,u,r+"",e,t,o):void 0,f=d===void 0;if(f){var p=wr(u),g=!p&&ko(u),m=!p&&!g&&Hu(u);d=u,p||g||m?wr(l)?d=l:sS(l)?d=mk(l):g?(f=!1,d=Ik(u,!0)):m?(f=!1,d=zk(u,!0)):d=[]:tte(u)||Co(u)?(d=l,Co(l)?d=Jre(l):(!In(l)||ul(l))&&(d=Vk(u))):f=!1}f&&(o.set(u,d),i(d,u,n,a,o),o.delete(u)),ix(e,r,d)}var tne,rne=_(()=>{"use strict";I5();u5();x5();KI();b5();Am();oi();N5();Rm();F1();$a();rte();Y1();P5();ene();s(V9e,"baseMergeDeep");tne=V9e});function nne(e,t,r,n,i){e!==t&&qm(t,function(a,o){if(i||(i=new pl),In(a))tne(e,t,o,r,nne,n,i);else{var l=n?n(sx(e,o),a,o+"",e,t,i):void 0;l===void 0&&(l=a),ix(e,o,l)}},Fs)}var ine,sne=_(()=>{"use strict";tx();I5();rS();rne();$a();Uu();P5();s(nne,"baseMerge");ine=nne});function W9e(e,t,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}var ane,one=_(()=>{"use strict";s(W9e,"arrayIncludesWith");ane=W9e});function q9e(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var rh,lne=_(()=>{"use strict";s(q9e,"last");rh=q9e});function j9e(e){return typeof e=="function"?e:Os}var Hm,aS=_(()=>{"use strict";Bu();s(j9e,"castFunction");Hm=j9e});function H9e(e,t){var r=wr(e)?yk:th;return r(e,Hm(t))}var He,M5=_(()=>{"use strict";JI();nx();aS();oi();s(H9e,"forEach");He=H9e});var cne=_(()=>{"use strict";M5()});function U9e(e,t){var r=[];return th(e,function(n,i,a){t(n,i,a)&&r.push(n)}),r}var une,hne=_(()=>{"use strict";nx();s(U9e,"baseFilter");une=U9e});function Y9e(e,t){var r=wr(e)?Nk:une;return r(e,is(t,3))}var xs,dne=_(()=>{"use strict";h5();hne();Cc();oi();s(Y9e,"filter");xs=Y9e});function K9e(e){return function(t,r,n){var i=Object(t);if(!Pi(t)){var a=is(r,3);t=qn(t),r=s(function(l){return a(i[l],l,i)},"predicate")}var o=e(t,r,n);return o>-1?i[a?t[o]:o]:void 0}}var fne,pne=_(()=>{"use strict";Cc();dl();bc();s(K9e,"createFind");fne=K9e});function Q9e(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:cJ(r);return i<0&&(i=X9e(n+i,0)),xk(e,is(t,3),i)}var X9e,mne,gne=_(()=>{"use strict";e5();Cc();uJ();X9e=Math.max;s(Q9e,"findIndex");mne=Q9e});var Z9e,Um,yne=_(()=>{"use strict";pne();gne();Z9e=fne(mne),Um=Z9e});function J9e(e,t){var r=-1,n=Pi(e)?Array(e.length):[];return th(e,function(i,a,o){n[++r]=t(i,a,o)}),n}var oS,O5=_(()=>{"use strict";nx();dl();s(J9e,"baseMap");oS=J9e});function eGe(e,t){var r=wr(e)?cl:oS;return r(e,is(t,3))}var an,xne=_(()=>{"use strict";B1();Cc();O5();oi();s(eGe,"map");an=eGe});function tGe(e,t){return e==null?e:qm(e,Hm(t),Fs)}var $5,bne=_(()=>{"use strict";rS();aS();Uu();s(tGe,"forIn");$5=tGe});function rGe(e,t){return e&&jm(e,Hm(t))}var B5,Tne=_(()=>{"use strict";nS();aS();s(rGe,"forOwn");B5=rGe});function nGe(e,t){return e>t}var Cne,kne=_(()=>{"use strict";s(nGe,"baseGt");Cne=nGe});function aGe(e,t){return e!=null&&sGe.call(e,t)}var iGe,sGe,Sne,vne=_(()=>{"use strict";iGe=Object.prototype,sGe=iGe.hasOwnProperty;s(aGe,"baseHas");Sne=aGe});function oGe(e,t){return e!=null&&Jk(e,t,Sne)}var ax,Ene=_(()=>{"use strict";vne();A5();s(oGe,"has");ax=oGe});function cGe(e){return typeof e=="string"||!wr(e)&&Xn(e)&&ys(e)==lGe}var lGe,wne,_ne=_(()=>{"use strict";$u();oi();To();lGe="[object String]";s(cGe,"isString");wne=cGe});function uGe(e,t){return cl(t,function(r){return e[r]})}var Ane,Rne=_(()=>{"use strict";B1();s(uGe,"baseValues");Ane=uGe});function hGe(e){return e==null?[]:Ane(e,qn(e))}var ma,Lne=_(()=>{"use strict";Rne();bc();s(hGe,"values");ma=hGe});function gGe(e){if(e==null)return!0;if(Pi(e)&&(wr(e)||typeof e=="string"||typeof e.splice=="function"||ko(e)||Hu(e)||Co(e)))return!e.length;var t=pa(e);if(t==dGe||t==fGe)return!e.size;if(qu(e))return!Lm(e).length;for(var r in e)if(mGe.call(e,r))return!1;return!0}var dGe,fGe,pGe,mGe,lS,Dne=_(()=>{"use strict";vk();Fd();Am();oi();dl();Rm();j1();Y1();dGe="[object Map]",fGe="[object Set]",pGe=Object.prototype,mGe=pGe.hasOwnProperty;s(gGe,"isEmpty");lS=gGe});function yGe(e){return e===void 0}var jn,Ine=_(()=>{"use strict";s(yGe,"isUndefined");jn=yGe});function xGe(e,t){return e<t}var cS,F5=_(()=>{"use strict";s(xGe,"baseLt");cS=xGe});function bGe(e,t){var r={};return t=is(t,3),jm(e,function(n,i,a){zu(r,i,t(n,i,a))}),r}var Gd,Nne=_(()=>{"use strict";z1();nS();Cc();s(bGe,"mapValues");Gd=bGe});function TGe(e,t,r){for(var n=-1,i=e.length;++n<i;){var a=e[n],o=t(a);if(o!=null&&(l===void 0?o===o&&!fa(o):r(o,l)))var l=o,u=a}return u}var Ym,uS=_(()=>{"use strict";Md();s(TGe,"baseExtremum");Ym=TGe});function CGe(e){return e&&e.length?Ym(e,Os,Cne):void 0}var Gs,Pne=_(()=>{"use strict";uS();kne();Bu();s(CGe,"max");Gs=CGe});var kGe,Km,Mne=_(()=>{"use strict";sne();zJ();kGe=GJ(function(e,t,r){ine(e,t,r)}),Km=kGe});function SGe(e){return e&&e.length?Ym(e,Os,cS):void 0}var kc,One=_(()=>{"use strict";uS();F5();Bu();s(SGe,"min");kc=SGe});function vGe(e,t){return e&&e.length?Ym(e,is(t,2),cS):void 0}var zd,$ne=_(()=>{"use strict";uS();Cc();F5();s(vGe,"minBy");zd=vGe});function EGe(e,t,r,n){if(!In(e))return e;t=Zu(t,e);for(var i=-1,a=t.length,o=a-1,l=e;l!=null&&++i<a;){var u=fl(t[i]),h=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return e;if(i!=o){var d=l[u];h=n?n(d,u,l):void 0,h===void 0&&(h=In(d)?d:Gu(t[i+1])?[]:{})}Vu(l,u,h),l=l[u]}return e}var Bne,Fne=_(()=>{"use strict";V1();J1();G1();$a();Mm();s(EGe,"baseSet");Bne=EGe});function wGe(e,t,r){for(var n=-1,i=t.length,a={};++n<i;){var o=t[n],l=Ju(e,o);r(l,o)&&Bne(a,Zu(o,e),l)}return a}var Gne,zne=_(()=>{"use strict";ex();Fne();J1();s(wGe,"basePickBy");Gne=wGe});function _Ge(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}var Vne,Wne=_(()=>{"use strict";s(_Ge,"baseSortBy");Vne=_Ge});function AGe(e,t){if(e!==t){var r=e!==void 0,n=e===null,i=e===e,a=fa(e),o=t!==void 0,l=t===null,u=t===t,h=fa(t);if(!l&&!h&&!a&&e>t||a&&o&&u&&!l&&!h||n&&o&&u||!r&&u||!i)return 1;if(!n&&!a&&!h&&e<t||h&&r&&i&&!n&&!a||l&&r&&i||!o&&i||!u)return-1}return 0}var qne,jne=_(()=>{"use strict";Md();s(AGe,"compareAscending");qne=AGe});function RGe(e,t,r){for(var n=-1,i=e.criteria,a=t.criteria,o=i.length,l=r.length;++n<o;){var u=qne(i[n],a[n]);if(u){if(n>=l)return u;var h=r[n];return u*(h=="desc"?-1:1)}}return e.index-t.index}var Hne,Une=_(()=>{"use strict";jne();s(RGe,"compareMultiple");Hne=RGe});function LGe(e,t,r){t.length?t=cl(t,function(a){return wr(a)?function(o){return Ju(o,a.length===1?a[0]:a)}:a}):t=[Os];var n=-1;t=cl(t,ju(is));var i=oS(e,function(a,o,l){var u=cl(t,function(h){return h(a)});return{criteria:u,index:++n,value:a}});return Vne(i,function(a,o){return Hne(a,o,r)})}var Yne,Kne=_(()=>{"use strict";B1();ex();Cc();O5();Wne();H1();Une();Bu();oi();s(LGe,"baseOrderBy");Yne=LGe});var DGe,Xne,Qne=_(()=>{"use strict";L5();DGe=tS("length"),Xne=DGe});function WGe(e){for(var t=Zne.lastIndex=0;Zne.test(e);)++t;return t}var Jne,IGe,NGe,PGe,MGe,OGe,$Ge,G5,z5,BGe,eie,tie,rie,FGe,nie,iie,GGe,zGe,VGe,Zne,sie,aie=_(()=>{"use strict";Jne="\\ud800-\\udfff",IGe="\\u0300-\\u036f",NGe="\\ufe20-\\ufe2f",PGe="\\u20d0-\\u20ff",MGe=IGe+NGe+PGe,OGe="\\ufe0e\\ufe0f",$Ge="["+Jne+"]",G5="["+MGe+"]",z5="\\ud83c[\\udffb-\\udfff]",BGe="(?:"+G5+"|"+z5+")",eie="[^"+Jne+"]",tie="(?:\\ud83c[\\udde6-\\uddff]){2}",rie="[\\ud800-\\udbff][\\udc00-\\udfff]",FGe="\\u200d",nie=BGe+"?",iie="["+OGe+"]?",GGe="(?:"+FGe+"(?:"+[eie,tie,rie].join("|")+")"+iie+nie+")*",zGe=iie+nie+GGe,VGe="(?:"+[eie+G5+"?",G5,tie,rie,$Ge].join("|")+")",Zne=RegExp(z5+"(?="+z5+")|"+VGe+zGe,"g");s(WGe,"unicodeSize");sie=WGe});function qGe(e){return nte(e)?sie(e):Xne(e)}var oie,lie=_(()=>{"use strict";Qne();ite();aie();s(qGe,"stringSize");oie=qGe});function jGe(e,t){return Gne(e,t,function(r,n){return eS(e,n)})}var cie,uie=_(()=>{"use strict";zne();R5();s(jGe,"basePick");cie=jGe});var HGe,Vd,hie=_(()=>{"use strict";uie();Jee();HGe=Zee(function(e,t){return e==null?{}:cie(e,t)}),Vd=HGe});function KGe(e,t,r,n){for(var i=-1,a=YGe(UGe((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var UGe,YGe,die,fie=_(()=>{"use strict";UGe=Math.ceil,YGe=Math.max;s(KGe,"baseRange");die=KGe});function XGe(e){return function(t,r,n){return n&&typeof n!="number"&&yc(t,r,n)&&(r=n=void 0),t=vm(t),r===void 0?(r=t,t=0):r=vm(r),n=n===void 0?t<r?1:-1:vm(n),die(t,r,n,e)}}var pie,mie=_(()=>{"use strict";fie();q1();UI();s(XGe,"createRange");pie=XGe});var QGe,Ga,gie=_(()=>{"use strict";mie();QGe=pie(),Ga=QGe});function ZGe(e,t,r,n,i){return i(e,function(a,o,l){r=n?(n=!1,a):t(r,a,o,l)}),r}var yie,xie=_(()=>{"use strict";s(ZGe,"baseReduce");yie=ZGe});function JGe(e,t,r){var n=wr(e)?ste:yie,i=arguments.length<3;return n(e,is(t,4),r,i,th)}var ml,bie=_(()=>{"use strict";ate();nx();Cc();xie();oi();s(JGe,"reduce");ml=JGe});function rze(e){if(e==null)return 0;if(Pi(e))return wne(e)?oie(e):e.length;var t=pa(e);return t==eze||t==tze?e.size:Lm(e).length}var eze,tze,V5,Tie=_(()=>{"use strict";vk();Fd();dl();_ne();lie();eze="[object Map]",tze="[object Set]";s(rze,"size");V5=rze});var nze,gl,Cie=_(()=>{"use strict";Lk();Kne();W1();q1();nze=Wu(function(e,t){if(e==null)return[];var r=t.length;return r>1&&yc(e,t[0],t[1])?t=[]:r>2&&yc(t[0],t[1],t[2])&&(t=[t[0]]),Yne(e,$m(t,1),[])}),gl=nze});var ize,sze,kie,Sie=_(()=>{"use strict";g5();wJ();Yk();ize=1/0,sze=eh&&1/Wm(new eh([,-0]))[1]==ize?function(e){return new eh(e)}:EJ,kie=sze});function oze(e,t,r){var n=-1,i=$J,a=e.length,o=!0,l=[],u=l;if(r)o=!1,i=ane;else if(a>=aze){var h=t?null:kie(e);if(h)return Wm(h);o=!1,i=Hk,u=new jk}else u=t?[]:l;e:for(;++n<a;){var d=e[n],f=t?t(d):d;if(d=r||d!==0?d:0,o&&f===f){for(var p=u.length;p--;)if(u[p]===f)continue e;t&&u.push(f),l.push(d)}else i(u,f,r)||(u!==l&&u.push(f),l.push(d))}return l}var aze,vie,Eie=_(()=>{"use strict";C5();BJ();one();k5();Sie();Yk();aze=200;s(oze,"baseUniq");vie=oze});var lze,W5,wie=_(()=>{"use strict";Lk();W1();Eie();N5();lze=Wu(function(e){return vie($m(e,1,sS,!0))}),W5=lze});function uze(e){var t=++cze;return Ak(e)+t}var cze,Wd,_ie=_(()=>{"use strict";l5();cze=0;s(uze,"uniqueId");Wd=uze});function hze(e,t,r){for(var n=-1,i=e.length,a=t.length,o={};++n<i;){var l=n<a?t[n]:void 0;r(o,e[n],l)}return o}var Aie,Rie=_(()=>{"use strict";s(hze,"baseZipObject");Aie=hze});function dze(e,t){return Aie(e||[],t||[],Vu)}var hS,Lie=_(()=>{"use strict";V1();Rie();s(dze,"zipObject");hS=dze});var on=_(()=>{"use strict";dre();XI();Zre();cne();dne();yne();c5();M5();bne();Tne();Ene();oi();Dne();F1();Ine();bc();lne();xne();Nne();Pne();Mne();One();$ne();Xre();hie();gie();bie();Tie();Cie();wie();_ie();Lne();Lie();});function Iie(e,t){e[t]?e[t]++:e[t]=1}function Nie(e,t){--e[t]||delete e[t]}function ox(e,t,r,n){var i=""+t,a=""+r;if(!e&&i>a){var o=i;i=a,a=o}return i+Die+a+Die+(jn(n)?fze:n)}function pze(e,t,r,n){var i=""+t,a=""+r;if(!e&&i>a){var o=i;i=a,a=o}var l={v:i,w:a};return n&&(l.name=n),l}function q5(e,t){return ox(e,t.v,t.w,t.name)}var fze,qd,Die,Qr,j5=_(()=>{"use strict";on();fze="\0",qd="\0",Die="",Qr=class{static{s(this,"Graph")}constructor(t={}){this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=Bs(void 0),this._defaultEdgeLabelFn=Bs(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[qd]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return ul(t)||(t=Bs(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return qn(this._nodes)}sources(){var t=this;return xs(this.nodes(),function(r){return lS(t._in[r])})}sinks(){var t=this;return xs(this.nodes(),function(r){return lS(t._out[r])})}setNodes(t,r){var n=arguments,i=this;return He(t,function(a){n.length>1?i.setNode(a,r):i.setNode(a)}),this}setNode(t,r){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=qd,this._children[t]={},this._children[qd][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var r=s(n=>this.removeEdge(this._edgeObjs[n]),"removeEdge");delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],He(this.children(t),n=>{this.setParent(n)}),delete this._children[t]),He(qn(this._in[t]),r),delete this._in[t],delete this._preds[t],He(qn(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(jn(r))r=qd;else{r+="";for(var n=r;!jn(n);n=this.parent(n))if(n===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==qd)return r}}children(t){if(jn(t)&&(t=qd),this._isCompound){var r=this._children[t];if(r)return qn(r)}else{if(t===qd)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return qn(r)}successors(t){var r=this._sucs[t];if(r)return qn(r)}neighbors(t){var r=this.predecessors(t);if(r)return W5(r,this.successors(t))}isLeaf(t){var r;return this.isDirected()?r=this.successors(t):r=this.neighbors(t),r.length===0}filterNodes(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;He(this._nodes,function(o,l){t(l)&&r.setNode(l,o)}),He(this._edgeObjs,function(o){r.hasNode(o.v)&&r.hasNode(o.w)&&r.setEdge(o,n.edge(o))});var i={};function a(o){var l=n.parent(o);return l===void 0||r.hasNode(l)?(i[o]=l,l):l in i?i[l]:a(l)}return s(a,"findParent"),this._isCompound&&He(r.nodes(),function(o){r.setParent(o,a(o))}),r}setDefaultEdgeLabel(t){return ul(t)||(t=Bs(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return ma(this._edgeObjs)}setPath(t,r){var n=this,i=arguments;return ml(t,function(a,o){return i.length>1?n.setEdge(a,o,r):n.setEdge(a,o),o}),this}setEdge(){var t,r,n,i,a=!1,o=arguments[0];typeof o=="object"&&o!==null&&"v"in o?(t=o.v,r=o.w,n=o.name,arguments.length===2&&(i=arguments[1],a=!0)):(t=o,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),t=""+t,r=""+r,jn(n)||(n=""+n);var l=ox(this._isDirected,t,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,l))return a&&(this._edgeLabels[l]=i),this;if(!jn(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[l]=a?i:this._defaultEdgeLabelFn(t,r,n);var u=pze(this._isDirected,t,r,n);return t=u.v,r=u.w,Object.freeze(u),this._edgeObjs[l]=u,Iie(this._preds[r],t),Iie(this._sucs[t],r),this._in[r][l]=u,this._out[t][l]=u,this._edgeCount++,this}edge(t,r,n){var i=arguments.length===1?q5(this._isDirected,arguments[0]):ox(this._isDirected,t,r,n);return this._edgeLabels[i]}hasEdge(t,r,n){var i=arguments.length===1?q5(this._isDirected,arguments[0]):ox(this._isDirected,t,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(t,r,n){var i=arguments.length===1?q5(this._isDirected,arguments[0]):ox(this._isDirected,t,r,n),a=this._edgeObjs[i];return a&&(t=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Nie(this._preds[r],t),Nie(this._sucs[t],r),delete this._in[r][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,r){var n=this._in[t];if(n){var i=ma(n);return r?xs(i,function(a){return a.v===r}):i}}outEdges(t,r){var n=this._out[t];if(n){var i=ma(n);return r?xs(i,function(a){return a.w===r}):i}}nodeEdges(t,r){var n=this.inEdges(t,r);if(n)return n.concat(this.outEdges(t,r))}};Qr.prototype._nodeCount=0;Qr.prototype._edgeCount=0;s(Iie,"incrementOrInitEntry");s(Nie,"decrementOrRemoveEntry");s(ox,"edgeArgsToId");s(pze,"edgeArgsToObj");s(q5,"edgeObjToId")});var ga=_(()=>{"use strict";j5()});function Pie(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function mze(e,t){if(e!=="_next"&&e!=="_prev")return t}var dS,Mie=_(()=>{"use strict";dS=class{static{s(this,"List")}constructor(){var t={};t._next=t._prev=t,this._sentinel=t}dequeue(){var t=this._sentinel,r=t._prev;if(r!==t)return Pie(r),r}enqueue(t){var r=this._sentinel;t._prev&&t._next&&Pie(t),t._next=r._next,r._next._prev=t,r._next=t,t._prev=r}toString(){for(var t=[],r=this._sentinel,n=r._prev;n!==r;)t.push(JSON.stringify(n,mze)),n=n._prev;return"["+t.join(", ")+"]"}};s(Pie,"unlink");s(mze,"filterOutLinks")});function Oie(e,t){if(e.nodeCount()<=1)return[];var r=xze(e,t||gze),n=yze(r.graph,r.buckets,r.zeroIdx);return Fa(an(n,function(i){return e.outEdges(i.v,i.w)}))}function yze(e,t,r){for(var n=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)H5(e,t,r,o);for(;o=i.dequeue();)H5(e,t,r,o);if(e.nodeCount()){for(var l=t.length-2;l>0;--l)if(o=t[l].dequeue(),o){n=n.concat(H5(e,t,r,o,!0));break}}}return n}function H5(e,t,r,n,i){var a=i?[]:void 0;return He(e.inEdges(n.v),function(o){var l=e.edge(o),u=e.node(o.v);i&&a.push({v:o.v,w:o.w}),u.out-=l,U5(t,r,u)}),He(e.outEdges(n.v),function(o){var l=e.edge(o),u=o.w,h=e.node(u);h.in-=l,U5(t,r,h)}),e.removeNode(n.v),a}function xze(e,t){var r=new Qr,n=0,i=0;He(e.nodes(),function(l){r.setNode(l,{v:l,in:0,out:0})}),He(e.edges(),function(l){var u=r.edge(l.v,l.w)||0,h=t(l),d=u+h;r.setEdge(l.v,l.w,d),i=Math.max(i,r.node(l.v).out+=h),n=Math.max(n,r.node(l.w).in+=h)});var a=Ga(i+n+3).map(function(){return new dS}),o=n+1;return He(r.nodes(),function(l){U5(a,o,r.node(l))}),{graph:r,buckets:a,zeroIdx:o}}function U5(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}var gze,$ie=_(()=>{"use strict";on();ga();Mie();gze=Bs(1);s(Oie,"greedyFAS");s(yze,"doGreedyFAS");s(H5,"removeNode");s(xze,"buildState");s(U5,"assignBucket")});function Bie(e){var t=e.graph().acyclicer==="greedy"?Oie(e,r(e)):bze(e);He(t,function(n){var i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=!0,e.setEdge(n.w,n.v,i,Wd("rev"))});function r(n){return function(i){return n.edge(i).weight}}s(r,"weightFn")}function bze(e){var t=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,He(e.outEdges(a),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?t.push(o):i(o.w)}),delete r[a])}return s(i,"dfs"),He(e.nodes(),i),t}function Fie(e){He(e.edges(),function(t){var r=e.edge(t);if(r.reversed){e.removeEdge(t);var n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}var Y5=_(()=>{"use strict";on();$ie();s(Bie,"run");s(bze,"dfsFAS");s(Fie,"undo")});function yl(e,t,r,n){var i;do i=Wd(n);while(e.hasNode(i));return r.dummy=t,e.setNode(i,r),i}function zie(e){var t=new Qr().setGraph(e.graph());return He(e.nodes(),function(r){t.setNode(r,e.node(r))}),He(e.edges(),function(r){var n=t.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),t}function fS(e){var t=new Qr({multigraph:e.isMultigraph()}).setGraph(e.graph());return He(e.nodes(),function(r){e.children(r).length||t.setNode(r,e.node(r))}),He(e.edges(),function(r){t.setEdge(r,e.edge(r))}),t}function K5(e,t){var r=e.x,n=e.y,i=t.x-r,a=t.y-n,o=e.width/2,l=e.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var u,h;return Math.abs(a)*o>Math.abs(i)*l?(a<0&&(l=-l),u=l*i/a,h=l):(i<0&&(o=-o),u=o,h=o*a/i),{x:r+u,y:n+h}}function nh(e){var t=an(Ga(Q5(e)+1),function(){return[]});return He(e.nodes(),function(r){var n=e.node(r),i=n.rank;jn(i)||(t[i][n.order]=r)}),t}function Vie(e){var t=kc(an(e.nodes(),function(r){return e.node(r).rank}));He(e.nodes(),function(r){var n=e.node(r);ax(n,"rank")&&(n.rank-=t)})}function Wie(e){var t=kc(an(e.nodes(),function(a){return e.node(a).rank})),r=[];He(e.nodes(),function(a){var o=e.node(a).rank-t;r[o]||(r[o]=[]),r[o].push(a)});var n=0,i=e.graph().nodeRankFactor;He(r,function(a,o){jn(a)&&o%i!==0?--n:n&&He(a,function(l){e.node(l).rank+=n})})}function X5(e,t,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),yl(e,"border",i,t)}function Q5(e){return Gs(an(e.nodes(),function(t){var r=e.node(t).rank;if(!jn(r))return r}))}function qie(e,t){var r={lhs:[],rhs:[]};return He(e,function(n){t(n)?r.lhs.push(n):r.rhs.push(n)}),r}function jie(e,t){var r=iS();try{return t()}finally{console.log(e+" time: "+(iS()-r)+"ms")}}function Hie(e,t){return t()}var xl=_(()=>{"use strict";on();ga();s(yl,"addDummyNode");s(zie,"simplify");s(fS,"asNonCompoundGraph");s(K5,"intersectRect");s(nh,"buildLayerMatrix");s(Vie,"normalizeRanks");s(Wie,"removeEmptyRanks");s(X5,"addBorderNode");s(Q5,"maxRank");s(qie,"partition");s(jie,"time");s(Hie,"notime")});function Yie(e){function t(r){var n=e.children(r),i=e.node(r);if(n.length&&He(n,t),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)Uie(e,"borderLeft","_bl",r,i,a),Uie(e,"borderRight","_br",r,i,a)}}s(t,"dfs"),He(e.children(),t)}function Uie(e,t,r,n,i,a){var o={width:0,height:0,rank:a,borderType:t},l=i[t][a-1],u=yl(e,"border",o,r);i[t][a]=u,e.setParent(u,n),l&&e.setEdge(l,u,{weight:1})}var Kie=_(()=>{"use strict";on();xl();s(Yie,"addBorderSegments");s(Uie,"addBorderNode")});function Qie(e){var t=e.graph().rankdir.toLowerCase();(t==="lr"||t==="rl")&&Jie(e)}function Zie(e){var t=e.graph().rankdir.toLowerCase();(t==="bt"||t==="rl")&&Tze(e),(t==="lr"||t==="rl")&&(Cze(e),Jie(e))}function Jie(e){He(e.nodes(),function(t){Xie(e.node(t))}),He(e.edges(),function(t){Xie(e.edge(t))})}function Xie(e){var t=e.width;e.width=e.height,e.height=t}function Tze(e){He(e.nodes(),function(t){Z5(e.node(t))}),He(e.edges(),function(t){var r=e.edge(t);He(r.points,Z5),Object.prototype.hasOwnProperty.call(r,"y")&&Z5(r)})}function Z5(e){e.y=-e.y}function Cze(e){He(e.nodes(),function(t){J5(e.node(t))}),He(e.edges(),function(t){var r=e.edge(t);He(r.points,J5),Object.prototype.hasOwnProperty.call(r,"x")&&J5(r)})}function J5(e){var t=e.x;e.x=e.y,e.y=t}var ese=_(()=>{"use strict";on();s(Qie,"adjust");s(Zie,"undo");s(Jie,"swapWidthHeight");s(Xie,"swapWidthHeightOne");s(Tze,"reverseY");s(Z5,"reverseYOne");s(Cze,"swapXY");s(J5,"swapXYOne")});function tse(e){e.graph().dummyChains=[],He(e.edges(),function(t){Sze(e,t)})}function Sze(e,t){var r=t.v,n=e.node(r).rank,i=t.w,a=e.node(i).rank,o=t.name,l=e.edge(t),u=l.labelRank;if(a!==n+1){e.removeEdge(t);var h=void 0,d,f;for(f=0,++n;n<a;++f,++n)l.points=[],h={width:0,height:0,edgeLabel:l,edgeObj:t,rank:n},d=yl(e,"edge",h,"_d"),n===u&&(h.width=l.width,h.height=l.height,h.dummy="edge-label",h.labelpos=l.labelpos),e.setEdge(r,d,{weight:l.weight},o),f===0&&e.graph().dummyChains.push(d),r=d;e.setEdge(r,i,{weight:l.weight},o)}}function rse(e){He(e.graph().dummyChains,function(t){var r=e.node(t),n=r.edgeLabel,i;for(e.setEdge(r.edgeObj,n);r.dummy;)i=e.successors(t)[0],e.removeNode(t),n.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),t=i,r=e.node(t)})}var eN=_(()=>{"use strict";on();xl();s(tse,"run");s(Sze,"normalizeEdge");s(rse,"undo")});function cx(e){var t={};function r(n){var i=e.node(n);if(Object.prototype.hasOwnProperty.call(t,n))return i.rank;t[n]=!0;var a=kc(an(e.outEdges(n),function(o){return r(o.w)-e.edge(o).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),i.rank=a}s(r,"dfs"),He(e.sources(),r)}function jd(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var pS=_(()=>{"use strict";on();s(cx,"longestPath");s(jd,"slack")});function mS(e){var t=new Qr({directed:!1}),r=e.nodes()[0],n=e.nodeCount();t.setNode(r,{});for(var i,a;vze(t,e)<n;)i=Eze(t,e),a=t.hasNode(i.v)?jd(e,i):-jd(e,i),wze(t,e,a);return t}function vze(e,t){function r(n){He(t.nodeEdges(n),function(i){var a=i.v,o=n===a?i.w:a;!e.hasNode(o)&&!jd(t,i)&&(e.setNode(o,{}),e.setEdge(n,o,{}),r(o))})}return s(r,"dfs"),He(e.nodes(),r),e.nodeCount()}function Eze(e,t){return zd(t.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return jd(t,r)})}function wze(e,t,r){He(e.nodes(),function(n){t.node(n).rank+=r})}var tN=_(()=>{"use strict";on();ga();pS();s(mS,"feasibleTree");s(vze,"tightTree");s(Eze,"findMinSlackEdge");s(wze,"shiftRanks")});var ise=_(()=>{"use strict"});var rN=_(()=>{"use strict"});var Olr,nN=_(()=>{"use strict";on();rN();Olr=Bs(1)});var sse=_(()=>{"use strict";nN()});var iN=_(()=>{"use strict"});var ase=_(()=>{"use strict";iN()});var Ulr,ose=_(()=>{"use strict";on();Ulr=Bs(1)});function sN(e){var t={},r={},n=[];function i(a){if(Object.prototype.hasOwnProperty.call(r,a))throw new ux;Object.prototype.hasOwnProperty.call(t,a)||(r[a]=!0,t[a]=!0,He(e.predecessors(a),i),delete r[a],n.push(a))}if(s(i,"visit"),He(e.sinks(),i),V5(t)!==e.nodeCount())throw new ux;return n}function ux(){}var aN=_(()=>{"use strict";on();sN.CycleException=ux;s(sN,"topsort");s(ux,"CycleException");ux.prototype=new Error});var lse=_(()=>{"use strict";aN()});function gS(e,t,r){wr(t)||(t=[t]);var n=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return He(t,function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);cse(e,o,r==="post",a,n,i)}),i}function cse(e,t,r,n,i,a){Object.prototype.hasOwnProperty.call(n,t)||(n[t]=!0,r||a.push(t),He(i(t),function(o){cse(e,o,r,n,i,a)}),r&&a.push(t))}var oN=_(()=>{"use strict";on();s(gS,"dfs");s(cse,"doDfs")});function lN(e,t){return gS(e,t,"post")}var use=_(()=>{"use strict";oN();s(lN,"postorder")});function cN(e,t){return gS(e,t,"pre")}var hse=_(()=>{"use strict";oN();s(cN,"preorder")});var dse=_(()=>{"use strict";rN();j5()});var fse=_(()=>{"use strict";ise();nN();sse();ase();ose();lse();use();hse();dse();iN();aN()});function sh(e){e=zie(e),cx(e);var t=mS(e);hN(t),uN(t,e);for(var r,n;r=yse(t);)n=xse(t,e,r),bse(t,e,r,n)}function uN(e,t){var r=lN(e,e.nodes());r=r.slice(0,r.length-1),He(r,function(n){Dze(e,t,n)})}function Dze(e,t,r){var n=e.node(r),i=n.parent;e.edge(r,i).cutvalue=mse(e,t,r)}function mse(e,t,r){var n=e.node(r),i=n.parent,a=!0,o=t.edge(r,i),l=0;return o||(a=!1,o=t.edge(i,r)),l=o.weight,He(t.nodeEdges(r),function(u){var h=u.v===r,d=h?u.w:u.v;if(d!==i){var f=h===a,p=t.edge(u).weight;if(l+=f?p:-p,Nze(e,r,d)){var g=e.edge(r,d).cutvalue;l+=f?-g:g}}}),l}function hN(e,t){arguments.length<2&&(t=e.nodes()[0]),gse(e,{},1,t)}function gse(e,t,r,n,i){var a=r,o=e.node(n);return t[n]=!0,He(e.neighbors(n),function(l){Object.prototype.hasOwnProperty.call(t,l)||(r=gse(e,t,r,l,n))}),o.low=a,o.lim=r++,i?o.parent=i:delete o.parent,r}function yse(e){return Um(e.edges(),function(t){return e.edge(t).cutvalue<0})}function xse(e,t,r){var n=r.v,i=r.w;t.hasEdge(n,i)||(n=r.w,i=r.v);var a=e.node(n),o=e.node(i),l=a,u=!1;a.lim>o.lim&&(l=o,u=!0);var h=xs(t.edges(),function(d){return u===pse(e,e.node(d.v),l)&&u!==pse(e,e.node(d.w),l)});return zd(h,function(d){return jd(t,d)})}function bse(e,t,r,n){var i=r.v,a=r.w;e.removeEdge(i,a),e.setEdge(n.v,n.w,{}),hN(e),uN(e,t),Ize(e,t)}function Ize(e,t){var r=Um(e.nodes(),function(i){return!t.node(i).parent}),n=cN(e,r);n=n.slice(1),He(n,function(i){var a=e.node(i).parent,o=t.edge(i,a),l=!1;o||(o=t.edge(a,i),l=!0),t.node(i).rank=t.node(a).rank+(l?o.minlen:-o.minlen)})}function Nze(e,t,r){return e.hasEdge(t,r)}function pse(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}var Tse=_(()=>{"use strict";on();fse();xl();tN();pS();sh.initLowLimValues=hN;sh.initCutValues=uN;sh.calcCutValue=mse;sh.leaveEdge=yse;sh.enterEdge=xse;sh.exchangeEdges=bse;s(sh,"networkSimplex");s(uN,"initCutValues");s(Dze,"assignCutValue");s(mse,"calcCutValue");s(hN,"initLowLimValues");s(gse,"dfsAssignLowLim");s(yse,"leaveEdge");s(xse,"enterEdge");s(bse,"exchangeEdges");s(Ize,"updateRanks");s(Nze,"isTreeEdge");s(pse,"isDescendant")});function dN(e){switch(e.graph().ranker){case"network-simplex":Cse(e);break;case"tight-tree":Mze(e);break;case"longest-path":Pze(e);break;default:Cse(e)}}function Mze(e){cx(e),mS(e)}function Cse(e){sh(e)}var Pze,fN=_(()=>{"use strict";tN();Tse();pS();s(dN,"rank");Pze=cx;s(Mze,"tightTreeRanker");s(Cse,"networkSimplexRanker")});function kse(e){var t=yl(e,"root",{},"_root"),r=Oze(e),n=Gs(ma(r))-1,i=2*n+1;e.graph().nestingRoot=t,He(e.edges(),function(o){e.edge(o).minlen*=i});var a=$ze(e)+1;He(e.children(),function(o){Sse(e,t,i,a,n,r,o)}),e.graph().nodeRankFactor=i}function Sse(e,t,r,n,i,a,o){var l=e.children(o);if(!l.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:r});return}var u=X5(e,"_bt"),h=X5(e,"_bb"),d=e.node(o);e.setParent(u,o),d.borderTop=u,e.setParent(h,o),d.borderBottom=h,He(l,function(f){Sse(e,t,r,n,i,a,f);var p=e.node(f),g=p.borderTop?p.borderTop:f,m=p.borderBottom?p.borderBottom:f,y=p.borderTop?n:2*n,x=g!==m?1:i-a[o]+1;e.setEdge(u,g,{weight:y,minlen:x,nestingEdge:!0}),e.setEdge(m,h,{weight:y,minlen:x,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,u,{weight:0,minlen:i+a[o]})}function Oze(e){var t={};function r(n,i){var a=e.children(n);a&&a.length&&He(a,function(o){r(o,i+1)}),t[n]=i}return s(r,"dfs"),He(e.children(),function(n){r(n,1)}),t}function $ze(e){return ml(e.edges(),function(t,r){return t+e.edge(r).weight},0)}function vse(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,He(e.edges(),function(r){var n=e.edge(r);n.nestingEdge&&e.removeEdge(r)})}var Ese=_(()=>{"use strict";on();xl();s(kse,"run");s(Sse,"dfs");s(Oze,"treeDepths");s($ze,"sumWeights");s(vse,"cleanup")});function wse(e,t,r){var n={},i;He(r,function(a){for(var o=e.parent(a),l,u;o;){if(l=e.parent(o),l?(u=n[l],n[l]=o):(u=i,i=o),u&&u!==o){t.setEdge(u,o);return}o=l}})}var _se=_(()=>{"use strict";on();s(wse,"addSubgraphConstraints")});function Ase(e,t,r){var n=Fze(e),i=new Qr({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return e.node(a)});return He(e.nodes(),function(a){var o=e.node(a),l=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,l||n),He(e[r](a),function(u){var h=u.v===a?u.w:u.v,d=i.edge(h,a),f=jn(d)?0:d.weight;i.setEdge(h,a,{weight:e.edge(u).weight+f})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function Fze(e){for(var t;e.hasNode(t=Wd("_root")););return t}var Rse=_(()=>{"use strict";on();ga();s(Ase,"buildLayerGraph");s(Fze,"createRootNode")});function Lse(e,t){for(var r=0,n=1;n<t.length;++n)r+=Gze(e,t[n-1],t[n]);return r}function Gze(e,t,r){for(var n=hS(r,an(r,function(h,d){return d})),i=Fa(an(t,function(h){return gl(an(e.outEdges(h),function(d){return{pos:n[d.w],weight:e.edge(d).weight}}),"pos")})),a=1;a<r.length;)a<<=1;var o=2*a-1;a-=1;var l=an(new Array(o),function(){return 0}),u=0;return He(i.forEach(function(h){var d=h.pos+a;l[d]+=h.weight;for(var f=0;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=h.weight;u+=h.weight*f})),u}var Dse=_(()=>{"use strict";on();s(Lse,"crossCount");s(Gze,"twoLayerCrossCount")});function Ise(e){var t={},r=xs(e.nodes(),function(l){return!e.children(l).length}),n=Gs(an(r,function(l){return e.node(l).rank})),i=an(Ga(n+1),function(){return[]});function a(l){if(!ax(t,l)){t[l]=!0;var u=e.node(l);i[u.rank].push(l),He(e.successors(l),a)}}s(a,"dfs");var o=gl(r,function(l){return e.node(l).rank});return He(o,a),i}var Nse=_(()=>{"use strict";on();s(Ise,"initOrder")});function Pse(e,t){return an(t,function(r){var n=e.inEdges(r);if(n.length){var i=ml(n,function(a,o){var l=e.edge(o),u=e.node(o.v);return{sum:a.sum+l.weight*u.order,weight:a.weight+l.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}var Mse=_(()=>{"use strict";on();s(Pse,"barycenter")});function Ose(e,t){var r={};He(e,function(i,a){var o=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};jn(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),He(t.edges(),function(i){var a=r[i.v],o=r[i.w];!jn(a)&&!jn(o)&&(o.indegree++,a.out.push(r[i.w]))});var n=xs(r,function(i){return!i.indegree});return zze(n)}function zze(e){var t=[];function r(a){return function(o){o.merged||(jn(o.barycenter)||jn(a.barycenter)||o.barycenter>=a.barycenter)&&Vze(a,o)}}s(r,"handleIn");function n(a){return function(o){o.in.push(a),--o.indegree===0&&e.push(o)}}for(s(n,"handleOut");e.length;){var i=e.pop();t.push(i),He(i.in.reverse(),r(i)),He(i.out,n(i))}return an(xs(t,function(a){return!a.merged}),function(a){return Vd(a,["vs","i","barycenter","weight"])})}function Vze(e,t){var r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}var $se=_(()=>{"use strict";on();s(Ose,"resolveConflicts");s(zze,"doResolveConflicts");s(Vze,"mergeEntries")});function Fse(e,t){var r=qie(e,function(d){return Object.prototype.hasOwnProperty.call(d,"barycenter")}),n=r.lhs,i=gl(r.rhs,function(d){return-d.i}),a=[],o=0,l=0,u=0;n.sort(Wze(!!t)),u=Bse(a,i,u),He(n,function(d){u+=d.vs.length,a.push(d.vs),o+=d.barycenter*d.weight,l+=d.weight,u=Bse(a,i,u)});var h={vs:Fa(a)};return l&&(h.barycenter=o/l,h.weight=l),h}function Bse(e,t,r){for(var n;t.length&&(n=rh(t)).i<=r;)t.pop(),e.push(n.vs),r++;return r}function Wze(e){return function(t,r){return t.barycenter<r.barycenter?-1:t.barycenter>r.barycenter?1:e?r.i-t.i:t.i-r.i}}var Gse=_(()=>{"use strict";on();xl();s(Fse,"sort");s(Bse,"consumeUnsortable");s(Wze,"compareWithBias")});function pN(e,t,r,n){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,l=a?a.borderRight:void 0,u={};o&&(i=xs(i,function(m){return m!==o&&m!==l}));var h=Pse(e,i);He(h,function(m){if(e.children(m.v).length){var y=pN(e,m.v,r,n);u[m.v]=y,Object.prototype.hasOwnProperty.call(y,"barycenter")&&jze(m,y)}});var d=Ose(h,r);qze(d,u);var f=Fse(d,n);if(o&&(f.vs=Fa([o,f.vs,l]),e.predecessors(o).length)){var p=e.node(e.predecessors(o)[0]),g=e.node(e.predecessors(l)[0]);Object.prototype.hasOwnProperty.call(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+g.order)/(f.weight+2),f.weight+=2}return f}function qze(e,t){He(e,function(r){r.vs=Fa(r.vs.map(function(n){return t[n]?t[n].vs:n}))})}function jze(e,t){jn(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}var zse=_(()=>{"use strict";on();Mse();$se();Gse();s(pN,"sortSubgraph");s(qze,"expandSubgraphs");s(jze,"mergeBarycenters")});function qse(e){var t=Q5(e),r=Vse(e,Ga(1,t+1),"inEdges"),n=Vse(e,Ga(t-1,-1,-1),"outEdges"),i=Ise(e);Wse(e,i);for(var a=Number.POSITIVE_INFINITY,o,l=0,u=0;u<4;++l,++u){Hze(l%2?r:n,l%4>=2),i=nh(e);var h=Lse(e,i);h<a&&(u=0,o=T5(i),a=h)}Wse(e,o)}function Vse(e,t,r){return an(t,function(n){return Ase(e,n,r)})}function Hze(e,t){var r=new Qr;He(e,function(n){var i=n.graph().root,a=pN(n,i,r,t);He(a.vs,function(o,l){n.node(o).order=l}),wse(n,r,a.vs)})}function Wse(e,t){He(t,function(r){He(r,function(n,i){e.node(n).order=i})})}var jse=_(()=>{"use strict";on();ga();xl();_se();Rse();Dse();Nse();zse();s(qse,"order");s(Vse,"buildLayerGraphs");s(Hze,"sweepLayerGraphs");s(Wse,"assignOrder")});function Hse(e){var t=Yze(e);He(e.graph().dummyChains,function(r){for(var n=e.node(r),i=n.edgeObj,a=Uze(e,t,i.v,i.w),o=a.path,l=a.lca,u=0,h=o[u],d=!0;r!==i.w;){if(n=e.node(r),d){for(;(h=o[u])!==l&&e.node(h).maxRank<n.rank;)u++;h===l&&(d=!1)}if(!d){for(;u<o.length-1&&e.node(h=o[u+1]).minRank<=n.rank;)u++;h=o[u]}e.setParent(r,h),r=e.successors(r)[0]}})}function Uze(e,t,r,n){var i=[],a=[],o=Math.min(t[r].low,t[n].low),l=Math.max(t[r].lim,t[n].lim),u,h;u=r;do u=e.parent(u),i.push(u);while(u&&(t[u].low>o||l>t[u].lim));for(h=u,u=n;(u=e.parent(u))!==h;)a.push(u);return{path:i.concat(a.reverse()),lca:h}}function Yze(e){var t={},r=0;function n(i){var a=r;He(e.children(i),n),t[i]={low:a,lim:r++}}return s(n,"dfs"),He(e.children(),n),t}var Use=_(()=>{"use strict";on();s(Hse,"parentDummyChains");s(Uze,"findPath");s(Yze,"postorder")});function Kze(e,t){var r={};function n(i,a){var o=0,l=0,u=i.length,h=rh(a);return He(a,function(d,f){var p=Qze(e,d),g=p?e.node(p).order:u;(p||d===h)&&(He(a.slice(l,f+1),function(m){He(e.predecessors(m),function(y){var x=e.node(y),T=x.order;(T<o||g<T)&&!(x.dummy&&e.node(m).dummy)&&Yse(r,y,m)})}),l=f+1,o=g)}),a}return s(n,"visitLayer"),ml(t,n),r}function Xze(e,t){var r={};function n(a,o,l,u,h){var d;He(Ga(o,l),function(f){d=a[f],e.node(d).dummy&&He(e.predecessors(d),function(p){var g=e.node(p);g.dummy&&(g.order<u||g.order>h)&&Yse(r,p,d)})})}s(n,"scan");function i(a,o){var l=-1,u,h=0;return He(o,function(d,f){if(e.node(d).dummy==="border"){var p=e.predecessors(d);p.length&&(u=e.node(p[0]).order,n(o,h,f,l,u),h=f,l=u)}n(o,h,o.length,u,a.length)}),o}return s(i,"visitLayer"),ml(t,i),r}function Qze(e,t){if(e.node(t).dummy)return Um(e.predecessors(t),function(r){return e.node(r).dummy})}function Yse(e,t,r){if(t>r){var n=t;t=r,r=n}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Zze(e,t,r){if(t>r){var n=t;t=r,r=n}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],r)}function Jze(e,t,r,n){var i={},a={},o={};return He(t,function(l){He(l,function(u,h){i[u]=u,a[u]=u,o[u]=h})}),He(t,function(l){var u=-1;He(l,function(h){var d=n(h);if(d.length){d=gl(d,function(y){return o[y]});for(var f=(d.length-1)/2,p=Math.floor(f),g=Math.ceil(f);p<=g;++p){var m=d[p];a[h]===h&&u<o[m]&&!Zze(r,h,m)&&(a[m]=h,a[h]=i[h]=i[m],u=o[m])}}})}),{root:i,align:a}}function eVe(e,t,r,n,i){var a={},o=tVe(e,t,r,i),l=i?"borderLeft":"borderRight";function u(f,p){for(var g=o.nodes(),m=g.pop(),y={};m;)y[m]?f(m):(y[m]=!0,g.push(m),g=g.concat(p(m))),m=g.pop()}s(u,"iterate");function h(f){a[f]=o.inEdges(f).reduce(function(p,g){return Math.max(p,a[g.v]+o.edge(g))},0)}s(h,"pass1");function d(f){var p=o.outEdges(f).reduce(function(m,y){return Math.min(m,a[y.w]-o.edge(y))},Number.POSITIVE_INFINITY),g=e.node(f);p!==Number.POSITIVE_INFINITY&&g.borderType!==l&&(a[f]=Math.max(a[f],p))}return s(d,"pass2"),u(h,o.predecessors.bind(o)),u(d,o.successors.bind(o)),He(n,function(f){a[f]=a[r[f]]}),a}function tVe(e,t,r,n){var i=new Qr,a=e.graph(),o=sVe(a.nodesep,a.edgesep,n);return He(t,function(l){var u;He(l,function(h){var d=r[h];if(i.setNode(d),u){var f=r[u],p=i.edge(f,d);i.setEdge(f,d,Math.max(o(e,h,u),p||0))}u=h})}),i}function rVe(e,t){return zd(ma(t),function(r){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return $5(r,function(a,o){var l=aVe(e,o)/2;n=Math.max(a+l,n),i=Math.min(a-l,i)}),n-i})}function nVe(e,t){var r=ma(t),n=kc(r),i=Gs(r);He(["u","d"],function(a){He(["l","r"],function(o){var l=a+o,u=e[l],h;if(u!==t){var d=ma(u);h=o==="l"?n-kc(d):i-Gs(d),h&&(e[l]=Gd(u,function(f){return f+h}))}})})}function iVe(e,t){return Gd(e.ul,function(r,n){if(t)return e[t.toLowerCase()][n];var i=gl(an(e,n));return(i[1]+i[2])/2})}function Kse(e){var t=nh(e),r=Km(Kze(e,t),Xze(e,t)),n={},i;He(["u","d"],function(o){i=o==="u"?t:ma(t).reverse(),He(["l","r"],function(l){l==="r"&&(i=an(i,function(f){return ma(f).reverse()}));var u=(o==="u"?e.predecessors:e.successors).bind(e),h=Jze(e,i,r,u),d=eVe(e,i,h.root,h.align,l==="r");l==="r"&&(d=Gd(d,function(f){return-f})),n[o+l]=d})});var a=rVe(e,n);return nVe(n,a),iVe(n,e.graph().align)}function sVe(e,t,r){return function(n,i,a){var o=n.node(i),l=n.node(a),u=0,h;if(u+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":h=-o.width/2;break;case"r":h=o.width/2;break}if(h&&(u+=r?h:-h),h=0,u+=(o.dummy?t:e)/2,u+=(l.dummy?t:e)/2,u+=l.width/2,Object.prototype.hasOwnProperty.call(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":h=l.width/2;break;case"r":h=-l.width/2;break}return h&&(u+=r?h:-h),h=0,u}}function aVe(e,t){return e.node(t).width}var Xse=_(()=>{"use strict";on();ga();xl();s(Kze,"findType1Conflicts");s(Xze,"findType2Conflicts");s(Qze,"findOtherInnerSegmentNode");s(Yse,"addConflict");s(Zze,"hasConflict");s(Jze,"verticalAlignment");s(eVe,"horizontalCompaction");s(tVe,"buildBlockGraph");s(rVe,"findSmallestWidthAlignment");s(nVe,"alignCoordinates");s(iVe,"balance");s(Kse,"positionX");s(sVe,"sep");s(aVe,"width")});function Qse(e){e=fS(e),oVe(e),B5(Kse(e),function(t,r){e.node(r).x=t})}function oVe(e){var t=nh(e),r=e.graph().ranksep,n=0;He(t,function(i){var a=Gs(an(i,function(o){return e.node(o).height}));He(i,function(o){e.node(o).y=n+a/2}),n+=a+r})}var Zse=_(()=>{"use strict";on();xl();Xse();s(Qse,"position");s(oVe,"positionY")});function hx(e,t){var r=t&&t.debugTiming?jie:Hie;r("layout",()=>{var n=r(" buildLayoutGraph",()=>xVe(e));r(" runLayout",()=>lVe(n,r)),r(" updateInputGraph",()=>cVe(e,n))})}function lVe(e,t){t(" makeSpaceForEdgeLabels",()=>bVe(e)),t(" removeSelfEdges",()=>AVe(e)),t(" acyclic",()=>Bie(e)),t(" nestingGraph.run",()=>kse(e)),t(" rank",()=>dN(fS(e))),t(" injectEdgeLabelProxies",()=>TVe(e)),t(" removeEmptyRanks",()=>Wie(e)),t(" nestingGraph.cleanup",()=>vse(e)),t(" normalizeRanks",()=>Vie(e)),t(" assignRankMinMax",()=>CVe(e)),t(" removeEdgeLabelProxies",()=>kVe(e)),t(" normalize.run",()=>tse(e)),t(" parentDummyChains",()=>Hse(e)),t(" addBorderSegments",()=>Yie(e)),t(" order",()=>qse(e)),t(" insertSelfEdges",()=>RVe(e)),t(" adjustCoordinateSystem",()=>Qie(e)),t(" position",()=>Qse(e)),t(" positionSelfEdges",()=>LVe(e)),t(" removeBorderNodes",()=>_Ve(e)),t(" normalize.undo",()=>rse(e)),t(" fixupEdgeLabelCoords",()=>EVe(e)),t(" undoCoordinateSystem",()=>Zie(e)),t(" translateGraph",()=>SVe(e)),t(" assignNodeIntersects",()=>vVe(e)),t(" reversePoints",()=>wVe(e)),t(" acyclic.undo",()=>Fie(e))}function cVe(e,t){He(e.nodes(),function(r){var n=e.node(r),i=t.node(r);n&&(n.x=i.x,n.y=i.y,t.children(r).length&&(n.width=i.width,n.height=i.height))}),He(e.edges(),function(r){var n=e.edge(r),i=t.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}function xVe(e){var t=new Qr({multigraph:!0,compound:!0}),r=gN(e.graph());return t.setGraph(Km({},hVe,mN(r,uVe),Vd(r,dVe))),He(e.nodes(),function(n){var i=gN(e.node(n));t.setNode(n,D5(mN(i,fVe),pVe)),t.setParent(n,e.parent(n))}),He(e.edges(),function(n){var i=gN(e.edge(n));t.setEdge(n,Km({},gVe,mN(i,mVe),Vd(i,yVe)))}),t}function bVe(e){var t=e.graph();t.ranksep/=2,He(e.edges(),function(r){var n=e.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function TVe(e){He(e.edges(),function(t){var r=e.edge(t);if(r.width&&r.height){var n=e.node(t.v),i=e.node(t.w),a={rank:(i.rank-n.rank)/2+n.rank,e:t};yl(e,"edge-proxy",a,"_ep")}})}function CVe(e){var t=0;He(e.nodes(),function(r){var n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=Gs(t,n.maxRank))}),e.graph().maxRank=t}function kVe(e){He(e.nodes(),function(t){var r=e.node(t);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t))})}function SVe(e){var t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=e.graph(),o=a.marginx||0,l=a.marginy||0;function u(h){var d=h.x,f=h.y,p=h.width,g=h.height;t=Math.min(t,d-p/2),r=Math.max(r,d+p/2),n=Math.min(n,f-g/2),i=Math.max(i,f+g/2)}s(u,"getExtremes"),He(e.nodes(),function(h){u(e.node(h))}),He(e.edges(),function(h){var d=e.edge(h);Object.prototype.hasOwnProperty.call(d,"x")&&u(d)}),t-=o,n-=l,He(e.nodes(),function(h){var d=e.node(h);d.x-=t,d.y-=n}),He(e.edges(),function(h){var d=e.edge(h);He(d.points,function(f){f.x-=t,f.y-=n}),Object.prototype.hasOwnProperty.call(d,"x")&&(d.x-=t),Object.prototype.hasOwnProperty.call(d,"y")&&(d.y-=n)}),a.width=r-t+o,a.height=i-n+l}function vVe(e){He(e.edges(),function(t){var r=e.edge(t),n=e.node(t.v),i=e.node(t.w),a,o;r.points?(a=r.points[0],o=r.points[r.points.length-1]):(r.points=[],a=i,o=n),r.points.unshift(K5(n,a)),r.points.push(K5(i,o))})}function EVe(e){He(e.edges(),function(t){var r=e.edge(t);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function wVe(e){He(e.edges(),function(t){var r=e.edge(t);r.reversed&&r.points.reverse()})}function _Ve(e){He(e.nodes(),function(t){if(e.children(t).length){var r=e.node(t),n=e.node(r.borderTop),i=e.node(r.borderBottom),a=e.node(rh(r.borderLeft)),o=e.node(rh(r.borderRight));r.width=Math.abs(o.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),He(e.nodes(),function(t){e.node(t).dummy==="border"&&e.removeNode(t)})}function AVe(e){He(e.edges(),function(t){if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function RVe(e){var t=nh(e);He(t,function(r){var n=0;He(r,function(i,a){var o=e.node(i);o.order=a+n,He(o.selfEdges,function(l){yl(e,"selfedge",{width:l.label.width,height:l.label.height,rank:o.rank,order:a+ ++n,e:l.e,label:l.label},"_se")}),delete o.selfEdges})})}function LVe(e){He(e.nodes(),function(t){var r=e.node(t);if(r.dummy==="selfedge"){var n=e.node(r.e.v),i=n.x+n.width/2,a=n.y,o=r.x-i,l=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*o/3,y:a-l},{x:i+5*o/6,y:a-l},{x:i+o,y:a},{x:i+5*o/6,y:a+l},{x:i+2*o/3,y:a+l}],r.label.x=r.x,r.label.y=r.y}})}function mN(e,t){return Gd(Vd(e,t),Number)}function gN(e){var t={};return He(e,function(r,n){t[n.toLowerCase()]=r}),t}var uVe,hVe,dVe,fVe,pVe,mVe,gVe,yVe,Jse=_(()=>{"use strict";on();ga();Kie();ese();Y5();eN();fN();Ese();jse();Use();Zse();xl();s(hx,"layout");s(lVe,"runLayout");s(cVe,"updateInputGraph");uVe=["nodesep","edgesep","ranksep","marginx","marginy"],hVe={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},dVe=["acyclicer","ranker","rankdir","align"],fVe=["width","height"],pVe={width:0,height:0},mVe=["minlen","weight","width","height","labeloffset"],gVe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},yVe=["labelpos"];s(xVe,"buildLayoutGraph");s(bVe,"makeSpaceForEdgeLabels");s(TVe,"injectEdgeLabelProxies");s(CVe,"assignRankMinMax");s(kVe,"removeEdgeLabelProxies");s(SVe,"translateGraph");s(vVe,"assignNodeIntersects");s(EVe,"fixupEdgeLabelCoords");s(wVe,"reversePointsForReversedEdges");s(_Ve,"removeBorderNodes");s(AVe,"removeSelfEdges");s(RVe,"insertSelfEdges");s(LVe,"positionSelfEdges");s(mN,"selectNumberAttrs");s(gN,"canonicalize")});var yN=_(()=>{"use strict";Y5();Jse();eN();fN()});var eae=_(()=>{"use strict"});var rae={};jt(rae,{captureNodeSizes:()=>MVe,shouldCaptureSizes:()=>IVe});function tae(){if(!(typeof globalThis>"u"))return globalThis}function IVe(){return!!tae()?.mermaidCaptureSizes}function NVe(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}function PVe(e,t){let r=tae();if(!r)return;let n=t.node(),a=((n&&"ownerSVGElement"in n?n.ownerSVGElement:null)??n)?.id??"(unknown)";r.mermaidCapturedSizes??=[];let o={svgId:a,sizes:e};r.mermaidCapturedSizes.push(o),r.mermaidLastCapturedSizes=o}function MVe(e,t){let r=[];for(let n of t.nodes)n.isGroup||r.push({id:n.id,width:n.width??0,height:n.height??0});r.length!==0&&PVe({metadata:{captureVersion:1,capturedAt:new Date().toISOString(),capturedFrom:NVe()},nodes:r},e)}var nae=_(()=>{"use strict";eae();s(tae,"getCaptureGlobal");s(IVe,"shouldCaptureSizes");s(NVe,"capturedFromLocation");s(PVe,"emitCapturedSizes");s(MVe,"captureNodeSizes")});function xN(e,{edgePathsClass:t="edges edgePath"}={}){let r=e.insert("g").attr("class","root"),n=r.insert("g").attr("class","clusters"),i=r.insert("g").attr("class",t),a=r.insert("g").attr("class","edgeLabels"),o=r.insert("g").attr("class","nodes");return{clusters:n,edgePaths:i,edgeLabels:a,nodes:o,rootGroups:r}}async function OVe(e,t){if(t.label){let{shapeSvg:r,bbox:n}=await it(e,t);t.labelBBox={width:n.width,height:n.height},r.remove()}else t.labelBBox={width:0,height:0}}async function bN(e,t,r){let n=await mc(e,t,r),i=n.node()?.getBBox()??{width:0,height:0};return t.width=i.width,t.height=i.height,n}async function iae(e,t){let r=new Qr({multigraph:!0,compound:!0}),n=[...t.edges],i=xe(),a=xN(e),{edgeLabels:o,nodes:l}=a,u=new Map,h=e.node()!=null;await Promise.all(t.nodes.map(async d=>{if(d.isGroup)h&&await OVe(l,d),r.setNode(d.id,{...d});else{if(h){let f=await bN(l,d,{config:i,dir:d.dir});u.set(d.id,f)}r.setNode(d.id,{...d})}}));for(let d of n)h&&ck(d)&&await bo(o,d),r.setEdge(d.start,d.end,{...d},d.id),t.edges.some(p=>p.id===d.id)||t.edges.push(d);if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:d}=await Promise.resolve().then(()=>(nae(),rae));d(e,t)}return{graph:r,groups:a,nodeElements:u}}var TN=_(()=>{"use strict";ga();Nt();km();Nd();Ct();s(xN,"createLayoutElementGroups");s(OVe,"measureGroupLabel");s(bN,"insertMeasuredNode");s(iae,"createGraphWithElements")});var br,Hd,aae,oae,dx,$Ve,lae,cae,BVe,Ud,sae,uae,hae,dae,yS,fae,FVe,CN=_(()=>{"use strict";ft();ga();br=new Map,Hd=new Map,aae=new Map,oae=s(()=>{Hd.clear(),aae.clear(),br.clear()},"clear"),dx=s((e,t)=>{let r=Hd.get(t)||[];return Y.trace("In isDescendant",t," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),$Ve=s((e,t)=>{let r=Hd.get(t)||[];return Y.info("Descendants of ",t," is ",r),Y.info("Edge is ",e),e.v===t||e.w===t?!1:r?r.includes(e.v)||dx(e.v,t)||dx(e.w,t)||r.includes(e.w):(Y.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),lae=s((e,t,r,n)=>{Y.debug("Copying children of ",e,"root",n,"data",t.node(e),n);let i=t.children(e)||[];e!==n&&i.push(e),Y.debug("Copying (nodes) clusterId",e,"nodes",i),i.forEach(a=>{if(t.children(a).length>0)lae(a,t,r,n);else{let o=t.node(a);Y.info("cp ",a," to ",n," with parent ",e),r.setNode(a,o),n!==t.parent(a)&&(Y.debug("Setting parent",a,t.parent(a)),r.setParent(a,t.parent(a))),e!==n&&a!==e?(Y.debug("Setting parent",a,e),r.setParent(a,e)):(Y.info("In copy ",e,"root",n,"data",t.node(e),n),Y.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==n,"node!==clusterId",a!==e));let l=t.edges(a);Y.debug("Copying Edges",l),l.forEach(u=>{Y.info("Edge",u);let h=t.edge(u.v,u.w,u.name);Y.info("Edge data",h,n);try{$Ve(u,n)?(Y.info("Copying as ",u.v,u.w,h,u.name),r.setEdge(u.v,u.w,h,u.name),Y.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):Y.info("Skipping copy of edge ",u.v,"-->",u.w," rootId: ",n," clusterId:",e)}catch(d){Y.error(d)}})}Y.debug("Removing node",a),t.removeNode(a)})},"copy"),cae=s((e,t)=>{let r=t.children(e),n=[...r];for(let i of r)aae.set(i,e),n=[...n,...cae(i,t)];return n},"extractDescendants"),BVe=s((e,t,r)=>{let n=e.edges().filter(u=>u.v===t||u.w===t),i=e.edges().filter(u=>u.v===r||u.w===r),a=n.map(u=>({v:u.v===t?r:u.v,w:u.w===t?t:u.w})),o=i.map(u=>({v:u.v,w:u.w}));return a.filter(u=>o.some(h=>u.v===h.v&&u.w===h.w))},"findCommonEdges"),Ud=s((e,t,r)=>{let n=t.children(e);if(Y.trace("Searching children of id ",e,n),n.length<1)return e;let i;for(let a of n){let o=Ud(a,t,r),l=BVe(t,r,o);if(o)if(l.length>0)i=o;else return o}return i},"findNonClusterChild"),sae=s(e=>!br.has(e)||!br.get(e).externalConnections?e:br.has(e)?br.get(e).id:e,"getAnchorId"),uae=s((e,t)=>{if(!e||t>10){Y.debug("Opting out, no graph ");return}else Y.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(Y.debug("Cluster identified",r," Replacement id in edges: ",Ud(r,e,r)),Hd.set(r,cae(r,e)),br.set(r,{id:Ud(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){let n=e.children(r),i=e.edges();n.length>0?(Y.debug("Cluster identified",r,Hd),i.forEach(a=>{let o=dx(a.v,r),l=dx(a.w,r);o^l&&(Y.debug("Edge: ",a," leaves cluster ",r),Y.debug("Descendants of XXX ",r,": ",Hd.get(r)),br.get(r).externalConnections=!0)})):Y.debug("Not a cluster ",r,Hd)});for(let r of br.keys()){let n=br.get(r).id,i=e.parent(n);i!==r&&br.has(i)&&!br.get(i).externalConnections&&(br.get(r).id=i);let a=e.edges().some(o=>o.v===r);if(n&&br.get(r)?.externalConnections&&a&&fae(e,n,r)){let o=FVe(e,r,e.parent(n));o&&(br.get(r).id=o)}}e.edges().forEach(function(r){let n=e.edge(r);Y.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),Y.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let i=r.v,a=r.w;if(Y.debug("Fix XXX",br,"ids:",r.v,r.w,"Translating: ",br.get(r.v)," --- ",br.get(r.w)),br.get(r.v)||br.get(r.w)){if(Y.debug("Fixing and trying - removing XXX",r.v,r.w,r.name),i=sae(r.v),a=sae(r.w),e.removeEdge(r.v,r.w,r.name),i!==r.v){let o=e.parent(i);br.get(o).externalConnections=!0,n.fromCluster=r.v}if(a!==r.w){let o=e.parent(a);br.get(o).externalConnections=!0,n.toCluster=r.w}Y.debug("Fix Replacing with XXX",i,a,r.name),e.setEdge(i,a,n,r.name)}}),hae(e,0),Y.trace(br)},"adjustClustersAndEdges"),hae=s((e,t)=>{if(t>10){Y.error("Bailing out");return}let r=e.nodes(),n=!1;for(let i of r){let a=e.children(i);n=n||a.length>0}if(!n){Y.debug("Done, no node has children",e.nodes());return}Y.debug("Nodes = ",r,t);for(let i of r)if(Y.debug("Extracting node",i,br,br.has(i)&&!br.get(i).externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!br.has(i))Y.debug("Not a cluster",i,t);else if(!br.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){Y.debug("Cluster without external connections, without a parent and with children",i,t);let o=e.graph().rankdir==="TB"?"LR":"TB";br.get(i)?.clusterData?.dir&&(o=br.get(i).clusterData.dir,Y.debug("Fixing dir",br.get(i).clusterData.dir,o));let l=new Qr({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});lae(i,e,l,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:br.get(i).clusterData,label:br.get(i).label,graph:l})}else Y.debug("Cluster ** ",i," **not meeting the criteria !externalConnections:",!br.get(i).externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),Y.debug(br);r=e.nodes(),Y.debug("New list of nodes",r);for(let i of r){let a=e.node(i);Y.debug(" Now next level",i,a),a?.clusterNode&&hae(a.graph,t+1)}},"extractor"),dae=s((e,t)=>{if(t.length===0)return[];let r=Object.assign([],t);return t.forEach(n=>{let i=e.children(n),a=dae(e,i);r=[...r,...a]}),r},"sorter"),yS=s(e=>dae(e,e.children()),"sortNodesByHierarchy"),fae=s((e,t,r)=>{let n=e.parent(t);for(;n&&n!==r;){let i=br.get(n);if(i&&!i.externalConnections)return!0;n=e.parent(n)}return!1},"isNodeInExtractableCluster"),FVe=s((e,t,r)=>{let n=e.children(t)??[];for(let i of n){if(i===r||dx(i,r))continue;let a=Ud(i,e,t);if(a&&!fae(e,a,t))return a}return null},"findSafeAnchorNode")});function Xm({prepareLayout:e,measureLayout:t,runLayoutCore:r,paintLayout:n,afterPaint:i,paintOptions:a}){let o=t??SN;return s(async function(u,h,d,f){let p=h.select("g");(d?.insertMarkers??Sm)(p,u.markers,u.type,u.diagramId),kN();let g={element:p,helpers:d,options:f};g.preparedLayout=await e?.(u,g);let m=await o(u,g),y=await r(u,g),x={...g,measure:m};n?await n(u,x,y):await vN(u,x,a),await i?.(u,x,y)},"render")}function kN(){zZ(),FZ(),LZ(),oae()}async function SN(e,{element:t}){return await iae(t,e)}async function vN(e,t,r={}){let{measure:n}=t,{groups:i}=n;for(let o of r.getNodes?.(e,t)??e.nodes)r.skipNode?.(o,t)||await GVe(i,o,t,r);let a=VVe(e.nodes);for(let o of e.edges)WVe(o,r)||await qVe(i,o,a,e,r,t)}async function GVe(e,t,r,n){t.clusterNode?ll(t):zVe(t,r,n)?await Mu(e.clusters,t):ll(t)}function zVe(e,t,r){return e.isGroup===!0&&(r.isCluster?.(e,t)??!0)}function VVe(e){let t=new Map;for(let r of e)r?.id&&t.set(r.id,r);return t}function WVe(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}async function qVe(e,t,r,n,i,a){let o=Ou(e.edgePaths,{...t},i.clusterDb??new Map,n.type,pae(t.start,t,r,a,i),pae(t.end,t,r,a,i),n.diagramId,jVe(t,i));ck(t)&&(Id.has(t.id)||await bo(e.edgeLabels,t),HVe(t,o))}function pae(e,t,r,n,i){return i.getEdgeNode?.(e,t,n)??(e?r.get(e)??{}:{})}function jVe(e,t){return typeof t.skipIntersect=="function"?t.skipIntersect(e):t.skipIntersect??!1}function HVe(e,t){let r=t?.updatedPath??t?.originalPath,n=mt(),{subGraphTitleTotalMargin:i}=pc({flowchart:n.flowchart??{}});if(e.label){let a=Id.get(e.id),o=e.x,l=e.y;if(r){let u=Bt.calcLabelPosition(r);Y.debug("Moving label "+e.label+" from (",o,",",l,") to (",u.x,",",u.y,") abc88"),t?.updatedPath&&(o=u.x,l=u.y)}a.attr("transform",`translate(${o}, ${l+i/2})`)}if(e?.startLabelLeft){let a=Vn.get(e.id).startLeft,o=e?.x,l=e?.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.startLabelRight){let a=Vn.get(e.id).startRight,o=e.x,l=e.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.endLabelLeft){let a=Vn.get(e.id).endLeft,o=e.x,l=e.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}if(e.endLabelRight){let a=Vn.get(e.id).endRight,o=e.x,l=e.y;if(r){let u=Bt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);o=u.x,l=u.y}a.attr("transform",`translate(${o}, ${l})`)}}var xS=_(()=>{"use strict";ft();mm();ir();Pt();P1();TN();M1();km();uk();Nd();CN();s(Xm,"createCommonLayoutRenderer");s(kN,"clearLayoutRenderState");s(SN,"defaultMeasureLayout");s(vN,"paintLayoutData");s(GVe,"paintLayoutNode");s(zVe,"shouldPaintAsCluster");s(VVe,"buildNodeLookup");s(WVe,"shouldSkipPaintEdge");s(qVe,"paintLayoutEdge");s(pae,"getRenderedNode");s(jVe,"shouldSkipIntersect");s(HVe,"positionRenderedEdgeLabel")});var Sae={};jt(Sae,{applyDagreLayoutResult:()=>Tae,getEdgesToRender:()=>EN,measureDagreLayout:()=>Cae,prepareLayoutForDagre:()=>wN,render:()=>iWe,runDagreLayoutCore:()=>kae});var mae,gae,UVe,YVe,KVe,XVe,QVe,EN,xae,bae,ZVe,yae,JVe,Tae,eWe,tWe,wN,Cae,kae,rWe,nWe,iWe,vae=_(()=>{"use strict";yN();ga();TN();xS();mm();Ct();CN();Nd();M1();km();ft();P1();Nt();mae=s((e,t,r)=>Math.max(t,Math.min(r,e)),"clamp"),gae=s((e="TB")=>{switch(e){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),UVe=s(e=>e==="flowchart"||e==="flowchart-v2"||e==="stateDiagram"||e==="er"||e==="classDiagram","shouldMergeSelfLoopSegments"),YVe=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],KVe=s((e,t,r,n,i)=>{let a=[],o=new Set;if(r.forEach(({start:d,end:f})=>{d!==n&&o.add(d),f!==n&&o.add(f)}),o.forEach(d=>{let f=e.node(d);typeof f?.x=="number"&&typeof f?.y=="number"&&a.push(f)}),a.length===0&&r.forEach(({edge:d})=>{(d.points??[]).forEach(f=>{typeof f?.x=="number"&&typeof f?.y=="number"&&a.push(f)})}),a.length===0)return gae(i);let l=a.reduce((d,f)=>({x:d.x+f.x/a.length,y:d.y+f.y/a.length}),{x:0,y:0}),u=l.x-t.x,h=l.y-t.y;return Math.abs(u)>Math.abs(h)?u>0?"right":"left":Math.abs(h)>0?h>0?"bottom":"top":gae(i)},"getSelfLoopSide"),XVe=s((e,t="top",r=0,n=0)=>{let i=e.x,a=e.y-r,o=e.width/2,l=e.height/2,u=Math.max(36,Math.min(100,e.width*.8)),h=mae(Math.max(n,e.width*.35),36,u),d=mae(Math.min(e.width,e.height)*.45,24,48);switch(t){case"bottom":{let f=a+l;return[{x:i-h/2,y:f},{x:i-h/2,y:f+d},{x:i+h/2,y:f+d},{x:i+h/2,y:f}]}case"right":{let f=i+o;return[{x:f,y:a-h/2},{x:f+d,y:a-h/2},{x:f+d,y:a+h/2},{x:f,y:a+h/2}]}case"left":{let f=i-o;return[{x:f,y:a-h/2},{x:f-d,y:a-h/2},{x:f-d,y:a+h/2},{x:f,y:a+h/2}]}case"top":default:{let f=a-l;return[{x:i-h/2,y:f},{x:i-h/2,y:f-d},{x:i+h/2,y:f-d},{x:i+h/2,y:f}]}}},"getSelfLoopPoints"),QVe=s((e,t,r="top",n=0,i={})=>{let o=e.x,l=e.y-n,u=i.width??0,h=i.height??0;switch(r){case"bottom":return{x:o,y:Math.max(...t.map(d=>d.y))+h/2+4};case"right":return{x:Math.max(...t.map(d=>d.x))+u/2+4,y:l};case"left":return{x:Math.min(...t.map(d=>d.x))-u/2-4,y:l};case"top":default:return{x:o,y:Math.min(...t.map(d=>d.y))-h/2-4}}},"getSelfLoopLabelPosition"),EN=s((e,t=0,{mergeSelfLoops:r=!0}={})=>{let n=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(o=>{let l=e.edge(o);if(r&&l.selfLoop){let u=l.selfLoop.id;n.has(u)||n.set(u,[]),n.get(u).push({edge:l,start:o.v,end:o.w})}else i.push({edge:l,start:o.v,end:o.w})}),n.forEach(o=>{if(o.length!==3){o.forEach(T=>i.push(T));return}o.sort((T,C)=>T.edge.selfLoop.order-C.edge.selfLoop.order);let[l,u,h]=o,d=l.edge.originalEdge??u.edge.originalEdge??h.edge.originalEdge??u.edge,f=e.node(d.start);if(!f){o.forEach(T=>i.push(T));return}let p={width:u.edge.width,height:u.edge.height},g=KVe(e,f,o,d.start,a),m=XVe(f,g,t,p.width??0),y=QVe(f,m,g,t,p),x={...u.edge,...d,id:d.id,points:m,start:d.start,end:d.end,x:y.x,y:y.y,width:p.width,height:p.height,labelStyle:u.edge.labelStyle,fromCluster:l.edge.fromCluster??u.edge.fromCluster??h.edge.fromCluster,toCluster:l.edge.toCluster??u.edge.toCluster??h.edge.toCluster};delete x.selfLoop,delete x.originalEdge,i.push({edge:x,start:x.start,end:x.end})}),i},"getEdgesToRender"),xae=s(async({element:e,graph:t,diagramType:r,id:n,parentCluster:i,siteConfig:a})=>{let o=t.graph().rankdir;Y.trace("Dir in recursive render - dir:",o);let{clusters:l,edgePaths:u,edgeLabels:h,nodes:d,rootGroups:f}=xN(e,{edgePathsClass:"edgePaths"});t.nodes()?Y.info("Recursive render XXX",t.nodes()):Y.info("No nodes found for",t),t.edges().length>0&&Y.info("Recursive edges",t.edge(t.edges()[0]));let p=UVe(r);await Promise.all(t.nodes().map(async function(y){let x=t.node(y);if(i!==void 0){let T=JSON.parse(JSON.stringify(i.clusterData));Y.trace(`Setting data for parent cluster XXX
344
344
  Node.id = `,y,`
345
345
  data=`,T.height,`
346
346
  Parent cluster`,i.height),t.setNode(i.id,T),t.parent(y)||(Y.trace("Setting parent",y,i.id),t.setParent(y,i.id,T))}if(Y.info("(Insert) Node XXX"+y+": "+JSON.stringify(t.node(y))),x?.clusterNode){Y.info("Cluster identified XBX",y,x.width,t.node(y));let{ranksep:T,nodesep:C}=t.graph();x.graph.setGraph({...x.graph.graph(),ranksep:T+25,nodesep:C});let k=await tWe({element:d,graph:x.graph,diagramType:r,id:n,parentCluster:t.node(y),siteConfig:a}),E=k.elem;Ze(x,E),x.diff=k.diff||0,Y.info("New compound node after recursive render XAX",y,"width",x.width,"height",x.height),GZ(E,x)}else t.children(y).length>0?(Y.trace("Cluster - the non recursive path XBX",y,x.id,x,x.width,"Graph:",t),Y.trace(Ud(x.id,t)),br.set(x.id,{id:Ud(x.id,t),node:x})):(Y.trace("Node - the non recursive path XAX",y,d,t.node(y),o),await bN(d,t.node(y),{config:a,dir:o}))})),await s(async()=>{let y=t.edges().map(async function(x){let T=t.edge(x.v,x.w,x.name);if(Y.info("Edge "+x.v+" -> "+x.w+": "+JSON.stringify(x)),Y.info("Edge "+x.v+" -> "+x.w+": ",x," ",JSON.stringify(t.edge(x))),Y.info("Fix",br,"ids:",x.v,x.w,"Translating: ",br.get(x.v),br.get(x.w)),p&&T.selfLoop){if(T.selfLoop.order!==1)return;let C={...T.originalEdge,...T,id:T.selfLoop.id,startLabelLeft:T.originalEdge?.startLabelLeft??T.startLabelLeft,startLabelRight:T.originalEdge?.startLabelRight??T.startLabelRight,endLabelLeft:T.originalEdge?.endLabelLeft??T.endLabelLeft,endLabelRight:T.originalEdge?.endLabelRight??T.endLabelRight};await bo(h,C),T.width=C.width,T.height=C.height,T.labelStyle=C.labelStyle;return}await bo(h,T)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:m}=pc(a);return{elem:f,graph:t,groups:{clusters:l,edgePaths:u,edgeLabels:h,nodes:d,rootGroups:f},diagramType:r,id:n,mergeSelfLoops:p,subGraphTitleTotalMargin:m}},"measureDagreGraph"),bae=s(e=>{Y.info("############################################# XXX"),Y.info("### Layout ### XXX"),Y.info("############################################# XXX"),hx(e)},"runDagreGraphLayout"),ZVe=s((e,t,r)=>{let n=e.node(t);if(!n)return;let i={...n};return n?.clusterNode?i.y=(n.y??0)+r:e.children(t).length>0?i.height=(n.height??0)+r:i.y=(n.y??0)+r/2,i},"normalizeDagreNode"),yae=s((e,t)=>{YVe.forEach(r=>{t[r]!==void 0&&(e[r]=t[r])})},"applyDagreNodeLayout"),JVe=s((e,t,r,n)=>({...e,start:e.start??t,end:e.end??r,points:(e.points??[]).map(i=>({...i,y:typeof i.y=="number"?i.y+n:i.y}))}),"normalizeDagreEdge"),Tae=s((e,t)=>{let{graph:r,mergeSelfLoops:n,subGraphTitleTotalMargin:i=0}=t,a=new Map(e.nodes.map(l=>[l.id,l]));yS(r).forEach(l=>{let u=ZVe(r,l,i);if(!u)return;yae(r.node(l),u);let h=a.get(l);h&&yae(h,u)});let o=i/2;return e.edges=EN(r,o,{mergeSelfLoops:n}).map(({edge:l,start:u,end:h})=>JVe(l,u,h,o)),e},"applyDagreLayoutResult"),eWe=s(async({elem:e,graph:t,groups:{clusters:r,edgePaths:n},diagramType:i,id:a,mergeSelfLoops:o,subGraphTitleTotalMargin:l})=>{let u=0;await Promise.all(yS(t).map(async function(f){let p=t.node(f);if(Y.info("Position XBX => "+f+": ("+p.x,","+p.y,") width: ",p.width," height: ",p.height),p?.clusterNode)p.y+=l,Y.info("A tainted cluster node XBX1",f,p.id,p.width,p.height,p.x,p.y,t.parent(f)),br.get(p.id).node=p,ll(p);else if(t.children(f).length>0){Y.info("A pure cluster node XBX1",f,p.id,p.x,p.y,p.width,p.height,t.parent(f)),p.height+=l,t.node(p.parentId);let g=p?.padding/2||0,m=p?.labelBBox?.height||0,y=m-g||0;Y.debug("OffsetY",y,"labelHeight",m,"halfPadding",g),await Mu(r,p),br.get(p.id).node=p}else{let g=t.node(p.parentId);p.y+=l/2,Y.info("A regular node XBX1 - using the padding",p.id,"parent",p.parentId,p.width,p.height,p.x,p.y,"offsetY",p.offsetY,"parent",g,g?.offsetY,p),ll(p)}}));let h=l/2;return EN(t,h,{mergeSelfLoops:o}).forEach(function({edge:f,start:p,end:g}){Y.info("Edge "+p+" -> "+g+": "+JSON.stringify(f),f),f.points.forEach(T=>T.y+=h);let m=t.node(p),y=t.node(g),x=Ou(n,f,br,i,m,y,a);Cm(f,x)}),t.nodes().forEach(function(f){let p=t.node(f);Y.info(f,p.type,p.diff),p.isGroup&&(u=p.diff)}),Y.warn("Returning from recursive render XAX",e,u),{elem:e,diff:u}},"paintDagreLayoutCore"),tWe=s(async e=>{let t=await xae(e);return bae(t.graph),await eWe(t)},"renderDagreSubgraph"),wN=s(e=>{let t=new Qr({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(r=>{t.setNode(r.id,{...r}),r.parentId&&t.setParent(r.id,r.parentId)}),Y.debug("Edges:",e.edges),e.edges.forEach(r=>{if(r.start===r.end){let n=r.start,i=n+"---"+n+"---1",a=n+"---"+n+"---2",o=t.node(n);t.setNode(i,{domId:i,id:i,parentId:o.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),t.setParent(i,o.parentId),t.setNode(a,{domId:a,id:a,parentId:o.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),t.setParent(a,o.parentId);let l=structuredClone(r),u=structuredClone(r),h=structuredClone(r),d=structuredClone(r);u.originalEdge=l,u.selfLoop={id:l.id,order:0},h.originalEdge=l,h.selfLoop={id:l.id,order:1},d.originalEdge=l,d.selfLoop={id:l.id,order:2},u.label="",u.arrowTypeEnd="none",u.endLabelLeft="",u.endLabelRight="",u.startLabelLeft="",u.id=n+"-cyclic-special-1",h.startLabelRight="",h.startLabelLeft="",h.endLabelLeft="",h.endLabelRight="",h.arrowTypeStart="none",h.arrowTypeEnd="none",h.id=n+"-cyclic-special-mid",d.label="",d.startLabelRight="",d.startLabelLeft="",d.arrowTypeStart="none",o.isGroup&&(u.fromCluster=n,d.toCluster=n),d.id=n+"-cyclic-special-2",d.arrowTypeStart="none",t.setEdge(n,i,u,n+"-cyclic-special-0"),t.setEdge(i,a,h,n+"-cyclic-special-1"),t.setEdge(a,n,d,n+"-cyclic-special-2")}else t.setEdge(r.start,r.end,{...r},r.id)}),uae(t),{graph:t}},"prepareLayoutForDagre"),Cae=s(async(e,{element:t,preparedLayout:r})=>{let n=r??wN(e),i=xe(),a=await xae({element:t,graph:n.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:i});return n.measuredLayout=a,a},"measureDagreLayout"),kae=s((e,t)=>{let r=t.preparedLayout?.measuredLayout;if(!r)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return bae(r.graph),Tae(e,r),r},"runDagreLayoutCore"),rWe=s((e,{measure:t})=>yS(t.graph).map(r=>t.graph.node(r)).filter(Boolean),"getDagrePaintNodes"),nWe=s((e,t,{measure:r})=>e?r.graph.node(e):void 0,"getDagreEdgeNode"),iWe=Xm({prepareLayout:wN,measureLayout:Cae,runLayoutCore:kae,paintOptions:{clusterDb:br,getNodes:rWe,getEdgeNode:nWe,skipNode:s((e,{measure:t})=>!t.graph.hasNode(e.id),"skipNode"),isCluster:s((e,{measure:t})=>t.graph.hasNode(e.id)&&(t.graph.children(e.id)??[]).length>0,"isCluster")}})});function _N(e){let t=[];for(let r=0;r<e.length-1;r++)t.push({a:e[r],b:e[r+1]});return t}function sWe(e,t,r,n){let i=t.x-e.x,a=t.y-e.y,o=n.x-r.x,l=n.y-r.y,u=i*l-a*o;if(u===0)return null;let h=r.x-e.x,d=r.y-e.y,f=(h*l-d*o)/u,p=(h*a-d*i)/u;return f<=TS||f>=1-TS||p<=TS||p>=1-TS?null:{point:{x:e.x+f*i,y:e.y+f*a},tA:f,tB:p}}function wae(e){return Math.abs(e.b.x-e.a.x)>=Math.abs(e.b.y-e.a.y)}function aWe(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],i=_N(n.points);for(let a=r+1;a<e.length;a++){let o=e[a],l=_N(o.points);for(let[u,h]of i.entries())for(let[d,f]of l.entries()){let p=sWe(h.a,h.b,f.a,f.b);if(!p)continue;let g=wae(h),m=wae(f);(g!==m?g:!1)?t.push({jumpEdgeId:n.id,otherEdgeId:o.id,segIndex:u,t:p.tA,point:p.point}):t.push({jumpEdgeId:o.id,otherEdgeId:n.id,segIndex:d,t:p.tB,point:p.point})}}}return t}function bl(e){let t=Math.round(e*1e3)/1e3;return Number.isInteger(t)?`${t}`:`${t}`}function fx(e){return`${bl(e.x)},${bl(e.y)}`}function oWe(e){let t=e.b.x-e.a.x,r=e.b.y-e.a.y;return Math.abs(t)>=Math.abs(r)?t>=0?1:0:r>=0?1:0}function cWe(e,t){if(e.length<2)return e.map(a=>({...a}));let r=e.map(a=>({...a})),n=t.arrowTypeStart&&ai[t.arrowTypeStart];if(n){let a=e[0],o=e[1],l=Math.atan2(o.y-a.y,o.x-a.x);r[0].x=a.x+n*Math.cos(l),r[0].y=a.y+n*Math.sin(l)}let i=t.arrowTypeEnd&&ai[t.arrowTypeEnd];if(i){let a=e.length,o=e[a-2],l=e[a-1],u=Math.atan2(l.y-o.y,l.x-o.x);r[a-1].x=l.x-i*Math.cos(u),r[a-1].y=l.y-i*Math.sin(u)}return r}function uWe(e,t,r,n,i){let a=e.point.x,o=e.point.y,l={x:a-t*e.r,y:o-r*e.r},u={x:a+t*e.r,y:o+r*e.r},h=[`L${fx(l)}`];return i==="arc"?h.push(`A${bl(e.r)},${bl(e.r)} 0 0 ${n} ${fx(u)}`):h.push(`M${fx(u)}`),h}function _ae(e,t,r,n){let i=t.x-e.x,a=t.y-e.y,o=r.x-t.x,l=r.y-t.y,u=Math.hypot(i,a),h=Math.hypot(o,l);if(u<bS||h<bS)return null;let d=i/u,f=a/u,p=o/h,g=l/h,m=d*p+f*g,y=Math.max(-1,Math.min(1,m)),x=Math.acos(y);if(x<bS||Math.abs(Math.PI-x)<bS)return null;let T=Math.min(n/Math.sin(x/2),u/2,h/2);return{startX:t.x-d*T,startY:t.y-f*T,endX:t.x+p*T,endY:t.y+g*T,ctrlX:t.x,ctrlY:t.y,cutLen:T}}function hWe(e,t,r){let n=e.points;if(n.length<2)return"";let i=cWe(n,e),a=e.curve==="rounded",o=_N(i),l=new Map;for(let h of t){let d=o[h.segIndex];if(!d)continue;let f=Math.hypot(d.b.x-d.a.x,d.b.y-d.a.y),p=l.get(h.segIndex)??[];p.push({t:h.t,point:h.point,d:h.t*f,r:r.jumpRadius}),l.set(h.segIndex,p)}let u=[`M${fx(i[0])}`];for(let h=0;h<o.length;h++){let d=o[h],f=Math.hypot(d.b.x-d.a.x,d.b.y-d.a.y),p=f===0?0:(d.b.x-d.a.x)/f,g=f===0?0:(d.b.y-d.a.y)/f,m=oWe(d),y=0;if(a&&h>0){let k=_ae(i[h-1],i[h],i[h+1]??i[h],Eae);k&&(y=k.cutLen)}let x=f,T=null;a&&h<o.length-1&&(T=_ae(i[h],i[h+1],i[h+2]??i[h+1],Eae),T&&(x=f-T.cutLen));let C=[...l.get(h)??[]].sort((k,E)=>k.t-E.t);for(let k of C)k.r=Math.min(k.r,k.d-y,x-k.d);for(let k=0;k<C.length-1;k++){let E=C[k+1].d-C[k].d;if(C[k].r+C[k+1].r>E){let v=E/2;C[k].r=Math.min(C[k].r,v),C[k+1].r=Math.min(C[k+1].r,v)}}for(let k of C)k.r<lWe||u.push(...uWe(k,p,g,m,r.jumpStyle));a&&T?(u.push(`L${bl(T.startX)},${bl(T.startY)}`),u.push(`Q${bl(T.ctrlX)},${bl(T.ctrlY)} ${bl(T.endX)},${bl(T.endY)}`)):u.push(`L${fx(d.b)}`)}return u.join(" ")}function dWe(e){return/^[\d\s+,.LMelm-]*$/.test(e)}function fWe(e){return e?e==="linear"||e==="rounded"||e==="step"||e==="stepBefore"||e==="stepAfter":!0}function pWe(e){if(!e)return null;try{let t=typeof atob=="function"?atob(e):Buffer.from(e,"base64").toString(),r=JSON.parse(t);if(!Array.isArray(r))return null;let n=[];for(let i of r)i&&typeof i.x=="number"&&typeof i.y=="number"&&n.push({x:i.x,y:i.y});return n.length>=2?n:null}catch{return null}}function Aae(e,t,r){if(!r.enabled)return;let n=e.node();if(!n)return;let i=new Map;for(let h of t)i.set(h.id,h);let a=[],o=new Map;for(let h of t){let d=typeof CSS<"u"&&CSS.escape?CSS.escape(h.id):h.id,f=n.querySelector(`path[data-id="${d}"]`);if(!f)continue;o.set(h.id,f);let g=pWe(f.getAttribute("data-points"))??h.points;a.push({...h,points:g})}let l=aWe(a);if(l.length===0)return;let u=new Map;for(let h of l){let d=u.get(h.jumpEdgeId)??[];d.push(h),u.set(h.jumpEdgeId,d)}for(let h of a){let d=u.get(h.id);if(!d||d.length===0)continue;let p=i.get(h.id)?.curve;if(p!==void 0&&!fWe(p))continue;let g=o.get(h.id);if(!g)continue;if(p===void 0){let k=g.getAttribute("d")??"";if(!dWe(k))continue}let m=g.getAttribute("style")??"",y=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(m),x=y?Number.parseFloat(y[1]):null,T=y?Number.parseFloat(y[2]):null,C=hWe(h,d,r);if(g.setAttribute("d",C),x!==null&&T!==null&&typeof g.getTotalLength=="function"){let k=g.getTotalLength(),E=Math.max(0,k-x-T),v=`0 ${x} ${E} ${T}`,S=m.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${v};`).replace(/;\s*;+/g,";");g.setAttribute("style",S)}}}var Eae,bS,TS,lWe,Rae=_(()=>{"use strict";jI();Eae=5,bS=1e-5,TS=1e-6;s(_N,"buildSegmentList");s(sWe,"segmentIntersection");s(wae,"isHorizontalSeg");s(aWe,"findEdgeIntersections");s(bl,"fmt");s(fx,"pointToString");s(oWe,"getArcSweepFlag");lWe=.001;s(cWe,"applyMarkerOffsets");s(uWe,"emitJump");s(_ae,"computeRoundedCorner");s(hWe,"rewriteEdgePath");s(dWe,"isStraightPath");s(fWe,"curveSupportsLineHops");s(pWe,"decodeDataPoints");s(Aae,"applyLineJumpsToSvg")});function Lae(e,{measure:t}){let r=e.config?.swimlane?.lineHops;if(r===!1)return;let n=r==="gap"?"gap":"arc",i=e.edges.filter(a=>Array.isArray(a.points)&&a.points.length>=2).map(a=>({id:a.id,points:a.points,curve:a.curve,arrowTypeStart:a.arrowTypeStart,arrowTypeEnd:a.arrowTypeEnd}));Aae(t.groups.edgePaths,i,{enabled:!0,jumpRadius:6,jumpStyle:n})}var Dae=_(()=>{"use strict";Rae();s(Lae,"applySwimlaneLineJumps")});function Iae(e){return Math.max(e.padding??20,20)}function mWe(e){let{x:t,y:r,width:n,height:i}=e,a=e.swimlaneContentTop;if(typeof t!="number"||typeof r!="number"||typeof n!="number"||typeof i!="number"||typeof a!="number"||!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(n)||!Number.isFinite(i)||!Number.isFinite(a)||n<=0||i<=0){delete e.groupTitleRect;return}let o=r-i/2,l=Math.min(a,r+i/2),u=Math.min(21,Math.max(0,l-o)),h=o+u;if(h<=o){delete e.groupTitleRect;return}e.groupTitleRect={left:t-n/2,right:t+n/2,top:o,bottom:h}}function Nae(e){let t=e.direction,r=e.nodes??=[];for(let a of e.nodes??[])a.isGroup&&!a.parentId&&(a.shape="swimlane",t&&(a.direction=t));let n=r.filter(a=>!a.isGroup&&!a.parentId);if(n.length===0)return;let i=r.find(a=>a.id===AN);i?i.isGroup&&(i.shape="swimlane",t&&(i.direction=t)):(i={id:AN,label:"",isGroup:!0,shape:"swimlane",padding:20,...t?{direction:t}:{}},r.push(i));for(let a of n)a.parentId=AN}function Pae(e){let t=new Map;for(let u of e.nodes??[])t.set(u.id,u);let r=[];for(let u of e.edges??[]){let h=typeof u.start=="string"?u.start:void 0,d=typeof u.end=="string"?u.end:void 0;!h||!d||u.labelNodeId||r.push({id:u.id,src:h,dst:d,ref:u})}let n=e.nodes??[],i=n.filter(u=>u.isGroup),a=n.filter(u=>!u.isGroup);return{nodes:[...[...i].reverse(),...a].map(u=>u.id),edges:r,layout:e,nodeById:t}}function Mae(e,t,r,n){let{layout:i}=e,a=e.nodeById,o=n?.layerGap??100,l=n?.nodeGap??40,u=0;for(let p of t.layers){let g=0;for(let m of p){let y=a.get(m);if(!y){g++;continue}y.layer=u,y.order=g;let x=r.x[m]??g*l,T=r.y[m]??u*o;y.x=x,y.y=T,g++}u++}let h=i.nodes??[],d=new Map,f=[];for(let p of h){if(!p?.isGroup)continue;p.parentId||f.push(p);let g=h.filter(C=>C.parentId===p.id),m=1/0,y=-1/0,x=1/0,T=-1/0;for(let C of g){let k=C.x??r.x[C.id],E=C.y??r.y[C.id],v=C.width??0,S=C.height??0;k!=null&&E!=null&&(m=Math.min(m,k-v/2),y=Math.max(y,k+v/2),x=Math.min(x,E-S/2),T=Math.max(T,E+S/2))}if(m===1/0||x===1/0)p.x=p.x??0,p.y=p.y??0,p.width=p.width??0,p.height=p.height??0;else{let C=p.padding??20,k=p.parentId?C:2*Iae(p),E=C,v=Math.max(0,y-m)+k,S=Math.max(0,T-x)+E,w=(m+y)/2,L=(x+T)/2;p.x=w,p.y=L,p.width=v,p.height=S,d.set(p.id,{minX:m,maxX:y,minY:x,maxY:T})}}if(f.length>0&&d.size>0){let p=1/0,g=-1/0,m=0;for(let y of f){let x=y.padding??20;x>m&&(m=x);let T=d.get(y.id);T&&(p=Math.min(p,T.minY),g=Math.max(g,T.maxY))}if(p!==1/0&&g!==-1/0){let y=Math.max(0,g-p),T=Math.max(m,36),C=y+2*T,k=(p+g)/2;for(let O of f)O.y=k,O.height=C,O.swimlaneContentTop=p;let E=[...f].sort((O,F)=>{let N=O.x??0,G=F.x??0;return N-G}),v=[],S=[],w=[];for(let O of E){let F=d.get(O.id);if(!F)continue;let N=Math.max(0,F.maxX-F.minX)+2*Iae(O),G=(F.minX+F.maxX)/2;v.push(O.id),S.push(G),w.push(N)}let L=v.length;if(L>0){let O=new Map;if(L===1)O.set(v[0],w[0]);else{let F=[];for(let I=0;I<L-1;I++)F.push(S[I+1]-S[I]);let N=new Array(L);N[0]=0;for(let I=0;I<L-1;I++)N[I+1]=2*F[I]-N[I];let G=0,A=Number.POSITIVE_INFINITY;for(let I=0;I<L;I++){let P=w[I];I%2===0?G=Math.max(G,P-N[I]):A=Math.min(A,N[I]-P)}let M=G;G<=A?M=(G+A)/2:M=G;for(let I=0;I<L;I++){let P=N[I]+(I%2===0?M:-M),B=Math.max(w[I],P);O.set(v[I],B)}}for(let F of f){let N=O.get(F.id);N!=null&&(F.width=N),mWe(F)}}}}}var AN,RN=_(()=>{"use strict";AN="__swimlane_default__";s(Iae,"topLaneHorizontalPadding");s(mWe,"assignTopLaneTitleRect");s(Nae,"prepareLayoutForSwimlanes");s(Pae,"toGraphView");s(Mae,"writeBackToLayoutData")});function Oae(e){let t=[],r=[],n=new Map;for(let o of e.nodes)n.set(o.id,o);for(let o of e.edges){if(!o.label||o.label.length===0||o.isLayoutOnly||o.labelNodeId)continue;let l=o.start?n.get(o.start):void 0,u=o.end?n.get(o.end):void 0;if(!l||!u){Y.warn(gWe,`Edge ${o.id} has missing source or target node`);continue}let h=`edge-label-${o.start}-${o.end}-${o.id}`,f=l.parentId!==u.parentId?u.parentId:l.parentId,p={id:h,label:o.label,edgeStart:o.start??"",edgeEnd:o.end??"",shape:"labelRect",width:0,height:0,isEdgeLabel:!0,isDummy:!0,parentId:f,isGroup:!1,labelStyle:Array.isArray(o.labelStyle)?o.labelStyle[0]:o.labelStyle??"",...l.dir?{dir:l.dir}:{}};t.push(p),o.labelNodeId=h,o.label=void 0,o.text=void 0;let g={id:`${o.id}-to-label`,start:o.start,end:h,type:"normal",isLayoutOnly:!0},m={id:`${o.id}-from-label`,start:h,end:o.end,type:"normal",isLayoutOnly:!0};r.push(g,m)}let i=[...e.nodes,...t],a=[...e.edges,...r];return{...e,nodes:i,edges:a}}var gWe,$ae=_(()=>{"use strict";ft();gWe="[EdgeLabelNodes]";s(Oae,"createEdgeLabelNodes")});function Fae(e){let t=e.x??0,r=e.y??0,n=e.width??0,i=e.height??0;return n>0&&i>0?{cx:t,cy:r,rect:Qm(t,r,n,i)}:void 0}function Gae(e){if(e.isGroup)return;let t=Fae(e);return t?{id:String(e.id??""),cx:t.cx,cy:t.cy,rect:t.rect}:void 0}function zs(e,t,r=.001){return Math.abs(e.x-t.x)<r&&Math.abs(e.y-t.y)<r}function Lr(e,t,r=.001){return Math.abs(e.x-t.x)<r}function Nr(e,t,r=.001){return Math.abs(e.y-t.y)<r}function Mn(e,t,r=.001){return Nr(e,t,r)&&Math.abs(e.x-t.x)>r}function On(e,t,r=.001){return Lr(e,t,r)&&Math.abs(e.y-t.y)>r}function ss(e,t,r,n){return Math.max(0,Math.min(Math.max(e,t),Math.max(r,n))-Math.max(Math.min(e,t),Math.min(r,n)))}function So(e,t,r=.001){return e.horizontal&&t.horizontal&&Nr(e.a,t.a,r)?ss(e.a.x,e.b.x,t.a.x,t.b.x):e.vertical&&t.vertical&&Lr(e.a,t.a,r)?ss(e.a.y,e.b.y,t.a.y,t.b.y):0}function ah(e,t=.001){let r=[];for(let n=0;n<e.length-1;n++){let i=e[n],a=e[n+1],o=Mn(i,a,t),l=On(i,a,t);(o||l)&&r.push({index:n,a:i,b:a,horizontal:o,vertical:l})}return r}function Vs(e,t=.001){let r=ah(e,t),n=0;for(let i=1;i<r.length;i++)r[i-1].horizontal!==r[i].horizontal&&n++;return n}function Dr(e,t=.001){let r=[];for(let n of e){let i=r.length>0?r[r.length-1]:void 0;(!i||!zs(i,n,t))&&r.push({x:n.x,y:n.y})}return r}function CS(e,t=.001){if(!e||e.length!==4)return;let[r,n,i,a]=e;return Mn(r,n,t)&&On(n,i,t)&&Mn(i,a,t)?{kind:"HVH",p0:r,p1:n,p2:i,p3:a}:On(r,n,t)&&Mn(n,i,t)&&On(i,a,t)?{kind:"VHV",p0:r,p1:n,p2:i,p3:a}:void 0}function px(e,t,r,n=0){let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),l=Math.max(e.y,t.y);return a>r.left-n&&i<r.right+n&&l>r.top-n&&o<r.bottom+n}function kS(e,t,r=0){return e.x>t.left+r&&e.x<t.right-r&&e.y>t.top+r&&e.y<t.bottom-r}function zae(e,t){return e.left<=t.left&&e.right>=t.right&&e.top<=t.top&&e.bottom>=t.bottom}function SS(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function LN(e,t){return{left:e.left-t,right:e.right+t,top:e.top-t,bottom:e.bottom+t}}function Qm(e,t,r,n){return{left:e-r/2,right:e+r/2,top:t-n/2,bottom:t+n/2}}function Mi(e){return Fae(e)?.rect}function oh(e,t){switch(t){case"top":return{x:e.cx,y:e.rect.top};case"bottom":return{x:e.cx,y:e.rect.bottom};case"left":return{x:e.rect.left,y:e.cy};case"right":return{x:e.rect.right,y:e.cy}}}function vS(e,t,r,n,i,a=.001){let o=t==="left"||t==="right",l=n==="left"||n==="right";if(o&&l){if(t==="right"&&n==="left"&&e.x<r.x||t==="left"&&n==="right"&&e.x>r.x){if(Nr(e,r,a))return[e,r];let f=(e.x+r.x)/2;return[e,{x:f,y:e.y},{x:f,y:r.y},r]}if(t===n){if(Nr(e,r,a))return;let f=t==="left"?Math.min(e.x,r.x)-i:Math.max(e.x,r.x)+i;return[e,{x:f,y:e.y},{x:f,y:r.y},r]}return}if(!o&&!l){if(t===n){if(Lr(e,r,a))return;let p=t==="top"?Math.min(e.y,r.y)-i:Math.max(e.y,r.y)+i;return[e,{x:e.x,y:p},{x:r.x,y:p},r]}if(!(t==="bottom"&&n==="top"&&e.y<r.y||t==="top"&&n==="bottom"&&e.y>r.y))return;if(Lr(e,r,a))return[e,r];let f=(e.y+r.y)/2;return[e,{x:e.x,y:f},{x:r.x,y:f},r]}if(o&&!l){let d=t==="right"&&r.x>e.x||t==="left"&&r.x<e.x,f=n==="top"&&e.y<r.y||n==="bottom"&&e.y>r.y;return d&&f?[e,{x:r.x,y:e.y},r]:void 0}let u=t==="bottom"&&r.y>e.y||t==="top"&&r.y<e.y,h=n==="left"&&e.x<r.x||n==="right"&&e.x>r.x;return u&&h?[e,{x:e.x,y:r.y},r]:void 0}function ES(e,t,r,n){return t==="left"||t==="right"?[e,{x:n,y:e.y},{x:n,y:r.y},r]:[e,{x:e.x,y:n},{x:r.x,y:n},r]}function Zm(e){let t=new Map,r=[];for(let n of e){if(n.isEdgeLabel)continue;let i=Gae(n);i&&(t.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:t,realNodeRects:r}}function Tl(e){let t=[],r=[];for(let n of e){let i=Gae(n);if(!i)continue;let a={id:i.id,rect:i.rect};n.isEdgeLabel?r.push(a):t.push(a)}return{realNodeRects:t,labelNodeRects:r}}function Vae(e,{includeEdgeLabels:t=!0}={}){let r=[];for(let n of e){if(n.isGroup||!t&&n.isEdgeLabel)continue;let i=n.x??0,a=n.y??0,o=n.width??0,l=n.height??0;r.push({nodeId:n.id,...Qm(i,a,o,l)})}return r}function wS(e,t,r=.001){let n=e.start,i=e.end;if(!n||!i)return;let a=t.get(n),o=t.get(i);if(!(!a||!o))return{srcId:n,dstId:i,srcInfo:a,dstInfo:o,collinearX:Math.abs(a.cx-o.cx)<r,collinearY:Math.abs(a.cy-o.cy)<r}}function xn(e,t,r,n=[],i=0){for(let a of r)if(!n.includes(a.id)&&px(e,t,a.rect,-i))return!0;return!1}function DN(e,t,r,n,i=.001,a=1e-6){let o=Nr(e,t,i),l=Lr(e,t,i),u=Nr(r,n,i),h=Lr(r,n,i);if(o&&u||l&&h||!(o||l)||!(u||h))return!1;let d=o?{a:e,b:t}:{a:r,b:n},f=l?{a:e,b:t}:{a:r,b:n},p=d.a.y,g=Math.min(d.a.x,d.b.x),m=Math.max(d.a.x,d.b.x),y=f.a.x,x=Math.min(f.a.y,f.b.y),T=Math.max(f.a.y,f.b.y);if(y<g||y>m||p<x||p>T)return!1;let C=Math.abs(y-d.a.x)<a&&Math.abs(p-d.a.y)<a||Math.abs(y-d.b.x)<a&&Math.abs(p-d.b.y)<a,k=Math.abs(y-f.a.x)<a&&Math.abs(p-f.a.y)<a||Math.abs(y-f.b.x)<a&&Math.abs(p-f.b.y)<a;return!(C&&k)}function yWe(e,t,r,n,i=.001){let a=Nr(e,t,i),o=Lr(e,t,i),l=Nr(r,n,i),u=Lr(r,n,i);return o&&u&&Lr(e,r,i)?ss(e.y,t.y,r.y,n.y)>i:a&&l&&Nr(e,r,i)?ss(e.x,t.x,r.x,n.x)>i:!1}function mx(e,t,r,n,{epsilon:i=.001,skipDegenerateOther:a=!1}={}){for(let o of r){if(o===n||o.isLayoutOnly)continue;let l=o.points;if(!(!l||l.length<2))for(let u=0;u<l.length-1;u++){let h=l[u],d=l[u+1];if(!(a&&zs(h,d,i))&&(DN(e,t,h,d,i)||yWe(e,t,h,d,i)))return!0}}return!1}function vo(e,t,r,n,i=.001){let a=Nr(e,t,i),o=Lr(e,t,i),l=Nr(r,n,i),u=Lr(r,n,i);if(!(a&&u||o&&l))return!1;let h=a?{a:e,b:t}:{a:r,b:n},d=a?{a:r,b:n}:{a:e,b:t},f=h.a.y,p=Math.min(h.a.x,h.b.x),g=Math.max(h.a.x,h.b.x),m=d.a.x,y=Math.min(d.a.y,d.b.y),x=Math.max(d.a.y,d.b.y);return m>p+i&&m<g-i&&f>y+i&&f<x-i}function Bae(e,t,r){let n=Math.min(t,r),i=Math.max(t,r);return e>n+.001&&e<i-.001}function xWe(e,t,r){return Lr(e,t)&&Lr(t,r)?Bae(t.y,e.y,r.y):Nr(e,t)&&Nr(t,r)?Bae(t.x,e.x,r.x):!1}function bWe(e){let t=!1,r=[];for(let n=0;n<e.length;n++){let i=r[r.length-1],a=e[n],o=n+1<e.length?e[n+1]:void 0;if(i&&o){if(zs(i,o)){n++,t=!0;continue}if(xWe(i,a,o)){t=!0;continue}}r.push(a)}return{points:r,changed:t}}function gx(e){let t=[e[0]];for(let n=1;n<e.length;n++){let i=t[t.length-1],a=e[n];if(!Lr(i,a)&&!Nr(i,a)){let o=t.length>=2?t[t.length-2]:void 0,u=(o?Lr(o,i):!1)?{x:i.x,y:a.y}:{x:a.x,y:i.y};t.push(u)}t.push(a)}let r=[];for(let n of t){let i=r[r.length-1];(!i||!zs(i,n))&&r.push(n)}return r}function za(e){if(e.length<3)return e;let t=[...e];for(let r=0;r<32;r++){let n=bWe(t);if(t=n.points,!n.changed)break}return t}var Eo=_(()=>{"use strict";s(Fae,"measuredNodeRect");s(Gae,"nodeBoundsInfoFor");s(zs,"samePoint");s(Lr,"sameX");s(Nr,"sameY");s(Mn,"isHorizontalSegment");s(On,"isVerticalSegment");s(ss,"overlapLength");s(So,"sameAxisSegmentOverlapLength");s(ah,"orthogonalSegmentsForPoints");s(Vs,"countOrthogonalBends");s(Dr,"dedupeConsecutivePoints");s(CS,"classifyThreeSegmentRoute");s(px,"segmentBoundsOverlapRect");s(kS,"pointInsideRect");s(zae,"rectContainsRect");s(SS,"rectsOverlap");s(LN,"inflateRect");s(Qm,"rectFromCenterSize");s(Mi,"rectOfNodeBounds");s(oh,"portForRectSide");s(vS,"buildOrthogonalPortPath");s(ES,"buildSameSideTrackPath");s(Zm,"collectRealNodeBounds");s(Tl,"collectNodeRectEntries");s(Vae,"collectLayoutNodeRects");s(wS,"getNodePairGeometry");s(xn,"segmentHitsAnyRect");s(DN,"orthogonalSegmentsCross");s(yWe,"sameAxisSegmentsOverlap");s(mx,"segmentConflictsWithAnyEdge");s(vo,"orthogonalSegmentsStrictlyCross");s(Bae,"strictlyBetween");s(xWe,"isCollinearIntermediate");s(bWe,"simplifyPolylineOnce");s(gx,"orthogonalizePolyline");s(za,"simplifyPolyline")});function Jae(e,t,r){let n=e;if(n.isLayoutOnly||!n.points||n.points.length<r)return;let i=n.start?t.get(n.start):void 0,a=n.end?t.get(n.end):void 0;return{edge:n,points:n.points,srcRect:i?Mi(i):void 0,dstRect:a?Mi(a):void 0}}function CWe(e,t,r){if(Nr(e,t,sr))return{x:e.x<r.left?r.left:r.right,y:e.y};if(Lr(e,t,sr)){let n=e.y<r.top?r.top:r.bottom;return{x:e.x,y:n}}return{x:Math.min(r.right,Math.max(r.left,e.x)),y:Math.min(r.bottom,Math.max(r.top,e.y))}}function qae(e,t,r){let n=r?1:-1,i=r?0:e.length-1;for(;i>=0&&i<e.length&&kS(e[i],t,TWe);)i+=n;if(i<0||i>=e.length)return e;let a=i-n;if(a<0||a>=e.length)return e;let o=CWe(e[i],e[a],t);return r?[o,...e.slice(i)]:[...e.slice(0,i+1),o]}function eoe(e,t){for(let r of e){let n=Jae(r,t,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=qae(i,n.srcRect,!0)),n.dstRect&&(i=qae(i,n.dstRect,!1)),i=za(gx(i)),i=toe(i,n.srcRect,n.dstRect),n.edge.points=za(gx(i))}}function jae(e,t,r,n=!1){if(Nr(e,t,sr)){if(t.y<r.top-sr||t.y>r.bottom+sr)return t;if(n){if(e.x<r.left-sr)return{x:r.left,y:e.y};if(e.x>r.right+sr)return{x:r.right,y:e.y}}return{x:Math.abs(t.x-r.left)<=Math.abs(t.x-r.right)?r.left:r.right,y:e.y}}if(Lr(e,t,sr)){if(t.x<r.left-sr||t.x>r.right+sr)return t;if(n){if(e.y<r.top-sr)return{x:e.x,y:r.top};if(e.y>r.bottom+sr)return{x:e.x,y:r.bottom}}let i=Math.abs(t.y-r.top)<=Math.abs(t.y-r.bottom);return{x:e.x,y:i?r.top:r.bottom}}return t}function IN(e,t,r){let n=e[t];for(let i=t+r;i>=0&&i<e.length;i+=r){let a=e[i];if(!zs(a,n,sr))return a}return e[t+r]}function NN(e,t){let r=e+Wae,n=t-Wae;return r<=n?{lo:r,hi:n}:{lo:(e+t)/2,hi:(e+t)/2}}function Hae(e,t,r){let{lo:n,hi:i}=NN(t,r);return Math.min(i,Math.max(n,e))}function kWe(e){let t=Math.max(...e.map(n=>n.lo)),r=Math.min(...e.map(n=>n.hi));if(!(t>r))return{lo:t,hi:r}}function Uae(e,t){return t==="left"||t==="right"?NN(e.top,e.bottom):NN(e.left,e.right)}function PN(e,t,r){let n=e.y>=r.top-sr&&e.y<=r.bottom+sr,i=e.x>=r.left-sr&&e.x<=r.right+sr;if(Nr(e,t,sr)&&n){if(Math.abs(e.x-r.left)<sr)return"left";if(Math.abs(e.x-r.right)<sr)return"right"}if(Lr(e,t,sr)&&i){if(Math.abs(e.y-r.top)<sr)return"top";if(Math.abs(e.y-r.bottom)<sr)return"bottom"}}function _S(e){return e==="left"||e==="right"}function SWe(e,t,r,n,i){let a=[],o=r?PN(e,t,r):void 0,l=n?PN(t,e,n):void 0;return r&&o&&_S(o)===i&&a.push(Uae(r,o)),n&&l&&_S(l)===i&&a.push(Uae(n,l)),a.length>0?kWe(a):void 0}function Yae(e,t,r,n,i){let a=SWe(e,t,r,n,i);if(!a)return;let o=i?e.y:e.x,l=Math.min(a.hi,Math.max(a.lo,o));if(!(Math.abs(l-o)<sr))return i?[{x:e.x,y:l},{x:t.x,y:l}]:[{x:l,y:e.y},{x:l,y:t.y}]}function toe(e,t,r){if(e.length!==2)return e;let[n,i]=e;return Nr(n,i,sr)?Yae(n,i,t,r,!0)??e:Lr(n,i,sr)?Yae(n,i,t,r,!1)??e:e}function vWe(e,t,r){return _S(r)?{x:e.x,y:Hae(e.y,t.top,t.bottom)}:{x:Hae(e.x,t.left,t.right),y:e.y}}function EWe(e,t,r,n,i,a){let o=e.map(l=>({...l}));for(let l=t;l>=0&&l<e.length;l+=r){let u=e[l];if(a&&!Nr(u,n,sr)||!a&&!Lr(u,n,sr))break;a?o[l].y=i.y:o[l].x=i.x}return o}function Kae(e,t,r){if(e.length<2)return e;let n=r?0:e.length-1,i=r?1:-1,a=e[n],o=IN(e,n,i);if(!o)return e;let l=PN(a,o,t);if(!l)return e;let u=_S(l),h=vWe(a,t,l);return zs(a,h,sr)?e:EWe(e,n,i,a,h,u)}function Xae(e,t,r){let n=Math.min(e.x,t.x)>=r.left-sr&&Math.max(e.x,t.x)<=r.right+sr,i=Math.min(e.y,t.y)>=r.top-sr&&Math.max(e.y,t.y)<=r.bottom+sr;if(Math.abs(e.y-r.top)<sr&&Math.abs(t.y-r.top)<sr&&n)return"top";if(Math.abs(e.y-r.bottom)<sr&&Math.abs(t.y-r.bottom)<sr&&n)return"bottom";if(Math.abs(e.x-r.left)<sr&&Math.abs(t.x-r.left)<sr&&i)return"left";if(Math.abs(e.x-r.right)<sr&&Math.abs(t.x-r.right)<sr&&i)return"right"}function Qae(e,t,r,n){switch(e){case"top":return Lr(t,r,sr)&&r.y<n.top-sr;case"bottom":return Lr(t,r,sr)&&r.y>n.bottom+sr;case"left":return Nr(t,r,sr)&&r.x<n.left-sr;case"right":return Nr(t,r,sr)&&r.x>n.right+sr}}function Zae(e,t,r){if(e.length<3)return e;if(r){let a=Xae(e[0],e[1],t);return a&&Qae(a,e[1],e[2],t)?e.slice(1):e}let n=e.length-1,i=Xae(e[n-1],e[n],t);return i&&Qae(i,e[n-1],e[n-2],t)?e.slice(0,n):e}function wWe(e,t,r){let n=e;if(t){let a=IN(n,0,1);if(a){let o=jae(a,n[0],t);o!==n[0]&&(n=[o,...n.slice(1)])}n=Zae(n,t,!0)}if(r){let a=n.length-1,o=IN(n,a,-1);if(o){let l=jae(o,n[a],r,!0);l!==n[a]&&(n=[...n.slice(0,a),l])}n=Zae(n,r,!1)}let i=toe(n,t,r);return i!==n||n.length===2?i:(t&&(n=Kae(n,t,!0)),r&&(n=Kae(n,r,!1)),n)}function MN(e,t){for(let r of e){let n=Jae(r,t,2);if(!n)continue;let i=Dr(n.points,sr),a=wWe(i,n.srcRect,n.dstRect);if(a.length<3){n.edge.points=a;continue}let o=[a[0],{...a[0]},...a.slice(1,-1),a[a.length-1],{...a[a.length-1]}];n.edge.points=o}}var sr,TWe,Wae,roe=_(()=>{"use strict";Eo();sr=.001,TWe=.5,Wae=4;s(Jae,"endpointContextFor");s(CWe,"segmentEnterPoint");s(qae,"clipEndpoint");s(eoe,"clipEdgeEndpointsToNodeBoundaries");s(jae,"snapEndpointToBoundary");s(IN,"firstDistinctAdjacent");s(NN,"cornerClearanceRange");s(Hae,"clampToCornerClearance");s(kWe,"intersectRanges");s(Uae,"clearanceRangeForSide");s(PN,"terminalSideForSegment");s(_S,"isHorizontalSide");s(SWe,"straightClearanceRange");s(Yae,"clearStraightEndpointCornerAxis");s(toe,"clearStraightEndpointCornerConnections");s(vWe,"cornerClearedEndpoint");s(EWe,"moveCollinearEndpointRun");s(Kae,"clearEndpointCornerConnection");s(Xae,"borderSideForSegment");s(Qae,"leavesOutward");s(Zae,"collapseOwnBorderStub");s(wWe,"snapAndCollapseEndpoints");s(MN,"prepareEdgeEndpointsForRenderer")});function ioe(e){return new Map(e.map(t=>[t.id,t]))}function _We(e,t){let r=e.parentId,n=null;for(;r;){let i=t.get(r);if(!i?.isGroup)break;n=i.id,r=i.parentId}return n}function noe(e,t){let r=0,n=e.parentId;for(;n;){let i=t.get(n);if(!i?.isGroup)break;r++,n=i.parentId}return r}function soe(e){let t=1/0,r=-1/0,n=1/0,i=-1/0;for(let a of e){let o=a.x,l=a.y;if(typeof o!="number"||typeof l!="number")continue;let u=a.width??0,h=a.height??0;t=Math.min(t,o-u/2),r=Math.max(r,o+u/2),n=Math.min(n,l-h/2),i=Math.max(i,l+h/2)}return t===1/0||n===1/0?null:{minX:t,maxX:r,minY:n,maxY:i}}function AWe(e,t){let r=e.padding??20;e.x=(t.minX+t.maxX)/2,e.y=(t.minY+t.maxY)/2,e.width=Math.max(0,t.maxX-t.minX)+r,e.height=Math.max(0,t.maxY-t.minY)+r}function RWe(e){let t=ioe(e),r=e.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>noe(i,t)-noe(n,t));for(let n of r){let i=e.filter(o=>o.parentId===n.id),a=soe(i);a&&AWe(n,a)}}function ON(e,t){let r=e.nodes??[],n=e.edges??[],i=r.filter(u=>!u.isGroup),a=1/0,o=-1/0;for(let u of i){let h=u[t];typeof h=="number"&&(a=Math.min(a,h),o=Math.max(o,h))}if(!Number.isFinite(a)||!Number.isFinite(o))return!1;let l=s(u=>a+o-u,"mirror");for(let u of r){let h=u[t];typeof h=="number"&&(u[t]=l(h));let d=u.groupTitleRect;d&&(u.groupTitleRect=t==="x"?{...d,left:l(d.right),right:l(d.left)}:{...d,top:l(d.bottom),bottom:l(d.top)})}for(let u of n)for(let h of u.points??[])h[t]=l(h[t]);return!0}function aoe(e){return(e.nodes??[]).some(r=>!r.isGroup)?ON(e,"y"):!0}function ooe(e,t="LR"){let r=e.nodes??[],n=e.edges??[],i=r.filter(A=>!A.isGroup),a=1/0,o=1/0;for(let A of i){let M=A.x??0,I=A.y??0;M<a&&(a=M),I<o&&(o=I)}if(!Number.isFinite(a)||!Number.isFinite(o))return!1;let l=36,u=0,h=0;for(let A of i)u+=A.width??0,h+=A.height??0;let d=u/i.length,f=h/i.length,p=f>0?Math.max(1,d/f):1;for(let A of i){let M=A.x??0,P=((A.y??0)-o)*p+l,B=M-a;A.x=P,A.y=B}for(let A of n)if(A.points)for(let M of A.points){let I=M.x,B=(M.y-o)*p+l,D=I-a;M.x=B,M.y=D}RWe(r);let g=r.filter(A=>A.isGroup&&!A.parentId);if(g.length===0)return t==="RL"&&ON(e,"x"),!0;let m=ioe(r),y=new Map;for(let A of r){if(A.isGroup)continue;let M=_We(A,m);if(!M)continue;let I=y.get(M)??[];I.push(A),y.set(M,I)}let x=0;for(let A of g){let M=A.padding??0;M>x&&(x=M)}let T=[],C=1/0,k=-1/0;for(let A of g){let M=y.get(A.id)??[],I=soe(M);I&&(C=Math.min(C,I.minX),k=Math.max(k,I.maxX),T.push({lane:A,contentTop:I.minY,contentBottom:I.maxY,centerY:(I.minY+I.maxY)/2}))}if(C===1/0||k===-1/0)return!0;let E=Math.max(0,k-C),v=Math.max(x,10),S=E+2*v,w=l+S,F=(C+k)/2-S/2-l,N=F+w/2,G=Math.max(x,l);T.sort((A,M)=>A.centerY-M.centerY);for(let A=0;A<T.length;A++){let M=T[A],I,P;if(A===0?I=M.contentTop-G:I=(T[A-1].contentBottom+M.contentTop)/2,A===T.length-1)P=M.contentBottom+G;else{let $=T[A+1];P=(M.contentBottom+$.contentTop)/2}let B=Math.max(0,P-I),D=(I+P)/2;M.lane.x=N,M.lane.y=D,M.lane.width=w,M.lane.height=B,M.lane.swimlaneContentTop=M.contentTop,M.lane.groupTitleRect={left:F,right:F+l,top:I,bottom:P}}return t==="RL"&&ON(e,"x"),!0}var loe=_(()=>{"use strict";s(ioe,"buildNodeMap");s(_We,"resolveTopLevelGroupId");s(noe,"groupDepth");s(soe,"boundsForChildren");s(AWe,"applyGroupBounds");s(RWe,"recomputeNestedGroupBounds");s(ON,"mirrorAxis");s(aoe,"applyBtDirectionTransform");s(ooe,"applyLrDirectionTransform")});function coe(e,t){let{nodeInfoById:r,realNodeRects:n}=Zm(t);for(let i of e){if(i.isLayoutOnly)continue;let a=i.points;if(!a||a.length<4)continue;let o=CS(Dr(a,wo),wo);if(!o)continue;let{p3:l}=o,u=o.kind==="HVH",h=wS(i,r,wo);if(!h)continue;let{srcId:d,dstId:f,srcInfo:p,dstInfo:g,collinearX:m,collinearY:y}=h;if(m||y)continue;let x,T=p.rect;for(let C of DWe){let k,E,v;if(u){let N=g.cy>p.cy?T.bottom:T.top,G=p.cx+C;if(G<=T.left+wo||G>=T.right-wo)continue;k={x:G,y:N},E={x:G,y:l.y},v={x:l.x,y:l.y}}else{let N=g.cx>p.cx?T.right:T.left,G=p.cy+C;if(G<=T.top+wo||G>=T.bottom-wo)continue;k={x:N,y:G},E={x:l.x,y:G},v={x:l.x,y:l.y}}let S=zs(k,E,wo),w=zs(E,v,wo);if(S&&w||!S&&xn(k,E,n,[d],1)||!w&&xn(E,v,n,[f],1))continue;let L=!S&&mx(k,E,e,i,{epsilon:wo,skipDegenerateOther:!0}),O=!w&&mx(E,v,e,i,{epsilon:wo,skipDegenerateOther:!0});if(!(L||O)){S?x=[E,v]:w?x=[k,E]:x=[k,E,v];break}}x&&(i.points=x)}}var wo,LWe,AS,DWe,uoe=_(()=>{"use strict";Eo();wo=1e-6,LWe=8,AS=LWe,DWe=[0,AS,-AS,2*AS,-2*AS];s(coe,"portSwapToLShape")});function hoe(e,t){let{realNodeRects:a,labelNodeRects:o}=Tl(t.values());for(let l of e){if(l.isLayoutOnly)continue;let u=l.points;if(!u||u.length<4)continue;let h=Dr(u,.001);if(h.length<4)continue;let d=h.length-1,f=h[d],p=h[d-1],g=h[d-2],m=f.x-p.x,y=f.y-p.y,x=Math.hypot(m,y);if(x>=10||x<.001)continue;let T=p.x-g.x,C=p.y-g.y;if(Math.hypot(T,C)<.001)continue;let E=Mn(p,f,.001),v=On(p,f,.001),S=Mn(g,p,.001),w=On(g,p,.001);if(!(E&&w||v&&S))continue;let L=l.end,O=l.start,F=L?t.get(L):void 0;if(!F)continue;let N=F.x??0,G=F.y??0,A=Mi(F);if(!A)continue;let M,I;if(w){let z=C<0;M={x:N,y:g.y},I={x:N,y:z?A.bottom:A.top}}else{let z=T>0;M={x:g.x,y:G},I={x:z?A.right:A.left,y:G}}if(xn(M,I,a,L?[L]:[],-2)||xn(M,I,o,[],-2))continue;if(O){let z=t.get(O),j=z?Mi(z):void 0;if(j&&kS(M,j,2))continue}let P=s((z,j)=>`${z.x.toFixed(3)},${z.y.toFixed(3)}|${j.x.toFixed(3)},${j.y.toFixed(3)}`,"ownSegmentKey"),B=new Set;for(let z=0;z<h.length-1;z++)B.add(P(h[z],h[z+1]));let D=s((z,j)=>{for(let J of e){if(J===l||J.isLayoutOnly)continue;let ee=J.points;if(!(!ee||ee.length<2))for(let le=0;le<ee.length-1;le++){let se=ee[le],Ce=ee[le+1];if(!B.has(P(se,Ce))&&vo(z,j,se,Ce,.001))return!0}}return!1},"segmentCrossesOtherEdge");if(D(M,I))continue;if(d-3>=0){let z=h[d-3],j=[O,L].filter(J=>!!J);if(xn(z,M,a,j,-2)||D(z,M))continue}let W=[...h.slice(0,d-2),M,I];l.points=W;let q=l.labelNodeId;if(q){let z=t.get(q);if(z){let j=z.width??0,J=z.height??0;if(j>0&&J>0){let ee,le,se=-1;for(let Ce=0;Ce<W.length-1;Ce++){let ce=W[Ce],_e=W[Ce+1],me=Math.hypot(_e.x-ce.x,_e.y-ce.y),ge=Nr(ce,_e,.001),Be=Lr(ce,_e,.001);(ge&&me>=j+2||Be&&me>=J+2)&&me>se&&(se=me,ee=(ce.x+_e.x)/2,le=(ce.y+_e.y)/2)}ee!==void 0&&le!==void 0&&(z.x=ee,z.y=le)}}}}}var doe=_(()=>{"use strict";Eo();s(hoe,"collapseShortTerminalStub")});function foe(e,t){let i=s((g,m)=>{let y=g.x??0,x=g.y??0,T=m.x-y,C=m.y-x,k=(g.width??0)/2,E=(g.height??0)/2;return Math.abs(C)*k>Math.abs(T)*E?(C<0&&(E=-E),{x:y+(C===0?0:E*T/C),y:x+E}):(T<0&&(k=-k),{x:y+k,y:x+(T===0?0:k*C/T)})},"rectIntersect"),a=s((g,m)=>{let y=Dr(g.points??[]);if(y.length<2)return;let x=m?g.start:g.end,T=x?t.get(x):void 0,C=T?Mi(T):void 0;if(!T||!x||!C)return;let k=m?y[0]:y[y.length-1],E=m?y[1]:y[y.length-2],v=i(T,k),S=k;if($N(E,v)&&(S=E),Lr(v,S,Mt))return{edge:g,edgeId:String(g.id??""),nodeId:x,atStart:m,orientation:"V",coord:v.x,min:Math.min(v.y,S.y),max:Math.max(v.y,S.y),boundary:v,railEnd:S,rect:C};if(Nr(v,S,Mt))return{edge:g,edgeId:String(g.id??""),nodeId:x,atStart:m,orientation:"H",coord:v.y,min:Math.min(v.x,S.x),max:Math.max(v.x,S.x),boundary:v,railEnd:S,rect:C}},"terminalLaneFor"),o=s((g,m)=>Math.max(0,Math.min(g.max,m.max)-Math.max(g.min,m.min)),"projectedOverlapLength"),l=s((g,m)=>g.nodeId!==m.nodeId||g.orientation!==m.orientation?!1:g.orientation==="H"?(Math.abs(g.boundary.x-g.rect.left)<1||Math.abs(g.boundary.x-g.rect.right)<1)&&Lr(g.boundary,m.boundary,1):(Math.abs(g.boundary.y-g.rect.top)<1||Math.abs(g.boundary.y-g.rect.bottom)<1)&&Nr(g.boundary,m.boundary,1),"sameTerminalFace"),u=s((g,m)=>g.nodeId!==m.nodeId||g.orientation!==m.orientation?!1:o(g,m)>=Oi&&Math.abs(g.coord-m.coord)<.5,"exactTerminalLaneConflict"),h=s((g,m)=>{if(g.nodeId!==m.nodeId||g.orientation!==m.orientation||g.orientation!=="H"||g.atStart===m.atStart)return!1;let y=o(g,m);if(y<Oi)return!1;let x=g.rect.bottom-g.rect.top;return y<x||y>2*x?!1:l(g,m)&&Math.abs(g.coord-m.coord)<16},"nearTerminalLaneConflict"),d=s((g,m)=>{let y=Dr(g.edge.points??[]);if(y.length<2)return;let x=g.orientation==="V"?{x:g.boundary.x+m,y:g.boundary.y}:{x:g.boundary.x,y:g.boundary.y+m},T=g.orientation==="V"?{x:g.railEnd.x+m,y:g.railEnd.y}:{x:g.railEnd.x,y:g.railEnd.y+m};if(!s(()=>Math.abs(g.boundary.y-g.rect.top)<1||Math.abs(g.boundary.y-g.rect.bottom)<1?Nr(x,g.boundary,Mt)&&x.x>=g.rect.left+1&&x.x<=g.rect.right-1:Math.abs(g.boundary.x-g.rect.left)<1||Math.abs(g.boundary.x-g.rect.right)<1?Lr(x,g.boundary,Mt)&&x.y>=g.rect.top+1&&x.y<=g.rect.bottom-1:!1,"boundaryStaysOnSameFace")())return;if(g.atStart){let S=y.length>1&&zs(y[1],g.railEnd,Mt),w=y.slice(S?2:1),L=w[0];return L&&!$N(L,T)?void 0:[x,T,...w]}let k=y.length>1&&zs(y[y.length-2],g.railEnd,Mt),E=y.slice(0,k?-2:-1),v=E[E.length-1];if(!(v&&!$N(v,T)))return[...E,T,x]},"shiftedCandidate"),f=s(g=>{let m=g.edge,y=Dr(m.points??[]);if(y.length!==2)return!1;let x=m.start,T=m.end,C=x?t.get(x):void 0,k=T?t.get(T):void 0;if(!C||!k)return!1;let E=C.x??0,v=C.y??0,S=k.x??0,w=k.y??0,[L,O]=y;return Nr(L,O,Mt)&&Math.abs(v-w)<1&&Math.abs(E-S)>1||Lr(L,O,Mt)&&Math.abs(E-S)<1&&Math.abs(v-w)>1},"laneIsStraightCollinearConnector"),p=[-7,7,-14,14,-21,21];for(let g=0;g<8;g++){let m=e.filter(x=>!x.isLayoutOnly).flatMap(x=>[a(x,!0),a(x,!1)]).filter(x=>!!x),y=!1;for(let x=0;x<m.length&&!y;x++)for(let T=x+1;T<m.length&&!y;T++){let C=m[x],k=m[T];if(C.edge===k.edge||!(u(C,k)||h(C,k)))continue;let E=!u(C,k),v=[C,k].sort((S,w)=>{let L=f(S),O=f(w);return L!==O?Number(L)-Number(O):+!w.atStart-+!S.atStart});for(let S of v){for(let w of p){let L=d(S,w);if(!L)continue;let O=a({...S.edge,points:L},S.atStart);if(!(!O||m.some(F=>F.edge!==S.edge&&(u(O,F)||E&&h(O,F))))){S.edge.points=L,y=!0;break}}if(y)break}}if(!y)return}}function poe(e,t){let{realNodeRects:i,labelNodeRects:a}=Tl(t.values()),o=s((u,h)=>{let d=u.start,f=u.end,p=_r(h);if(p.length!==h.length-1)return!1;let g=[d,f].filter(m=>!!m);for(let m of p)if(xn(m.a,m.b,i,g,-2)||xn(m.a,m.b,a,[],-2))return!1;for(let m of e){if(m===u||m.isLayoutOnly)continue;let y=m.points;if(!(!y||y.length<2)){for(let x of p)for(let T of _r(Dr(y)))if(So(x,T,.5)>=Oi||vo(x.a,x.b,T.a,T.b,Mt))return!1}}return!0},"candidateIsSafe"),l=s((u,h)=>{if(h+4>=u.length)return;let d=u[h],f=u[h+1],p=u[h+2],g=u[h+3],m=u[h+4],y=Mn(d,f)&&On(f,p)&&Mn(p,g)&&On(g,m)&&Lr(d,g,Mt)&&Lr(d,m,Mt)&&Lr(f,p,Mt)&&(f.x-d.x)*(g.x-p.x)<0,x=On(d,f)&&Mn(f,p)&&On(p,g)&&Mn(g,m)&&Nr(d,g,Mt)&&Nr(d,m,Mt)&&Nr(f,p,Mt)&&(f.y-d.y)*(g.y-p.y)<0;if(y||x)return Dr([...u.slice(0,h+1),m,...u.slice(h+5)]);if(h+5>=u.length)return;let T=u[h+5],C=On(d,f)&&Mn(f,p)&&On(p,g)&&Mn(g,m)&&On(m,T)&&Lr(d,m,Mt)&&Lr(d,T,Mt)&&Lr(p,g,Mt)&&(p.x-f.x)*(m.x-g.x)<0,k=Mn(d,f)&&On(f,p)&&Mn(p,g)&&On(g,m)&&Mn(m,T)&&Nr(d,m,Mt)&&Nr(d,T,Mt)&&Nr(p,g,Mt)&&(p.y-f.y)*(m.y-g.y)<0;if(!(!C&&!k))return Dr([...u.slice(0,h+1),T,...u.slice(h+6)])},"withoutDogleg");for(let u=0;u<8;u++){let h=!1;for(let d of e){if(d.isLayoutOnly)continue;let f=Dr(d.points??[]);for(let p=0;p<=f.length-5;p++){let g=l(f,p);if(!(!g||!o(d,g))){d.points=g,h=!0;break}}if(h)break}if(!h)return}}function BN(e,t){let{realNodeRects:a,labelNodeRects:o}=Tl(t.values()),l=e.filter(m=>!m.isLayoutOnly),u=s((m,y,x)=>Dr(m===y?x??[]:m.points??[]),"pointsFor"),h=s((m,y)=>{let x=0;for(let T=0;T<l.length;T++){let C=_r(u(l[T],m,y));for(let k=T+1;k<l.length;k++){let E=_r(u(l[k],m,y));for(let v of C)for(let S of E)vo(v.a,v.b,S.a,S.b,Mt)&&x++}}return x},"strictCrossingCount"),d=s(m=>{let y=_r(m);if(y.length!==3)return;let x=y[1];if(!(y[0].horizontal===x.horizontal||y[2].horizontal===x.horizontal))return{index:x.index,horizontal:x.horizontal,vertical:x.vertical,segment:x}},"middleRail"),f=s((m,y)=>{let x=[m.start,m.end].filter(T=>!!T);return a.filter(T=>{if(x.includes(T.id))return!1;let C=T.rect;return y.horizontal?ss(y.a.x,y.b.x,C.left,C.right)>=Oi&&y.a.y>=C.top-2&&y.a.y<=C.bottom+2:ss(y.a.y,y.b.y,C.top,C.bottom)>=Oi&&y.a.x>=C.left-2&&y.a.x<=C.right+2})},"blockingRectsFor"),p=s((m,y,x)=>{let T=m.map(k=>({...k}));if(y.horizontal)T[y.index].y=x,T[y.index+1].y=x;else if(y.vertical)T[y.index].x=x,T[y.index+1].x=x;else return;let C=za(Dr(T));return _r(C).length===C.length-1?C:void 0},"candidateByMovingRail"),g=s((m,y,x)=>{let T=[m.start,m.end].filter(k=>!!k),C=_r(y);if(C.length!==y.length-1)return!1;for(let k of C)if(xn(k.a,k.b,a,T,-2)||xn(k.a,k.b,o,[],-2))return!1;for(let k of l)if(k!==m){for(let E of C)for(let v of _r(u(k)))if(So(E,v,.5)>=Oi)return!1}return h(m,y)<=x},"candidateIsSafe");for(let m=0;m<8;m++){let y=h(),x=!1;for(let T of l){let C=u(T),k=d(C);if(!k)continue;let E=f(T,k.segment);if(E.length===0)continue;let v=k.horizontal?[Math.min(...E.map(S=>S.rect.top))-20,Math.max(...E.map(S=>S.rect.bottom))+20]:[Math.min(...E.map(S=>S.rect.left))-20,Math.max(...E.map(S=>S.rect.right))+20];for(let S of v){let w=p(C,k.segment,S);if(!(!w||!g(T,w,y))){T.points=w,x=!0;break}}if(x)break}if(!x)return}}function FN(e,t){let n=s(u=>{let h=u.groupTitleRect;if(!(!h||typeof h.left!="number"||typeof h.right!="number"||typeof h.top!="number"||typeof h.bottom!="number"||!Number.isFinite(h.left)||!Number.isFinite(h.right)||!Number.isFinite(h.top)||!Number.isFinite(h.bottom)||h.right<=h.left||h.bottom<=h.top))return{left:h.left,right:h.right,top:h.top,bottom:h.bottom}},"validTitleRect"),i=s(u=>{if(!u.isGroup||u.parentId)return;let h=u.direction,d=typeof h=="string"?h.toUpperCase():"";if(d==="LR"||d==="RL"||d==="BT")return;let f=n(u),p=u.y,g=u.height;if(!f||typeof p!="number"||typeof g!="number"||!Number.isFinite(p)||!Number.isFinite(g)||g<=0)return;let m=f.right-f.left,y=f.bottom-f.top;if(!(y<=0||m<y))return{node:u,rect:f}},"topLaneTitleFor"),a=s((u,h)=>{if(!u.horizontal)return!1;let d=u.a.y;return d<=h.top+Mt||d>=h.bottom-Mt?!1:ss(u.a.x,u.b.x,h.left,h.right)>=Oi},"horizontalSegmentIntersectsTitle"),o=[...t.values()].map(i).filter(u=>!!u);if(o.length===0)return;let l=0;for(let u of e){if(u.isLayoutOnly)continue;let h=Dr(u.points??[]);for(let d of _r(h))for(let f of o)a(d,f.rect)&&(l=Math.max(l,f.rect.bottom-d.a.y+4))}if(!(l<=Mt))for(let u of o){let h=u.node.y,d=u.node.height;typeof h!="number"||typeof d!="number"||!Number.isFinite(h)||!Number.isFinite(d)||d<=0||(u.node.y=h-l/2,u.node.height=d+l,u.node.groupTitleRect={...u.rect,top:u.rect.top-l,bottom:u.rect.bottom-l})}}function GN(e,t){let n=s(h=>{let d=h.groupTitleRect;if(!(!d||typeof d.left!="number"||typeof d.right!="number"||typeof d.top!="number"||typeof d.bottom!="number"||!Number.isFinite(d.left)||!Number.isFinite(d.right)||!Number.isFinite(d.top)||!Number.isFinite(d.bottom)||d.right<=d.left||d.bottom<=d.top))return{left:d.left,right:d.right,top:d.top,bottom:d.bottom}},"validTitleRect"),i=s(h=>{if(!h.isGroup||h.parentId||h.direction!=="LR")return;let f=n(h),p=h.x,g=h.width;if(!f||typeof p!="number"||typeof g!="number"||!Number.isFinite(p)||!Number.isFinite(g)||g<=0)return;let m=f.right-f.left,y=f.bottom-f.top;if(!(m<=0||y<m))return{node:h,rect:f}},"leftLaneTitleFor"),a=s((h,d)=>{if(!h.vertical)return!1;let f=h.a.x;return f<=d.left+Mt||f>=d.right-Mt?!1:ss(h.a.y,h.b.y,d.top,d.bottom)>=Oi},"verticalSegmentIntersectsTitle"),o=s((h,d)=>{if(!h.horizontal)return!1;let f=h.a.y;return f<=d.top+Mt||f>=d.bottom-Mt?!1:ss(h.a.x,h.b.x,d.left,d.right)>=Oi},"horizontalSegmentIntersectsTitle"),l=[...t.values()].map(i).filter(h=>!!h);if(l.length===0)return;let u=0;for(let h of e){if(h.isLayoutOnly)continue;let d=Dr(h.points??[]);for(let f of _r(d))for(let p of l)if(a(f,p.rect))u=Math.max(u,p.rect.right-f.a.x+4);else if(o(f,p.rect)){let g=Math.min(f.a.x,f.b.x);u=Math.max(u,p.rect.right-g+4)}}if(!(u<=Mt))for(let h of l){let d=h.node.x,f=h.node.width;typeof d!="number"||typeof f!="number"||!Number.isFinite(d)||!Number.isFinite(f)||f<=0||(h.node.x=d-u/2,h.node.width=f+u,h.node.groupTitleRect={...h.rect,left:h.rect.left-u,right:h.rect.right-u})}}function moe(e,t){let{realNodeRects:i}=Tl(t.values()),a=e.filter(y=>!y.isLayoutOnly),o=s((y,x=new Map)=>Dr(x.get(y)??y.points??[]),"replacementPointsFor"),l=s((y=new Map)=>{let x=0;for(let T=0;T<a.length;T++){let C=_r(o(a[T],y));for(let k=T+1;k<a.length;k++){let E=_r(o(a[k],y));for(let v of C)for(let S of E)vo(v.a,v.b,S.a,S.b,Mt)&&x++}}return x},"crossingCount"),u=s((y=new Map)=>a.reduce((x,T)=>x+Vs(o(T,y)),0),"totalBends"),h=s(y=>{let x=o(y);if(x.length<4)return;let T=x[x.length-2],C=x[x.length-1];if(!(!Mn(T,C,Mt)&&!On(T,C,Mt)))return{tailStart:T,terminal:C}},"terminalTailFor"),d=s((y,x)=>{let T=o(y);if(T.length<3)return;let C=T[0],k=T[1],E;if(Mn(C,k,Mt))E={x:k.x,y:x.tailStart.y};else if(On(C,k,Mt))E={x:x.tailStart.x,y:k.y};else return;let v=za(Dr([C,k,E,x.tailStart,x.terminal]));return _r(v).length===v.length-1?v:void 0},"candidateWithDestinationTail"),f=s((y,x)=>{let T=[y.start,y.end].filter(C=>!!C);for(let C of _r(x))if(xn(C.a,C.b,i,T,-2))return!0;return!1},"pathHasNodeHit"),p=s((y,x,T)=>{for(let C of a)if(C!==y){for(let k of _r(x))for(let E of _r(o(C,T)))if(So(k,E,.5)>=Oi)return!0}return!1},"pathHasSharedTrack"),g=s((y,x,T)=>!f(y,x)&&!p(y,x,T),"candidateIsSafe"),m=s(()=>{let y=new Map;for(let x of a){let T=x.end;if(!T||!t.has(T)||o(x).length<4)continue;let k=y.get(T)??[];k.push(x),y.set(T,k)}return y},"edgesByDestination");for(let y=0;y<4;y++){let x=l();if(x===0)return;let T=u(),C,k=x,E=T;for(let v of m().values())for(let S=0;S<v.length;S++)for(let w=S+1;w<v.length;w++){let L=v[S],O=v[w],F=h(L),N=h(O);if(!F||!N)continue;let G=d(L,N),A=d(O,F);if(!G||!A)continue;let M=new Map([[L,G],[O,A]]);if(!g(L,G,M)||!g(O,A,M))continue;let I=l(M),P=u(M);I>=x||I>k||I===k&&P>=E||(C=M,k=I,E=P)}if(!C)return;for(let[v,S]of C)v.points=S}}function goe(e,t){let{realNodeRects:o,labelNodeRects:l}=Tl(t.values()),u=e.filter(v=>!v.isLayoutOnly),h=s((v,S=new Map)=>Dr(S.get(v)??v.points??[]),"replacementPointsFor"),d=s((v=new Map)=>{let S=0;for(let w=0;w<u.length;w++){let L=_r(h(u[w],v));for(let O=w+1;O<u.length;O++){let F=_r(h(u[O],v));for(let N of L)for(let G of F)vo(N.a,N.b,G.a,G.b,Mt)&&S++}}return S},"strictCrossingCount"),f=s((v=new Map)=>u.reduce((S,w)=>S+Vs(h(w,v)),0),"totalBends"),p=s(v=>{let S=v.start,w=v.end,L=S?t.get(S):void 0,O=w?t.get(w):void 0,F=L?Mi(L):void 0,N=O?Mi(O):void 0;return F&&N?{src:F,dst:N}:void 0},"endpointRectsFor"),g=s((v,S,w)=>{if(w.index<=0||w.index+1>=S.length-1)return;let L=p(v);if(L){if(w.vertical){let O=w.a.x,F=Math.min(L.src.left,L.dst.left),N=Math.max(L.src.right,L.dst.right),G=O<F-Mt?"left":O>N+Mt?"right":void 0;return G?{edge:v,points:S,segmentIndex:w.index,axis:"vertical",side:G,coord:O,min:Math.min(w.a.y,w.b.y),max:Math.max(w.a.y,w.b.y)}:void 0}if(w.horizontal){let O=w.a.y,F=Math.min(L.src.top,L.dst.top),N=Math.max(L.src.bottom,L.dst.bottom),G=O<F-Mt?"top":O>N+Mt?"bottom":void 0;return G?{edge:v,points:S,segmentIndex:w.index,axis:"horizontal",side:G,coord:O,min:Math.min(w.a.x,w.b.x),max:Math.max(w.a.x,w.b.x)}:void 0}}},"externalRailForSegment"),m=s(()=>{let v=[];for(let S of u){let w=h(S);for(let L of _r(w)){let O=g(S,w,L);O&&v.push(O)}}return v},"collectExternalRails"),y=s((v,S)=>v.edge!==S.edge&&v.axis===S.axis&&v.side===S.side&&ss(v.min,v.max,S.min,S.max)>=Oi,"railsInteract"),x=s(v=>{let S=[],w=new Set;for(let L of v){if(w.has(L))continue;let O=[L],F=[];for(w.add(L);O.length>0;){let N=O.pop();F.push(N);for(let G of v)!w.has(G)&&y(N,G)&&(w.add(G),O.push(G))}F.length>1&&S.push(F)}return S},"connectedComponents"),T=s(v=>{let S=[];for(let w of v)S.some(L=>Math.abs(L-w.coord)<Mt)||S.push(w.coord);for(;S.length<v.length;){let w=Math.min(...S),L=Math.max(...S),O=v[0].side;S.push(O==="left"||O==="top"?w-12*(v.length-S.length):L+12*(v.length-S.length))}return S},"uniqueCoordsFor"),C=s(v=>{let S=v.map(O=>O.coord),w=T(v),L=[];if(v.length<=6){let O=new Array(w.length).fill(!1),F=[],N=s(()=>{if(F.length===v.length){F.some((G,A)=>Math.abs(G-S[A])>=Mt)&&L.push([...F]);return}for(let[G,A]of w.entries())O[G]||(O[G]=!0,F.push(A),N(),F.pop(),O[G]=!1)},"visit");return N(),L}for(let O=0;O<S.length;O++)for(let F=O+1;F<S.length;F++){let N=[...S];[N[O],N[F]]=[N[F],N[O]],L.push(N)}return L},"coordinateAssignmentsFor"),k=s((v,S)=>{let w=new Map;for(let[O,F]of v.entries()){let N=S[O],G=w.get(F.edge)??F.points.map(A=>({x:A.x,y:A.y}));F.axis==="vertical"?(G[F.segmentIndex].x=N,G[F.segmentIndex+1].x=N):(G[F.segmentIndex].y=N,G[F.segmentIndex+1].y=N),w.set(F.edge,G)}let L=new Map;for(let[O,F]of w){let N=za(Dr(F));if(_r(N).length!==N.length-1)return;L.set(O,N)}return L},"replacementsForAssignment"),E=s(v=>{for(let[S,w]of v){let L=[S.start,S.end].filter(O=>!!O);for(let O of _r(w))if(xn(O.a,O.b,o,L,-2)||xn(O.a,O.b,l,[],-2))return!1}for(let S=0;S<u.length;S++){let w=u[S],L=v.has(w),O=_r(h(w,v));for(let F=S+1;F<u.length;F++){let N=u[F];if(!L&&!v.has(N))continue;let G=_r(h(N,v));for(let A of O)for(let M of G)if(So(A,M,.5)>=Oi)return!1}}return!0},"candidateIsSafe");for(let v=0;v<4;v++){let S=d();if(S===0)return;let w,L=S,O=f(),F=Number.POSITIVE_INFINITY;for(let N of x(m()))for(let G of C(N)){let A=k(N,G);if(!A||!E(A))continue;let M=d(A);if(M>=S)continue;let I=f(A),P=N.reduce((B,D,$)=>B+Math.abs(G[$]-D.coord),0);M>L||M===L&&(I>O||I===O&&P>=F)||(w=A,L=M,O=I,F=P)}if(!w)return;for(let[N,G]of w)N.points=G}}function yoe(e,t){let{realNodeRects:i,labelNodeRects:a}=Tl(t.values()),o=e.filter(m=>!m.isLayoutOnly),l=s((m,y,x)=>Dr(m===y?x??[]:m.points??[]),"pointsFor"),u=s(m=>_r(m).reduce((y,x)=>{let T=x.a.x-x.b.x,C=x.a.y-x.b.y;return y+Math.hypot(T,C)},0),"pathLength"),h=s((m,y)=>{let x=0;for(let T=0;T<o.length;T++){let C=_r(l(o[T],m,y));for(let k=T+1;k<o.length;k++){let E=_r(l(o[k],m,y));for(let v of C)for(let S of E)vo(v.a,v.b,S.a,S.b,Mt)&&x++}}return x},"strictCrossingCount"),d=s((m,y)=>{if(m.horizontal){let x=m.a.y;return(Math.abs(x-y.top)<1||Math.abs(x-y.bottom)<1)&&ss(m.a.x,m.b.x,y.left,y.right)>=Oi}if(m.vertical){let x=m.a.x;return(Math.abs(x-y.left)<1||Math.abs(x-y.right)<1)&&ss(m.a.y,m.b.y,y.top,y.bottom)>=Oi}return!1},"segmentRunsAlongRectBorder"),f=s(m=>{let y=[m.start,m.end].filter(T=>!!T),x=[];for(let T of y){let C=t.get(T),k=C?Mi(C):void 0;k&&x.push(k)}return x},"endpointRectsFor"),p=s((m,y)=>{if(y+3>=m.length)return[];let x=m[y],T=m[y+1],C=m[y+2],k=m[y+3],E=Mn(x,T,Mt)&&On(T,C,Mt)&&Mn(C,k,Mt),v=On(x,T,Mt)&&Mn(T,C,Mt)&&On(C,k,Mt);if(!E&&!v)return[];if(!(E?Math.sign(T.x-x.x)!==Math.sign(k.x-C.x):Math.sign(T.y-x.y)!==Math.sign(k.y-C.y)))return[];let w=Lr(x,k,Mt)||Nr(x,k,Mt)?[]:[{x:x.x,y:k.y},{x:k.x,y:x.y}],L=w.length===0?[[...m.slice(0,y+1),...m.slice(y+3)]]:w.map(F=>[...m.slice(0,y+1),F,...m.slice(y+3)]),O=new Set;return L.map(F=>za(Dr(F))).filter(F=>{if(_r(F).length!==F.length-1||!F.some(G=>zs(G,k,Mt)))return!1;let N=F.map(G=>`${G.x.toFixed(3)},${G.y.toFixed(3)}`).join("|");return O.has(N)?!1:(O.add(N),!0)})},"shortcutCandidatesAt"),g=s((m,y,x)=>{let T=[m.start,m.end].filter(k=>!!k),C=f(m);for(let k of _r(y))if(xn(k.a,k.b,i,T,-2)||xn(k.a,k.b,a,[],-2)||C.some(E=>d(k,E)))return!1;for(let k of o)if(k!==m){for(let E of _r(y))for(let v of _r(l(k)))if(So(E,v,.5)>=Oi)return!1}return h(m,y)<=x},"candidateIsSafe");for(let m=0;m<8;m++){let y=h(),x,T,C=y,k=Number.POSITIVE_INFINITY,E=Number.POSITIVE_INFINITY;for(let v of o){let S=l(v),w=Vs(S,Mt),L=u(S);for(let O=0;O<=S.length-4;O++)for(let F of p(S,O)){let N=Vs(F,Mt),G=u(F);if(!(N<w||N===w&&G<L-Mt)||!g(v,F,y))continue;let M=h(v,F);M>C||M===C&&(N>k||N===k&&G>=E)||(x=v,T=F,C=M,k=N,E=G)}}if(!x||!T)return;x.points=T}}function xoe(e,t){let o=[];for(let Te of t.values()){if(Te.isGroup||Te.isEdgeLabel)continue;let Ne=Te.x??0,Pe=Te.y??0,Re=Mi(Te);Re&&o.push({id:String(Te.id??""),cx:Ne,cy:Pe,rect:Re})}if(o.length===0)return;let l=new Map(o.map(Te=>[Te.id,Te])),u=o.map(Te=>({id:Te.id,rect:Te.rect})),h=["top","bottom","left","right"],d={top:Math.min(...o.map(Te=>Te.rect.top))-20,bottom:Math.max(...o.map(Te=>Te.rect.bottom))+20,left:Math.min(...o.map(Te=>Te.rect.left))-20,right:Math.max(...o.map(Te=>Te.rect.right))+20},f=e.filter(Te=>!Te.isLayoutOnly),p=new Map(f.map((Te,Ne)=>[Te,Ne])),g=s(Te=>{let Ne=Te==="left"||Te==="top"?-1:1,Pe=[];for(let Re=0;Re<=2;Re++)Pe.push(d[Te]+Ne*20*Re);return Pe},"outwardTracksForSide"),m=s((Te,Ne=new Map)=>Dr(Ne.get(Te)??Te.points??[]),"replacementPointsFor"),y=s((Te,Ne)=>{let Pe=0;for(let Re of Te)for(let X of Ne)vo(Re.a,Re.b,X.a,X.b,Mt)&&Pe++;return Pe},"crossingCountBetweenSegments"),x=s((Te,Ne)=>y(_r(Te),_r(Ne)),"crossingCountBetweenPaths"),T=s((Te=new Map)=>{let Ne=0,Pe=[],Re=new Set,X=[],re=s(te=>{Re.has(te)||(Re.add(te),X.push(te))},"addEdge");for(let te=0;te<f.length;te++){let ie=f[te],ue=m(ie,Te);for(let Q=te+1;Q<f.length;Q++){let R=f[Q],V=x(ue,m(R,Te));V>0&&(Ne+=V,Pe.push({first:ie,second:R,count:V}),re(ie),re(R))}}return X.sort((te,ie)=>(p.get(te)??0)-(p.get(ie)??0)),{count:Ne,pairs:Pe,edgeSet:Re,edges:X}},"crossingSnapshot"),C=s((Te,Ne)=>{let Pe=new Set(Ne.keys());if(Pe.size===0)return Te.count;let Re=0;for(let re of Te.pairs)(Pe.has(re.first)||Pe.has(re.second))&&(Re+=re.count);let X=0;for(let re=0;re<f.length;re++){let te=f[re],ie=Pe.has(te),ue=m(te,Ne);for(let Q=re+1;Q<f.length;Q++){let R=f[Q];!ie&&!Pe.has(R)||(X+=x(ue,m(R,Ne)))}}return Te.count-Re+X},"crossingCountWithReplacements"),k=s(Te=>{let Ne=new Map;for(let X of Te.pairs){let re=Ne.get(X.first)??new Set;re.add(X.second),Ne.set(X.first,re);let te=Ne.get(X.second)??new Set;te.add(X.first),Ne.set(X.second,te)}let Pe=[],Re=new Set;for(let X of Te.edges){if(Re.has(X))continue;let re=[X],te=[];for(Re.add(X);re.length>0;){let ie=re.pop();te.push(ie);for(let ue of Ne.get(ie)??[])Re.has(ue)||(Re.add(ue),re.push(ue))}te.sort((ie,ue)=>(p.get(ie)??0)-(p.get(ue)??0)),te.length>1&&Pe.push(te)}return Pe},"crossingComponents"),E=s(Te=>[Te.start,Te.end].filter(Ne=>!!Ne),"endpointIdsFor"),v=s(Te=>{let Ne=[];for(let Pe of k(Te)){let Re=new Set(Pe),X=new Set(Pe.flatMap(te=>E(te))),re=[...Pe];for(let te of f)Re.has(te)||E(te).some(ie=>X.has(ie))&&re.push(te);re.sort((te,ie)=>(p.get(te)??0)-(p.get(ie)??0)),Ne.push(re)}return Ne},"pairSearchGroups"),S=s((Te,Ne,Pe)=>C(Te,new Map([[Ne,Pe]])),"crossingCountWithSingleReplacement"),w=s(Te=>{let Ne=new Map;for(let Pe of Te.pairs)Ne.set(Pe.first,(Ne.get(Pe.first)??0)+Pe.count),Ne.set(Pe.second,(Ne.get(Pe.second)??0)+Pe.count);return Ne},"currentCrossingsByEdge"),L=s(Te=>Te.slice(1).reduce((Ne,Pe,Re)=>{let X=Te[Re];return Ne+Math.abs(Pe.x-X.x)+Math.abs(Pe.y-X.y)},0),"pathLength"),O=s((Te=new Map)=>f.reduce((Ne,Pe)=>Ne+Vs(m(Pe,Te)),0),"totalBends"),F=s((Te=new Map)=>f.reduce((Ne,Pe)=>Ne+L(m(Pe,Te)),0),"totalLength"),N=s((Te,Ne,Pe=new Map)=>{let Re=_r(Ne);for(let X of f)if(X!==Te){for(let re of Re)for(let te of _r(m(X,Pe)))if(So(re,te,.5)>=Oi)return!0}return!1},"pathHasSegmentConflict"),G=s((Te,Ne)=>{let Pe=[Te.start,Te.end].filter(Re=>!!Re);for(let Re of _r(Ne))if(xn(Re.a,Re.b,u,Pe,-2))return!0;return!1},"pathHitsNode"),A=s((Te,Ne)=>{let Pe=za(Dr(Ne));_r(Pe).length===Pe.length-1&&Te.push(Pe)},"pushOrthogonalCandidate"),M=s(Te=>Te==="left"||Te==="right","sideIsHorizontal"),I=s((Te,Ne,Pe)=>{switch(Ne){case"left":return Math.min(Te.x,Pe.x)-20;case"right":return Math.max(Te.x,Pe.x)+20;case"top":return Math.min(Te.y,Pe.y)-20;case"bottom":return Math.max(Te.y,Pe.y)+20}},"localTrackForSameSide"),P=s((Te,Ne,Pe,Re)=>{let X=Pe==="left"||Pe==="top"?-1:1,re=[I(Ne,Pe,Re),d[Pe]];for(let te of re)for(let ie=0;ie<=2;ie++)A(Te,ES(Ne,Pe,Re,te+X*20*ie))},"addSameSideCandidates"),B=s((Te,Ne,Pe,Re,X)=>{for(let re of g(Pe))for(let te of g(X))A(Te,[Ne,{x:re,y:Ne.y},{x:re,y:te},{x:Re.x,y:te},Re])},"addHorizontalToVerticalCandidates"),D=s((Te,Ne,Pe,Re,X)=>{for(let re of g(Pe))for(let te of g(X))A(Te,[Ne,{x:Ne.x,y:re},{x:te,y:re},{x:te,y:Re.y},Re])},"addVerticalToHorizontalCandidates"),$=s((Te,Ne,Pe,Re,X)=>{let re=[...g("top"),...g("bottom")];for(let te of g(Pe))for(let ie of g(X))for(let ue of re)A(Te,[Ne,{x:te,y:Ne.y},{x:te,y:ue},{x:ie,y:ue},{x:ie,y:Re.y},Re])},"addHorizontalPairCandidates"),W=s((Te,Ne,Pe,Re,X)=>{let re=[...g("left"),...g("right")];for(let te of g(Pe))for(let ie of g(X))for(let ue of re)A(Te,[Ne,{x:Ne.x,y:te},{x:ue,y:te},{x:ue,y:ie},{x:Re.x,y:ie},Re])},"addVerticalPairCandidates"),q=s(Te=>{let Ne=new Set;return Te.map(Pe=>Dr(Pe)).filter(Pe=>{let Re=Pe.map(X=>`${X.x.toFixed(3)},${X.y.toFixed(3)}`).join("|");return Ne.has(Re)||Pe.length<2?!1:(Ne.add(Re),!0)})},"dedupeCandidatePaths"),z=s((Te,Ne,Pe,Re)=>{let X=[],re=vS(Te,Ne,Pe,Re,20,Mt);re&&A(X,re),Ne===Re&&P(X,Te,Ne,Pe);let te=M(Ne),ie=M(Re);return te&&!ie?B(X,Te,Ne,Pe,Re):!te&&ie?D(X,Te,Ne,Pe,Re):te?$(X,Te,Ne,Pe,Re):W(X,Te,Ne,Pe,Re),q(X)},"buildCandidatesForSides"),j=s((Te,Ne,Pe,Re)=>{let X=[...g("left"),...g("right")],re=[...g("top"),...g("bottom")];for(let te of h){let ie=oh(Re,te),ue=te==="top"||te==="bottom"?g(te):re;for(let Q of X){A(Te,[Ne,Pe,{x:Q,y:Pe.y},{x:Q,y:ie.y},ie]);for(let R of ue)A(Te,[Ne,Pe,{x:Q,y:Pe.y},{x:Q,y:R},{x:ie.x,y:R},ie])}}},"addVerticalDepartureOuterTrackCandidates"),J=s((Te,Ne,Pe,Re)=>{let X=[...g("left"),...g("right")],re=[...g("top"),...g("bottom")];for(let te of h){let ie=oh(Re,te),ue=te==="left"||te==="right"?g(te):X;for(let Q of re){A(Te,[Ne,Pe,{x:Pe.x,y:Q},{x:ie.x,y:Q},ie]);for(let R of ue)A(Te,[Ne,Pe,{x:Pe.x,y:Q},{x:R,y:Q},{x:R,y:ie.y},ie])}}},"addHorizontalDepartureOuterTrackCandidates"),ee=s(Te=>{let Ne=Te.start,Pe=Te.end,Re=Pe?l.get(Pe):void 0;if(!Ne||!Re)return[];let X=Dr(Te.points??[]);if(X.length<4)return[];let re=X[0],te=X[1],ie=[];return On(re,te,Mt)?j(ie,re,te,Re):Mn(re,te,Mt)&&J(ie,re,te,Re),ie},"terminalPreservingOuterTrackCandidates"),le=s(Te=>{let Ne=Te.start,Pe=Te.end,Re=Ne?l.get(Ne):void 0,X=Pe?l.get(Pe):void 0;if(!Re||!X)return[];let re=[];for(let te of h){let ie=oh(Re,te);for(let ue of h)re.push(...z(ie,te,oh(X,ue),ue))}return re.push(...ee(Te)),re},"candidatePathsFor"),se=s(()=>new Map(f.map(Te=>[Te,_r(m(Te))])),"currentSegmentsByEdge"),Ce=s((Te,Ne,Pe)=>{let Re=new Set;for(let X of f){if(X===Te)continue;let re=Pe.get(X)??_r(m(X));Ne.some(te=>re.some(ie=>So(te,ie,.5)>=Oi))&&Re.add(X)}return Re},"sharedTrackConflictsFor"),ce=s((Te,Ne,Pe,Re)=>{let X=new Set;return le(Te).map(te=>za(Dr(te))).filter(te=>{if(G(Te,te))return!1;let ie=te.map(ue=>`${ue.x.toFixed(3)},${ue.y.toFixed(3)}`).join("|");return X.has(ie)||te.length<2?!1:(X.add(ie),!0)}).map(te=>{let ie=_r(te),ue=0;for(let Q of f)Q!==Te&&(ue+=y(ie,Pe.get(Q)??_r(m(Q))));return{candidate:te,candidateSegments:ie,crossings:Ne.count-(Re.get(Te)??0)+ue,bends:Vs(te,Mt),totalBends:Vs(te),length:L(te)}}).filter(({crossings:te})=>te<=Ne.count).sort((te,ie)=>te.crossings-ie.crossings||te.bends-ie.bends||te.length-ie.length).slice(0,48).map(te=>({path:te.candidate,segments:te.candidateSegments,sharedTrackConflicts:Ce(Te,te.candidateSegments,Pe),totalBends:te.totalBends,length:te.length}))},"pairCandidatesFor"),_e=s((Te,Ne,Pe,Re,X,re)=>{let te=0;for(let ue of Te.pairs)(ue.first===Ne||ue.second===Ne||ue.first===Re||ue.second===Re)&&(te+=ue.count);let ie=y(Pe.segments,X.segments);for(let ue of f){if(ue===Ne||ue===Re)continue;let Q=re.get(ue)??_r(m(ue));ie+=y(Pe.segments,Q)+y(X.segments,Q)}return Te.count-te+ie},"pairCrossingCount"),me=s((Te,Ne)=>{for(let Pe of Te.sharedTrackConflicts)if(Pe!==Ne)return!1;return!0},"conflictsOnlyWith"),ge=s((Te,Ne)=>Te.segments.some(Pe=>Ne.segments.some(Re=>So(Pe,Re,.5)>=Oi)),"candidatesShareTrack"),Be=s((Te,Ne,Pe,Re)=>me(Ne,Pe.edge)&&me(Re,Te.edge)&&!ge(Ne,Re),"pairCandidatesAreCompatible"),$e=s((Te,Ne,Pe,Re,X)=>{let re=_e(Te.current,Ne.edge,Pe,Re.edge,X,Te.baseSegments);if(!(re>=Te.current.count))return{replacements:new Map([[Ne.edge,Pe.path],[Re.edge,X.path]]),crossings:re,bends:Te.currentBends-(Te.baseBendsByEdge.get(Ne.edge)??0)-(Te.baseBendsByEdge.get(Re.edge)??0)+Pe.totalBends+X.totalBends,length:Te.currentLength-(Te.baseLengthByEdge.get(Ne.edge)??0)-(Te.baseLengthByEdge.get(Re.edge)??0)+Pe.length+X.length}},"scorePairReplacement"),Ie=s((Te,Ne)=>Te.crossings<Ne.crossings||Te.crossings===Ne.crossings&&(Te.bends<Ne.bends||Te.bends===Ne.bends&&Te.length<Ne.length),"pairScoreIsBetter"),nt=s((Te,Ne,Pe,Re)=>{let X=Re;for(let re of Ne.candidates)for(let te of Pe.candidates){if(!Be(Ne,re,Pe,te))continue;let ie=$e(Te,Ne,re,Pe,te);ie&&Ie(ie,X)&&(X=ie)}return X},"bestScoreForOptionPair"),lt=s(Te=>{let Ne=O(),Pe=F(),Re=se(),X=w(Te),re=new Map(f.map(V=>[V,Vs(m(V))])),te=new Map(f.map(V=>[V,L(m(V))])),ie=new Map,ue=v(Te);for(let V of ue)for(let ae of V){if(ie.has(ae))continue;let K=ce(ae,Te,Re,X);K.length>0&&ie.set(ae,{edge:ae,candidates:K})}let Q={replacements:new Map,crossings:Te.count,bends:Ne,length:Pe},R={current:Te,currentBends:Ne,currentLength:Pe,baseBendsByEdge:re,baseLengthByEdge:te,baseSegments:Re};for(let V of ue){let ae=new Set(V.filter(ye=>Te.edgeSet.has(ye))),K=V.map(ye=>ie.get(ye)).filter(ye=>!!ye);for(let ye=0;ye<K.length;ye++){let Z=K[ye];for(let H=ye+1;H<K.length;H++){let U=K[H];!ae.has(Z.edge)&&!ae.has(U.edge)||(Q=nt(R,Z,U,Q))}}}return Q.replacements.size>0?Q.replacements:void 0},"bestPairedReplacement");for(let Te=0;Te<4;Te++){let Ne=T(),Pe=Ne.count;if(Pe===0)return;let Re,X,re=Pe,te=Number.POSITIVE_INFINITY;for(let ue of Ne.edges){let Q=Vs(m(ue),Mt);for(let R of le(ue)){let V=G(ue,R),ae=!V&&N(ue,R),K=S(Ne,ue,R),ye=Vs(R,Mt);V||ae||!(K<Pe||K===Pe&&ye<Q)||K>re||K===re&&ye>=te||(Re=ue,X=R,re=K,te=ye)}}if(Re&&X){Re.points=X;continue}let ie=lt(Ne);if(!ie)return;for(let[ue,Q]of ie)ue.points=Q}}var Mt,Oi,_r,$N,boe=_(()=>{"use strict";Eo();Mt=.001,Oi=8,_r=ah,$N=s((e,t)=>Lr(e,t,Mt)||Nr(e,t,Mt),"orthogonallyAligned");s(foe,"separateSharedRenderedTerminalLanes");s(poe,"collapseRedundantRectangularDoglegs");s(BN,"liftObstacleHuggingSameSideRails");s(FN,"liftTopLaneTitleBandsAboveRails");s(GN,"shiftLeftLaneTitleBandsLeftOfRails");s(moe,"swapDestinationTerminalTailsToReduceCrossings");s(goe,"reassignCrossingExternalRailChannels");s(yoe,"shortcutRedundantOrthogonalJogs");s(xoe,"resolveRenderedOrthogonalCrossings")});function Toe(e,t){let{nodeInfoById:r,realNodeRects:n}=Zm(t),i=["top","bottom","left","right"],a=20,o={top:Math.min(...n.map(y=>y.rect.top))-a,bottom:Math.max(...n.map(y=>y.rect.bottom))+a,left:Math.min(...n.map(y=>y.rect.left))-a,right:Math.max(...n.map(y=>y.rect.right))+a},l=s((y,x,T,C)=>{let k=[],E=vS(y,x,T,C,a,lh);return E&&k.push(E),x===C&&k.push(ES(y,x,T,o[x])),k},"buildOrthogonalPathCandidates"),u=s((y,x)=>{for(let T=0;T<y.length-1;T++){let C=y[T],k=y[T+1];if(xn(C,k,n,x,1))return!0}return!1},"pathHitsNode"),h=s((y,x,T=!1)=>{let C=0,k=ah(y,lh),E=x.start,v=x.end;for(let S of e){if(S===x||S.isLayoutOnly)continue;let w=S.start,L=S.end;if(!T&&E&&v&&(w===E||w===v||L===E||L===v))continue;let O=S.points;if(!(!O||O.length<2))for(let F of k)for(let N of ah(O,lh)){if(DN(F.a,F.b,N.a,N.b,lh,lh)){C++;continue}So(F,N,lh)>=IWe&&C++}}return C},"pathConflictCount"),d=4,f=s((y,x)=>{let T=Math.abs(y.y-x.rect.top),C=Math.abs(y.y-x.rect.bottom),k=Math.abs(y.x-x.rect.left),E=Math.abs(y.x-x.rect.right),v="top",S=T;return C<S&&(v="bottom",S=C),k<S&&(v="left",S=k),E<S&&(v="right",S=E),v},"nearestSideOfRect"),p=new Map,g=s((y,x,T)=>{let C=p.get(y)??[];C.push({side:x,edgeId:T}),p.set(y,C)},"addFaceClaim");for(let y of e){if(y.isLayoutOnly)continue;let x=y.points??[];if(x.length<1)continue;let T=y.id??"",C=y.start,k=y.end;if(C){let E=r.get(C);E&&g(C,f(x[0],E),T)}if(k){let E=r.get(k);E&&g(k,f(x[x.length-1],E),T)}}let m=s((y,x,T)=>p.get(y)?.some(C=>C.edgeId!==T&&C.side===x)??!1,"faceIsClaimed");for(let y of e){if(y.isLayoutOnly)continue;let x=y.points;if(!x||x.length<2)continue;let T=Vs(x,lh);if(T<d)continue;let C=y.start,k=y.end;if(!C||!k)continue;let E=r.get(C),v=r.get(k);if(!E||!v)continue;let S=y.id??"",w=h(x,y,!0),L=h(x,y),O,F=w,N=T;for(let G of i){if(m(C,G,S))continue;let A=oh(E,G);for(let M of i){if(m(k,M,S))continue;let I=oh(v,M);for(let P of l(A,G,I,M)){if(u(P,[C,k]))continue;let B=Vs(P,lh);if(w>0){let D=h(P,y,!0);if(D>F||D===F&&B>=N)continue;F=D,N=B,O=P;continue}h(P,y)>L||B<N&&(N=B,O=P)}}}if(O){y.points=O;let G=p.get(C);G&&p.set(C,G.filter(M=>M.edgeId!==S));let A=p.get(k);A&&p.set(k,A.filter(M=>M.edgeId!==S)),g(C,f(O[0],E),S),g(k,f(O[O.length-1],v),S)}}}var lh,IWe,Coe=_(()=>{"use strict";Eo();lh=.001,IWe=8;s(Toe,"simplifyDetouredEdges")});function Soe(e,t){let r=t?0:e.length-1,n=t?1:-1,i=e[r],a=e[r+n];if(!i||!a)return;let o=a.x-i.x,l=a.y-i.y;if(!(Math.abs(o)+Math.abs(l)<Ws)){if(Math.abs(l)<=Ws){let h=i.x+Math.sign(o)*koe;return{left:Math.min(i.x,h),right:Math.max(i.x,h),top:i.y-RS,bottom:i.y+RS}}if(Math.abs(o)<=Ws){let h=i.y+Math.sign(l)*koe;return{left:i.x-RS,right:i.x+RS,top:Math.min(i.y,h),bottom:Math.max(i.y,h)}}return{left:Math.min(i.x,a.x),right:Math.max(i.x,a.x),top:Math.min(i.y,a.y),bottom:Math.max(i.y,a.y)}}}function NWe(e){return{left:Math.min(e.left,e.right),right:Math.max(e.left,e.right),top:Math.min(e.top,e.bottom),bottom:Math.max(e.top,e.bottom)}}function voe(e,t){let r=Dr(t),n=Soe(r,!0),i=Soe(r,!1);return[n,i].some(a=>a&&SS(e,NWe(a)))}function LS(e,t){let r=[];for(let m of e){if(m.isLayoutOnly)continue;let y=m.points;if(!(!y||y.length<2))for(let x=0;x<y.length-1;x++)r.push({edgeId:m.id,p1:y[x],p2:y[x+1]})}let n=[],i=[];for(let m of t.values()){let y=m.isGroup,x=m.parentId;if(y&&!x){let C=Mi(m);C&&i.push({id:m.id,rect:C});continue}if(y||m.isEdgeLabel)continue;let T=Mi(m);T&&n.push({nodeId:m.id,rect:T})}let a=3,o=1,l=12,u=s((m,y)=>{let x=LN(y,a);for(let{nodeId:T,rect:C}of n)if(T!==m&&SS(x,C))return!0;return!1},"labelOverlapsForeignNode"),h=s((m,y)=>{let x=LN(y,a);for(let T of r)if(T.edgeId!==m&&px(T.p1,T.p2,x))return!0;return!1},"labelOverlapsForeignEdge"),d=s((m,y,x)=>u(m,x)||h(y,x),"labelOverlapsAnything"),f=[],p=s(m=>{for(let{id:y,rect:x}of i)if(zae(x,m))return y},"findContainingLane"),g=s((m,y)=>f.some(x=>x.labelId!==m&&SS(y,x.rect)),"overlapsPlacedLabel");for(let m of e){if(m.isLayoutOnly)continue;let y=m.labelNodeId;if(!y)continue;let x=t.get(y);if(!x)continue;let T=m.points;if(!T||T.length<2)continue;let C=x.width??0,k=x.height??0;if(C<=0||k<=0)continue;let E=[];for(let q=0;q<T.length-1;q++){let z=T[q],j=T[q+1],J=Math.abs(z.x-j.x),ee=Math.abs(z.y-j.y);J<Ws&&ee<Ws||J>=Ws&&ee>=Ws||E.push({idx:q,length:J+ee,orientation:J>=Ws?"horizontal":"vertical",midX:(z.x+j.x)/2,midY:(z.y+j.y)/2})}if(E.length===0)continue;let v=E.length>=3?E.filter(q=>q.idx>0&&q.idx<E.length-1):E,S=v.length>0?v:E,w=C>=k?"horizontal":"vertical",L=s(q=>[...q].sort((z,j)=>{let J=z.orientation===w,ee=j.orientation===w;if(J!==ee)return J?-1:1;let le=z.length>=(z.orientation==="horizontal"?C:k)+2,se=j.length>=(j.orientation==="horizontal"?C:k)+2;return le!==se?le?-1:1:j.length-z.length}),"rankSegments"),O=E[0],F=E[E.length-1],N=[.5,.25,.75,.05,.95,.15,.85,.1,.9],G=s((q,z)=>{let j=T[q.idx],J=T[q.idx+1];return{midX:j.x+(J.x-j.x)*z,midY:j.y+(J.y-j.y)*z}},"anchorAtT"),A=s((q,z,j)=>Math.min(j,Math.max(z,q)),"clamp"),M=s((q,z)=>q.midX>=z.left-Ws&&q.midX<=z.right+Ws&&q.midY>=z.top-Ws&&q.midY<=z.bottom+Ws,"pointInsideRectInclusive"),I=s(q=>{let z=Qm(q.midX,q.midY,C,k),j=p(z);if(j)return{laneId:j,anchor:q,rect:z};let J=i.find(({rect:me})=>M(q,me));if(!J)return;let ee=J.rect.left+C/2+o,le=J.rect.right-C/2-o,se=J.rect.top+k/2+o,Ce=J.rect.bottom-k/2-o;if(ee>le||se>Ce)return;let ce={midX:A(q.midX,ee,le),midY:A(q.midY,se,Ce)},_e=Qm(ce.midX,ce.midY,C,k);return M(q,_e)?{laneId:J.id,anchor:ce,rect:_e}:void 0},"placementForAnchor"),P=s((q,z,j)=>q.orientation==="horizontal"?Math.abs(z.midX-j.x):Math.abs(z.midY-j.y),"distanceAlongSegment"),B=s((q,z)=>{let J=(q.orientation==="horizontal"?C/2:k/2)+l;if(q===O){let ee=T[q.idx];if(P(q,z,ee)+Ws<J)return!1}if(q===F){let ee=T[q.idx+1];if(P(q,z,ee)+Ws<J)return!1}return!0},"labelClearsTerminalEndpoints"),D=s(q=>{let z=L(q);for(let j of z)for(let J of N){let ee=G(j,J);if(!B(j,ee))continue;let le=I(ee);if(le&&!voe(le.rect,T)&&!g(y,le.rect)&&!d(y,m.id,le.rect))return{laneId:le.laneId,anchor:le.anchor}}},"tryPool"),$=s((q,z,j=!1)=>{let J=L(q);for(let ee of J){let le={midX:ee.midX,midY:ee.midY};if(z&&!B(ee,le))continue;let se=I(le);if(se&&!voe(se.rect,T)&&!g(y,se.rect)&&!u(y,se.rect)&&(j||!h(m.id,se.rect)))return{laneId:se.laneId,anchor:se.anchor}}},"findLaneContainingFallback"),W=D(S)??(S.length<E.length?D(E):void 0)??$(E,!0)??$(E,!1)??$(E,!1,!0);if(W){x.x=W.anchor.midX,x.y=W.anchor.midY,x.parentId=W.laneId;let q=Qm(W.anchor.midX,W.anchor.midY,C,k),z=f.findIndex(j=>j.labelId===y);z>=0?f[z]={labelId:y,rect:q}:f.push({labelId:y,rect:q})}}}var Ws,koe,RS,Eoe=_(()=>{"use strict";Eo();Ws=.001,koe=10,RS=7;s(Soe,"markerClearanceRectFor");s(NWe,"normalizeRect");s(voe,"labelOverlapsOwnMarker");s(LS,"anchorLabelsToPolyline")});function _oe(e,t){return e<t?`${e}::${t}`:`${t}::${e}`}function Aoe(e,t){let{nodeInfoById:r,realNodeRects:n}=Zm(t),i=new Map;for(let o of t){let l=o.id;if(!o.isGroup&&o.isEdgeLabel){i.set(l,{w:o.width??0,h:o.height??0});continue}}let a=s((o,l,u,h)=>{let d=_oe(l,u),f=0,p=s(g=>{if(!g)return;let m=i.get(g);if(!m)return;let y=h==="x"?m.w/2:m.h/2;y>f&&(f=y)},"consider");p(o.labelNodeId);for(let g of e){if(g===o||g.isLayoutOnly)continue;let m=g.start,y=g.end;!m||!y||_oe(m,y)===d&&p(g.labelNodeId)}return f>0?f+MWe:0},"labelClearanceFor");for(let o of e){if(o.isLayoutOnly)continue;let l=o.points;if(!CS(l,zN))continue;let u=wS(o,r,zN);if(!u)continue;let{srcId:h,dstId:d,srcInfo:f,dstInfo:p,collinearX:g,collinearY:m}=u;if(g===m)continue;let y,x;if(g){let v=p.cy>f.cy;y={x:f.cx,y:v?f.rect.bottom:f.rect.top},x={x:p.cx,y:v?p.rect.top:p.rect.bottom}}else{let v=p.cx>f.cx;y={x:v?f.rect.right:f.rect.left,y:f.cy},x={x:v?p.rect.left:p.rect.right,y:p.cy}}if(xn(y,x,n,[h,d],1))continue;let C=a(o,h,d,g?"x":"y"),k=C>woe?C:woe,E=[0,k,-k];for(let v of E){let S={...y},w={...x};if(g){if(S.x+=v,w.x+=v,S.x<=f.rect.left||S.x>=f.rect.right||w.x<=p.rect.left||w.x>=p.rect.right)continue}else if(S.y+=v,w.y+=v,S.y<=f.rect.top||S.y>=f.rect.bottom||w.y<=p.rect.top||w.y>=p.rect.bottom)continue;if(!xn(S,w,n,[h,d],1)&&!mx(S,w,e,o,{epsilon:zN})){o.points=[S,w];break}}}}var zN,PWe,woe,MWe,Roe=_(()=>{"use strict";Eo();zN=1e-6,PWe=8,woe=PWe/2,MWe=3;s(_oe,"pairKey");s(Aoe,"straightenCollinearSiblingDetours")});function VN(e,t){let{realNodeRects:h,labelNodeRects:d}=Tl(t.values()),f=s((S,w)=>ah(w,.001).map(L=>({...L,edge:S,interior:L.index>=1&&L.index<=w.length-3})),"segmentsFor"),p=s(()=>{let S=[];for(let w of e){if(w.isLayoutOnly)continue;let L=w.points;!L||L.length<2||S.push(...f(w,Dr(L)))}return S},"allSegments"),g=s((S,w)=>S.horizontal&&w.horizontal?ss(S.a.x,S.b.x,w.a.x,w.b.x)>=8&&Math.abs(S.a.y-w.a.y)<7:S.vertical&&w.vertical?ss(S.a.y,S.b.y,w.a.y,w.b.y)>=8&&Math.abs(S.a.x-w.a.x)<7:!1,"hasCrowdedParallelTrack"),m=s((S,w)=>{let L=S.start,O=S.end,F=f(S,w);if(F.length!==w.length-1)return!1;let N=[L,O].filter(A=>!!A),G=S.labelNodeId?[S.labelNodeId]:[];for(let A of F)if(xn(A.a,A.b,h,N,-2)||xn(A.a,A.b,d,G,-2))return!1;for(let A of e){if(A===S||A.isLayoutOnly)continue;let M=A.points;if(!(!M||M.length<2)){for(let I of F)for(let P of f(A,Dr(M)))if(g(I,P)||vo(I.a,I.b,P.a,P.b,.001))return!1}}return!0},"candidateIsSafe"),y=s((S,w)=>{let L=Dr(S.edge.points??[]);if(L.length<4||S.index>=L.length-1)return;let O=L.map(F=>({...F}));if(S.horizontal)O[S.index].y+=w,O[S.index+1].y+=w;else if(S.vertical)O[S.index].x+=w,O[S.index+1].x+=w;else return;return f(S.edge,O).length===O.length-1?O:void 0},"shiftedCandidate"),x=s((S,w)=>({x:S.x??(w.left+w.right)/2,y:S.y??(w.top+w.bottom)/2}),"nodeCenter"),T=s(S=>{let w=S.edge,L=Dr(w.points??[]);if(L.length!==4||S.index!==1)return;let O=w.start?t.get(w.start):void 0,F=w.end?t.get(w.end):void 0,N=O?Mi(O):void 0,G=F?Mi(F):void 0,A=L.slice(S.index+2);if(!(!O||!F||!N||!G||A.length===0))return{sourceCenter:x(O,N),targetCenter:x(F,G),sourceRect:N,tail:A}},"sourceDetourContextFor"),C=s((S,w,L,O,F,N)=>{let G=O.y>=L.y,A=G?F.bottom:F.top,M=A+(G?20:-20);if(G&&S.b.y<=M+.001||!G&&S.b.y>=M-.001)return;let I=S.a.x+w;return Dr([{x:L.x,y:A},{x:L.x,y:M},{x:I,y:M},{x:I,y:S.b.y},...N],.001)},"verticalSourceDetour"),k=s((S,w,L,O,F,N)=>{let G=O.x>=L.x,A=G?F.right:F.left,M=A+(G?20:-20);if(G&&S.b.x<=M+.001||!G&&S.b.x>=M-.001)return;let I=S.a.y+w;return Dr([{x:A,y:L.y},{x:M,y:L.y},{x:M,y:I},{x:S.b.x,y:I},...N],.001)},"horizontalSourceDetour"),E=s((S,w)=>{let L=T(S);if(L){if(S.vertical)return C(S,w,L.sourceCenter,L.targetCenter,L.sourceRect,L.tail);if(S.horizontal)return k(S,w,L.sourceCenter,L.targetCenter,L.sourceRect,L.tail)}},"sourceDetourCandidate"),v=[-7,7,-14,14,-21,21];for(let S=0;S<12;S++){let w=p(),L=!1;for(let O=0;O<w.length&&!L;O++)for(let F=O+1;F<w.length&&!L;F++){let N=w[O],G=w[F];if(N.edge===G.edge||!g(N,G))continue;let A=[N,G].filter(M=>M.interior);for(let M of A){for(let I of v){let P=y(M,I);if(P&&m(M.edge,P)){M.edge.points=P,L=!0;break}let B=E(M,I);if(B&&m(M.edge,B)){M.edge.points=B,L=!0;break}}if(L)break}}if(!L)return}}var Loe=_(()=>{"use strict";Eo();s(VN,"nudgeSharedInteriorSubpaths")});function OWe(e,t,r,n){let i=t.x-e.x,a=t.y-e.y,o=n.x-r.x,l=n.y-r.y,u=i*l-a*o;if(Math.abs(u)<1e-10)return!1;let h=r.x-e.x,d=r.y-e.y,f=(h*l-d*o)/u,p=(h*a-d*i)/u,g=.01;return f>g&&f<1-g&&p>g&&p<1-g}function WN(e){let t=e.nodes??[],r=e.edges??[],n=[];if(!r.length||!t.length)return n;let i=Vae(t),a=1,o=[];for(let u of r){if(u.isLayoutOnly)continue;let h=u.points;if(!h||h.length<2)continue;let d=u.start,f=u.end,p=u.labelNodeId,g=u.id??`${d}->${f}`;for(let m of i)if(!(m.nodeId===d||m.nodeId===f)&&!(p&&m.nodeId===p)){for(let y=0;y<h.length-1;y++)if(px(h[y],h[y+1],m,-a)){n.push({type:"edge-node-overlap",edgeId:g,targetId:m.nodeId,detail:`segment ${y} passes through node "${m.nodeId}"`});break}}for(let m=0;m<h.length-1;m++)o.push({edgeId:g,start:d,end:f,p1:h[m],p2:h[m+1]})}let l=new Set;for(let u=0;u<o.length;u++)for(let h=u+1;h<o.length;h++){let d=o[u],f=o[h];if(d.edgeId!==f.edgeId&&!(d.start===f.start||d.start===f.end||d.end===f.start||d.end===f.end)&&OWe(d.p1,d.p2,f.p1,f.p2)){let p=d.edgeId<f.edgeId?`${d.edgeId}|${f.edgeId}`:`${f.edgeId}|${d.edgeId}`;l.has(p)||(l.add(p),n.push({type:"edge-edge-crossing",edgeId:d.edgeId,targetId:f.edgeId,detail:`edges "${d.edgeId}" and "${f.edgeId}" cross`}))}}if(n.length>0){let u=n.filter(d=>d.type==="edge-node-overlap").length,h=n.filter(d=>d.type==="edge-edge-crossing").length;Y.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${u} edge-node overlap(s), ${h} edge crossing(s)`);for(let d of n)Y.warn(`[SWIMLANE_VALIDATE] ${d.type}: ${d.detail}`)}return n}var Doe=_(()=>{"use strict";ft();Eo();s(OWe,"segmentsIntersect");s(WN,"validateSwimlanesLayout")});function Ioe(e,t){let r=e.nodes??[],n=e.edges??[],i=r.filter(l=>!l.isGroup);if((t==="LR"||t==="RL")&&i.length>0&&!ooe(e,t)||t==="BT"&&i.length>0&&!aoe(e))return;for(let l of n){if(l.isLayoutOnly)continue;let u=l.points;!u||u.length<2||(l.points=za(gx(u)))}Toe(n,r),Aoe(n,r),coe(n,r);let a=new Map;for(let l of r)a.set(String(l.id),l);LS(n,a),eoe(n,a),hoe(n,a),VN(n,a),foe(n,a),poe(n,a),BN(n,a),moe(n,a);let o=s(()=>{xoe(n,a),goe(n,a),yoe(n,a),LS(n,a),MN(n,a),BN(n,a),LS(n,a),MN(n,a)},"finalizeRenderedEdges");o(),VN(n,a),o(),FN(n,a),GN(n,a),FN(n,a),GN(n,a)}var Noe=_(()=>{"use strict";roe();Eo();loe();uoe();doe();boe();Coe();Eoe();Roe();Loe();Doe();s(Ioe,"postProcessSwimlaneLayout")});function qs(e){let t=new Map(e.nodeById),r=new Set,n=[];for(let a of e.edges){if(!t.has(a.src)||!t.has(a.dst))continue;let o=`${a.id}:${a.src}->${a.dst}`;r.has(o)||(r.add(o),n.push(a))}return{nodes:[...t.keys()],edges:n,layout:e.layout,nodeById:t}}function DS(e,t){return e.edges.filter(r=>r.dst===t)}function $We(e){let t=new Map;for(let r of e.nodes)t.set(r,[]);for(let r of e.edges)t.get(r.src).push(r.dst);return t}function qN(e){let t=$We(e);for(let r of t.values())r.sort((n,i)=>n.localeCompare(i));return t}function jN(e){let t=new Map;for(let r of e.nodes)t.set(r,0);for(let r of e.edges)t.set(r.dst,(t.get(r.dst)??0)+1);return t}function HN(e){return[...e.entries()].filter(([,t])=>t===0).map(([t])=>t).sort((t,r)=>t.localeCompare(r))}function Jm(e,t=()=>!0){let r=new Map,n=new Map;for(let i of e.nodes)r.set(i,[]),n.set(i,[]);for(let i of e.edges)t(i)&&(n.get(i.src).push(i.dst),r.get(i.dst).push(i.src));return{preds:r,succs:n}}function IS(e,t,r,n){let i=0;for(let o of e.nodes)n?.skipGroups&&e.nodeById.get(o)?.isGroup||(i=Math.max(i,r[o]??0));let a=Array.from({length:i+1},()=>[]);for(let o of t)n?.skipGroups&&e.nodeById.get(o)?.isGroup||a[Math.max(0,r[o]??0)].push(o);return a}function ch(e){let t=jN(e),r=HN(t),n=[],i=qN(e);for(;r.length;){let a=r.shift();n.push(a);for(let o of i.get(a)??[])if(t.set(o,(t.get(o)??0)-1),(t.get(o)??0)===0){let l=0;for(;l<r.length&&r[l]<o;)l++;r.splice(l,0,o)}}return n.length===e.nodes.length?n:null}function Yd(e){let t=new Map,r=0;for(let n of e)t.set(n,r),r++;return t}function NS(e){let t=new Array(e.length),r=s((n,i)=>{if(i-n<=1)return 0;let a=n+i>>1,o=r(n,a)+r(a,i),l=n,u=a,h=n;for(;l<a||u<i;)u>=i||l<a&&e[l]<=e[u]?t[h++]=e[l++]:(t[h++]=e[u++],o+=a-l);for(let d=n;d<i;d++)e[d]=t[d];return o},"count");return r(0,e.length)}var Cl=_(()=>{"use strict";s(qs,"normalizeGraph");s(DS,"incoming");s($We,"buildSuccessorMap");s(qN,"buildSortedSuccessorMap");s(jN,"buildInDegreeMap");s(HN,"sortedZeroInDegreeNodes");s(Jm,"buildPredecessorSuccessorMaps");s(IS,"buildLayersFromRanks");s(ch,"topoSortIfAcyclic");s(Yd,"buildLayerIndex");s(NS,"countInversions")});function Poe(e){let t=qs(e),r=new Map;for(let d of t.nodes)r.set(d,[]);for(let d of t.edges)r.get(d.src).push(d);for(let d of r.values())d.sort((f,p)=>f.dst===p.dst?f.id.localeCompare(p.id):f.dst.localeCompare(p.dst));let n=Object.create(null);for(let d of t.nodes)n[d]=0;let i=[],a=s(d=>{n[d]=1;for(let f of r.get(d)??[]){let p=f.dst;n[p]===0?a(p):n[p]===1&&i.push(f)}n[d]=2},"dfs"),o=[...t.nodes].sort((d,f)=>d.localeCompare(f));for(let d of o)n[d]===0&&a(d);let l=new Set(i.map(d=>`${d.id}:${d.src}->${d.dst}`)),u=t.edges.map(d=>l.has(`${d.id}:${d.src}->${d.dst}`)?{id:d.id,src:d.dst,dst:d.src,weight:d.weight,ref:d.ref}:d);return{acyclic:{nodes:[...t.nodes],edges:u,layout:t.layout,nodeById:new Map(t.nodeById)},reversed:i}}var Moe=_(()=>{"use strict";Cl();s(Poe,"removeCycles_DFS")});function BWe(e){let t=new Map,r=s(n=>{if(t.has(n))return t.get(n);let i=e.nodeById.get(n);if(!i)return t.set(n,null),null;let a=i.parentId;if(!a)return t.set(n,null),null;let l=r(a)??a;return t.set(n,l),l},"resolve");for(let n of e.nodes)r(n);return t}function as(e){let t=BWe(e);return r=>t.get(r)??null}function PS(e){let t=[];for(let r of e.layout.nodes??[])r.isGroup&&!r.parentId&&t.push(r.id);return[...new Set(t)].reverse()}function MS(e,t){let r=PS(e);if(!t||t.length===0)return r;let n=new Set(r),i=new Set,a=[];for(let o of t)!n.has(o)||i.has(o)||(i.add(o),a.push(o));for(let o of r)i.has(o)||a.push(o);return a}var Sc=_(()=>{"use strict";s(BWe,"buildTopLaneMap");s(as,"createTopLaneResolver");s(PS,"buildTopLaneOrder");s(MS,"resolveTopLaneOrder")});var Ooe,Kd,UN,eg=_(()=>{"use strict";Ooe={EPSILON:1e-6},Kd={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},UN={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40}});function $oe(e,t){let r=qs(e),n=t?.laneOf??(()=>null),i=t?.rankHint,{preds:a}=Jm(r);for(let v of a.values())v.sort((S,w)=>S.localeCompare(w));let o=ch(r)??[...r.nodes].sort((v,S)=>v.localeCompare(S)),l=new Map;for(let[v,S]of o.entries())l.set(S,v);let u=new Map,h=new Map;for(let v of r.nodes)h.set(v,[]);for(let v of o){let S=(a.get(v)??[]).filter(w=>u.has(w));if(S.length>0){let w=FWe(v,S,{laneOf:n,rankHint:i,topoIndex:l});u.set(v,w),h.get(w).push(v)}else u.has(v)||u.set(v,null)}for(let v of r.nodes)u.has(v)||u.set(v,null);let d=new Set;for(let v of r.nodes)(u.get(v)??null)===null&&d.add(v);let f=[...d].sort((v,S)=>{let w=l.get(v)??0,L=l.get(S)??0;return w===L?v.localeCompare(S):w-L}),p=GWe(r),g=new Map;for(let[v,S]of p.entries())g.set(v,[...S].sort((w,L)=>w.localeCompare(L)));let m=zWe(g),y=VWe(g),x=new Map;for(let v of r.nodes)x.set(v,[]);for(let v of y)for(let S of v.nodes){let w=x.get(S);w?w.push(v.id):x.set(S,[v.id])}let T=[],C=[],k=new Set,E=s(v=>{if(!k.has(v)){k.add(v),T.push(v);for(let S of h.get(v)??[])E(S);C.push(v)}},"walk");for(let v of f)E(v);for(let v of o)E(v);return{parent:u,children:h,roots:f,componentOf:m,blocks:y,nodeBlocks:x,adjacency:g,preorder:T,postorder:C,topologicalOrder:o}}function FWe(e,t,r){let n=r.laneOf(e);return[...t].sort((a,o)=>{let l=r.laneOf(a),u=r.laneOf(o),h=l!=null&&l===n,d=u!=null&&u===n;if(h!==d)return h?-1:1;let f=r.rankHint?.[a],p=r.rankHint?.[o];if(f!=null&&p!=null&&f!==p)return p-f;let g=r.topoIndex.get(a)??0,m=r.topoIndex.get(o)??0;return g!==m?g-m:a.localeCompare(o)})[0]}function GWe(e){let t=new Map;for(let r of e.nodes)t.set(r,new Set);for(let r of e.edges)t.get(r.src).add(r.dst),t.get(r.dst).add(r.src);return t}function zWe(e){let t=new Map,r=0;for(let n of e.keys()){if(t.has(n))continue;let i=[n];for(;i.length>0;){let a=i.pop();if(!t.has(a)){t.set(a,r);for(let o of e.get(a)??[])t.has(o)||i.push(o)}}r++}return t}function VWe(e){let t=new Map,r=new Map,n=[],i=[],a=0,o=s((l,u)=>{t.set(l,++a),r.set(l,a);for(let h of e.get(l)??[])h!==u&&(t.has(h)?(t.get(h)??0)<(t.get(l)??0)&&(n.push([l,h]),r.set(l,Math.min(r.get(l)??a,t.get(h)??a))):(n.push([l,h]),o(h,l),r.set(l,Math.min(r.get(l)??a,r.get(h)??a)),(r.get(h)??0)>=(t.get(l)??0)&&i.push(WWe(l,h,n,i.length))))},"visit");for(let l of e.keys())t.has(l)||o(l,null);return i}function WWe(e,t,r,n){let i=[],a=new Set;for(;r.length>0;){let o=r.pop();if(i.push(o),a.add(o[0]),a.add(o[1]),o[0]===e&&o[1]===t||o[0]===t&&o[1]===e)break}return{id:n,edges:i,nodes:[...a]}}var Boe=_(()=>{"use strict";Cl();s($oe,"buildDrivingTree");s(FWe,"chooseParent");s(GWe,"buildAdjacency");s(zWe,"assignComponents");s(VWe,"computeBlocks");s(WWe,"popBlock")});function Foe(e,t,r){let n=[...e.nodes],i=new Map;for(let[C,k]of n.entries())i.set(k,C);let a=n.length,o=new Array(a).fill(-1),l=new Array(a).fill(0),u=[],h=new Set;for(let C of n){let k=r.parent.get(C)??null,E=i.get(C);E!=null&&k==null&&(o[E]=-1,l[E]=0,h.has(C)||(h.add(C),u.push(C)))}for(;u.length>0;){let C=u.shift(),k=i.get(C);if(k==null)continue;let E=r.children.get(C)??[];for(let v of E){if(h.has(v))continue;let S=i.get(v);S!=null&&(o[S]=k,l[S]=l[k]+1,h.add(v),u.push(v))}}for(let C of n){if(h.has(C))continue;let k=i.get(C);k!=null&&(o[k]=-1,l[k]=0,h.add(C))}let d=Math.max(1,Math.ceil(Math.log2(Math.max(1,a)))+1),f=Array.from({length:d},()=>new Array(a).fill(-1));for(let C=0;C<a;C++)f[0][C]=o[C];for(let C=1;C<d;C++)for(let k=0;k<a;k++){let E=f[C-1][k];f[C][k]=E===-1?-1:f[C-1][E]}let p=s((C,k)=>{if(C===-1||k===-1)return-1;l[C]<l[k]&&([C,k]=[k,C]);let E=l[C]-l[k];for(let v=0;v<d;v++)if(E>>v&1&&(C=f[v][C],C===-1))return-1;if(C===k)return C;for(let v=d-1;v>=0;v--){let S=f[v][C],w=f[v][k];S===-1||w===-1||S!==w&&(C=S,k=w)}return f[0][C]},"lcaIndex"),g=Array.from({length:a},()=>new Map);for(let C of e.edges){let k=C.src,E=C.dst,v=t[k],S=t[E];if(v==null||S==null||(v>S&&([k,E]=[E,k],[v,S]=[S,v]),v==null||S==null||v===S))continue;let w=i.get(k),L=i.get(E);if(w==null||L==null)continue;let O=p(w,L);if(O===-1)continue;let F=g[O];for(let N=v;N<S;N++)F.set(N,(F.get(N)??0)+1)}let m=new Map,y=s((C,k)=>{if(k.size!==0)for(let[E,v]of k)C.set(E,(C.get(E)??0)+v)},"mergeInto"),x=new Set,T=s(C=>{let k=i.get(C);x.add(C);let E=k==null?void 0:g[k],v=E?new Map(E):new Map,S=r.children.get(C)??[];for(let w of S){let L=T(w),O=t[C];if(O!=null){let F=m.get(C);F||(F=new Map,m.set(C,F));let N=L.get(O)??0,G=t[w];G!=null&&G>O&&(N+=1),F.set(w,N)}y(v,L)}return v},"dfs");for(let C of r.roots)x.has(C)||T(C);for(let C of n)x.has(C)||T(C);return m}var Goe=_(()=>{"use strict";s(Foe,"computeSubtreeCrossCounts")});function zoe(e,t,r){let n=new Map,i=s(a=>{let o=r[a]??0,l=[...t.get(a)??[]];l.sort(YN(r));for(let u of l){i(u);let h=n.get(u);h!=null&&(o=Math.min(o,h))}n.set(a,o)},"annotate");for(let a of e)i(a);return n}function YN(e){return(t,r)=>{let n=e[t]??0,i=e[r]??0;return n===i?t.localeCompare(r):n-i}}function Voe(e,t,r,n){let i=0;for(let u of t){let h=r[u]??0;h>i&&(i=h)}let a=Array.from({length:i+1},()=>[]),o=new Set,l=s(u=>{if(o.has(u))return;o.add(u);let h=r[u]??0;a[h]||(a[h]=[]),a[h].push(u);for(let d of n(u))l(d)},"emit");for(let u of e)l(u);for(let u of t)if(!o.has(u)){let h=r[u]??0;a[h]||(a[h]=[]),a[h].push(u),o.add(u)}return a}function Woe(e){let t=[];for(let r of e){let n=new Set,i=[];for(let a of r)n.has(a)||(n.add(a),i.push(a));t.push(i)}return t}var qoe=_(()=>{"use strict";s(zoe,"annotateMinimumLayers");s(YN,"compareByRankThenId");s(Voe,"emitNodesInTreeOrder");s(Woe,"deduplicateLayers")});function qWe(e,t,r,n){return i=>{let a=e.get(i)??[];if(a.length===0)return[];let o=t[i]??0,l=[],u=[],h=r.get(i);for(let d of a){let f=n.get(d)??o;f>o?l.push({child:d,min:f}):u.push(d)}return l.sort((d,f)=>d.min===f.min?d.child.localeCompare(f.child):d.min-f.min),u.sort((d,f)=>{let p=h?.get(d)??0,g=h?.get(f)??0;if(p!==g)return p-g;let m=n.get(d)??o,y=n.get(f)??o;return m!==y?m-y:d.localeCompare(f)}),[...l.map(d=>d.child),...u]}}function yx(e,t,r){let n=$oe(e,{rankHint:t,laneOf:r}),{children:i,roots:a}=n;for(let f of e.nodes)i.has(f)||i.set(f,[]);let o=Foe(e,t,n),l=[...a].sort(YN(t)),u=zoe(l,i,t),h=qWe(i,t,o,u),d=Voe(l,e.nodes,t,h);return d=Woe(d),d}var KN=_(()=>{"use strict";Boe();Goe();qoe();s(qWe,"createChildOrderer");s(yx,"buildMultitreeLayerOrder")});function jWe(e,t,r){let n=new Set(e),i=new Set(t),a=Yd(t),o=[];for(let l of r)n.has(l.src)&&i.has(l.dst)&&o.push(a.get(l.dst));return NS(o)}function joe(e,t,r){let n=[];for(let a of t){let o=r[a.src],l=r[a.dst];if(o==null||l==null||o===l)continue;let u=a.src,h=a.dst,d=o,f=l;o>l&&(u=a.dst,h=a.src,d=l,f=o);for(let p=d;p<f;p++)n.push({id:`${a.id}@${p}`,src:u,dst:h,ref:a.ref})}let i=0;for(let a=0;a+1<e.length;a++)i+=jWe(e[a],e[a+1],n);return i}function Hoe(e,t){let r={...t},{preds:n}=Jm(e),i=as(e),a=yx(e,r,i),o=joe(a,e.edges,r),l=Kd.MAX_CROSSING_OPTIMIZATION_PASSES;for(let u=0;u<l;u++){let h=!1,d=[...e.nodes].sort((f,p)=>(r[p]??0)-(r[f]??0));for(let f of d){let p=r[f]??0;if(p===0)continue;let g=0;for(let T of n.get(f)??[])g=Math.max(g,(r[T]??0)+1);if(g>=p)continue;let m=p;r[f]=g;let y=yx(e,r,i),x=joe(y,e.edges,r);x<o?(o=x,h=!0):r[f]=m}if(!h)break}return r}var Uoe=_(()=>{"use strict";Cl();eg();Sc();KN();s(jWe,"countCrossingsBetweenAdjacent");s(joe,"totalCrossings");s(Hoe,"optimizeRanksByCrossings")});function Yoe(e,t){let r=as(e),n=[...e.nodes].sort((i,a)=>(t[i]??0)-(t[a]??0)||i.localeCompare(a));for(let i of n){let a=r(i);if(!a)continue;let o=e.edges.filter(y=>y.src===i);if(o.length===0)continue;let l=!1,u=0;for(let y of o){let x=r(y.dst);x==null||x===a?l=!0:u++}if(u===0||l)continue;let h=0,d=!1;for(let y of e.edges){if(y.dst!==i)continue;let x=r(y.src);x&&(x===a?d=!0:h++)}if(h>0||!d)continue;let f=t[i]??0,p=f+u,g=0;for(let y of e.edges)y.dst===i&&(g=Math.max(g,(t[y.src]??0)+1));let m=Math.max(f,g,p);m!==f&&(t[i]=m)}}var Koe=_(()=>{"use strict";Sc();s(Yoe,"adjustCrossLaneSources")});function Xoe(e,t){let r=qs(e),n=ch(r)??[...r.nodes].sort(),i=t?.compactSingleInput??!1,a=as(r),o=Object.create(null);for(let u of n){let h=DS(r,u),d=t?.ignoreCrossLaneEdges?h.filter(f=>{let p=a(f.src),g=a(u);return!p||!g?!0:p===g}):h;if(d.length===0)o[u]=0;else if(i&&d.length===1){let f=d[0].src,p=a(f),g=a(u);p!==g?o[u]=o[f]??0:o[u]=(o[f]??0)+1}else{let f=-1/0;for(let p of d)f=Math.max(f,(o[p.src]??0)+1);o[u]=f===-1/0?0:f}}return(t?.optimizeRanksByCrossings??!1)&&(o=Hoe(r,o)),t?.ignoreCrossLaneEdges&&Yoe(r,o),{layers:yx(r,o,a),rankOf:o,dummy:new Set}}var Qoe=_(()=>{"use strict";Cl();Sc();Uoe();Koe();KN();s(Xoe,"assignLayers_LongestPath")});function Zoe(e,t){let r=qs(e),i={...Xoe(r,{compactSingleInput:t?.compactSingleInput,ignoreCrossLaneEdges:t?.ignoreCrossLaneEdges,optimizeRanksByCrossings:t?.optimizeRanksByCrossings}).rankOf},a=as(r),{preds:o,succs:l}=Jm(r,m=>{if(t?.ignoreCrossLaneEdges){let y=a(m.src),x=a(m.dst);if(y&&x&&y!==x)return!1}return!0}),u=ch(r)??[...r.nodes],h=[...u].reverse(),d=s((m,y)=>{let x=0;for(let k of o.get(m)??[])x=Math.max(x,(i[k]??0)+1);let T=Number.POSITIVE_INFINITY,C=l.get(m)??[];return C.length>0&&(T=Math.min(...C.map(k=>(i[k]??0)-1))),Number.isFinite(T)||(T=Math.max(x,y)),Math.min(Math.max(y,x),T)},"clampFeasible"),f=Kd.GRAVITY_ITERATIONS,p=s(m=>{let y=!1;for(let x of m){let T=o.get(x)??[],C=l.get(x)??[];if(T.length===0&&C.length===0)continue;let k=T.length>0?T.reduce((w,L)=>w+(i[L]??0)+1,0)/T.length:i[x]??0,E=C.length>0?C.reduce((w,L)=>w+(i[L]??0)-1,0)/C.length:i[x]??0,v=Math.round((k+E)/2),S=d(x,v);S!==i[x]&&(i[x]=S,y=!0)}return y},"relaxOrder");for(let m=0;m<f;m++){let y=p(u),x=p(h);if(!y&&!x)break}for(let m of u){let y=0;for(let x of o.get(m)??[])y=Math.max(y,(i[x]??0)+1);(i[m]??0)<y&&(i[m]=y)}for(let m of h){let y=l.get(m)??[];if(y.length>0){let x=Math.min(...y.map(T=>(i[T]??0)-1));(i[m]??0)>x&&(i[m]=x)}}return{layers:IS(r,u,i),rankOf:i,dummy:new Set}}var Joe=_(()=>{"use strict";Cl();Sc();eg();Qoe();s(Zoe,"assignLayers_Gravity")});function HWe(e){let t=jN(e),r=qN(e),n=HN(t),i=[];for(;n.length>0;){let a=[];for(let o of n){i.push(o);for(let l of r.get(o)??[])t.set(l,(t.get(l)??0)-1),(t.get(l)??0)===0&&a.push(l)}n=a.sort((o,l)=>o.localeCompare(l))}return i.length===e.nodes.length?i:null}function ele(e,t){let r=qs(e),n=t?.direction==="LR"?HWe(r)??[...r.nodes].sort():ch(r)??[...r.nodes].sort(),i=as(r),a=s(d=>i(d)??d,"laneOf"),o=Object.create(null),l=new Map,u=s((d,f)=>t?.ignoreCrossLaneEdges??!0?a(d)===a(f)?1:0:1,"edgeWeight");for(let d of n){if(r.nodeById.get(d)?.isGroup)continue;let p=DS(r,d),g=0;if(p.length>0)for(let T of p){let C=T.src,k=o[C]??0;g=Math.max(g,k+u(C,d))}let m=a(d),y=l.get(m)??0,x=Math.max(g,y);o[d]=x,l.set(m,x+1)}return{layers:IS(r,n,o,{skipGroups:!0}),rankOf:o,dummy:new Set}}var tle=_(()=>{"use strict";Cl();Sc();s(HWe,"topoSortByGenerationIfAcyclic");s(ele,"assignLayers_LaneAwareCompact")});function rle(e,t){let r=qs(t),{rankOf:n}=e,i=e.layers.map(g=>[...g]),a=new Set(e.dummy?[...e.dummy]:[]),o=0,l=new Map(r.nodeById),u=s(g=>{let m=`placeholder-${o++}`,y={id:m,isGroup:!1,isDummy:!0,width:0,height:0};for(l.set(m,y),a.add(m);i.length<=g;)i.push([]);return i[g].push(m),n[m]=g,m},"addDummyAt"),h=[...r.edges].sort((g,m)=>g.id===m.id?g.src===m.src?g.dst.localeCompare(m.dst):g.src.localeCompare(m.src):g.id.localeCompare(m.id)),d=[];for(let g of h){let m=n[g.src]??0,y=n[g.dst]??0;if(y-m<=1){d.push(g);continue}let x=g.src;for(let C=m+1,k=0;C<y;C++,k++){let E=u(C);d.push({id:`${g.id}#${k}`,src:x,dst:E,weight:g.weight,ref:g.ref}),x=E}let T=y-m-2;d.push({id:`${g.id}#${Math.max(T+1,0)}`,src:x,dst:g.dst,weight:g.weight,ref:g.ref})}let p={nodes:[...r.nodes,...[...a].filter(g=>!r.nodes.includes(g))],edges:d,layout:r.layout,nodeById:l};return{layering:{layers:i,rankOf:n,dummy:a},graphWithDummies:p}}var nle=_(()=>{"use strict";Cl();s(rle,"makeProperLayering")});function ile(e){let t=e.length;if(t===0)return Number.POSITIVE_INFINITY;let r=[...e].sort((n,i)=>n-i);return t%2===1?r[(t-1)/2]:.5*(r[t/2-1]+r[t/2])}function sle(e){return e.length===0?Number.POSITIVE_INFINITY:e.reduce((r,n)=>r+n,0)/e.length}function UWe(e,t,r,n){let i=new Map;for(let a of e)i.set(a,[]);for(let a of r)n==="down"?t.has(a.src)&&i.has(a.dst)&&i.get(a.dst).push(t.get(a.src)):t.has(a.dst)&&i.has(a.src)&&i.get(a.src).push(t.get(a.dst));return i}function YWe(e,t,r){let n=r.get(e)??0,i=r.get(t)??0;return n!==i?n-i:e.localeCompare(t)}function ale(e,t,r){let n=new Set(e),i=new Set(t),a=Yd(e),o=Yd(t),l=[];for(let h of r)n.has(h.src)&&i.has(h.dst)&&l.push({u:a.get(h.src),v:o.get(h.dst)});l.sort((h,d)=>h.u===d.u?h.v-d.v:h.u-d.u);let u=l.map(h=>h.v);return NS(u)}function XN(e,t,r){return[...e].sort((n,i)=>{let a=ile(t.get(n)??[]),o=ile(t.get(i)??[]);return a===o?YWe(n,i,r):isFinite(a)?isFinite(o)?a-o:-1:1})}function ole(e,t,r,n,i,a){let o=Yd(e),l=Yd(t),u=UWe(t,o,r,n);if(!i||!a||a.length===0)return XN(t,u,l);let h=new Map;for(let p of t){let g=i(p),m=h.get(g)??[];m.push(p),h.set(g,m)}let d=[];for(let p of a){let g=h.get(p);if(!g||g.length===0)continue;let m=XN(g,u,l);d.push(...m)}let f=h.get(null);if(f&&f.length>0){let p=XN(f,u,l);for(let g of p){let m=sle(u.get(g)??[]),y=d.length;if(isFinite(m))for(let[x,T]of d.entries()){let C=sle(u.get(T)??[]);if(m<C){y=x;break}}d.splice(y,0,g)}}return d}function lle(e,t,r,n,i){let a=[...t],o=new Set(e),l=new Set(t),u=n?new Set(n):null,h=r.filter(y=>o.has(y.src)&&l.has(y.dst)),d=u?r.filter(y=>l.has(y.src)&&u.has(y.dst)):void 0,f=s(y=>{let x=ale(e,y,h);return d&&n&&(x+=ale(y,n,d)),x},"crossingScore"),p=i?new Map:null;if(i&&p)for(let y of t)p.set(y,i(y));let g=!0,m=f(a);for(;g;){g=!1;for(let y=0;y+1<a.length;y++){if(p){let C=p.get(a[y]),k=p.get(a[y+1]);if(C!==k)continue}let x=m;[a[y],a[y+1]]=[a[y+1],a[y]];let T=f(a);T<x?(m=T,g=!0):[a[y],a[y+1]]=[a[y+1],a[y]]}}return a}function cle(e,t,r){let n=e.layers.map(l=>[...l]),i=t.edges,a=as(t),o=MS(t,r?.laneOrder);for(let l=0;l<3;l++){for(let u=1;u<n.length;u++)n[u]=ole(n[u-1],n[u],i,"down",a,o),n[u]=lle(n[u-1],n[u],i,n[u+1],a);for(let u=n.length-2;u>=0;u--)n[u]=ole(n[u+1],n[u],i,"up",a,o),n[u]=lle(n[u+1],n[u],i,n[u-1],a)}return{layers:n}}var ule=_(()=>{"use strict";Cl();Sc();s(ile,"median");s(sle,"barycenter");s(UWe,"neighborPositionsFor");s(YWe,"currentOrderTieBreak");s(ale,"countCrossingsBetweenAdjacent");s(XN,"sortByHeuristic");s(ole,"reorderLayer");s(lle,"transposeImprove");s(cle,"orderLayers")});function hle(e,t,r){let n=r?.layerGap??UN.DEFAULT_LAYER_GAP,i=r?.nodeGap??UN.DEFAULT_NODE_GAP,a=r?.laneGap??i*2,o=r?.direction??"TB",l=o==="LR"||o==="RL",u=e.layers,h=Object.create(null),d=Object.create(null),f=s(F=>t.nodeById.get(F),"getNode"),p=s(F=>f(F)?.width??0,"getWidth"),g=s(F=>f(F)?.height??0,"getHeight"),m=as(t),y=MS(t,r?.laneOrder),x=u.map(F=>F.reduce((N,G)=>Math.max(N,g(G)),0)),T=[];if(l)for(let F=0;F+1<u.length;F++){let N=u[F].reduce((D,$)=>Math.max(D,p($)),0),G=u[F+1].reduce((D,$)=>Math.max(D,p($)),0),A=x[F],M=x[F+1],I=A/2+M/2,P=(N+G)/2,B=Math.max(0,P-I-n);T.push(B)}let C=new Set;for(let F of u)for(let N of F)C.add(m(N));let k=C.has(null),E=y.filter(F=>C.has(F)),v=[...k?[null]:[],...E],S=Object.create(null);for(let F of E)S[F]=0;k&&(S.null=0);for(let F of u){let N=Object.create(null),G=[];for(let A of F){let M=m(A);M===null?G.push(A):(N[M]||=[]).push(A)}for(let[A,M]of Object.entries(N)){let I=M.reduce((P,B)=>P+p(B),0)+i*Math.max(0,M.length-1);S[A]=Math.max(S[A]??0,I)}if(k&&G.length){let A=G.reduce((M,I)=>M+p(I),0)+i*Math.max(0,G.length-1);S.null=Math.max(S.null??0,A)}}let w=new Map;{let F=v.map(A=>(A===null?S.null:S[A])??0),G=-(F.reduce((A,M)=>A+M,0)+a*Math.max(0,v.length-1))/2;for(let A=0;A<v.length;A++){let M=v[A],I=F[A]??0,P=G+I/2;w.set(M,P),G+=I,A<v.length-1&&(G+=a)}}let L=0;for(let[F,N]of u.entries()){let G=x[F]??0,A=new Map;for(let I of N){let P=m(I),B=A.get(P)??[];B.push(I),A.set(P,B)}for(let I of v){let P=A.get(I)??[];if(P.length===0)continue;let B=w.get(I);if(P.length===1){let D=P[0];h[D]=B,d[D]=L+G/2}else{let D=P.map(q=>p(q)),$=D.reduce((q,z)=>q+z,0)+i*(P.length-1),W=B-$/2;for(let[q,z]of P.entries()){let j=D[q];h[z]=W+j/2,d[z]=L+G/2,W+=j+i}}}let M=T[F]??0;L+=G+n+M}let O=new Map;for(let F of t.edges){let N=F.ref.id;O.has(N)||O.set(N,[]),O.get(N).push(F)}for(let[,F]of O){if(F.length===0)continue;let N=F[0].ref,G=N.start,A=N.end;if(G==null||A==null)continue;let M=Math.round(((h[G]??0)+(h[A]??0))/2),I=new Set;for(let P of F)I.add(P.src),I.add(P.dst);for(let P of I){if(P===G||P===A)continue;t.nodeById.get(P)?.isDummy&&(h[P]=M)}}return{x:h,y:d}}var dle=_(()=>{"use strict";eg();Sc();s(hle,"assignCoordinates")});function KWe(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return t>>>0}function XWe(e){let t=e>>>0;return()=>{t+=1831565813;let r=t;return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),((r^r>>>14)>>>0)/4294967296}}function QWe(e,t){let r=[...e],n=XWe(t);for(let i=r.length-1;i>0;i--){let a=Math.floor(n()*(i+1));[r[i],r[a]]=[r[a],r[i]]}return r}function ZWe(e,t){let r=0;for(let[n,i]of e.entries())r+=Math.abs(n-(t.get(i)??n));return r}function fle(e,t){let r=new Map;for(let[i,a]of e.entries())r.set(a,i);let n=0;for(let{a:i,b:a,weight:o}of t){let l=r.get(i),u=r.get(a);l==null||u==null||(n+=o*Math.abs(l-u))}return n}function JWe(e){let t=PS(e);if(t.length<2)return[];let r=new Map(t.map((a,o)=>[a,o])),n=as(e),i=new Map;for(let a of e.layout.edges??[]){if(a.isLayoutOnly)continue;let o=typeof a.start=="string"?a.start:void 0,l=typeof a.end=="string"?a.end:void 0;if(!o||!l||!e.nodeById.has(o)||!e.nodeById.has(l))continue;let u=n(o),h=n(l);if(!u||!h||u===h)continue;let d=r.get(u),f=r.get(h);if(d==null||f==null)continue;let[p,g]=d<=f?[u,h]:[h,u],m=`${p}\0${g}`,y=i.get(m);y?y.weight++:i.set(m,{a:p,b:g,weight:1})}return[...i.values()]}function ple(e,t,r){let n=[...e],i=fle(n,t),a=!0,o=0,l=Math.max(1,n.length);for(;a&&o<l;){a=!1,o++;for(let u=0;u+1<n.length;u++){[n[u],n[u+1]]=[n[u+1],n[u]];let h=fle(n,t);h<i?(i=h,a=!0):[n[u],n[u+1]]=[n[u+1],n[u]]}}return{order:n,cost:i,sourceDistance:ZWe(n,r)}}function eqe(e,t){return e.cost!==t.cost?e.cost<t.cost:e.sourceDistance<t.sourceDistance}function tqe(e,t,r){let n=[...t].sort((i,a)=>i.a===a.a?i.b.localeCompare(a.b):i.a.localeCompare(a.a)).map(({a:i,b:a,weight:o})=>`${i}:${a}:${o}`).join("|");return KWe(`${e.join("|")}#${n}#${r}`)}function mle(e,t={}){let r=PS(e);if(r.length<2)return r;let n=JWe(e);if(n.length===0)return r;let i=new Map(r.map((l,u)=>[l,u])),a=ple(r,n,i),o=Math.max(0,t.restarts??QN);for(let l=0;l<o;l++){let u=tqe(r,n,l),h=QWe(r,u),d=ple(h,n,i);eqe(d,a)&&(a=d)}return a.order}var QN,gle=_(()=>{"use strict";Sc();QN=8;s(KWe,"hashString");s(XWe,"mulberry32");s(QWe,"deterministicShuffle");s(ZWe,"sourceDistance");s(fle,"laneArrangementCost");s(JWe,"buildWeightedLaneEdges");s(ple,"greedySwitch");s(eqe,"isBetterCandidate");s(tqe,"seedForRestart");s(mle,"optimizeTopLaneOrder")});function yle(e,t){let r=t?.ignoreCrossLaneEdges??!0,n=t?.optimizeRanksByCrossings??!0,i=qs(e),a=t?.automaticLaneOrdering?mle(i,{restarts:QN}):void 0,o=Poe(i),l=o.acyclic,u=r?ele(l,{compactSingleInput:t?.compactSingleInput??Kd.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!0,direction:t?.direction}):Zoe(l,{compactSingleInput:t?.compactSingleInput??Kd.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!1,optimizeRanksByCrossings:n}),{layering:h,graphWithDummies:d}=rle(u,l),f=cle(h,d,{laneOrder:a}),p=hle(f,d,{layerGap:t?.layerGap,nodeGap:t?.nodeGap,direction:t?.direction,laneOrder:a});return{acyclic:l,reversed:o.reversed,layering:h,ordered:f,coordinates:p}}var xle=_(()=>{"use strict";Cl();Moe();Joe();tle();nle();ule();dle();eg();gle();s(yle,"sugiyamaLayout")});function ble(e,t,r){let n=e.x??0,i=e.y??0,a=t.x-n,o=t.y-i,l=Math.abs(a),u=Math.abs(o);return l<Rr&&u<Rr?r:u>Rr&&u*3>=l?o>0?"bottom":"top":l>Rr?a>0?"right":"left":r}function Tle(e,t){return Math.abs(e.to-t.from)<Rr||Math.abs(e.to-t.to)<Rr?e.to:e.from}function rg(e,t){return e.orient==="vertical"?{x:e.coord,y:t}:{x:t,y:e.coord}}function Cle(e,t){let r=e.nodes??[],n=e.edges??[],i=[];for(let X of n)X.isLayoutOnly||i.push({...X,__originalEdge:X});let a=new Map,o=new Map,l=[],u=t==="LR";for(let X of r)a.set(X.id,X);let h=r.filter(X=>X.isGroup&&!X.parentId);for(let X of h){let re={id:X.id},te=s(ie=>{o.set(ie.id,re),r.filter(ue=>ue.parentId===ie.id).forEach(te)},"assignLane");te(X)}let d=r.filter(X=>!X.isGroup&&!X.isEdgeLabel).map(X=>{let re=X.width??10,te=X.height??10,ie=X.x??0,ue=X.y??0,Q=rqe;return{nodeId:X.id,minX:ie-re/2-Q,maxX:ie+re/2+Q,minY:ue-te/2-Q,maxY:ue+te/2+Q,visualXHalfExtent:u?te/2+Q:re/2+Q}}),f=s((X,re,te,ie)=>{let ue=l.find(Q=>Q.orientation===X&&Math.abs(Q.coord-re)<1);return ue||(ue={id:`pipe-${X}-${re.toFixed(0)}`,orientation:X,coord:re,spanMin:te,spanMax:ie,tracks:[]},l.push(ue)),ue.spanMin=Math.min(ue.spanMin,te),ue.spanMax=Math.max(ue.spanMax,ie),ue},"getOrAddPipe"),p=s((X,re)=>{let te=X.width??10,ie=X.height??10,ue=X.x??0,Q=X.y??0;switch(re){case"top":return{x:ue,y:Q-ie/2};case"bottom":return{x:ue,y:Q+ie/2};case"left":return{x:ue-te/2,y:Q};case"right":return{x:ue+te/2,y:Q}}},"portForSide"),g=s((X,re,te)=>p(X,ble(X,re,te?"bottom":"top")),"getOrthogonalPort"),m=[],y=[],x=new Set,T=1e3,C=s((X,re,te)=>{if(m.length===0)return 0;let ie=Math.abs(re.y-te.y)<Rr,ue=Math.abs(re.x-te.x)<Rr;if(!ie&&!ue)return 0;let Q=0;if(ie){let R=re.y,V=Math.min(re.x,te.x)-Rr,ae=Math.max(re.x,te.x)+Rr;if(ae<=V)return 0;for(let K of m)K.edgeIndex===X||K.orientation!=="vertical"||K.pipe.coord<V||K.pipe.coord>ae||K.from-Rr<=R&&K.to+Rr>=R&&(Q+=T)}else if(ue){let R=re.x,V=Math.min(re.y,te.y)-Rr,ae=Math.max(re.y,te.y)+Rr;if(ae<=V)return 0;for(let K of m)K.edgeIndex===X||K.orientation!=="horizontal"||K.pipe.coord<V||K.pipe.coord>ae||K.from-Rr<=R&&K.to+Rr>=R&&(Q+=T)}return Q},"crossingPenalty"),k=i.map((X,re)=>{if(!X.start||!X.end)return{idx:re,crossLane:0,dx:0,dy:0};let te=a.get(X.start),ie=a.get(X.end),ue=o.get(X.start),Q=o.get(X.end),R=ue&&Q&&ue.id!==Q.id?1:0,V=te&&ie?Math.abs((ie.x??0)-(te.x??0)):0,ae=te&&ie?Math.abs((ie.y??0)-(te.y??0)):0;return{idx:re,crossLane:R,dx:V,dy:ae}}).sort((X,re)=>{if(X.crossLane!==re.crossLane)return re.crossLane-X.crossLane;let te=X.dx+X.dy,ie=re.dx+re.dy;return Math.abs(te-ie)>1?te-ie:X.idx-re.idx}).map(X=>X.idx),E=s((X,re,te,ie)=>{let ue=Math.min(X.x,re.x),Q=Math.max(X.x,re.x),R=Math.min(X.y,re.y),V=Math.max(X.y,re.y);return!!d.find(K=>te&&K.nodeId===te||ie&&K.nodeId===ie?!1:Math.abs(X.x-re.x)>Rr?K.minY<X.y&&K.maxY>X.y&&K.maxX>ue&&K.minX<Q:K.minX<X.x&&K.maxX>X.x&&K.maxY>R&&K.minY<V)},"isSegmentBlocked"),v=new Map,S=new Map;for(let X of i)!X.start||!X.end||X.start===X.end||(S.set(X.start,(S.get(X.start)??0)+1),S.set(X.end,(S.get(X.end)??0)+1));let w=s((X,re)=>ble(X,re,"bottom"),"determineSide"),L=new Map;for(let[X,re]of i.entries()){if(!re.start||!re.end||re.start===re.end||re.points&&re.points.length>0)continue;let te=a.get(re.start),ie=a.get(re.end);if(!te||!ie)continue;let ue=(ie.x??0)-(te.x??0),Q=(ie.y??0)-(te.y??0);L.set(X,{edgeIdx:X,srcId:re.start,dstId:re.end,srcSide:w(te,{x:ie.x??0,y:ie.y??0}),dstSide:w(ie,{x:te.x??0,y:te.y??0}),absDx:Math.abs(ue),absDy:Math.abs(Q),dxSign:Math.sign(ue),dySign:Math.sign(Q)})}let O=s(X=>X.srcSide==="top"||X.srcSide==="bottom"?X.absDx===0?1/0:X.absDy/X.absDx:X.absDy===0?1/0:X.absDx/X.absDy,"preferenceStrength"),F=s(X=>X.srcSide==="top"||X.srcSide==="bottom"?X.dxSign>=0?"right":"left":X.dySign>=0?"bottom":"top","secondarySide"),N=new Map;for(let X of L.values()){let re=`${X.srcId}:${X.srcSide}`;N.has(re)||N.set(re,[]),N.get(re).push(X)}let G=new Map,A=s((X,re)=>`${X}:${re}`,"loadKey");for(let X of L.values())G.set(A(X.srcId,X.srcSide),(G.get(A(X.srcId,X.srcSide))??0)+1),G.set(A(X.dstId,X.dstSide),(G.get(A(X.dstId,X.dstSide))??0)+1);for(let X of N.values())if(!(X.length<2)){X.sort((re,te)=>{let ie=O(re),ue=O(te);return Math.abs(ie-ue)>1e-9?ue-ie:re.edgeIdx-te.edgeIdx});for(let re=1;re<X.length;re++){let te=X[re],ie=F(te),ue=G.get(A(te.srcId,te.srcSide))??0,Q=G.get(A(te.srcId,ie))??0;Q>=ue||(G.set(A(te.srcId,te.srcSide),ue-1),G.set(A(te.srcId,ie),Q+1),te.srcSide=ie)}}let M=s(X=>{let re=X?.shape;return re==="question"||re==="diamond"},"isDiamondNode"),I=new Map;for(let X of L.values())I.has(X.dstId)||I.set(X.dstId,new Set),I.get(X.dstId).add(X.dstSide);for(let X of L.values()){if(!M(a.get(X.srcId)))continue;let re=I.get(X.srcId);if(!re?.has(X.srcSide))continue;let te=F(X);if(re.has(te)||(G.get(A(X.srcId,te))??0)>0)continue;let ie=G.get(A(X.srcId,X.srcSide))??0;G.set(A(X.srcId,X.srcSide),Math.max(0,ie-1)),G.set(A(X.srcId,te),1),X.srcSide=te}for(let X of L.values()){let{edgeIdx:re,srcId:te,dstId:ie,srcSide:ue,dstSide:Q}=X,R=a.get(te),V=a.get(ie),ae=`${te}:${ue}:src`,K=ue==="top"||ue==="bottom"?V.x??0:V.y??0;v.has(ae)||v.set(ae,[]),v.get(ae).push({edgeIdx:re,oppositeCoord:K});let ye=`${ie}:${Q}:dst`,Z=Q==="top"||Q==="bottom"?R.x??0:R.y??0;v.has(ye)||v.set(ye,[]),v.get(ye).push({edgeIdx:re,oppositeCoord:Z})}let P=new Map,B=8;for(let[X,re]of v){if(re.length<2)continue;re.sort((Ae,Se)=>Ae.oppositeCoord-Se.oppositeCoord);let te=X.split(":"),ie=te.slice(0,-2).join(":"),ue=te[te.length-2],Q=te[te.length-1],R=a.get(ie);if(!R)continue;let ae=ue==="left"||ue==="right"?R.height??10:R.width??10,K=R.shape,Z=K==="question"||K==="diamond"?ae*.3:ae,U=Math.min(20,Math.max(B,Z/(re.length+1))),ke=-(U*(re.length-1))/2;for(let[Ae,Se]of re.entries()){let De=ke+Ae*U,Le=`${Se.edgeIdx}:${Q}`;P.set(Le,De)}}let D=s(X=>!!i[X]?.labelNodeId,"edgeHasLabelNode"),$=s((X,re)=>X?(v.get(`${X}:${re}:src`)??[]).some(({edgeIdx:te})=>D(te))||(v.get(`${X}:${re}:dst`)??[]).some(({edgeIdx:te})=>D(te)):!1,"faceHasLabelNode"),W=s((X,re,te)=>re==="top"||re==="bottom"?{x:X.x+te,y:X.y}:{x:X.x,y:X.y+te},"applyPortOffset"),q=s((X,re,te)=>{let ie=L.get(X),ue={x:te.x??0,y:te.y??0},Q={x:re.x??0,y:re.y??0},R=ie?.srcSide??w(re,ue),V=ie?.dstSide??w(te,Q),ae=ie?p(re,ie.srcSide):g(re,ue,!0),K=ie?p(te,ie.dstSide):g(te,Q,!1),ye=P.get(`${X}:src`),Z=P.get(`${X}:dst`);return ye!==void 0&&(ae=W(ae,R,ye)),Z!==void 0&&(K=W(K,V,Z)),{pSrcPort:ae,pDstPort:K,srcSide:R,dstSide:V}},"portsForEdge");for(let X of k){let re=i[X];if(y[X]=[],!re.start||!re.end||re.points&&re.points.length>0||re.start===re.end)continue;let te=a.get(re.start),ie=a.get(re.end);if(!te||!ie)continue;let{pSrcPort:ue,pDstPort:Q,srcSide:R,dstSide:V}=q(X,te,ie),ae={...ue},K={...Q},ye=R==="top"||R==="bottom",Z=V==="top"||V==="bottom";if(ye){let We=ue.y>(te.y??0);ae.y=We?ue.y+Va:ue.y-Va}else{let We=ue.x>(te.x??0);ae.x=We?ue.x+Va:ue.x-Va}if(Z){let We=Q.y>(ie.y??0);K.y=We?Q.y+Va:Q.y-Va}else{let We=Q.x>(ie.x??0);K.x=We?Q.x+Va:Q.x-Va}let H=s((We,rt)=>{for(let pt of d)if(!rt.includes(pt.nodeId)&&We.x>pt.minX&&We.x<pt.maxX&&We.y>pt.minY&&We.y<pt.maxY)return{inside:!0,obstacle:pt};return{inside:!1}},"isPointInObstacle"),U=s((We,rt,pt,nr,Wt)=>{if(Wt){let gn=We.y>(rt.y??0);return{x:(pt.x??0)>=We.x?nr.maxX+Xd:nr.minX-Xd,y:gn?nr.maxY+tg:nr.minY-tg,leavesPositiveSide:gn}}let Or=We.x>(rt.x??0),cn=(pt.y??0)>=We.y;return{x:Or?nr.maxX+Xd:nr.minX-Xd,y:cn?nr.maxY+tg:nr.minY-tg,leavesPositiveSide:Or}},"obstacleDetour"),ve=[],ke=[re.start,re.end],Ae=H(ae,ke);if(Ae.inside&&Ae.obstacle){let We=Ae.obstacle;if(ye){let rt=U(ue,te,ie,We,!0);ae.x=rt.x,ae.y=rt.y;let pt=rt.leavesPositiveSide?Math.min(We.minY-2,ue.y+Va):Math.max(We.maxY+2,ue.y-Va);ve=[{x:ue.x,y:pt},{x:rt.x,y:pt},{x:rt.x,y:rt.y}]}else{let rt=U(ue,te,ie,We,!1),pt=rt.leavesPositiveSide?Math.min(We.minX-2,ue.x+Va):Math.max(We.maxX+2,ue.x-Va);ae.x=rt.x,ae.y=rt.y,ve=[{x:pt,y:ue.y},{x:pt,y:rt.y},{x:rt.x,y:rt.y}]}}let Se=[],De=H(K,ke);if(De.inside&&De.obstacle){let We=De.obstacle;if(Z){let rt=U(Q,ie,te,We,!0);K.x=rt.x,K.y=rt.y,Se=[{x:rt.x,y:rt.y},{x:Q.x,y:rt.y}]}else{let rt=U(Q,ie,te,We,!1);K.x=rt.x,K.y=rt.y,Se=[{x:rt.x,y:rt.y},{x:rt.x,y:Q.y}]}}if(ve.length===0&&Se.length===0){let We=Xd,rt=Math.abs(ae.x-K.x)<We,pt=Math.abs(ae.y-K.y)<We,nr=P.get(`${X}:src`)!==void 0||P.get(`${X}:dst`)!==void 0,Wt=(v.get(`${re.start??""}:${R}:src`)?.length??0)+(v.get(`${re.start??""}:${R}:dst`)?.length??0),Or=(v.get(`${re.end??""}:${V}:src`)?.length??0)+(v.get(`${re.end??""}:${V}:dst`)?.length??0),cn=Wt>1||Or>1,gn=S.get(re.start??"")??0,dr=S.get(re.end??"")??0,kt=Wt>1&&$(re.start,R)||Or>1&&$(re.end,V),Rt=Wt<=1||gn<=2,Dt=Or<=1||dr<=2;if((rt||pt)&&!nr&&(!cn||cn&&!kt&&Rt&&Dt)&&!E(ue,Q,re.start,re.end)){re.points=[{...ue},{...ae},{...K},{...Q}],x.add(X);let he=pt?"horizontal":"vertical",Fr=pt?ue.y:ue.x,be=pt?Math.min(ue.x,Q.x):Math.min(ue.y,Q.y),ur=pt?Math.max(ue.x,Q.x):Math.max(ue.y,Q.y),ei={id:`fast-path-${he}-${Fr.toFixed(0)}-${X}`,orientation:he,coord:Fr,spanMin:be,spanMax:ur,tracks:[]};m.push({edgeIndex:X,segmentIndex:0,orientation:he,pipe:ei,trackIndex:0,from:be,to:ur});continue}}let Le=f("vertical",ae.x,ae.y,ae.y);ae.x=Le.coord;let Fe=f("vertical",K.x,K.y,K.y);K.x=Fe.coord;let Ee=Math.min(ae.x,K.x)-50,tt=Math.max(ae.x,K.x)+50,de=Math.min(ae.y,K.y)-50,bt=Math.max(ae.y,K.y)+50;for(let We of d){let rt=Math.min(ae.x,K.x),pt=Math.max(ae.x,K.x),nr=Math.min(ae.y,K.y),Wt=Math.max(ae.y,K.y);We.minX<pt&&We.maxX>rt&&We.minY<Wt&&We.maxY>nr&&(Ee=Math.min(Ee,We.minX-OS),tt=Math.max(tt,We.maxX+OS),de=Math.min(de,We.minY-OS),bt=Math.max(bt,We.maxY+OS))}for(let We of d){if(We.maxX<Ee||We.minX>tt||We.maxY<de||We.minY>bt)continue;let rt=Xd;f("horizontal",We.minY-rt,Ee,tt),f("horizontal",We.maxY+rt,Ee,tt);let pt=tg;f("vertical",We.minX-pt,de,bt),f("vertical",We.maxX+pt,de,bt)}f("horizontal",ae.y,Ee,tt),f("horizontal",K.y,Ee,tt);let we=l.filter(We=>We.orientation==="horizontal"&&We.coord>=de&&We.coord<=bt),vt=l.filter(We=>We.orientation==="vertical"&&We.coord>=Ee&&We.coord<=tt),Ot=s((We,rt)=>`${We.toFixed(1)},${rt.toFixed(1)}`,"getKey"),Ar=Ot(ae.x,ae.y),xt=Ot(K.x,K.y),$t=new Map,Et=new Map,oe=new Map,ut=new Set,yt=[];$t.set(Ar,0),oe.set(Ar,"n"),yt.push({key:Ar,f:Math.hypot(K.x-ae.x,K.y-ae.y),pt:ae}),ut.add(Ar);let Ue=[],fe=s((We,rt)=>E(We,rt,re.start,re.end),"checkSegmentBlocked"),Qe={x:K.x,y:ae.y},Ye=fe(ae,Qe),ct=fe(Qe,K),Jt=Ye||ct,St={x:ae.x,y:K.y},Kt=fe(ae,St),kr=fe(St,K);if(Jt?Kt||kr||(Math.abs(ae.x-K.x)<Rr?Ue=[ae,K]:Ue=[ae,St,K]):Math.abs(ae.y-K.y)<Rr||Math.abs(ae.x-K.x)<Rr?Ue=[ae,K]:Ue=[ae,Qe,K],Ue.length===0)for(;yt.length>0;){yt.sort((dr,kt)=>dr.f-kt.f);let We=yt.shift();if(ut.delete(We.key),We.key===xt){let dr=xt,kt=K;for(Ue=[kt];Et.has(dr);){let Rt=Et.get(dr);Ue.unshift(Rt),kt=Rt,dr=Ot(Rt.x,Rt.y)}break}let rt=We.pt.x,pt=We.pt.y,nr=vt.sort((dr,kt)=>dr.coord-kt.coord),Wt=nr.findIndex(dr=>Math.abs(dr.coord-rt)<1),Or=we.sort((dr,kt)=>dr.coord-kt.coord),cn=Or.findIndex(dr=>Math.abs(dr.coord-pt)<1),gn=[];Wt>0&&gn.push({x:nr[Wt-1].coord,y:pt}),Wt>=0&&Wt<nr.length-1&&gn.push({x:nr[Wt+1].coord,y:pt}),cn>0&&gn.push({x:rt,y:Or[cn-1].coord}),cn>=0&&cn<Or.length-1&&gn.push({x:rt,y:Or[cn+1].coord});for(let dr of gn){let kt=Math.min(rt,dr.x),Rt=Math.max(rt,dr.x),Dt=Math.min(pt,dr.y),ht=Math.max(pt,dr.y);if(d.some(pe=>pe.nodeId===re.start||pe.nodeId===re.end?!1:kt!==Rt?pe.minY<pt&&pe.maxY>pt&&pe.maxX>kt&&pe.minX<Rt:pe.minX<rt&&pe.maxX>rt&&pe.maxY>Dt&&pe.minY<ht))continue;let he=Ot(dr.x,dr.y),Fr=Math.abs(dr.x-rt)+Math.abs(dr.y-pt),be=C(X,We.pt,dr),ur=0,ei=K.x-ae.x,_a=K.y-ae.y,iu=dr.x-rt,Hl=dr.y-pt;(_a>10&&Hl<-5||_a<-10&&Hl>5)&&(ur=Math.abs(Hl)*100),(ei>10&&iu<-5||ei<-10&&iu>5)&&(ur+=Math.abs(iu)*50);let wp=0,Nn=oe.get(We.key)??"n",na=Math.abs(iu)>Rr?"h":"v";Nn!=="n"&&Nn!==na&&(wp=50);let Go=Fr+be+ur+wp,Aa=($t.get(We.key)??1/0)+Go,gt=Math.abs(K.x-dr.x)+Math.abs(K.y-dr.y);if(Aa<($t.get(he)??1/0))if(Et.set(he,We.pt),$t.set(he,Aa),oe.set(he,na),!ut.has(he))yt.push({key:he,f:Aa+gt,pt:dr}),ut.add(he);else{let pe=yt.findIndex(qe=>qe.key===he);pe!==-1&&(yt[pe].f=Aa+gt)}}}if(Ue.length===0&&(Ue=[ae,{x:ae.x,y:K.y},K]),Ue.length>4){let We=Ue[0],rt=Ue[Ue.length-1],pt=Math.min(We.x,rt.x),nr=Math.max(We.x,rt.x),Wt=Math.min(We.y,rt.y),Or=Math.max(We.y,rt.y);for(let Dt of Ue)pt=Math.min(pt,Dt.x),nr=Math.max(nr,Dt.x),Wt=Math.min(Wt,Dt.y),Or=Math.max(Or,Dt.y);let cn=nr>Math.max(We.x,rt.x),gn=pt<Math.min(We.x,rt.x);if(u){let Dt=tg;if(cn){let ht=Math.max(We.x,rt.x),Xt=Math.min(We.y,rt.y),he=Math.max(We.y,rt.y),Fr=d.filter(be=>be.minX<ht&&be.maxX>ht&&be.minY<he&&be.maxY>Xt);if(Fr.length>0){let be=Math.max(We.x,rt.x);for(let ur of Fr){let ei=(ur.minX+ur.maxX)/2;if(ur.visualXHalfExtent===void 0||isNaN(ur.visualXHalfExtent))continue;let _a=ei+ur.visualXHalfExtent+Dt;be=Math.max(be,_a)}isNaN(be)||(nr=be)}}if(gn){let ht=d.filter(Xt=>Xt.minX<Math.min(We.x,rt.x)+Dt&&Xt.minY<Math.max(We.y,rt.y)&&Xt.maxY>Math.min(We.y,rt.y));if(ht.length>0){let Xt=Math.min(We.x,rt.x);for(let he of ht){let be=(he.minX+he.maxX)/2-he.visualXHalfExtent-Dt;Xt=Math.min(Xt,be)}pt=Xt}}}let dr=s(Dt=>{let ht=rt.y>We.y,Xt=d.filter(be=>{let ur=Math.min(We.x,rt.x)<be.maxX&&Math.max(We.x,rt.x)>be.minX,ei=Math.min(We.y,rt.y)<be.maxY&&Math.max(We.y,rt.y)>be.minY;return ur&&ei}),he=Xt;if(u&&Xt.length>0){let be=Xt.filter(ur=>ur.minX<Dt&&ur.maxX>Dt);be.length>0&&(he=be)}if(he.length===0)return rt.y;let Fr=Xd;if(ht){let ur=Math.max(...he.map(ei=>ei.maxY))+Fr;if(ur<rt.y-Rr)return ur}else{let ur=Math.min(...he.map(ei=>ei.minY))-Fr;if(ur>rt.y+Rr)return ur}return rt.y},"findBestReturnY"),kt=s(Dt=>{let ht=dr(Dt),Xt={x:Dt,y:We.y},he={x:Dt,y:ht},Fr={x:rt.x,y:ht},be=fe(We,Xt),ur=fe(Xt,he),ei=fe(he,Fr),_a=ht!==rt.y?fe(Fr,rt):!1;return!be&&!ur&&!ei&&!_a?Math.abs(ht-rt.y)<Rr?[We,Xt,he,rt]:[We,Xt,he,Fr,rt]:null},"trySimplifyWithDetourX"),Rt=cn&&!gn?kt(nr):gn&&!cn?kt(pt):null;Rt&&(Ue=Rt)}let wt=[ue,...ve,...Ue,...Se.reverse(),Q];if(wt.length>=3){let We=wt[wt.length-1],rt=wt[wt.length-2],pt=wt[wt.length-3],nr=Math.abs(pt.y-rt.y)<Rr&&Math.abs(rt.y-We.y)<Rr,Wt=Math.abs(pt.x-rt.x)<Rr&&Math.abs(rt.x-We.x)<Rr;if(nr){let Or=Math.sign(rt.x-pt.x),cn=Math.sign(We.x-pt.x);Or!==0&&Or===cn&&Math.abs(rt.x-pt.x)>Math.abs(We.x-pt.x)&&wt.splice(-2,1)}else if(Wt){let Or=Math.sign(rt.y-pt.y),cn=Math.sign(We.y-pt.y);Or!==0&&Or===cn&&Math.abs(rt.y-pt.y)>Math.abs(We.y-pt.y)&&wt.splice(-2,1)}}let Vt=[wt[0]];for(let We=1;We<wt.length-1;We++){if(We===1){Vt.push(wt[We]);continue}let rt=Vt[Vt.length-1],pt=wt[We],nr=wt[We+1];if(Math.abs(rt.y-pt.y)<Rr&&Math.abs(pt.y-nr.y)<Rr){let Wt=pt.x>rt.x,Or=nr.x>pt.x;if(Wt!==Or){Vt.push(pt);continue}continue}if(Math.abs(rt.x-pt.x)<Rr&&Math.abs(pt.x-nr.x)<Rr){let Wt=pt.y>rt.y,Or=nr.y>pt.y;if(Wt!==Or){Vt.push(pt);continue}continue}Vt.push(pt)}Vt.push(wt[wt.length-1]);for(let We=0;We<Vt.length-1;We++){let rt=Vt[We],pt=Vt[We+1],nr=Math.abs(rt.x-pt.x)<Rr?"vertical":"horizontal",Wt=nr==="vertical"?rt.x:rt.y,Or=nr==="vertical"?Math.min(rt.y,pt.y):Math.min(rt.x,pt.x),cn=nr==="vertical"?Math.max(rt.y,pt.y):Math.max(rt.x,pt.x),gn=f(nr,Wt,Or,cn),dr={edgeIndex:X,segmentIndex:We,orientation:nr,pipe:gn,trackIndex:0,from:Or,to:cn};m.push(dr),y[X].push(m.length-1),gn.tracks[0]||(gn.tracks[0]={index:0,coord:gn.coord,segments:[]}),gn.tracks[0].segments.push({edgeIndex:X,segmentIndex:We,from:Or,to:cn})}}let z=s((X,re)=>X.from<re.to&&re.from<X.to,"segmentsOverlap"),j=s((X,re,te,ie)=>{let ue=!ie.segments.some(R=>(R.edgeIndex!==re.edgeIndex||R.segmentIndex!==re.segmentIndex)&&z(R,X)),Q=!te.segments.some(R=>(R.edgeIndex!==X.edgeIndex||R.segmentIndex!==X.segmentIndex)&&z(R,re));return ue&&Q?(X.trackIndex=ie.index,re.trackIndex=te.index,te.segments=[...te.segments.filter(R=>R.edgeIndex!==X.edgeIndex||R.segmentIndex!==X.segmentIndex),{edgeIndex:re.edgeIndex,segmentIndex:re.segmentIndex,from:re.from,to:re.to}],ie.segments=[...ie.segments.filter(R=>R.edgeIndex!==re.edgeIndex||R.segmentIndex!==re.segmentIndex),{edgeIndex:X.edgeIndex,segmentIndex:X.segmentIndex,from:X.from,to:X.to}],!0):!1},"trySwapSegmentsAcrossTracks"),J=s(X=>{let re=X.tracks.length;return X.tracks[re]={index:re,coord:X.coord,segments:[]},re},"createNewTrack"),ee=s((X,re)=>{let te=X.pipe.tracks[X.trackIndex];te.segments=te.segments.filter(ue=>ue.edgeIndex!==X.edgeIndex||ue.segmentIndex!==X.segmentIndex),X.trackIndex=re,X.pipe.tracks[re].segments.push({edgeIndex:X.edgeIndex,segmentIndex:X.segmentIndex,from:X.from,to:X.to})},"moveSegmentToTrack"),le=s((X,re)=>{let te=y[X.edgeIndex];for(let ie of te){let ue=m[ie];ue.pipe===X.pipe&&ee(ue,re)}},"moveSegmentChainToTrack"),se=s(X=>{let re=y[X.edgeIndex],te=re.indexOf(m.indexOf(X)),ie=[];return te>0&&ie.push(m[re[te-1]]),te<re.length-1&&ie.push(m[re[te+1]]),ie},"getAdjacentSegmentsAlongEdge"),Ce=s((X,re)=>{if(X.orientation===re.orientation)return!1;let te=X.orientation==="horizontal"?X:re,ie=X.orientation==="horizontal"?re:X;return ie.pipe.coord>te.from&&ie.pipe.coord<te.to&&te.pipe.coord>ie.from&&te.pipe.coord<ie.to},"haveAnyCrossing"),ce=s((X,re)=>{for(let te of X.tracks)if(!te.segments.some(ue=>(ue.edgeIndex!==re.edgeIndex||ue.segmentIndex!==re.segmentIndex)&&z(ue,re)))return te.index;return-1},"findAvailableTrack"),_e=s((X,re)=>{if(X.trackIndex===re.trackIndex)return z(X,re);let te=se(X),ie=se(re);return te.some(ue=>ie.some(Q=>Ce(ue,Q)))},"segmentsConflict"),me=s((X,re,te)=>{if(j(X,re,X.pipe.tracks[X.trackIndex],re.pipe.tracks[re.trackIndex]))return;let ie=ce(X.pipe,re);te(re,ie!==-1?ie:J(X.pipe))},"resolveTrackConflict"),ge=s(X=>{let re=0;for(let te=0;te<X.length;te++)for(let ie=te+1;ie<X.length;ie++){let ue=X[te],Q=X[ie];ue.pipe===Q.pipe&&_e(ue,Q)&&(re++,me(ue,Q,le))}return re},"resolveHandleConflicts"),Be=new Map,$e=s(X=>{if(Be.has(X))return Be.get(X);let re=y[X];if(re.length===0){let V={dest:0,deviation:0,base:0,delta:0};return Be.set(X,V),V}let ie=m[re[0]].pipe.coord,ue=ie;for(let V=1;V<re.length;V++){let ae=m[re[V]];if(ae.orientation==="horizontal"){let K=ae.from,ye=ae.to;ue=Math.abs(K-ie)>Math.abs(ye-ie)?K:ye;break}}let Q=Math.abs(ue-ie),R={dest:ue,deviation:Q,base:ie,delta:ue-ie};return Be.set(X,R),R},"getDestInfo"),Ie=s(()=>{let X=0,re=new Map;for(let[ie,ue]of i.entries())y[ie].length!==0&&ue.start&&(re.has(ue.start)||re.set(ue.start,[]),re.get(ue.start).push(ie));let te=s(ie=>{let ue=i[ie];if(!ue.start||!ue.end)return 0;let Q=a.get(ue.start),R=a.get(ue.end);if(!Q||!R)return 0;let V=(R.x??0)-(Q.x??0),ae=(R.y??0)-(Q.y??0);return Math.abs(V)+Math.abs(ae)},"getEdgeDistance");for(let ie of re.values()){ie.sort((Q,R)=>{let V=$e(Q),ae=$e(R);if(Math.abs(V.deviation-ae.deviation)>1)return V.deviation-ae.deviation;if(Math.abs(V.dest-ae.dest)>1)return V.dest-ae.dest;let K=te(Q),ye=te(R);if(Math.abs(K-ye)>1)return ye-K;let Z=y[Q].length,H=y[R].length;if(Z!==H)return Z-H;if(Z===1){let U=y[Q][0],ve=y[R][0];if(m[U]&&m[ve]){let ke=m[U],Ae=m[ve],Se=Math.abs(ke.to-ke.from),De=Math.abs(Ae.to-Ae.from);if(Math.abs(Se-De)>1)return Se-De}}return 0});let ue=ie.map(Q=>m[y[Q][0]]);X+=ge(ue)}return X},"fixSourceHandleCrossings"),nt=s(()=>{let X=0,re=new Map;for(let[te,ie]of i.entries())y[te].length!==0&&ie.end&&(re.has(ie.end)||re.set(ie.end,[]),re.get(ie.end).push(te));for(let te of re.values()){te.sort((ue,Q)=>{let R=s(K=>{let ye=y[K];if(ye.length<2)return 0;let Z=m[ye[ye.length-2]];return Math.abs(Z.to-Z.from)},"getDist"),V=R(ue),ae=R(Q);return Math.abs(V-ae)>.1?V-ae:ue-Q});let ie=te.map(ue=>m[y[ue][y[ue].length-1]]);X+=ge(ie)}return X},"fixTargetHandleCrossings"),lt=s(()=>{let X=0;for(let re of l){let te=[];for(let ie of re.tracks)for(let ue of ie.segments){let Q=y[ue.edgeIndex].find(R=>m[R].segmentIndex===ue.segmentIndex);Q!==void 0&&te.push(m[Q])}te.sort((ie,ue)=>ie.edgeIndex-ue.edgeIndex||ie.segmentIndex-ue.segmentIndex);for(let ie=0;ie<te.length;ie++)for(let ue=ie+1;ue<te.length;ue++){let Q=te[ie],R=te[ue];_e(Q,R)&&(X++,me(Q,R,ee))}}return X},"fixPipeCrossings"),Te=0,Ne=10;for(;Te<Ne;){let X=0;if(X+=Ie(),X+=nt(),X+=lt(),X===0)break;Te++}let Pe=new Map;for(let X of l){let re=[];X.tracks.forEach(ie=>{ie.segments.forEach(ue=>{re.push({edgeIndex:ue.edgeIndex,segmentIndex:ue.segmentIndex,trackIndex:ie.index,from:ue.from,to:ue.to})})}),re.sort((ie,ue)=>ie.from-ue.from);let te=[];if(re.length>0){let ie=[re[0]],ue=re[0].to;for(let Q=1;Q<re.length;Q++){let R=re[Q];R.from<ue?(ie.push(R),ue=Math.max(ue,R.to)):(te.push(ie),ie=[R],ue=R.to)}te.push(ie)}for(let ie of te){let ue=new Set;ie.forEach(U=>ue.add(U.trackIndex));let Q=new Map;ie.forEach(U=>{let ve=$e(U.edgeIndex);Q.set(U.trackIndex,(Q.get(U.trackIndex)??0)+ve.delta)});let R=[...ue].filter(U=>(Q.get(U)??0)<-1),V=[...ue].filter(U=>(Q.get(U)??0)>1),ae=[...ue].filter(U=>Math.abs(Q.get(U)??0)<=1);R.sort((U,ve)=>(Q.get(ve)??0)-(Q.get(U)??0)),V.sort((U,ve)=>(Q.get(U)??0)-(Q.get(ve)??0));let K=s((U,ve)=>{ie.filter(ke=>ke.trackIndex===U).forEach(ke=>{let Ae=x.has(ke.edgeIndex)?X.coord:ve;Pe.set(`${ke.edgeIndex}-${ke.segmentIndex}`,Ae)})},"assignCoord"),ye=0;for(let U of R)ye++,K(U,X.coord-ye*ZN);if(ae.length===0&&ue.size>0){let U=[...ue].sort((Ae,Se)=>Math.abs(Q.get(Ae)??0)-Math.abs(Q.get(Se)??0))[0],ve=R.indexOf(U);ve!==-1&&R.splice(ve,1);let ke=V.indexOf(U);ke!==-1&&V.splice(ke,1),ae.push(U)}let Z=0;for(let U of ae){if(Z===0)K(U,X.coord);else{let ve=Z%2===1?1:-1,ke=Math.ceil(Z/2);K(U,X.coord+ve*ke*ZN*.5)}Z++}let H=0;for(let U of V)H++,K(U,X.coord+H*ZN)}}for(let[X,re]of i.entries()){let te=y[X]??[];if(te.length===0)continue;let ie=[],ue=a.get(re.start),Q=a.get(re.end),{pSrcPort:R,pDstPort:V}=q(X,ue,Q),ae=te.map(Z=>{let H=m[Z],U=Pe.get(`${H.edgeIndex}-${H.segmentIndex}`)??H.pipe.coord;return{orient:H.orientation,coord:U,from:H.from,to:H.to}});ie.push(R);for(let Z=0;Z<ae.length;Z++){let H=ae[Z],U=ie[ie.length-1],ve=H.orient==="vertical"?U.y:U.x,ke=H.orient==="vertical"?U.x:U.y,Ae=ae[Z+1],Se=Z<ae.length-1;if(Math.abs(ke-H.coord)>Rr&&ie.push(rg(H,ve)),Se&&Ae.orient===H.orient)if(Math.abs(H.coord-Ae.coord)>Rr){let De=H.orient==="vertical"?(ve+Ae.from)/2:Tle(H,Ae);ie.push(rg(H,De),rg(Ae,De))}else(Z===0||Z===ae.length-2)&&ie.push(rg(H,Tle(H,Ae)));else if(Se)ie.push(rg(H,Ae.coord));else{let De=Math.abs(H.from-ve)<Math.abs(H.to-ve)?H.to:H.from;ie.push(rg(H,De))}}let K=ie[ie.length-1];(Math.abs(K.x-V.x)>Rr||Math.abs(K.y-V.y)>Rr)&&ie.push(V);let ye=[];ie.length>0&&ye.push(ie[0]);for(let Z=1;Z<ie.length;Z++){let H=ie[Z],U=ye[ye.length-1];(Math.abs(H.x-U.x)>Rr||Math.abs(H.y-U.y)>Rr)&&ye.push(H)}re.points=ye}for(let X of i){let re=X.__originalEdge;re&&X.points&&(re.points=X.points)}e.edges=(e.edges??[]).filter(X=>!X.isLayoutOnly);let Re=s((X,re)=>{let te=re.x??0,ie=re.y??0,ue=re.width??0,Q=re.height??0;if(ue<=0||Q<=0)return X;let R=te-ue/2,V=te+ue/2,ae=ie-Q/2,K=ie+Q/2;if(X.x<R||X.x>V||X.y<ae||X.y>K)return X;let ye=X.x-R,Z=V-X.x,H=X.y-ae,U=K-X.y,ve=Math.min(ye,Z,H,U);return ve===ye?{x:R,y:X.y}:ve===Z?{x:V,y:X.y}:ve===H?{x:X.x,y:ae}:{x:X.x,y:K}},"nodeBoundaryClamp");for(let X of e.edges){let re=X.points;if(!re||re.length<2)continue;let te=X.start,ie=X.end,ue=te?a.get(te):void 0,Q=ie?a.get(ie):void 0;ue&&(re[0]=Re(re[0],ue)),Q&&(re[re.length-1]=Re(re[re.length-1],Q))}return e}var Rr,rqe,Xd,tg,OS,Va,ZN,kle=_(()=>{"use strict";eg();Rr=Ooe.EPSILON,rqe=8,Xd=15,tg=15,OS=25,Va=20,ZN=10;s(ble,"chooseOrthogonalSide");s(Tle,"sharedLineEndpointCoord");s(rg,"pointOnLine");s(Cle,"routeEdgesOrthogonal")});function nqe(e){return e.direction??"TB"}function Sle(e){let t=Pae(e),r=e.config.flowchart?.nodeSpacing??40,n=e.config.flowchart?.rankSpacing??100,i=e.config.swimlane?.ignoreCrossLaneEdges??!0,a=e.config.swimlane?.optimizeRanksByCrossings??!0,o=e.config.swimlane?.automaticLaneOrdering??!1,l=nqe(e),{ordered:u,coordinates:h}=yle(t,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:o,direction:l});Mae(t,u,h,{nodeGap:r,layerGap:n});for(let d of e.edges??[])delete d.points;Cle(e,l);for(let d of e.edges??[])(!d.curve||d.curve==="basis")&&(d.curve="rounded");return Ioe(e,l),WN(e),l}var vle=_(()=>{"use strict";Noe();RN();xle();kle();s(nqe,"getSwimlaneDirection");s(Sle,"runSwimlaneLayoutCore")});var Ele={};jt(Ele,{render:()=>sqe});function iqe(e){Nae(e);let t=Oae(e);e.nodes=t.nodes,e.edges=t.edges}var sqe,wle=_(()=>{"use strict";xS();Dae();RN();$ae();vle();s(iqe,"prepareSwimlaneLayout");sqe=Xm({prepareLayout:iqe,runLayoutCore:Sle,afterPaint:Lae})});var xx,JN,aqe,kl,uh,Qd=_(()=>{"use strict";WZ();ft();xx={},JN=s(e=>{for(let t of e)xx[t.name]=t},"registerLayoutLoaders"),aqe=s(()=>{JN([{name:"dagre",loader:s(async()=>await Promise.resolve().then(()=>(vae(),Sae)),"loader")},{name:"swimlane",loader:s(async()=>await Promise.resolve().then(()=>(wle(),Ele)),"loader")}])},"registerDefaultLayoutLoaders");aqe();kl=s(async(e,t)=>{if(!(e.layoutAlgorithm in xx))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let d of e.nodes){let f=d.domId||d.id;d.domId=`${e.diagramId}-${f}`}let r=xx[e.layoutAlgorithm],n=await r.loader(),{theme:i,themeVariables:a}=e.config,{useGradient:o,gradientStart:l,gradientStop:u}=a,h=t.attr("id");if(t.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${i?.includes("dark")?"#FFFFFF":"#000000"}`),o){let d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}return n.render(e,t,VZ,{algorithm:r.algorithm})},"render"),uh=s((e="",{fallback:t="dagre"}={})=>{if(e in xx)return e;if(t in xx)return Y.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm")});var Wa,oqe,lqe,Zd=_(()=>{"use strict";fn();ft();Wa=s((e,t,r,n)=>{e.attr("class",r);let{width:i,height:a,x:o,y:l}=oqe(e,t);Cr(e,a,i,n);let u=lqe(o,l,i,a,t);e.attr("viewBox",u),Y.debug(`viewBox configured: ${u} with padding: ${t}`)},"setupViewPortForSVG"),oqe=s((e,t)=>{let r=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:r.width+t*2,height:r.height+t*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),lqe=s((e,t,r,n,i)=>`${e-i} ${t-i} ${r} ${n}`,"createViewBox")});var cqe,uqe,_le,Ale=_(()=>{"use strict";Nt();ft();bm();Qd();Zd();Pt();cqe=s(function(e,t){return t.db.getClasses()},"getClasses"),uqe=s(async function(e,t,r,n){Y.info("REF0:"),Y.info("Drawing state diagram (v2)",t);let{securityLevel:i,flowchart:a,layout:o}=xe();n.db.setDiagramId(t),Y.debug("Before getData: ");let l=n.db.getData();Y.debug("Data: ",l);let u=ol(t,i),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=uh(o),l.layoutAlgorithm==="dagre"&&o==="elk"&&Y.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),l.direction=h,l.nodeSpacing=a?.nodeSpacing||50,l.rankSpacing=a?.rankSpacing||50,l.markers=["point","circle","cross"],l.diagramId=t,Y.debug("REF1:",l),await kl(l,u);let d=l.config.flowchart?.diagramPadding??8;Bt.insertTitle(u,"flowchartTitleText",a?.titleTopMargin||0,n.db.getDiagramTitle()),Wa(u,d,"flowchart",a?.useMaxWidth||!1)},"draw"),_le={getClasses:cqe,draw:uqe}});var eP,tP,Rle=_(()=>{"use strict";eP=(function(){var e=s(function(dr,kt,Rt,Dt){for(Rt=Rt||{},Dt=dr.length;Dt--;Rt[dr[Dt]]=kt);return Rt},"o"),t=[1,4],r=[1,3],n=[1,5],i=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],a=[2,2],o=[1,13],l=[1,14],u=[1,15],h=[1,16],d=[1,23],f=[1,25],p=[1,26],g=[1,27],m=[1,50],y=[1,49],x=[1,29],T=[1,30],C=[1,31],k=[1,32],E=[1,33],v=[1,45],S=[1,47],w=[1,43],L=[1,48],O=[1,44],F=[1,51],N=[1,46],G=[1,52],A=[1,53],M=[1,34],I=[1,35],P=[1,36],B=[1,37],D=[1,38],$=[1,58],W=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],q=[1,62],z=[1,61],j=[1,63],J=[8,9,11,75,77,78],ee=[1,79],le=[1,92],se=[1,97],Ce=[1,96],ce=[1,93],_e=[1,89],me=[1,95],ge=[1,91],Be=[1,98],$e=[1,94],Ie=[1,99],nt=[1,90],lt=[8,9,10,11,40,75,77,78],Te=[8,9,10,11,40,46,75,77,78],Ne=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],Pe=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],Re=[44,60,89,102,105,106,109,111,114,115,116],X=[1,122],re=[1,123],te=[1,125],ie=[1,124],ue=[44,60,62,74,89,102,105,106,109,111,114,115,116],Q=[1,134],R=[1,148],V=[1,149],ae=[1,150],K=[1,151],ye=[1,136],Z=[1,138],H=[1,142],U=[1,143],ve=[1,144],ke=[1,145],Ae=[1,146],Se=[1,147],De=[1,152],Le=[1,153],Fe=[1,132],Ee=[1,133],tt=[1,140],de=[1,135],bt=[1,139],we=[1,137],vt=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Ot=[1,155],Ar=[1,157],xt=[8,9,11],$t=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],Et=[1,177],oe=[1,173],ut=[1,174],yt=[1,178],Ue=[1,175],fe=[1,176],Qe=[77,116,119],Ye=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],ct=[10,106],Jt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],St=[1,248],Kt=[1,246],kr=[1,250],Yt=[1,244],wt=[1,245],Vt=[1,247],We=[1,249],rt=[1,251],pt=[1,269],nr=[8,9,11,106],Wt=[8,9,10,11,60,84,105,106,109,110,111,112],Or={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:s(function(kt,Rt,Dt,ht,Xt,he,Fr){var be=he.length-1;switch(Xt){case 2:this.$=[];break;case 3:(!Array.isArray(he[be])||he[be].length>0)&&he[be-1].push(he[be]),this.$=he[be-1];break;case 4:case 183:this.$=he[be];break;case 11:ht.setDirection("TB"),this.$="TB";break;case 12:ht.setDirection(he[be-1]),this.$=he[be-1];break;case 27:this.$=he[be-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=ht.addSubGraph(he[be-6],he[be-1],he[be-4]);break;case 34:this.$=ht.addSubGraph(he[be-3],he[be-1],he[be-3]);break;case 35:this.$=ht.addSubGraph(void 0,he[be-1],void 0);break;case 37:this.$=he[be].trim(),ht.setAccTitle(this.$);break;case 38:case 39:this.$=he[be].trim(),ht.setAccDescription(this.$);break;case 43:this.$=he[be-1]+he[be];break;case 44:this.$=he[be];break;case 45:ht.addVertex(he[be-1][he[be-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,he[be]),ht.addLink(he[be-3].stmt,he[be-1],he[be-2]),this.$={stmt:he[be-1],nodes:he[be-1].concat(he[be-3].nodes)};break;case 46:ht.addLink(he[be-2].stmt,he[be],he[be-1]),this.$={stmt:he[be],nodes:he[be].concat(he[be-2].nodes)};break;case 47:ht.addLink(he[be-3].stmt,he[be-1],he[be-2]),this.$={stmt:he[be-1],nodes:he[be-1].concat(he[be-3].nodes)};break;case 48:this.$={stmt:he[be-1],nodes:he[be-1]};break;case 49:ht.addVertex(he[be-1][he[be-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,he[be]),this.$={stmt:he[be-1],nodes:he[be-1],shapeData:he[be]};break;case 50:this.$={stmt:he[be],nodes:he[be]};break;case 51:this.$=[he[be]];break;case 52:ht.addVertex(he[be-5][he[be-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,he[be-4]),this.$=he[be-5].concat(he[be]);break;case 53:this.$=he[be-4].concat(he[be]);break;case 54:this.$=he[be];break;case 55:this.$=he[be-2],ht.setClass(he[be-2],he[be]);break;case 56:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"square");break;case 57:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"doublecircle");break;case 58:this.$=he[be-5],ht.addVertex(he[be-5],he[be-2],"circle");break;case 59:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"ellipse");break;case 60:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"stadium");break;case 61:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"subroutine");break;case 62:this.$=he[be-7],ht.addVertex(he[be-7],he[be-1],"rect",void 0,void 0,void 0,Object.fromEntries([[he[be-5],he[be-3]]]));break;case 63:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"cylinder");break;case 64:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"round");break;case 65:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"diamond");break;case 66:this.$=he[be-5],ht.addVertex(he[be-5],he[be-2],"hexagon");break;case 67:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"odd");break;case 68:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"trapezoid");break;case 69:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"inv_trapezoid");break;case 70:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"lean_right");break;case 71:this.$=he[be-3],ht.addVertex(he[be-3],he[be-1],"lean_left");break;case 72:this.$=he[be],ht.addVertex(he[be]);break;case 73:he[be-1].text=he[be],this.$=he[be-1];break;case 74:case 75:he[be-2].text=he[be-1],this.$=he[be-2];break;case 76:this.$=he[be];break;case 77:var ur=ht.destructLink(he[be],he[be-2]);this.$={type:ur.type,stroke:ur.stroke,length:ur.length,text:he[be-1]};break;case 78:var ur=ht.destructLink(he[be],he[be-2]);this.$={type:ur.type,stroke:ur.stroke,length:ur.length,text:he[be-1],id:he[be-3]};break;case 79:this.$={text:he[be],type:"text"};break;case 80:this.$={text:he[be-1].text+""+he[be],type:he[be-1].type};break;case 81:this.$={text:he[be],type:"string"};break;case 82:this.$={text:he[be],type:"markdown"};break;case 83:var ur=ht.destructLink(he[be]);this.$={type:ur.type,stroke:ur.stroke,length:ur.length};break;case 84:var ur=ht.destructLink(he[be]);this.$={type:ur.type,stroke:ur.stroke,length:ur.length,id:he[be-1]};break;case 85:this.$=he[be-1];break;case 86:this.$={text:he[be],type:"text"};break;case 87:this.$={text:he[be-1].text+""+he[be],type:he[be-1].type};break;case 88:this.$={text:he[be],type:"string"};break;case 89:case 104:this.$={text:he[be],type:"markdown"};break;case 101:this.$={text:he[be],type:"text"};break;case 102:this.$={text:he[be-1].text+""+he[be],type:he[be-1].type};break;case 103:this.$={text:he[be],type:"text"};break;case 105:this.$=he[be-4],ht.addClass(he[be-2],he[be]);break;case 106:this.$=he[be-4],ht.setClass(he[be-2],he[be]);break;case 107:case 115:this.$=he[be-1],ht.setClickEvent(he[be-1],he[be]);break;case 108:case 116:this.$=he[be-3],ht.setClickEvent(he[be-3],he[be-2]),ht.setTooltip(he[be-3],he[be]);break;case 109:this.$=he[be-2],ht.setClickEvent(he[be-2],he[be-1],he[be]);break;case 110:this.$=he[be-4],ht.setClickEvent(he[be-4],he[be-3],he[be-2]),ht.setTooltip(he[be-4],he[be]);break;case 111:this.$=he[be-2],ht.setLink(he[be-2],he[be]);break;case 112:this.$=he[be-4],ht.setLink(he[be-4],he[be-2]),ht.setTooltip(he[be-4],he[be]);break;case 113:this.$=he[be-4],ht.setLink(he[be-4],he[be-2],he[be]);break;case 114:this.$=he[be-6],ht.setLink(he[be-6],he[be-4],he[be]),ht.setTooltip(he[be-6],he[be-2]);break;case 117:this.$=he[be-1],ht.setLink(he[be-1],he[be]);break;case 118:this.$=he[be-3],ht.setLink(he[be-3],he[be-2]),ht.setTooltip(he[be-3],he[be]);break;case 119:this.$=he[be-3],ht.setLink(he[be-3],he[be-2],he[be]);break;case 120:this.$=he[be-5],ht.setLink(he[be-5],he[be-4],he[be]),ht.setTooltip(he[be-5],he[be-2]);break;case 121:this.$=he[be-4],ht.addVertex(he[be-2],void 0,void 0,he[be]);break;case 122:this.$=he[be-4],ht.updateLink([he[be-2]],he[be]);break;case 123:this.$=he[be-4],ht.updateLink(he[be-2],he[be]);break;case 124:this.$=he[be-8],ht.updateLinkInterpolate([he[be-6]],he[be-2]),ht.updateLink([he[be-6]],he[be]);break;case 125:this.$=he[be-8],ht.updateLinkInterpolate(he[be-6],he[be-2]),ht.updateLink(he[be-6],he[be]);break;case 126:this.$=he[be-6],ht.updateLinkInterpolate([he[be-4]],he[be]);break;case 127:this.$=he[be-6],ht.updateLinkInterpolate(he[be-4],he[be]);break;case 128:case 130:this.$=[he[be]];break;case 129:case 131:he[be-2].push(he[be]),this.$=he[be-2];break;case 133:this.$=he[be-1]+he[be];break;case 181:this.$=he[be];break;case 182:this.$=he[be-1]+""+he[be];break;case 184:this.$=he[be-1]+""+he[be];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:t,10:r,12:n},{1:[3]},e(i,a,{5:6}),{4:7,9:t,10:r,12:n},{4:8,9:t,10:r,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:o,9:l,10:u,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:d,33:24,34:f,36:p,38:g,42:28,43:39,44:m,45:40,47:41,60:y,84:x,85:T,86:C,87:k,88:E,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A,121:M,122:I,123:P,124:B,125:D},e(i,[2,9]),e(i,[2,10]),e(i,[2,11]),{8:[1,55],9:[1,56],10:$,15:54,18:57},e(W,[2,3]),e(W,[2,4]),e(W,[2,5]),e(W,[2,6]),e(W,[2,7]),e(W,[2,8]),{8:q,9:z,11:j,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:q,9:z,11:j,21:68},{8:q,9:z,11:j,21:69},{8:q,9:z,11:j,21:70},{8:q,9:z,11:j,21:71},{8:q,9:z,11:j,21:72},{8:q,9:z,10:[1,73],11:j,21:74},e(W,[2,36]),{35:[1,75]},{37:[1,76]},e(W,[2,39]),e(J,[2,50],{18:77,39:78,10:$,40:ee}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:le,44:se,60:Ce,80:[1,87],89:ce,95:[1,84],97:[1,85],101:86,105:_e,106:me,109:ge,111:Be,114:$e,115:Ie,116:nt,120:88},e(W,[2,185]),e(W,[2,186]),e(W,[2,187]),e(W,[2,188]),e(W,[2,189]),e(lt,[2,51]),e(lt,[2,54],{46:[1,100]}),e(Te,[2,72],{113:113,29:[1,101],44:m,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:y,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:v,102:S,105:w,106:L,109:O,111:F,114:N,115:G,116:A}),e(Ne,[2,181]),e(Ne,[2,142]),e(Ne,[2,143]),e(Ne,[2,144]),e(Ne,[2,145]),e(Ne,[2,146]),e(Ne,[2,147]),e(Ne,[2,148]),e(Ne,[2,149]),e(Ne,[2,150]),e(Ne,[2,151]),e(Ne,[2,152]),e(i,[2,12]),e(i,[2,18]),e(i,[2,19]),{9:[1,114]},e(Pe,[2,26],{18:115,10:$}),e(W,[2,27]),{42:116,43:39,44:m,45:40,47:41,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A},e(W,[2,40]),e(W,[2,41]),e(W,[2,42]),e(Re,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:X,81:re,116:te,119:ie},{75:[1,126],77:[1,127]},e(ue,[2,83]),e(W,[2,28]),e(W,[2,29]),e(W,[2,30]),e(W,[2,31]),e(W,[2,32]),{10:Q,12:R,14:V,27:ae,28:128,32:K,44:ye,60:Z,75:H,80:[1,130],81:[1,131],83:141,84:U,85:ve,86:ke,87:Ae,88:Se,89:De,90:Le,91:129,105:Fe,109:Ee,111:tt,114:de,115:bt,116:we},e(vt,a,{5:154}),e(W,[2,37]),e(W,[2,38]),e(J,[2,48],{44:Ot}),e(J,[2,49],{18:156,10:$,40:Ar}),e(lt,[2,44]),{44:m,47:158,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A},{102:[1,159],103:160,105:[1,161]},{44:m,47:162,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A},{44:m,47:163,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A},e(xt,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(xt,[2,115],{120:168,10:[1,167],14:le,44:se,60:Ce,89:ce,105:_e,106:me,109:ge,111:Be,114:$e,115:Ie,116:nt}),e(xt,[2,117],{10:[1,169]}),e($t,[2,183]),e($t,[2,170]),e($t,[2,171]),e($t,[2,172]),e($t,[2,173]),e($t,[2,174]),e($t,[2,175]),e($t,[2,176]),e($t,[2,177]),e($t,[2,178]),e($t,[2,179]),e($t,[2,180]),{44:m,47:170,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A},{30:171,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:179,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:181,50:[1,180],67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:182,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:183,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:184,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{109:[1,185]},{30:186,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:187,65:[1,188],67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:189,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:190,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{30:191,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},e(Ne,[2,182]),e(i,[2,20]),e(Pe,[2,25]),e(J,[2,46],{39:192,18:193,10:$,40:ee}),e(Re,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{77:[1,197],79:198,116:te,119:ie},e(Qe,[2,79]),e(Qe,[2,81]),e(Qe,[2,82]),e(Qe,[2,168]),e(Qe,[2,169]),{76:199,79:121,80:X,81:re,116:te,119:ie},e(ue,[2,84]),{8:q,9:z,10:Q,11:j,12:R,14:V,21:201,27:ae,29:[1,200],32:K,44:ye,60:Z,75:H,83:141,84:U,85:ve,86:ke,87:Ae,88:Se,89:De,90:Le,91:202,105:Fe,109:Ee,111:tt,114:de,115:bt,116:we},e(Ye,[2,101]),e(Ye,[2,103]),e(Ye,[2,104]),e(Ye,[2,157]),e(Ye,[2,158]),e(Ye,[2,159]),e(Ye,[2,160]),e(Ye,[2,161]),e(Ye,[2,162]),e(Ye,[2,163]),e(Ye,[2,164]),e(Ye,[2,165]),e(Ye,[2,166]),e(Ye,[2,167]),e(Ye,[2,90]),e(Ye,[2,91]),e(Ye,[2,92]),e(Ye,[2,93]),e(Ye,[2,94]),e(Ye,[2,95]),e(Ye,[2,96]),e(Ye,[2,97]),e(Ye,[2,98]),e(Ye,[2,99]),e(Ye,[2,100]),{6:11,7:12,8:o,9:l,10:u,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,203],33:24,34:f,36:p,38:g,42:28,43:39,44:m,45:40,47:41,60:y,84:x,85:T,86:C,87:k,88:E,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A,121:M,122:I,123:P,124:B,125:D},{10:$,18:204},{44:[1,205]},e(lt,[2,43]),{10:[1,206],44:m,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:113,114:N,115:G,116:A},{10:[1,207]},{10:[1,208],106:[1,209]},e(ct,[2,128]),{10:[1,210],44:m,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:113,114:N,115:G,116:A},{10:[1,211],44:m,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:113,114:N,115:G,116:A},{80:[1,212]},e(xt,[2,109],{10:[1,213]}),e(xt,[2,111],{10:[1,214]}),{80:[1,215]},e($t,[2,184]),{80:[1,216],98:[1,217]},e(lt,[2,55],{113:113,44:m,60:y,89:v,102:S,105:w,106:L,109:O,111:F,114:N,115:G,116:A}),{31:[1,218],67:Et,82:219,116:yt,117:Ue,118:fe},e(Jt,[2,86]),e(Jt,[2,88]),e(Jt,[2,89]),e(Jt,[2,153]),e(Jt,[2,154]),e(Jt,[2,155]),e(Jt,[2,156]),{49:[1,220],67:Et,82:219,116:yt,117:Ue,118:fe},{30:221,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{51:[1,222],67:Et,82:219,116:yt,117:Ue,118:fe},{53:[1,223],67:Et,82:219,116:yt,117:Ue,118:fe},{55:[1,224],67:Et,82:219,116:yt,117:Ue,118:fe},{57:[1,225],67:Et,82:219,116:yt,117:Ue,118:fe},{60:[1,226]},{64:[1,227],67:Et,82:219,116:yt,117:Ue,118:fe},{66:[1,228],67:Et,82:219,116:yt,117:Ue,118:fe},{30:229,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},{31:[1,230],67:Et,82:219,116:yt,117:Ue,118:fe},{67:Et,69:[1,231],71:[1,232],82:219,116:yt,117:Ue,118:fe},{67:Et,69:[1,234],71:[1,233],82:219,116:yt,117:Ue,118:fe},e(J,[2,45],{18:156,10:$,40:Ar}),e(J,[2,47],{44:Ot}),e(Re,[2,75]),e(Re,[2,74]),{62:[1,235],67:Et,82:219,116:yt,117:Ue,118:fe},e(Re,[2,77]),e(Qe,[2,80]),{77:[1,236],79:198,116:te,119:ie},{30:237,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},e(vt,a,{5:238}),e(Ye,[2,102]),e(W,[2,35]),{43:239,44:m,45:40,47:41,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A},{10:$,18:240},{10:St,60:Kt,84:kr,92:241,105:Yt,107:242,108:243,109:wt,110:Vt,111:We,112:rt},{10:St,60:Kt,84:kr,92:252,104:[1,253],105:Yt,107:242,108:243,109:wt,110:Vt,111:We,112:rt},{10:St,60:Kt,84:kr,92:254,104:[1,255],105:Yt,107:242,108:243,109:wt,110:Vt,111:We,112:rt},{105:[1,256]},{10:St,60:Kt,84:kr,92:257,105:Yt,107:242,108:243,109:wt,110:Vt,111:We,112:rt},{44:m,47:258,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A},e(xt,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(xt,[2,116]),e(xt,[2,118],{10:[1,262]}),e(xt,[2,119]),e(Te,[2,56]),e(Jt,[2,87]),e(Te,[2,57]),{51:[1,263],67:Et,82:219,116:yt,117:Ue,118:fe},e(Te,[2,64]),e(Te,[2,59]),e(Te,[2,60]),e(Te,[2,61]),{109:[1,264]},e(Te,[2,63]),e(Te,[2,65]),{66:[1,265],67:Et,82:219,116:yt,117:Ue,118:fe},e(Te,[2,67]),e(Te,[2,68]),e(Te,[2,70]),e(Te,[2,69]),e(Te,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(Re,[2,78]),{31:[1,266],67:Et,82:219,116:yt,117:Ue,118:fe},{6:11,7:12,8:o,9:l,10:u,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,267],33:24,34:f,36:p,38:g,42:28,43:39,44:m,45:40,47:41,60:y,84:x,85:T,86:C,87:k,88:E,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A,121:M,122:I,123:P,124:B,125:D},e(lt,[2,53]),{43:268,44:m,45:40,47:41,60:y,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A},e(xt,[2,121],{106:pt}),e(nr,[2,130],{108:270,10:St,60:Kt,84:kr,105:Yt,109:wt,110:Vt,111:We,112:rt}),e(Wt,[2,132]),e(Wt,[2,134]),e(Wt,[2,135]),e(Wt,[2,136]),e(Wt,[2,137]),e(Wt,[2,138]),e(Wt,[2,139]),e(Wt,[2,140]),e(Wt,[2,141]),e(xt,[2,122],{106:pt}),{10:[1,271]},e(xt,[2,123],{106:pt}),{10:[1,272]},e(ct,[2,129]),e(xt,[2,105],{106:pt}),e(xt,[2,106],{113:113,44:m,60:y,89:v,102:S,105:w,106:L,109:O,111:F,114:N,115:G,116:A}),e(xt,[2,110]),e(xt,[2,112],{10:[1,273]}),e(xt,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:q,9:z,11:j,21:278},e(W,[2,34]),e(lt,[2,52]),{10:St,60:Kt,84:kr,105:Yt,107:279,108:243,109:wt,110:Vt,111:We,112:rt},e(Wt,[2,133]),{14:le,44:se,60:Ce,89:ce,101:280,105:_e,106:me,109:ge,111:Be,114:$e,115:Ie,116:nt,120:88},{14:le,44:se,60:Ce,89:ce,101:281,105:_e,106:me,109:ge,111:Be,114:$e,115:Ie,116:nt,120:88},{98:[1,282]},e(xt,[2,120]),e(Te,[2,58]),{30:283,67:Et,80:oe,81:ut,82:172,116:yt,117:Ue,118:fe},e(Te,[2,66]),e(vt,a,{5:284}),e(nr,[2,131],{108:270,10:St,60:Kt,84:kr,105:Yt,109:wt,110:Vt,111:We,112:rt}),e(xt,[2,126],{120:168,10:[1,285],14:le,44:se,60:Ce,89:ce,105:_e,106:me,109:ge,111:Be,114:$e,115:Ie,116:nt}),e(xt,[2,127],{120:168,10:[1,286],14:le,44:se,60:Ce,89:ce,105:_e,106:me,109:ge,111:Be,114:$e,115:Ie,116:nt}),e(xt,[2,114]),{31:[1,287],67:Et,82:219,116:yt,117:Ue,118:fe},{6:11,7:12,8:o,9:l,10:u,11:h,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,288],33:24,34:f,36:p,38:g,42:28,43:39,44:m,45:40,47:41,60:y,84:x,85:T,86:C,87:k,88:E,89:v,102:S,105:w,106:L,109:O,111:F,113:42,114:N,115:G,116:A,121:M,122:I,123:P,124:B,125:D},{10:St,60:Kt,84:kr,92:289,105:Yt,107:242,108:243,109:wt,110:Vt,111:We,112:rt},{10:St,60:Kt,84:kr,92:290,105:Yt,107:242,108:243,109:wt,110:Vt,111:We,112:rt},e(Te,[2,62]),e(W,[2,33]),e(xt,[2,124],{106:pt}),e(xt,[2,125],{106:pt})],defaultActions:{},parseError:s(function(kt,Rt){if(Rt.recoverable)this.trace(kt);else{var Dt=new Error(kt);throw Dt.hash=Rt,Dt}},"parseError"),parse:s(function(kt){var Rt=this,Dt=[0],ht=[],Xt=[null],he=[],Fr=this.table,be="",ur=0,ei=0,_a=0,iu=2,Hl=1,wp=he.slice.call(arguments,1),Nn=Object.create(this.lexer),na={yy:{}};for(var Go in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Go)&&(na.yy[Go]=this.yy[Go]);Nn.setInput(kt,na.yy),na.yy.lexer=Nn,na.yy.parser=this,typeof Nn.yylloc>"u"&&(Nn.yylloc={});var Aa=Nn.yylloc;he.push(Aa);var gt=Nn.options&&Nn.options.ranges;typeof na.yy.parseError=="function"?this.parseError=na.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(ia){Dt.length=Dt.length-2*ia,Xt.length=Xt.length-ia,he.length=he.length-ia}s(pe,"popStack");function qe(){var ia;return ia=ht.pop()||Nn.lex()||Hl,typeof ia!="number"&&(ia instanceof Array&&(ht=ia,ia=ht.pop()),ia=Rt.symbols_[ia]||ia),ia}s(qe,"lex");for(var at,It,qt,zt,Pn,ti,Ti={},hi,Yn,Ci,bT;;){if(qt=Dt[Dt.length-1],this.defaultActions[qt]?zt=this.defaultActions[qt]:((at===null||typeof at>"u")&&(at=qe()),zt=Fr[qt]&&Fr[qt][at]),typeof zt>"u"||!zt.length||!zt[0]){var LA="";bT=[];for(hi in Fr[qt])this.terminals_[hi]&&hi>iu&&bT.push("'"+this.terminals_[hi]+"'");Nn.showPosition?LA="Parse error on line "+(ur+1)+`:
@@ -1182,7 +1182,7 @@ Expecting `+ie.join(", ")+", got '"+(this.terminals_[Ie]||Ie)+"'":ue="Parse erro
1182
1182
  fill: ${e.titleColor||e.textColor};
1183
1183
  font-family: ${e.fontFamily};
1184
1184
  }
1185
- `,"getStyles"),j2e=Hst});var U2e={};jt(U2e,{diagram:()=>Ust});var Ust,Y2e=_(()=>{"use strict";x2e();F2e();q2e();H2e();Ust={parser:y2e,db:$2e,renderer:W2e,styles:j2e}});var Q2e,Z2e=_(()=>{"use strict";os();ft();Q2e={parse:s(async e=>{let t=await Jn("info",e);Y.debug(t)},"parse")}});var Qst,Zst,J2e,eCe=_(()=>{"use strict";Qst={version:"11.17.0-tiny"},Zst=s(()=>Qst.version,"getVersion"),J2e={getVersion:Zst}});var nn,ls=_(()=>{"use strict";Sr();Nt();nn=s(e=>{let{securityLevel:t}=xe(),r=et("body");if(t==="sandbox"){let a=et(`#i${e}`).node()?.contentDocument??document;r=et(a.body)}return r.select(`#${e}`)},"selectSvgElement")});var Jst,tCe,rCe=_(()=>{"use strict";ft();ls();fn();Jst=s((e,t,r)=>{Y.debug(`rendering info diagram
1185
+ `,"getStyles"),j2e=Hst});var U2e={};jt(U2e,{diagram:()=>Ust});var Ust,Y2e=_(()=>{"use strict";x2e();F2e();q2e();H2e();Ust={parser:y2e,db:$2e,renderer:W2e,styles:j2e}});var Q2e,Z2e=_(()=>{"use strict";os();ft();Q2e={parse:s(async e=>{let t=await Jn("info",e);Y.debug(t)},"parse")}});var Qst,Zst,J2e,eCe=_(()=>{"use strict";Qst={version:"11.17.1-tiny"},Zst=s(()=>Qst.version,"getVersion"),J2e={getVersion:Zst}});var nn,ls=_(()=>{"use strict";Sr();Nt();nn=s(e=>{let{securityLevel:t}=xe(),r=et("body");if(t==="sandbox"){let a=et(`#i${e}`).node()?.contentDocument??document;r=et(a.body)}return r.select(`#${e}`)},"selectSvgElement")});var Jst,tCe,rCe=_(()=>{"use strict";ft();ls();fn();Jst=s((e,t,r)=>{Y.debug(`rendering info diagram
1186
1186
  `+e);let n=nn(t);Cr(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),tCe={draw:Jst}});var nCe={};jt(nCe,{diagram:()=>eat});var eat,iCe=_(()=>{"use strict";Z2e();eCe();rCe();eat={parser:Q2e,db:J2e,renderer:tCe}});var oCe,Y8,y_,K8,nat,iat,sat,aat,oat,lat,cat,x_,X8=_(()=>{"use strict";ft();un();Vi();oCe=ar.pie,Y8={sections:new Map,showData:!1,config:oCe},y_=Y8.sections,K8=Y8.showData,nat=structuredClone(oCe),iat=s(()=>structuredClone(nat),"getConfig"),sat=s(()=>{y_=new Map,K8=Y8.showData,er()},"clear"),aat=s(({label:e,value:t})=>{if(t<0)throw new Error(`"${e}" has invalid value: ${t}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);y_.has(e)||(y_.set(e,t),Y.debug(`added new section: ${e}, with value: ${t}`))},"addSection"),oat=s(()=>y_,"getSections"),lat=s(e=>{K8=e},"setShowData"),cat=s(()=>K8,"getShowData"),x_={getConfig:iat,clear:sat,setDiagramTitle:xr,getDiagramTitle:yr,setAccTitle:hr,getAccTitle:pr,setAccDescription:mr,getAccDescription:gr,addSection:aat,getSections:oat,setShowData:lat,getShowData:cat}});var uat,lCe,cCe=_(()=>{"use strict";os();ft();Qs();X8();uat=s((e,t)=>{kn(e,t),t.setShowData(e.showData),e.sections.map(t.addSection)},"populateDb"),lCe={parse:s(async e=>{let t=await Jn("pie",e);Y.debug(t),uat(t,x_)},"parse")}});var hat,uCe,hCe=_(()=>{"use strict";hat=s(e=>`
1187
1187
  .pieCircle{
1188
1188
  stroke: ${e.pieStrokeColor};
@@ -2877,7 +2877,7 @@ A`,o,o,0,a.large?1:0,a.sweep?1:0,n(a.p1.x),n(a.p1.y))}return i.join(" ")}functio
2877
2877
  `}else n+=`${e.themeCSS}
2878
2878
  `;return n+SR(r)},"createCssStyles"),Pgt=s((e,t)=>AA($Re(`${e}{${t}}`),FRe([s(function(n,i,a,o){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===gT)return;n.props=n.props.map(l=>l===e&&Array.isArray(n.children)&&n.children.every(h=>h.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(h.props))||(l.startsWith(`${e} `)||l.startsWith(`${e}>`))&&!l.startsWith(`${e} ||`)?l:`${e} ${l}`)}else n.type.startsWith("@")&&([...[TRe,kRe,TA,vRe,"@container","@starting-style"],gT].includes(n.type)||(Y.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=Py))},"addNamespace"),BRe])),"compileCSS"),Mgt=s((e,t,r,n)=>{let i=Ngt(e,r),a=Cz(t,i,{...e.themeVariables,theme:e.theme,look:e.look},n);return Pgt(n,a)},"createUserStyles"),Ogt=s((e="",t,r)=>{let n=e;return!r&&!t&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=Ps(n),n=n.replace(/<br>/g,"<br/>"),n},"cleanUpSvgCode"),$gt=s((e="",t)=>{let r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":Egt,n=HRe(`<body style="${_gt}">${e}</body>`);return`<iframe style="width:${vgt};height:${r};${wgt}" src="data:text/html;charset=UTF-8;base64,${n}" sandbox="${Agt}">
2879
2879
  ${Rgt}
2880
- </iframe>`},"putIntoIFrame"),YRe=s((e,t,r,n,i)=>{let a=e.append("div");a.attr("id",r),n&&a.attr("style",n);let o=a.append("svg").attr("id",t).attr("width","100%").attr("xmlns",Cgt);return i&&o.attr("xmlns:xlink",i),o.append("g"),e},"appendDivSvgG");function KRe(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}s(KRe,"sandboxedIframe");var Bgt=s((e,t,r,n)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(n)?.remove()},"removeExistingElements"),Fgt=s(async function(e,t,r){Ny();let n=XRe(t);t=n.code;let i=mt();Y.debug(i),t.length>(i?.maxTextSize??ygt)&&(t=xgt);let a=`#${e}`,o="i"+e,l="#"+o,u="d"+e,h="#"+u,d=s(()=>{let M=et(p?l:h).node();M&&"remove"in M&&M.remove()},"removeTempElements"),f=et(document.body),p=i.securityLevel===bgt,g=i.securityLevel===Tgt,m=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),p){let A=KRe(et(r),o);f=et(A.nodes()[0].contentDocument.body),f.node().style.margin="0"}else f=et(r);YRe(f,e,u,`font-family: ${m}`,kgt)}else{if(Bgt(document,e,u,o),p){let A=KRe(et(document.body),o);f=et(A.nodes()[0].contentDocument.body),f.node().style.margin="0"}else f=et("body");YRe(f,e,u)}let y,x;try{y=await Gy.fromText(t,{title:n.title})}catch(A){if(i.suppressErrorRendering)throw d(),A;y=await Gy.fromText("error"),x=A}let T=f.select(h).node(),C=y.type,k=T.firstChild,E=k.firstChild,v=y.renderer.getClasses?.(t,y),S=Mgt(i,C,v,a),w=document.createElement("style");w.innerHTML=S,k.insertBefore(w,E);try{await y.renderer.draw(t,e,"11.17.0",y)}catch(A){throw i.suppressErrorRendering?d():USe.draw(t,e,"11.17.0"),A}let L=f.select(`${h} svg`),O=y.db.getAccTitle?.(),F=y.db.getAccDescription?.();zgt(C,L,O,F);let G=s(()=>{f.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",Sgt);let A=f.select(h).node().innerHTML;if(Y.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),A=Ogt(A,p,Ei(i.arrowMarkerAbsolute)),p){let M=f.select(h+" svg").node();A=$gt(A,M)}else g||(A=Ds.sanitize(A,{ADD_TAGS:Lgt,ADD_ATTR:Dgt,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return WRe(),A},"serializeSvg")();if(x)throw x;return d(),{diagramType:C,svg:G,bindFunctions:y.db.bindFunctions}},"render");function Ggt(e={}){let t=Sn({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),zG(t),t?.theme&&t.theme in Da?t.themeVariables=Da[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=Da.default.getThemeVariables(t.themeVariables));let r=typeof t=="object"?oR(t):lR();Vy(r.logLevel),Ny()}s(Ggt,"initialize");var QRe=s((e,t={})=>{let{code:r}=b9(e);return Gy.fromText(r,t)},"getDiagramFromText");function zgt(e,t,r,n){GRe(t,e),zRe(t,r,n,t.attr("id"))}s(zgt,"addA11yInfo");var Hh=Object.freeze({render:Fgt,parse:Igt,getDiagramFromText:QRe,initialize:Ggt,getConfig:mt,setConfig:IT,getSiteConfig:lR,updateSiteConfig:VG,reset:s(()=>{Ky()},"reset"),globalReset:s(()=>{Ky(au)},"globalReset"),defaultConfig:au});Vy(mt().logLevel);Ky(mt());Qd();Pt();xS();var Vgt=s((e,t,r)=>{Y.warn(e),C4(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),ZRe=s(async function(e={querySelector:".mermaid"}){try{await Wgt(e)}catch(t){if(C4(t)&&Y.error(t.str),nu.parseError&&nu.parseError(t),!e.suppressErrors)throw Y.error("Use the suppressErrors option to suppress these errors"),t}},"run"),Wgt=s(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){let n=Hh.getConfig();Y.debug(`${e?"":"No "}Callback function found`);let i;if(r)i=r;else if(t)i=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");Y.debug(`Found ${i.length} diagrams`),n?.startOnLoad!==void 0&&(Y.debug("Start On Load: "+n?.startOnLoad),Hh.updateSiteConfig({startOnLoad:n?.startOnLoad}));let a=new Bt.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed),o,l=[];for(let u of Array.from(i)){Y.info("Rendering diagram: "+u.id);if(u.getAttribute("data-processed"))continue;u.setAttribute("data-processed","true");let h=`mermaid-${a.next()}`;o=u.innerHTML,o=MT(Bt.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,"<br/>");let d=Bt.detectInit(o);d&&Y.debug("Detected early reinit: ",d);try{let{svg:f,bindFunctions:p}=await r3e(h,o,u);u.innerHTML=f,e&&await e(h),p&&p(u)}catch(f){Vgt(f,l,nu.parseError)}}if(l.length>0)throw l[0]},"runThrowsErrors"),JRe=s(function(e){Hh.initialize(e)},"initialize"),qgt=s(async function(e,t,r){Y.warn("mermaid.init is deprecated. Please use run instead."),e&&JRe(e);let n={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?n.querySelector=t:t&&(t instanceof HTMLElement?n.nodes=[t]:n.nodes=t),await ZRe(n)},"init"),jgt=s(async(e,{lazyLoad:t=!0}={})=>{Ny(),BT(...e),t===!1&&await bRe()},"registerExternalDiagrams"),e3e=s(function(){if(nu.startOnLoad){let{startOnLoad:e}=Hh.getConfig();e&&nu.run().catch(t=>Y.error("Mermaid failed to initialize",t))}},"contentLoaded");if(typeof document<"u"){window.addEventListener("load",e3e,!1)}var Hgt=s(function(e){nu.parseError=e},"setParseErrorHandler"),RA=[],T9=!1,t3e=s(async()=>{if(!T9){for(T9=!0;RA.length>0;){let e=RA.shift();if(e)try{await e()}catch(t){Y.error("Error executing queue",t)}}T9=!1}},"executeQueue"),Ugt=s(async(e,t)=>new Promise((r,n)=>{let i=s(()=>new Promise((a,o)=>{Hh.parse(e,t).then(l=>{a(l),r(l)},l=>{Y.error("Error parsing",l),nu.parseError?.(l),o(l),n(l)})}),"performCall");RA.push(i),t3e().catch(n)}),"parse"),r3e=s((e,t,r)=>new Promise((n,i)=>{let a=s(()=>new Promise((o,l)=>{Hh.render(e,t,r).then(u=>{o(u),n(u)},u=>{Y.error("Error parsing",u),nu.parseError?.(u),l(u),i(u)})}),"performCall");RA.push(a),t3e().catch(i)}),"render"),Ygt=s(()=>Object.keys(Zl).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),nu={startOnLoad:!0,mermaidAPI:Hh,parse:Ugt,render:r3e,init:qgt,run:ZRe,registerExternalDiagrams:jgt,registerLayoutLoaders:JN,initialize:JRe,parseError:void 0,contentLoaded:e3e,setParseErrorHandler:Hgt,detectType:Bp,registerIconPacks:PT,getRegisteredDiagramsMetadata:Ygt},Kgt=nu;return l3e(Xgt);})();
2880
+ </iframe>`},"putIntoIFrame"),YRe=s((e,t,r,n,i)=>{let a=e.append("div");a.attr("id",r),n&&a.attr("style",n);let o=a.append("svg").attr("id",t).attr("width","100%").attr("xmlns",Cgt);return i&&o.attr("xmlns:xlink",i),o.append("g"),e},"appendDivSvgG");function KRe(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}s(KRe,"sandboxedIframe");var Bgt=s((e,t,r,n)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(n)?.remove()},"removeExistingElements"),Fgt=s(async function(e,t,r){Ny();let n=XRe(t);t=n.code;let i=mt();Y.debug(i),t.length>(i?.maxTextSize??ygt)&&(t=xgt);let a=`#${e}`,o="i"+e,l="#"+o,u="d"+e,h="#"+u,d=s(()=>{let M=et(p?l:h).node();M&&"remove"in M&&M.remove()},"removeTempElements"),f=et(document.body),p=i.securityLevel===bgt,g=i.securityLevel===Tgt,m=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),p){let A=KRe(et(r),o);f=et(A.nodes()[0].contentDocument.body),f.node().style.margin="0"}else f=et(r);YRe(f,e,u,`font-family: ${m}`,kgt)}else{if(Bgt(document,e,u,o),p){let A=KRe(et(document.body),o);f=et(A.nodes()[0].contentDocument.body),f.node().style.margin="0"}else f=et("body");YRe(f,e,u)}let y,x;try{y=await Gy.fromText(t,{title:n.title})}catch(A){if(i.suppressErrorRendering)throw d(),A;y=await Gy.fromText("error"),x=A}let T=f.select(h).node(),C=y.type,k=T.firstChild,E=k.firstChild,v=y.renderer.getClasses?.(t,y),S=Mgt(i,C,v,a),w=document.createElement("style");w.innerHTML=S,k.insertBefore(w,E);try{await y.renderer.draw(t,e,"11.17.1",y)}catch(A){throw i.suppressErrorRendering?d():USe.draw(t,e,"11.17.1"),A}let L=f.select(`${h} svg`),O=y.db.getAccTitle?.(),F=y.db.getAccDescription?.();zgt(C,L,O,F);let G=s(()=>{f.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",Sgt);let A=f.select(h).node().innerHTML;if(Y.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),A=Ogt(A,p,Ei(i.arrowMarkerAbsolute)),p){let M=f.select(h+" svg").node();A=$gt(A,M)}else g||(A=Ds.sanitize(A,{ADD_TAGS:Lgt,ADD_ATTR:Dgt,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return WRe(),A},"serializeSvg")();if(x)throw x;return d(),{diagramType:C,svg:G,bindFunctions:y.db.bindFunctions}},"render");function Ggt(e={}){let t=Sn({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),zG(t),t?.theme&&t.theme in Da?t.themeVariables=Da[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=Da.default.getThemeVariables(t.themeVariables));let r=typeof t=="object"?oR(t):lR();Vy(r.logLevel),Ny()}s(Ggt,"initialize");var QRe=s((e,t={})=>{let{code:r}=b9(e);return Gy.fromText(r,t)},"getDiagramFromText");function zgt(e,t,r,n){GRe(t,e),zRe(t,r,n,t.attr("id"))}s(zgt,"addA11yInfo");var Hh=Object.freeze({render:Fgt,parse:Igt,getDiagramFromText:QRe,initialize:Ggt,getConfig:mt,setConfig:IT,getSiteConfig:lR,updateSiteConfig:VG,reset:s(()=>{Ky()},"reset"),globalReset:s(()=>{Ky(au)},"globalReset"),defaultConfig:au});Vy(mt().logLevel);Ky(mt());Qd();Pt();xS();var Vgt=s((e,t,r)=>{Y.warn(e),C4(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),ZRe=s(async function(e={querySelector:".mermaid"}){try{await Wgt(e)}catch(t){if(C4(t)&&Y.error(t.str),nu.parseError&&nu.parseError(t),!e.suppressErrors)throw Y.error("Use the suppressErrors option to suppress these errors"),t}},"run"),Wgt=s(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){let n=Hh.getConfig();Y.debug(`${e?"":"No "}Callback function found`);let i;if(r)i=r;else if(t)i=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");Y.debug(`Found ${i.length} diagrams`),n?.startOnLoad!==void 0&&(Y.debug("Start On Load: "+n?.startOnLoad),Hh.updateSiteConfig({startOnLoad:n?.startOnLoad}));let a=new Bt.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed),o,l=[];for(let u of Array.from(i)){Y.info("Rendering diagram: "+u.id);if(u.getAttribute("data-processed"))continue;u.setAttribute("data-processed","true");let h=`mermaid-${a.next()}`;o=u.innerHTML,o=MT(Bt.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,"<br/>");let d=Bt.detectInit(o);d&&Y.debug("Detected early reinit: ",d);try{let{svg:f,bindFunctions:p}=await r3e(h,o,u);u.innerHTML=f,e&&await e(h),p&&p(u)}catch(f){Vgt(f,l,nu.parseError)}}if(l.length>0)throw l[0]},"runThrowsErrors"),JRe=s(function(e){Hh.initialize(e)},"initialize"),qgt=s(async function(e,t,r){Y.warn("mermaid.init is deprecated. Please use run instead."),e&&JRe(e);let n={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?n.querySelector=t:t&&(t instanceof HTMLElement?n.nodes=[t]:n.nodes=t),await ZRe(n)},"init"),jgt=s(async(e,{lazyLoad:t=!0}={})=>{Ny(),BT(...e),t===!1&&await bRe()},"registerExternalDiagrams"),e3e=s(function(){if(nu.startOnLoad){let{startOnLoad:e}=Hh.getConfig();e&&nu.run().catch(t=>Y.error("Mermaid failed to initialize",t))}},"contentLoaded");if(typeof document<"u"){window.addEventListener("load",e3e,!1)}var Hgt=s(function(e){nu.parseError=e},"setParseErrorHandler"),RA=[],T9=!1,t3e=s(async()=>{if(!T9){for(T9=!0;RA.length>0;){let e=RA.shift();if(e)try{await e()}catch(t){Y.error("Error executing queue",t)}}T9=!1}},"executeQueue"),Ugt=s(async(e,t)=>new Promise((r,n)=>{let i=s(()=>new Promise((a,o)=>{Hh.parse(e,t).then(l=>{a(l),r(l)},l=>{Y.error("Error parsing",l),nu.parseError?.(l),o(l),n(l)})}),"performCall");RA.push(i),t3e().catch(n)}),"parse"),r3e=s((e,t,r)=>new Promise((n,i)=>{let a=s(()=>new Promise((o,l)=>{Hh.render(e,t,r).then(u=>{o(u),n(u)},u=>{Y.error("Error parsing",u),nu.parseError?.(u),l(u),i(u)})}),"performCall");RA.push(a),t3e().catch(i)}),"render"),Ygt=s(()=>Object.keys(Zl).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),nu={startOnLoad:!0,mermaidAPI:Hh,parse:Ugt,render:r3e,init:qgt,run:ZRe,registerExternalDiagrams:jgt,registerLayoutLoaders:JN,initialize:JRe,parseError:void 0,contentLoaded:e3e,setParseErrorHandler:Hgt,detectType:Bp,registerIconPacks:PT,getRegisteredDiagramsMetadata:Ygt},Kgt=nu;return l3e(Xgt);})();
2881
2881
  /*! Bundled license information:
2882
2882
 
2883
2883
  lodash-es/lodash.js: