"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "useQuarters", {
    enumerable: true,
    get: function() {
        return useQuarters;
    }
});
const _react = require("react");
const _utils = require("../utils");
const _types = require("../store/types");
const useQuarters = ({ date, value, eventList, disabledList, min, max, includeEdgeDates })=>(0, _react.useMemo)(()=>{
        const quarters = _utils.QUARTER_NAMES.map((quarterName)=>{
            const { monthIndex, day } = _utils.quarterDates[quarterName];
            return {
                quarterName,
                isCurrent: (0, _utils.isCurrentQuarter)(date, monthIndex),
                isSelected: Array.isArray(value) ? Boolean(value.find((v)=>(0, _utils.isSelectedMonth)(date, monthIndex, v))) : (0, _utils.isSelectedMonth)(date, monthIndex, value),
                inRange: Array.isArray(value) ? (0, _utils.isDateInRange)(date.year, monthIndex, day, value) : false,
                date: {
                    year: date.year,
                    monthIndex,
                    day: 1
                }
            };
        });
        if (eventList?.length || disabledList?.length || max || min) {
            const modifiedQuarters = (0, _utils.getDatesWithModifications)({
                dates: quarters,
                type: _types.CalendarState.Quarters,
                min,
                max,
                includeEdgeDates,
                eventList,
                disabledList
            });
            return (0, _utils.getMatrix)(modifiedQuarters, 2);
        }
        return (0, _utils.getMatrix)(quarters, 2);
    }, [
        date,
        value,
        eventList,
        disabledList,
        max,
        min
    ]);
