import { ap as gi, R as Rs } from './index.esm2.js';

var l = function(s, t) {
    var e = s.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 !== void 0 && e.attr("rx", t.rx), t.ry !== void 0 && e.attr("ry", t.ry), t.attrs !== void 0) for(var r in t.attrs)e.attr(r, t.attrs[r]);
    return t.class !== void 0 && e.attr("class", t.class), e;
}, x = function(s, t) {
    var e = {
        x: t.startx,
        y: t.starty,
        width: t.stopx - t.startx,
        height: t.stopy - t.starty,
        fill: t.fill,
        stroke: t.stroke,
        class: "rect"
    };
    l(s, e).lower();
}, d = function(s, t) {
    var e = t.text.replace(gi, " "), r = s.append("text");
    r.attr("x", t.x), r.attr("y", t.y), r.attr("class", "legend"), r.style("text-anchor", t.anchor), t.class !== void 0 && r.attr("class", t.class);
    var n = r.append("tspan");
    return n.attr("x", t.x + t.textMargin * 2), n.text(e), r;
}, h = function(s, t, e, r) {
    var n = s.append("image");
    n.attr("x", t), n.attr("y", e);
    var a = Rs.sanitizeUrl(r);
    n.attr("xlink:href", a);
}, y = function(s, t, e, r) {
    var n = s.append("use");
    n.attr("x", t), n.attr("y", e);
    var a = Rs.sanitizeUrl(r);
    n.attr("xlink:href", "#".concat(a));
}, g = function() {
    return {
        x: 0,
        y: 0,
        width: 100,
        height: 100,
        fill: "#EDF2AE",
        stroke: "#666",
        anchor: "start",
        rx: 0,
        ry: 0
    };
}, p = function() {
    return {
        x: 0,
        y: 0,
        width: 100,
        height: 100,
        "text-anchor": "start",
        style: "#666",
        textMargin: 0,
        rx: 0,
        ry: 0,
        tspan: true
    };
};

export { d, g, h, l, p, x, y };
