import { $ as u } from "./useControlledState-3TGZUXux.es.js";
import { useState as S } from "react";
function $(e = {}) {
  let { isReadOnly: d } = e, [t, a] = u(e.isSelected, e.defaultSelected || !1, e.onChange), [c] = S(t);
  function f(n) {
    d || a(n);
  }
  function i() {
    d || a(!t);
  }
  var l;
  return {
    isSelected: t,
    defaultSelected: (l = e.defaultSelected) !== null && l !== void 0 ? l : c,
    setSelected: f,
    toggle: i
  };
}
export {
  $
};
//# sourceMappingURL=useToggleState-DWm4nWJh.es.js.map
