import { jsxs as s, jsx as e } from "react/jsx-runtime";
import { useState as L, createElement as j } from "react";
import p from "../../utils/classNames.js";
import z from "../button/ToggleButton.js";
const F = (b) => {
  const {
    headline: c,
    count: h = 1,
    circleButtons: u = !1,
    buttonLabels: f,
    buttonStyles: o,
    buttonClassName: N = "",
    leftLabel: i,
    rightLabel: l,
    leadingIcon: d,
    trailingIcon: m,
    onRatingChanged: x = () => {
    },
    ...v
  } = b, [y, k] = L(), w = (r) => {
    k(r), x(r);
  }, n = !!i || !!l, C = p(
    "display-flex gap-10",
    n ? "align-items-start" : "align-items-center",
    "text-size-14",
    "margin-bottom-25"
  ), g = p(
    "display-flex align-items-center",
    "text-size-200pct",
    n && "padding-top-3"
  );
  return /* @__PURE__ */ s("div", { ...v, className: "FeedbackRating", children: [
    c && /* @__PURE__ */ e("div", { className: "text-medium text-size-16 margin-bottom-10", children: c }),
    /* @__PURE__ */ s("div", { className: C, children: [
      d && /* @__PURE__ */ e("div", { className: g, children: d }),
      /* @__PURE__ */ s("div", { children: [
        /* @__PURE__ */ e("div", { className: "display-flex flex-wrap gap-10", children: Array.from({ length: h }, (r, a) => {
          const t = a + 1;
          return /* @__PURE__ */ j(
            z,
            {
              ...o?.[a],
              key: t,
              active: y === t,
              onClick: (R) => w(R ? t : void 0),
              className: `${u ? "rounded-circle aspect-ratio-1" : ""} ${N} ${o?.[a].className ?? ""}`
            },
            f?.[a] ?? t
          );
        }) }),
        n && /* @__PURE__ */ s("div", { className: "display-flex justify-content-between margin-top-5 gap-25", children: [
          i ? /* @__PURE__ */ e("label", { className: "word-wrap text-color-dark", children: i }) : /* @__PURE__ */ e("div", {}),
          l ? /* @__PURE__ */ e("label", { className: "word-wrap text-color-dark", children: l }) : /* @__PURE__ */ e("div", {})
        ] })
      ] }),
      m && /* @__PURE__ */ e("div", { className: g, children: m })
    ] })
  ] });
};
export {
  F as default
};
//# sourceMappingURL=FeedbackRating.js.map
