import { C as b } from "./4963ac97.js";
import { X as v, gC as y, gD as f, M as g, S as l, L as w, am as i, a6 as u, G as d, Y as o, F as e, an as F, ao as h, ap as V, Z as x, aq as A, w as s, a3 as T, O as k, a2 as S, a as M, ar as E, aj as p, as as z, ad as c, ak as G, au as I } from "./603b75d9.js";
import "react";
import "./ffcffc16.js";
import "react-dom";
v.div`
  > a {
    color: ${y} !important;

    &:hover {
      color: ${f} !important;
    }
  }
`;
const C = ["#fde68a", "#eecff3", "#a7f3d0", "#bfdbfe", "#bfdbfe", "#c7d2fe", "#fecaca", "#fcd6bb"], $ = v.div`
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: ${(t) => t.alignment};
  cursor: pointer;
`, O = new g({
  src: l,
  AvatarIcon: w,
  label: l,
  color: i,
  backgroundColor: i,
  Tooltip: l
}, (t) => t).setPropertyViewFn((t) => /* @__PURE__ */ u(d, {
  children: [t.src.propertyView({
    label: o("avatarComp.src"),
    placeholder: "",
    tooltip: o("avatarComp.avatarCompTooltip")
  }), t.label.propertyView({
    label: o("avatarComp.title"),
    tooltip: o("avatarComp.avatarCompTooltip")
  }), t.AvatarIcon.propertyView({
    label: o("avatarComp.icon"),
    IconType: "All",
    tooltip: o("avatarComp.avatarCompTooltip")
  }), t.color.propertyView({
    label: o("style.fill")
  }), t.backgroundColor.propertyView({
    label: o("style.background")
  }), t.Tooltip.propertyView({
    label: o("badge.tooltip")
  })]
})).build(), j = [G, I], B = [{
  label: /* @__PURE__ */ e(F, {}),
  value: "flex-start"
}, {
  label: /* @__PURE__ */ e(h, {}),
  value: "center"
}, {
  label: /* @__PURE__ */ e(V, {}),
  value: "flex-end"
}], H = function() {
  const t = {
    style: x(A),
    maxCount: s(c, 3),
    avatarSize: s(c, 40),
    alignment: T(B, "center"),
    autoColor: k.DEFAULT_TRUE,
    onEvent: S(j),
    currentAvatar: M({}),
    avatars: E(O, {
      initOptions: [{
        src: "https://api.dicebear.com/7.x/miniavs/svg?seed=1",
        label: String.fromCharCode(65 + Math.ceil(Math.random() * 25))
      }, {
        AvatarIcon: "/icon:antd/startwotone"
      }, {
        label: String.fromCharCode(65 + Math.ceil(Math.random() * 25))
      }, {
        label: String.fromCharCode(65 + Math.ceil(Math.random() * 25))
      }]
    })
  };
  return new b(t, (a, D) => /* @__PURE__ */ e($, {
    $style: a.style,
    alignment: a.alignment,
    children: /* @__PURE__ */ e(p.Group, {
      maxCount: a.maxCount,
      size: a.avatarSize,
      children: a.avatars.map((r, m) => {
        var n;
        return /* @__PURE__ */ e(z, {
          title: r.Tooltip,
          children: /* @__PURE__ */ e(p, {
            src: r.src ?? void 0,
            icon: ((n = r.AvatarIcon) == null ? void 0 : n.props.value) === "" || r.label.trim() !== "" ? void 0 : r.AvatarIcon,
            style: {
              color: r.color ? r.color : a.style.fill !== "#FFFFFF" ? a.style.fill : "#FFFFFF",
              backgroundColor: r.backgroundColor ? r.backgroundColor : a.autoColor ? C[m % C.length] : a.style.background
            },
            size: a.avatarSize,
            onClick: () => {
              a.onEvent("click");
            },
            children: r.label
          })
        });
      })
    })
  }), () => "").setPropertyViewFn((a) => /* @__PURE__ */ u(d, {
    children: [a.avatars.propertyView({}), a.maxCount.propertyView({
      label: o("avatarGroup.maxCount")
    }), a.avatarSize.propertyView({
      label: o("avatarGroup.avatarSize")
    }), a.autoColor.propertyView({
      label: o("avatarGroup.autoColor")
    }), a.alignment.propertyView({
      label: o("table.avatarGroupAlignment"),
      radioButton: !0
    }), a.onEvent.propertyView()]
  })).build();
}();
export {
  H as ColumnAvatarsComp,
  B as alignOptions
};
