import{_ as __name,d as select,T as lineBreakRegex,j as distExports}from"./mermaid.core-BV3ugHFm.js";var drawRect=__name((element,rectData)=>{const rectElement=element.append("rect");if(rectElement.attr("x",rectData.x),rectElement.attr("y",rectData.y),rectElement.attr("fill",rectData.fill),rectElement.attr("stroke",rectData.stroke),rectElement.attr("width",rectData.width),rectElement.attr("height",rectData.height),rectData.name&&rectElement.attr("name",rectData.name),rectData.rx&&rectElement.attr("rx",rectData.rx),rectData.ry&&rectElement.attr("ry",rectData.ry),void 0!==rectData.attrs)for(const attrKey in rectData.attrs)rectElement.attr(attrKey,rectData.attrs[attrKey]);return rectData.class&&rectElement.attr("class",rectData.class),rectElement},"drawRect"),drawBackgroundRect=__name((element,bounds)=>{const rectData={x:bounds.startx,y:bounds.starty,width:bounds.stopx-bounds.startx,height:bounds.stopy-bounds.starty,fill:bounds.fill,stroke:bounds.stroke,class:"rect"};drawRect(element,rectData).lower()},"drawBackgroundRect"),drawText=__name((element,textData)=>{const nText=textData.text.replace(lineBreakRegex," "),textElem=element.append("text");textElem.attr("x",textData.x),textElem.attr("y",textData.y),textElem.attr("class","legend"),textElem.style("text-anchor",textData.anchor),textData.class&&textElem.attr("class",textData.class);const tspan=textElem.append("tspan");return tspan.attr("x",textData.x+2*textData.textMargin),tspan.text(nText),textElem},"drawText"),drawImage=__name((elem,x,y,link)=>{const imageElement=elem.append("image");imageElement.attr("x",x),imageElement.attr("y",y);const sanitizedLink=distExports.sanitizeUrl(link);imageElement.attr("xlink:href",sanitizedLink)},"drawImage"),drawEmbeddedImage=__name((element,x,y,link)=>{const imageElement=element.append("use");imageElement.attr("x",x),imageElement.attr("y",y);const sanitizedLink=distExports.sanitizeUrl(link);imageElement.attr("xlink:href",`#${sanitizedLink}`)},"drawEmbeddedImage"),getNoteRect=__name(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),getTextObj=__name(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),createTooltip=__name(()=>{let tooltipElem=select(".mermaidTooltip");return tooltipElem.empty()&&(tooltipElem=select("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),tooltipElem},"createTooltip");export{drawBackgroundRect as a,getTextObj as b,createTooltip as c,drawRect as d,drawEmbeddedImage as e,drawImage as f,getNoteRect as g,drawText as h};
