import { jsxs as l, jsx as t } from "react/jsx-runtime";
/* empty css                            */
import { breakpoints as G } from "./index-breakpoints.js";
import { useWindowResize as W } from "./index-use-window.resize.js";
import { useFormConfig as w } from "./index-useFormConfig.js";
import { classNames as i } from "./index-classNames.js";
import { AnimatedConditional as L } from "./index-AnimatedConditional.js";
import { Label as y } from "./index-Label.js";
import { Render as z } from "./index-Render.js";
import { FontWeights as m, Text as I, TextTypes as j } from "./index-Text.js";
import "react";
import { ComponentContainer as k } from "./index-ComponentContainer.js";
import { Form as O } from "./index-Form.js";
import { RadioButton as P } from "./index-RadioButton.js";
const Y = (p) => {
  const {
    formconfig: u,
    formClassName: c,
    options: f,
    name: d,
    setRadioValueFn: g,
    value: h,
    direction: a,
    capitalizeOptions: b,
    testId: C,
    translate: x = !0,
    theme: s = "standard",
    replacements: n,
    groupLabel: r,
    groupLabelFontWeight: R = m.bold,
    groupLabelNoPadding: N = !1
  } = p, T = W(), v = () => {
    let e, o;
    return a === "column" && (e = "RadioButtonGroup-force-col"), a === "row" && (e = "RadioButtonGroup-force-row"), r && (o = "RadioButtonGroup-force-no-padding"), i(c, e, s === "success" ? "success" : "", o);
  }, B = () => N ? "RadioButtonGroup-title-no-padding" : "", {
    formConfig: F
  } = w({
    inputs: {
      group: {}
    }
  });
  return l(k, {
    className: i("RadioButtonGroup-container"),
    testId: C,
    children: [t(z, {
      if: !!r,
      children: t("div", {
        className: i("RadioButtonGroup-title", B()),
        children: t(y, {
          value: r,
          replacements: n,
          fontWeight: R
        })
      })
    }), t(O, {
      className: v(),
      config: u,
      children: f.map((e, o) => l("div", {
        children: [t(L, {
          condition: !!e.infoText && T <= G.mobile,
          children: typeof e.infoText == "string" ? t(I, {
            translate: !0,
            type: j.textCaption,
            replacements: e.replacements ?? n,
            fontWeight: m.regular,
            children: e.infoText
          }) : e.infoText
        }), t(P, {
          testId: `radio-button${o}`,
          formConfig: F.group,
          onChangeFn: () => {
            if (!e.disabled)
              return g(e.value);
          },
          inputName: d,
          labelText: e.labelText,
          value: e.value,
          checked: h === e.value,
          disabled: e.disabled,
          labelClassName: e.labelClassName,
          theme: s,
          translate: x,
          replacements: e.replacements ?? n,
          capitalizeOption: b,
          children: e.children
        })]
      }, o))
    })]
  });
};
export {
  Y as RadioButtonGroup
};
