import { openBlock as n, createElementBlock as o, normalizeStyle as d, renderSlot as l, Fragment as s, renderList as u, normalizeClass as g, createVNode as m, normalizeProps as h, guardReactiveProps as k, unref as p, createCommentVNode as v } from "vue";
import { Y as y } from "./index-CxkSLqkR.js";
import { _ as $ } from "./Shape-Ci6tClcc.js";
import { _ as b } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const S = ["id"], x = ["onClick", "height", "width"], z = {
  __name: "Legend",
  props: {
    legendSet: {
      type: Array,
      default() {
        return [];
      }
    },
    config: {
      type: Object,
      default() {
        return {};
      }
    },
    id: {
      type: String,
      default: ""
    },
    clickable: {
      type: Boolean,
      default: !0
    }
  },
  emits: ["clickMarker"],
  setup(e, { emit: c }) {
    function f(i, r) {
      c("clickMarker", { legend: i, i: r });
    }
    return (i, r) => (n(), o("div", {
      id: e.id,
      class: "vue-data-ui-legend",
      style: d(`background:${e.config.backgroundColor};font-size:${e.config.fontSize}px;color:${e.config.color};padding-bottom:${e.config.paddingBottom}px;padding-top:${e.config.paddingTop || 12}px;font-weight:${e.config.fontWeight}`)
    }, [
      l(i.$slots, "legendTitle", { titleSet: e.legendSet }, void 0, !0),
      (n(!0), o(s, null, u(e.legendSet, (t, a) => (n(), o("div", {
        class: g({ "vue-data-ui-legend-item": !0, active: e.clickable })
      }, [
        t.shape ? (n(), o("svg", {
          key: 0,
          onClick: (C) => f(t, a),
          height: e.config.fontSize,
          width: e.config.fontSize,
          viewBox: "0 0 60 60",
          style: d(`overflow: visible;opacity:${t.opacity}`)
        }, [
          m($, {
            shape: t.shape,
            radius: 30,
            stroke: "none",
            plot: { x: 30, y: 30 },
            fill: t.color
          }, null, 8, ["shape", "fill"]),
          l(i.$slots, "legend-pattern", h(k({ legend: t, index: p(y)(t.absoluteIndex) ? t.absoluteIndex : a })), void 0, !0)
        ], 12, x)) : v("", !0),
        l(i.$slots, "item", {
          legend: t,
          index: a
        }, void 0, !0)
      ], 2))), 256))
    ], 12, S));
  }
}, I = /* @__PURE__ */ b(z, [["__scopeId", "data-v-f1db6c9f"]]);
export {
  I as L
};
