import { a3 as b, ab as u, W as y, bX as f, dr as h, ds as C, a5 as o, dt as v, cg as p, aG as w, S as x, du as V, ci as $, U as I, dg as P, H as a, c5 as D, ad as n, I as s, ae as l, af as i, a4 as g, am as d, dv as E, co as M, c0 as k, ag as B, dn as F, ah as R, aj as j, dk as N, c1 as O, aC as q, c3 as z, cr as A, dw as H } from "./56c67d3b.js";
import { useContext as r } from "react";
import "react-dom";
const L = (e) => q`
    &.ant-segmented:not(.ant-segmented-disabled) {
      &,
      .ant-segmented-item-selected,
      .ant-segmented-thumb,
      .ant-segmented-item:hover,
      .ant-segmented-item:focus {
        color: ${e.text};
        border-radius: ${e.radius};
      }
      .ant-segmented-item {
        padding: ${e.padding};
      }
      .ant-segmented-item-selected,
      .ant-segmented-thumb {
        background: ${e.indicatorBackground};
      }
    }

    &.ant-segmented,
    .ant-segmented-item-selected {
      border-radius: ${e.radius};
    }
    &.ant-segmented, .ant-segmented-item-label {
      font-family:${e.fontFamily};
      font-style:${e.fontStyle};
      font-size:${e.textSize};
      font-weight:${e.textWeight};
      text-transform:${e.textTransform};
      text-decoration:${e.textDecoration};
    }
  `, T = b(H)`
  width: 100%;
  min-height: 24px; // keep the height unchanged when there are no options
  ${(e) => e.$style && L(e.$style)}
`, U = {
  defaultValue: u("value"),
  value: u("value"),
  label: y,
  disabled: f,
  onEvent: h,
  options: C,
  style: o(v, "style"),
  labelStyle: o(p, "labelStyle"),
  animationStyle: o(w, "animationStyle"),
  viewRef: x,
  ...V,
  ...$
};
let m = function() {
  return new I(U, (e) => {
    const [c, S] = P(e);
    return e.label({
      required: e.required,
      style: e.style,
      labelStyle: e.labelStyle,
      animationStyle: e.animationStyle,
      children: /* @__PURE__ */ a(T, {
        ref: e.viewRef,
        block: !0,
        disabled: e.disabled,
        value: e.value.value,
        $style: e.style,
        onChange: (t) => {
          S(String(t));
        },
        options: e.options.filter((t) => t.value !== void 0 && !t.hidden).map((t) => ({
          label: t.label,
          value: t.value,
          disabled: t.disabled,
          icon: D(t.prefixIcon) && t.prefixIcon
        }))
      }),
      ...c
    });
  }).setPropertyViewFn((e) => /* @__PURE__ */ n(s, {
    children: [/* @__PURE__ */ n(l, {
      name: i.basic,
      children: [e.options.propertyView({}), e.defaultValue.propertyView({
        label: g("prop.defaultValue")
      })]
    }), ["logic", "both"].includes(r(d).editorModeStatus) && /* @__PURE__ */ n(s, {
      children: [/* @__PURE__ */ a(E, {
        ...e
      }), /* @__PURE__ */ a(M, {
        ...e
      }), /* @__PURE__ */ n(l, {
        name: i.interaction,
        children: [e.onEvent.getPropertyView(), k(e), B(e)]
      })]
    }), ["layout", "both"].includes(r(d).editorModeStatus) && e.label.getPropertyView(), ["layout", "both"].includes(r(d).editorModeStatus) && /* @__PURE__ */ n(s, {
      children: [/* @__PURE__ */ a(l, {
        name: i.style,
        children: e.style.getPropertyView()
      }), /* @__PURE__ */ a(l, {
        name: i.labelStyle,
        children: e.labelStyle.getPropertyView()
      }), /* @__PURE__ */ a(l, {
        name: i.animationStyle,
        hasTooltip: !0,
        children: e.animationStyle.getPropertyView()
      })]
    })]
  })).setExposeMethodConfigs(F).build();
}();
m = z(m, A);
const J = R(m, [new j("value", g("selectInput.valueDesc")), N, ...O]);
export {
  J as SegmentedControlComp
};
