import { p as l, q as n, t as x, h as d } from "./index-CNUFa5l3.js";
var o = d(), p = /* @__PURE__ */ l((a, t) => {
  let e = a.append("rect");
  if (e.attr("x", t.x), e.attr("y", t.y), e.attr("fill", t.fill), e.attr("stroke", t.stroke), e.attr("width", t.width), e.attr("height", t.height), t.name && e.attr("name", t.name), t.rx && e.attr("rx", t.rx), t.ry && e.attr("ry", t.ry), t.attrs !== void 0) for (let r in t.attrs) e.attr(r, t.attrs[r]);
  return t.class && e.attr("class", t.class), e;
}, "drawRect"), c = /* @__PURE__ */ l((a, t) => {
  p(a, {
    x: t.startx,
    y: t.starty,
    width: t.stopx - t.startx,
    height: t.stopy - t.starty,
    fill: t.fill,
    stroke: t.stroke,
    class: "rect"
  }).lower();
}, "drawBackgroundRect"), h = /* @__PURE__ */ l((a, t) => {
  let e = t.text.replace(x, " "), r = a.append("text");
  r.attr("x", t.x), r.attr("y", t.y), r.attr("class", "legend"), r.style("text-anchor", t.anchor), t.class && r.attr("class", t.class);
  let s = r.append("tspan");
  return s.attr("x", t.x + t.textMargin * 2), s.text(e), r;
}, "drawText"), g = /* @__PURE__ */ l((a, t, e, r) => {
  let s = a.append("image");
  s.attr("x", t), s.attr("y", e);
  let i = (0, o.sanitizeUrl)(r);
  s.attr("xlink:href", i);
}, "drawImage"), f = /* @__PURE__ */ l((a, t, e, r) => {
  let s = a.append("use");
  s.attr("x", t), s.attr("y", e);
  let i = (0, o.sanitizeUrl)(r);
  s.attr("xlink:href", `#${i}`);
}, "drawEmbeddedImage"), m = /* @__PURE__ */ l(() => ({
  x: 0,
  y: 0,
  width: 100,
  height: 100,
  fill: "#EDF2AE",
  stroke: "#666",
  anchor: "start",
  rx: 0,
  ry: 0
}), "getNoteRect"), w = /* @__PURE__ */ l(() => ({
  x: 0,
  y: 0,
  width: 100,
  height: 100,
  "text-anchor": "start",
  style: "#666",
  textMargin: 0,
  rx: 0,
  ry: 0,
  tspan: !0
}), "getTextObj"), u = /* @__PURE__ */ l(() => {
  let a = n(".mermaidTooltip");
  return a.empty() && (a = n("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")), a;
}, "createTooltip");
export {
  p as a,
  g as c,
  w as d,
  u as f,
  f as l,
  c as o,
  h as s,
  m as u
};
