import{k as p}from"./chunk-2HR5LOFI.mjs";import{Y as s,j as m}from"./chunk-5YUVU3PZ.mjs";import{a as o}from"./chunk-VELTKBKT.mjs";var d=o(({flowchart:n})=>{let i=n?.subGraphTitleMargin?.top??0,e=n?.subGraphTitleMargin?.bottom??0,r=i+e;return{subGraphTitleTopMargin:i,subGraphTitleBottomMargin:e,subGraphTitleTotalMargin:r}},"getSubGraphTitleMargins");async function G(n,i){let e=n.getElementsByTagName("img");if(!e||e.length===0)return;let r=i.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...e].map(t=>new Promise(g=>{function a(){if(t.style.display="flex",t.style.flexDirection="column",r){let c=s().fontSize?s().fontSize:window.getComputedStyle(document.body).fontSize,u=5,[f=m.fontSize]=p(c),l=f*u+"px";t.style.minWidth=l,t.style.maxWidth=l}else t.style.width="100%";g(t)}o(a,"setupImage"),setTimeout(()=>{t.complete&&a()}),t.addEventListener("error",a),t.addEventListener("load",a)})))}o(G,"configureLabelImages");export{G as a,d as b};
