import { defineComponent as y, computed as h, createElementBlock as s, openBlock as o, normalizeClass as r, Fragment as a, renderList as i, createElementVNode as f, createTextVNode as k, normalizeStyle as v, toDisplayString as C } from "vue";
const B = /* @__PURE__ */ y({
  __name: "Legends",
  props: {
    maxInColumn: {},
    legends: {}
  },
  setup(p) {
    function m(e, c) {
      const l = [];
      let n = [];
      for (let t = 0; t < e.length; t++)
        n.length < c ? n.push(e[t]) : (l.push(n), n = [e[t]]);
      return l.push(n), l;
    }
    const u = p, d = h(() => m(u.legends, u.maxInColumn ?? 5));
    return (e, c) => (o(), s("div", {
      class: r(e.$style.component)
    }, [
      (o(!0), s(a, null, i(d.value, (l, n) => (o(), s("div", {
        key: n,
        class: r(e.$style.legend)
      }, [
        (o(!0), s(a, null, i(l, (t, g) => (o(), s("div", {
          key: g,
          class: r(e.$style.item)
        }, [
          f("div", {
            class: r(e.$style.chip),
            style: v({ backgroundColor: t.color.toString() })
          }, null, 6),
          k(" " + C(t.text), 1)
        ], 2))), 128))
      ], 2))), 128))
    ], 2));
  }
});
export {
  B as default
};
//# sourceMappingURL=Legends.vue2.js.map
