"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const aria = require("../../../../constants/aria.js");
const event = require("../../../../utils/dom/event.js");
const shared_esmBundler = require("../../../../../../@vue/shared/dist/shared.esm-bundler.js");
const arrays = require("../../../../utils/arrays.js");
const index$1 = require("../../../../hooks/use-locale/index.js");
const index = require("../../../../hooks/use-namespace/index.js");
const index$4 = require("../../../icon/index.js");
const useFormCommonProps = require("../../../form/src/hooks/use-form-common-props.js");
const index$2 = require("../../../input/index.js");
const index$6 = require("../../../button/index.js");
const constants = require("../../../time-picker/src/constants.js");
const utils = require("../../../time-picker/src/utils.js");
const index$3 = require("../../../../directives/click-outside/index.js");
const panelTimePick = require("../../../time-picker/src/time-picker-com/panel-time-pick.js");
const constants$1 = require("../constants.js");
const panelDatePick = require("../props/panel-date-pick.js");
const utils$1 = require("../utils.js");
const basicDateTable = require("./basic-date-table.js");
const basicMonthTable = require("./basic-month-table.js");
const basicYearTable = require("./basic-year-table.js");
const index$5 = require("../../../../../../@element-plus/icons-vue/dist/index.js");
const Vue = require("vue");
const dayjs_min = require("../../../../../../../_virtual/dayjs.min.js");
const _hoisted_1 = ["disabled", "onClick"];
const _hoisted_2 = ["aria-label", "disabled"];
const _hoisted_3 = ["aria-label", "disabled"];
const _hoisted_4 = ["tabindex", "aria-disabled"];
const _hoisted_5 = ["tabindex", "aria-disabled"];
const _hoisted_6 = ["aria-label", "disabled"];
const _hoisted_7 = ["aria-label", "disabled"];
var panel_date_pick_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ Vue.defineComponent({
  __name: "panel-date-pick",
  props: panelDatePick.panelDatePickProps,
  emits: [
    "pick",
    "set-picker-option",
    "panel-change"
  ],
  setup(__props, { emit: __emit }) {
    const timeWithinRange = (_, __, ___) => true;
    const props = __props;
    const contextEmit = __emit;
    const ppNs = index.useNamespace("picker-panel");
    const dpNs = index.useNamespace("date-picker");
    const attrs = Vue.useAttrs();
    const slots = Vue.useSlots();
    const { t, lang } = index$1.useLocale();
    const pickerBase = Vue.inject(constants.PICKER_BASE_INJECTION_KEY);
    const isDefaultFormat = Vue.inject(constants$1.ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, void 0);
    const { shortcuts, disabledDate, cellClassName, defaultTime } = pickerBase.props;
    const defaultValue = Vue.toRef(pickerBase.props, "defaultValue");
    const currentViewRef = Vue.ref();
    const innerDate = Vue.ref(dayjs_min.default().locale(lang.value));
    const isChangeToNow = Vue.ref(false);
    let isShortcut = false;
    const defaultTimeD = Vue.computed(() => {
      return dayjs_min.default(defaultTime).locale(lang.value);
    });
    const month = Vue.computed(() => {
      return innerDate.value.month();
    });
    const year = Vue.computed(() => {
      return innerDate.value.year();
    });
    const selectableRange = Vue.ref([]);
    const userInputDate = Vue.ref(null);
    const userInputTime = Vue.ref(null);
    const checkDateWithinRange = (date) => {
      return selectableRange.value.length > 0 ? timeWithinRange(date, selectableRange.value, props.format || "HH:mm:ss") : true;
    };
    const formatEmit = (emitDayjs) => {
      if (defaultTime && !visibleTime.value && !isChangeToNow.value && !isShortcut) return defaultTimeD.value.year(emitDayjs.year()).month(emitDayjs.month()).date(emitDayjs.date());
      if (showTime.value) return emitDayjs.millisecond(0);
      return emitDayjs.startOf("day");
    };
    const emit = (value, ...args) => {
      if (!value) contextEmit("pick", value, ...args);
      else if (shared_esmBundler.isArray(value)) contextEmit("pick", value.map(formatEmit), ...args);
      else contextEmit("pick", formatEmit(value), ...args);
      userInputDate.value = null;
      userInputTime.value = null;
      isChangeToNow.value = false;
      isShortcut = false;
    };
    const handleDatePick = async (value, keepOpen) => {
      if (selectionMode.value === "date" && dayjs_min.default.isDayjs(value)) {
        const parsedDateValue = arrays.extractFirst(props.parsedValue);
        let newDate = parsedDateValue ? parsedDateValue.year(value.year()).month(value.month()).date(value.date()) : value;
        if (!checkDateWithinRange(newDate)) newDate = selectableRange.value[0][0].year(value.year()).month(value.month()).date(value.date());
        innerDate.value = newDate;
        emit(newDate, showTime.value || keepOpen);
      } else if (selectionMode.value === "week") emit(value.date);
      else if (selectionMode.value === "dates") emit(value, true);
    };
    const moveByMonth = (forward) => {
      const action = forward ? "add" : "subtract";
      innerDate.value = innerDate.value[action](1, "month");
      handlePanelChange("month");
    };
    const moveByYear = (forward) => {
      const currentDate = innerDate.value;
      const action = forward ? "add" : "subtract";
      innerDate.value = currentView.value === "year" ? currentDate[action](10, "year") : currentDate[action](1, "year");
      handlePanelChange("year");
    };
    const currentView = Vue.ref("date");
    const yearLabel = Vue.computed(() => {
      const yearTranslation = t("el.datepicker.year");
      if (currentView.value === "year") {
        const startYear = Math.floor(year.value / 10) * 10;
        if (yearTranslation) return `${startYear} ${yearTranslation} - ${startYear + 9} ${yearTranslation}`;
        return `${startYear} - ${startYear + 9}`;
      }
      return `${year.value} ${yearTranslation}`;
    });
    const handleShortcutClick = (shortcut) => {
      const shortcutValue = shared_esmBundler.isFunction(shortcut.value) ? shortcut.value() : shortcut.value;
      if (shortcutValue) {
        isShortcut = true;
        emit(dayjs_min.default(shortcutValue).locale(lang.value));
        return;
      }
      if (shortcut.onClick) shortcut.onClick({
        attrs,
        slots,
        emit: contextEmit
      });
    };
    const selectionMode = Vue.computed(() => {
      const { type } = props;
      if ([
        "week",
        "month",
        "months",
        "year",
        "years",
        "dates"
      ].includes(type)) return type;
      return "date";
    });
    const isMultipleType = Vue.computed(() => {
      return selectionMode.value === "dates" || selectionMode.value === "months" || selectionMode.value === "years";
    });
    const keyboardMode = Vue.computed(() => {
      return selectionMode.value === "date" ? currentView.value : selectionMode.value;
    });
    const hasShortcuts = Vue.computed(() => !!shortcuts.length);
    const handleMonthPick = async (month2, keepOpen) => {
      if (selectionMode.value === "month") {
        innerDate.value = utils$1.getValidDateOfMonth(innerDate.value, innerDate.value.year(), month2, lang.value, disabledDate);
        emit(innerDate.value, false);
      } else if (selectionMode.value === "months") emit(month2, keepOpen ?? true);
      else {
        innerDate.value = utils$1.getValidDateOfMonth(innerDate.value, innerDate.value.year(), month2, lang.value, disabledDate);
        currentView.value = "date";
        if ([
          "month",
          "year",
          "date",
          "week"
        ].includes(selectionMode.value)) {
          emit(innerDate.value, true);
          await Vue.nextTick();
          handleFocusPicker();
        }
      }
      handlePanelChange("month");
    };
    const handleYearPick = async (year2, keepOpen) => {
      if (selectionMode.value === "year") {
        innerDate.value = utils$1.getValidDateOfYear(innerDate.value.startOf("year").year(year2), lang.value, disabledDate);
        emit(innerDate.value, false);
      } else if (selectionMode.value === "years") emit(year2, keepOpen ?? true);
      else {
        innerDate.value = utils$1.getValidDateOfYear(innerDate.value.year(year2), lang.value, disabledDate);
        currentView.value = "month";
        if ([
          "month",
          "year",
          "date",
          "week"
        ].includes(selectionMode.value)) {
          emit(innerDate.value, true);
          await Vue.nextTick();
          handleFocusPicker();
        }
      }
      handlePanelChange("year");
    };
    const dateDisabled = useFormCommonProps.useFormDisabled();
    const showPicker = async (view) => {
      if (dateDisabled.value) return;
      currentView.value = view;
      await Vue.nextTick();
      handleFocusPicker();
    };
    const showTime = Vue.computed(() => props.type === "datetime" || props.type === "datetimerange");
    const footerVisible = Vue.computed(() => {
      const showDateFooter = showTime.value || selectionMode.value === "dates";
      const showYearFooter = selectionMode.value === "years";
      const showMonthFooter = selectionMode.value === "months";
      const isDateView = currentView.value === "date";
      const isYearView = currentView.value === "year";
      const isMonthView = currentView.value === "month";
      return showDateFooter && isDateView || showYearFooter && isYearView || showMonthFooter && isMonthView;
    });
    const footerFilled = Vue.computed(() => !isMultipleType.value && props.showNow || props.showConfirm);
    const disabledConfirm = Vue.computed(() => {
      if (!disabledDate) return false;
      if (!props.parsedValue) return true;
      if (shared_esmBundler.isArray(props.parsedValue)) return disabledDate(props.parsedValue[0].toDate());
      return disabledDate(props.parsedValue.toDate());
    });
    const onConfirm = () => {
      if (isMultipleType.value) emit(props.parsedValue);
      else {
        let result = arrays.extractFirst(props.parsedValue);
        if (!result) {
          const defaultTimeD2 = dayjs_min.default(defaultTime).locale(lang.value);
          const defaultValueD = getDefaultValue();
          result = defaultTimeD2.year(defaultValueD.year()).month(defaultValueD.month()).date(defaultValueD.date());
        }
        innerDate.value = result;
        emit(result);
      }
    };
    const disabledNow = Vue.computed(() => {
      if (!disabledDate) return false;
      return disabledDate(dayjs_min.default().locale(lang.value).toDate());
    });
    const changeToNow = () => {
      const nowDate = dayjs_min.default().locale(lang.value).toDate();
      isChangeToNow.value = true;
      if ((!disabledDate || !disabledDate(nowDate)) && checkDateWithinRange(nowDate)) {
        innerDate.value = dayjs_min.default().locale(lang.value);
        emit(innerDate.value);
      }
    };
    const timeFormat = Vue.computed(() => {
      return props.timeFormat || utils.extractTimeFormat(props.format) || constants.DEFAULT_FORMATS_TIME;
    });
    const dateFormat = Vue.computed(() => {
      return props.dateFormat || utils.extractDateFormat(props.format) || constants.DEFAULT_FORMATS_DATE;
    });
    const visibleTime = Vue.computed(() => {
      if (userInputTime.value) return userInputTime.value;
      if (!props.parsedValue && !defaultValue.value) return;
      return (arrays.extractFirst(props.parsedValue) || innerDate.value).format(timeFormat.value);
    });
    const visibleDate = Vue.computed(() => {
      if (userInputDate.value) return userInputDate.value;
      if (!props.parsedValue && !defaultValue.value) return;
      return (arrays.extractFirst(props.parsedValue) || innerDate.value).format(dateFormat.value);
    });
    const timePickerVisible = Vue.ref(false);
    const onTimePickerInputFocus = () => {
      timePickerVisible.value = true;
    };
    const handleTimePickClose = () => {
      timePickerVisible.value = false;
    };
    const getUnits = (date) => {
      return {
        hour: date.hour(),
        minute: date.minute(),
        second: date.second(),
        year: date.year(),
        month: date.month(),
        date: date.date()
      };
    };
    const handleTimePick = (value, visible, first) => {
      const { hour, minute, second } = getUnits(value);
      const parsedDateValue = arrays.extractFirst(props.parsedValue);
      innerDate.value = parsedDateValue ? parsedDateValue.hour(hour).minute(minute).second(second) : value;
      emit(innerDate.value, true);
      if (!first) timePickerVisible.value = visible;
    };
    const handleVisibleTimeChange = (value) => {
      const newDate = dayjs_min.default(value, timeFormat.value).locale(lang.value);
      if (newDate.isValid() && checkDateWithinRange(newDate)) {
        const { year: year2, month: month2, date } = getUnits(innerDate.value);
        innerDate.value = newDate.year(year2).month(month2).date(date);
        userInputTime.value = null;
        timePickerVisible.value = false;
        emit(innerDate.value, true);
      }
    };
    const handleVisibleDateChange = (value) => {
      const newDate = utils$1.correctlyParseUserInput(value, dateFormat.value, lang.value, isDefaultFormat);
      if (newDate.isValid()) {
        if (disabledDate && disabledDate(newDate.toDate())) return;
        const { hour, minute, second } = getUnits(innerDate.value);
        innerDate.value = newDate.hour(hour).minute(minute).second(second);
        userInputDate.value = null;
        emit(innerDate.value, true);
      }
    };
    const isValidValue = (date) => {
      return dayjs_min.default.isDayjs(date) && date.isValid() && (disabledDate ? !disabledDate(date.toDate()) : true);
    };
    const parseUserInput = (value) => {
      return utils$1.correctlyParseUserInput(value, props.format, lang.value, isDefaultFormat);
    };
    const getDefaultValue = () => {
      const parseDate = dayjs_min.default(defaultValue.value).locale(lang.value);
      if (!defaultValue.value) {
        const defaultTimeDValue = defaultTimeD.value;
        return dayjs_min.default().hour(defaultTimeDValue.hour()).minute(defaultTimeDValue.minute()).second(defaultTimeDValue.second()).locale(lang.value);
      }
      return parseDate;
    };
    const handleFocusPicker = () => {
      var _a;
      if ([
        "week",
        "month",
        "year",
        "date"
      ].includes(selectionMode.value)) (_a = currentViewRef.value) == null ? void 0 : _a.focus();
    };
    const _handleFocusPicker = () => {
      handleFocusPicker();
      if (selectionMode.value === "week") handleKeyControl(aria.EVENT_CODE.down);
    };
    const handleKeydownTable = (event$1) => {
      const code = event.getEventCode(event$1);
      if ([
        aria.EVENT_CODE.up,
        aria.EVENT_CODE.down,
        aria.EVENT_CODE.left,
        aria.EVENT_CODE.right,
        aria.EVENT_CODE.home,
        aria.EVENT_CODE.end,
        aria.EVENT_CODE.pageUp,
        aria.EVENT_CODE.pageDown
      ].includes(code)) {
        handleKeyControl(code);
        event$1.stopPropagation();
        event$1.preventDefault();
      }
      if ([
        aria.EVENT_CODE.enter,
        aria.EVENT_CODE.space,
        aria.EVENT_CODE.numpadEnter
      ].includes(code) && userInputDate.value === null && userInputTime.value === null) {
        event$1.preventDefault();
        emit(innerDate.value, false);
      }
    };
    const handleKeyControl = (code) => {
      const { up, down, left, right, home, end, pageUp, pageDown } = aria.EVENT_CODE;
      const mapping = {
        year: {
          [up]: -4,
          [down]: 4,
          [left]: -1,
          [right]: 1,
          offset: (date, step) => date.setFullYear(date.getFullYear() + step)
        },
        month: {
          [up]: -4,
          [down]: 4,
          [left]: -1,
          [right]: 1,
          offset: (date, step) => date.setMonth(date.getMonth() + step)
        },
        week: {
          [up]: -1,
          [down]: 1,
          [left]: -1,
          [right]: 1,
          offset: (date, step) => date.setDate(date.getDate() + step * 7)
        },
        date: {
          [up]: -7,
          [down]: 7,
          [left]: -1,
          [right]: 1,
          [home]: (date) => -date.getDay(),
          [end]: (date) => -date.getDay() + 6,
          [pageUp]: (date) => -new Date(date.getFullYear(), date.getMonth(), 0).getDate(),
          [pageDown]: (date) => new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(),
          offset: (date, step) => date.setDate(date.getDate() + step)
        }
      };
      const newDate = innerDate.value.toDate();
      while (Math.abs(innerDate.value.diff(newDate, "year", true)) < 1) {
        const map = mapping[keyboardMode.value];
        if (!map) return;
        map.offset(newDate, shared_esmBundler.isFunction(map[code]) ? map[code](newDate) : map[code] ?? 0);
        if (disabledDate && disabledDate(newDate)) break;
        const result = dayjs_min.default(newDate).locale(lang.value);
        innerDate.value = result;
        contextEmit("pick", result, true);
        break;
      }
    };
    const handlePanelChange = (mode) => {
      contextEmit("panel-change", innerDate.value.toDate(), mode, currentView.value);
    };
    Vue.watch(() => selectionMode.value, (val) => {
      if (["month", "year"].includes(val)) {
        currentView.value = val;
        return;
      } else if (val === "years") {
        currentView.value = "year";
        return;
      } else if (val === "months") {
        currentView.value = "month";
        return;
      }
      currentView.value = "date";
    }, { immediate: true });
    Vue.watch(() => defaultValue.value, (val) => {
      if (val) innerDate.value = getDefaultValue();
    }, { immediate: true });
    Vue.watch(() => props.parsedValue, (val) => {
      if (val) {
        if (isMultipleType.value) return;
        if (shared_esmBundler.isArray(val)) return;
        innerDate.value = val;
      } else innerDate.value = getDefaultValue();
    }, { immediate: true });
    contextEmit("set-picker-option", ["isValidValue", isValidValue]);
    contextEmit("set-picker-option", ["parseUserInput", parseUserInput]);
    contextEmit("set-picker-option", ["handleFocusPicker", _handleFocusPicker]);
    return (_ctx, _cache) => {
      return Vue.openBlock(), Vue.createElementBlock("div", { class: Vue.normalizeClass([
        Vue.unref(ppNs).b(),
        Vue.unref(dpNs).b(),
        Vue.unref(ppNs).is("border", _ctx.border),
        Vue.unref(ppNs).is("disabled", Vue.unref(dateDisabled)),
        {
          "has-sidebar": _ctx.$slots.sidebar || hasShortcuts.value,
          "has-time": showTime.value
        }
      ]) }, [Vue.createElementVNode("div", { class: Vue.normalizeClass(Vue.unref(ppNs).e("body-wrapper")) }, [
        Vue.renderSlot(_ctx.$slots, "sidebar", { class: Vue.normalizeClass(Vue.unref(ppNs).e("sidebar")) }),
        hasShortcuts.value ? (Vue.openBlock(), Vue.createElementBlock("div", {
          key: 0,
          class: Vue.normalizeClass(Vue.unref(ppNs).e("sidebar"))
        }, [(Vue.openBlock(true), Vue.createElementBlock(Vue.Fragment, null, Vue.renderList(Vue.unref(shortcuts), (shortcut, key) => {
          return Vue.openBlock(), Vue.createElementBlock("button", {
            key,
            type: "button",
            disabled: Vue.unref(dateDisabled),
            class: Vue.normalizeClass(Vue.unref(ppNs).e("shortcut")),
            onClick: ($event) => handleShortcutClick(shortcut)
          }, Vue.toDisplayString(shortcut.text), 11, _hoisted_1);
        }), 128))], 2)) : Vue.createCommentVNode("v-if", true),
        Vue.createElementVNode("div", { class: Vue.normalizeClass(Vue.unref(ppNs).e("body")) }, [
          showTime.value ? (Vue.openBlock(), Vue.createElementBlock("div", {
            key: 0,
            class: Vue.normalizeClass(Vue.unref(dpNs).e("time-header"))
          }, [Vue.createElementVNode("span", { class: Vue.normalizeClass(Vue.unref(dpNs).e("editor-wrap")) }, [Vue.createVNode(Vue.unref(index$2.ElInput), {
            placeholder: Vue.unref(t)("el.datepicker.selectDate"),
            "model-value": visibleDate.value,
            size: "small",
            "validate-event": false,
            disabled: Vue.unref(dateDisabled),
            readonly: !_ctx.editable,
            onInput: _cache[0] || (_cache[0] = (val) => userInputDate.value = val),
            onChange: handleVisibleDateChange
          }, null, 8, [
            "placeholder",
            "model-value",
            "disabled",
            "readonly"
          ])], 2), Vue.withDirectives((Vue.openBlock(), Vue.createElementBlock("span", { class: Vue.normalizeClass(Vue.unref(dpNs).e("editor-wrap")) }, [Vue.createVNode(Vue.unref(index$2.ElInput), {
            placeholder: Vue.unref(t)("el.datepicker.selectTime"),
            "model-value": visibleTime.value,
            size: "small",
            "validate-event": false,
            disabled: Vue.unref(dateDisabled),
            readonly: !_ctx.editable,
            onFocus: onTimePickerInputFocus,
            onInput: _cache[1] || (_cache[1] = (val) => userInputTime.value = val),
            onChange: handleVisibleTimeChange
          }, null, 8, [
            "placeholder",
            "model-value",
            "disabled",
            "readonly"
          ]), Vue.createVNode(Vue.unref(panelTimePick.default), {
            visible: timePickerVisible.value,
            format: timeFormat.value,
            "parsed-value": innerDate.value,
            onPick: handleTimePick
          }, null, 8, [
            "visible",
            "format",
            "parsed-value"
          ])], 2)), [[Vue.unref(index$3.default), handleTimePickClose]])], 2)) : Vue.createCommentVNode("v-if", true),
          Vue.withDirectives(Vue.createElementVNode("div", { class: Vue.normalizeClass([Vue.unref(dpNs).e("header"), (currentView.value === "year" || currentView.value === "month") && Vue.unref(dpNs).em("header", "bordered")]) }, [
            Vue.createElementVNode("span", { class: Vue.normalizeClass(Vue.unref(dpNs).e("prev-btn")) }, [Vue.createElementVNode("button", {
              type: "button",
              "aria-label": Vue.unref(t)(`el.datepicker.prevYear`),
              class: Vue.normalizeClass(["d-arrow-left", Vue.unref(ppNs).e("icon-btn")]),
              disabled: Vue.unref(dateDisabled),
              onClick: _cache[2] || (_cache[2] = ($event) => moveByYear(false))
            }, [Vue.renderSlot(_ctx.$slots, "prev-year", {}, () => [Vue.createVNode(Vue.unref(index$4.ElIcon), null, {
              default: Vue.withCtx(() => [Vue.createVNode(Vue.unref(index$5.DArrowLeft))]),
              _: 1
            })])], 10, _hoisted_2), Vue.withDirectives(Vue.createElementVNode("button", {
              type: "button",
              "aria-label": Vue.unref(t)(`el.datepicker.prevMonth`),
              class: Vue.normalizeClass([Vue.unref(ppNs).e("icon-btn"), "arrow-left"]),
              disabled: Vue.unref(dateDisabled),
              onClick: _cache[3] || (_cache[3] = ($event) => moveByMonth(false))
            }, [Vue.renderSlot(_ctx.$slots, "prev-month", {}, () => [Vue.createVNode(Vue.unref(index$4.ElIcon), null, {
              default: Vue.withCtx(() => [Vue.createVNode(Vue.unref(index$5.ArrowLeft))]),
              _: 1
            })])], 10, _hoisted_3), [[Vue.vShow, currentView.value === "date"]])], 2),
            Vue.createElementVNode("span", {
              role: "button",
              class: Vue.normalizeClass(Vue.unref(dpNs).e("header-label")),
              "aria-live": "polite",
              tabindex: _ctx.disabled ? void 0 : 0,
              "aria-disabled": _ctx.disabled,
              onKeydown: _cache[4] || (_cache[4] = Vue.withKeys(($event) => showPicker("year"), ["enter"])),
              onClick: _cache[5] || (_cache[5] = ($event) => showPicker("year"))
            }, Vue.toDisplayString(yearLabel.value), 43, _hoisted_4),
            Vue.withDirectives(Vue.createElementVNode("span", {
              role: "button",
              "aria-live": "polite",
              tabindex: _ctx.disabled ? void 0 : 0,
              "aria-disabled": _ctx.disabled,
              class: Vue.normalizeClass([Vue.unref(dpNs).e("header-label"), { active: currentView.value === "month" }]),
              onKeydown: _cache[6] || (_cache[6] = Vue.withKeys(($event) => showPicker("month"), ["enter"])),
              onClick: _cache[7] || (_cache[7] = ($event) => showPicker("month"))
            }, Vue.toDisplayString(Vue.unref(t)(`el.datepicker.month${month.value + 1}`)), 43, _hoisted_5), [[Vue.vShow, currentView.value === "date"]]),
            Vue.createElementVNode("span", { class: Vue.normalizeClass(Vue.unref(dpNs).e("next-btn")) }, [Vue.withDirectives(Vue.createElementVNode("button", {
              type: "button",
              "aria-label": Vue.unref(t)(`el.datepicker.nextMonth`),
              class: Vue.normalizeClass([Vue.unref(ppNs).e("icon-btn"), "arrow-right"]),
              disabled: Vue.unref(dateDisabled),
              onClick: _cache[8] || (_cache[8] = ($event) => moveByMonth(true))
            }, [Vue.renderSlot(_ctx.$slots, "next-month", {}, () => [Vue.createVNode(Vue.unref(index$4.ElIcon), null, {
              default: Vue.withCtx(() => [Vue.createVNode(Vue.unref(index$5.ArrowRight))]),
              _: 1
            })])], 10, _hoisted_6), [[Vue.vShow, currentView.value === "date"]]), Vue.createElementVNode("button", {
              type: "button",
              "aria-label": Vue.unref(t)(`el.datepicker.nextYear`),
              class: Vue.normalizeClass([Vue.unref(ppNs).e("icon-btn"), "d-arrow-right"]),
              disabled: Vue.unref(dateDisabled),
              onClick: _cache[9] || (_cache[9] = ($event) => moveByYear(true))
            }, [Vue.renderSlot(_ctx.$slots, "next-year", {}, () => [Vue.createVNode(Vue.unref(index$4.ElIcon), null, {
              default: Vue.withCtx(() => [Vue.createVNode(Vue.unref(index$5.DArrowRight))]),
              _: 1
            })])], 10, _hoisted_7)], 2)
          ], 2), [[Vue.vShow, currentView.value !== "time"]]),
          Vue.createElementVNode("div", {
            class: Vue.normalizeClass(Vue.unref(ppNs).e("content")),
            onKeydown: handleKeydownTable
          }, [
            currentView.value === "date" ? (Vue.openBlock(), Vue.createBlock(basicDateTable.default, {
              key: 0,
              ref_key: "currentViewRef",
              ref: currentViewRef,
              "selection-mode": selectionMode.value,
              date: innerDate.value,
              "parsed-value": _ctx.parsedValue,
              "disabled-date": Vue.unref(disabledDate),
              disabled: Vue.unref(dateDisabled),
              "cell-class-name": Vue.unref(cellClassName),
              "show-week-number": _ctx.showWeekNumber,
              onPick: handleDatePick
            }, null, 8, [
              "selection-mode",
              "date",
              "parsed-value",
              "disabled-date",
              "disabled",
              "cell-class-name",
              "show-week-number"
            ])) : Vue.createCommentVNode("v-if", true),
            currentView.value === "year" ? (Vue.openBlock(), Vue.createBlock(basicYearTable.default, {
              key: 1,
              ref_key: "currentViewRef",
              ref: currentViewRef,
              "selection-mode": selectionMode.value,
              date: innerDate.value,
              "disabled-date": Vue.unref(disabledDate),
              disabled: Vue.unref(dateDisabled),
              "parsed-value": _ctx.parsedValue,
              "cell-class-name": Vue.unref(cellClassName),
              onPick: handleYearPick
            }, null, 8, [
              "selection-mode",
              "date",
              "disabled-date",
              "disabled",
              "parsed-value",
              "cell-class-name"
            ])) : Vue.createCommentVNode("v-if", true),
            currentView.value === "month" ? (Vue.openBlock(), Vue.createBlock(basicMonthTable.default, {
              key: 2,
              ref_key: "currentViewRef",
              ref: currentViewRef,
              "selection-mode": selectionMode.value,
              date: innerDate.value,
              "parsed-value": _ctx.parsedValue,
              "disabled-date": Vue.unref(disabledDate),
              disabled: Vue.unref(dateDisabled),
              "cell-class-name": Vue.unref(cellClassName),
              onPick: handleMonthPick
            }, null, 8, [
              "selection-mode",
              "date",
              "parsed-value",
              "disabled-date",
              "disabled",
              "cell-class-name"
            ])) : Vue.createCommentVNode("v-if", true)
          ], 34)
        ], 2)
      ], 2), _ctx.showFooter && footerVisible.value && footerFilled.value ? (Vue.openBlock(), Vue.createElementBlock("div", {
        key: 0,
        class: Vue.normalizeClass(Vue.unref(ppNs).e("footer"))
      }, [Vue.withDirectives(Vue.createVNode(Vue.unref(index$6.ElButton), {
        text: "",
        size: "small",
        class: Vue.normalizeClass(Vue.unref(ppNs).e("link-btn")),
        disabled: disabledNow.value,
        onClick: changeToNow
      }, {
        default: Vue.withCtx(() => [Vue.createTextVNode(Vue.toDisplayString(Vue.unref(t)("el.datepicker.now")), 1)]),
        _: 1
      }, 8, ["class", "disabled"]), [[Vue.vShow, !isMultipleType.value && _ctx.showNow]]), _ctx.showConfirm ? (Vue.openBlock(), Vue.createBlock(Vue.unref(index$6.ElButton), {
        key: 0,
        plain: "",
        size: "small",
        class: Vue.normalizeClass(Vue.unref(ppNs).e("link-btn")),
        disabled: disabledConfirm.value,
        onClick: onConfirm
      }, {
        default: Vue.withCtx(() => [Vue.createTextVNode(Vue.toDisplayString(Vue.unref(t)("el.datepicker.confirm")), 1)]),
        _: 1
      }, 8, ["class", "disabled"])) : Vue.createCommentVNode("v-if", true)], 2)) : Vue.createCommentVNode("v-if", true)], 2);
    };
  }
});
exports.default = panel_date_pick_vue_vue_type_script_setup_true_lang_default;
