"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "useMonths", {
    enumerable: true,
    get: function() {
        return useMonths;
    }
});
const _react = require("react");
const _utils = require("../utils");
const _types = require("../store/types");
const useMonths = ({ date, value, eventList, disabledList, min, max, locale = 'ru', includeEdgeDates })=>(0, _react.useMemo)(()=>{
        const months = _utils.SHORT_MONTH_NAME[locale].map((monthName, monthIndex)=>{
            return {
                monthName,
                monthIndex,
                isCurrent: (0, _utils.isCurrentMonth)(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, 1, value) : false,
                monthFullName: _utils.MONTH_NAMES[locale][monthIndex],
                date: {
                    year: date.year,
                    monthIndex,
                    day: 1
                }
            };
        });
        if (eventList?.length || disabledList?.length || max || min) {
            const modifiedMonths = (0, _utils.getDatesWithModifications)({
                dates: months,
                type: _types.CalendarState.Months,
                min,
                max,
                includeEdgeDates,
                eventList,
                disabledList
            });
            return (0, _utils.getMatrix)(modifiedMonths, 3);
        }
        return (0, _utils.getMatrix)(months, 3);
    }, [
        date,
        value,
        eventList,
        disabledList,
        max,
        min,
        locale
    ]);
