"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseDatePicker = void 0;
const react_1 = __importDefault(require("react"));
const Styled = __importStar(require("./index.styled"));
const YearMonthController_1 = __importDefault(require("./YearMonthController"));
const library_1 = require("../../../library");
const Month_1 = __importDefault(require("./Month"));
const Week_1 = __importDefault(require("./Week"));
const DateOfMonth_1 = require("./DateOfMonth");
const date_1 = require("../../../types/date");
const index_util_1 = require("./hooks/index.util");
const DayOfWeek_1 = __importDefault(require("./DayOfWeek"));
const BaseDatePicker = (props) => {
    return (react_1.default.createElement(Styled.DatePickerWrapper, null,
        react_1.default.createElement(YearMonthController_1.default, { displayYear: props.displayYear, displayMonth: props.displayMonth, handleClickPrevYear: props.handleClickPrevYear, handleClickPrevMonth: props.handleClickPrevMonth, handleClickNextMonth: props.handleClickNextMonth, handleClickNextYear: props.handleClickNextYear }),
        react_1.default.createElement(library_1.Spacing, { spaceNumber: 10 }),
        react_1.default.createElement(Month_1.default, null,
            react_1.default.createElement(Week_1.default, null, index_util_1.DAY_OF_WEEK_LIST.map((val, key) => (react_1.default.createElement(DayOfWeek_1.default, { key: key }, val)))),
            props.dateList.map((week, key) => {
                return (react_1.default.createElement(Week_1.default, { key: `week-${key}` }, week.map((d, key) => {
                    if (!(d === date_1.EMPTY_DATE || d instanceof date_1.PurpleDate)) {
                        switch (d.type) {
                            case '비활성화':
                                return react_1.default.createElement(DateOfMonth_1.DisabledDateOfMonth, Object.assign({}, d, { key: d.date.toDateString() }));
                            case '활성화':
                                return react_1.default.createElement(DateOfMonth_1.ActiveDateOfMonth, Object.assign({}, d, { key: d.date.toDateString() }));
                            case '포커스단일':
                                return react_1.default.createElement(DateOfMonth_1.SingleFocusDateOfMonth, Object.assign({}, d, { key: d.date.toDateString() }));
                            case '포커스시작일':
                                return react_1.default.createElement(DateOfMonth_1.RangeStartFocusDateOfMonth, Object.assign({}, d, { key: d.date.toDateString() }));
                            case '포커스종료일':
                                return react_1.default.createElement(DateOfMonth_1.RangeEndFocusDateOfMonth, Object.assign({}, d, { key: d.date.toDateString() }));
                            case '빈값':
                            default:
                                return react_1.default.createElement(DateOfMonth_1.NoneDateOfMonth, Object.assign({}, d, { key: `null-${key}` }));
                        }
                    }
                })));
            }))));
};
exports.BaseDatePicker = BaseDatePicker;
