import { a as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./useHover-LmGemtHE.js";
import { useState } from "react";
function $3017fa7ffdddec74$export$8042c6c013fd5226(props = {}) {
  let { isReadOnly } = props;
  let [isSelected, setSelected] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(props.isSelected, props.defaultSelected || false, props.onChange);
  let [initialValue] = useState(isSelected);
  function updateSelected(value) {
    if (!isReadOnly) setSelected(value);
  }
  function toggleState() {
    if (!isReadOnly) setSelected(!isSelected);
  }
  var _props_defaultSelected;
  return {
    isSelected,
    defaultSelected: (_props_defaultSelected = props.defaultSelected) !== null && _props_defaultSelected !== void 0 ? _props_defaultSelected : initialValue,
    setSelected: updateSelected,
    toggle: toggleState
  };
}
export {
  $3017fa7ffdddec74$export$8042c6c013fd5226 as $
};
