import { useCallback } from "react";
export var useCheckboxesList = function useCheckboxesList(values, handlers) {
  var checked = values.every(function (isChecked) {
    return isChecked;
  });
  var isIndeterminate = !checked && values.includes(false) && values.includes(true);
  var switchAllCheckboxes = useCallback(function () {
    if (checked) {
      handlers.forEach(function (handler) {
        return handler(false);
      });
    } else {
      handlers.forEach(function (handler) {
        return handler(true);
      });
    }
  }, [checked, handlers]);
  return [checked, isIndeterminate, switchAllCheckboxes];
};