import { b as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-cvK1vxO7.js";
import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "./filterDOMProps-D2C6R0DK.js";
import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "./usePress-CBQIDzpQ.js";
import { $ as $f645667febf57a63$export$4c014de7c8940b4c } from "./useHover-LmGemtHE.js";
function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
  let { elementType = "button", isDisabled, onPress, onPressStart, onPressEnd, onPressUp, onPressChange, preventFocusOnPress, allowFocusWhenDisabled, onClick, href, target, rel, type = "button" } = props;
  let additionalProps;
  if (elementType === "button") additionalProps = {
    type,
    disabled: isDisabled,
    form: props.form,
    formAction: props.formAction,
    formEncType: props.formEncType,
    formMethod: props.formMethod,
    formNoValidate: props.formNoValidate,
    formTarget: props.formTarget,
    name: props.name,
    value: props.value
  };
  else additionalProps = {
    role: "button",
    href: elementType === "a" && !isDisabled ? href : void 0,
    target: elementType === "a" ? target : void 0,
    type: elementType === "input" ? type : void 0,
    disabled: elementType === "input" ? isDisabled : void 0,
    "aria-disabled": !isDisabled || elementType === "input" ? void 0 : isDisabled,
    rel: elementType === "a" ? rel : void 0
  };
  let { pressProps, isPressed } = $f6c31cce2adf654f$export$45712eceda6fad21({
    onPressStart,
    onPressEnd,
    onPressChange,
    onPress,
    onPressUp,
    onClick,
    isDisabled,
    preventFocusOnPress,
    ref
  });
  let { focusableProps } = $f645667febf57a63$export$4c014de7c8940b4c(props, ref);
  if (allowFocusWhenDisabled) focusableProps.tabIndex = isDisabled ? -1 : focusableProps.tabIndex;
  let buttonProps = $3ef42575df84b30b$export$9d1611c77c2fe928(focusableProps, pressProps, $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
    labelable: true
  }));
  return {
    isPressed,
    buttonProps: $3ef42575df84b30b$export$9d1611c77c2fe928(additionalProps, buttonProps, {
      "aria-haspopup": props["aria-haspopup"],
      "aria-expanded": props["aria-expanded"],
      "aria-controls": props["aria-controls"],
      "aria-pressed": props["aria-pressed"],
      "aria-current": props["aria-current"],
      "aria-disabled": props["aria-disabled"]
    })
  };
}
export {
  $701a24aa0da5b062$export$ea18c227d4417cc3 as $
};
