import { isObject } from "../../../../../@vue/shared/dist/shared.esm-bundler.mjs";
import { buildProps, definePropType } from "../../../utils/vue/props/runtime.mjs";
import { rangeArr } from "../../time-picker/src/utils.mjs";
const getPrevMonthLastDays = (date, count) => {
  const lastDay = date.subtract(1, "month").endOf("month").date();
  return rangeArr(count).map((_, index) => lastDay - (count - index - 1));
};
const getMonthDays = (date) => {
  return rangeArr(date.daysInMonth()).map((_, index) => index + 1);
};
const toNestedArr = (days) => rangeArr(days.length / 7).map((index) => {
  const start = index * 7;
  return days.slice(start, start + 7);
});
const dateTableProps = buildProps({
  selectedDay: { type: definePropType(Object) },
  range: { type: definePropType(Array) },
  date: {
    type: definePropType(Object),
    required: true
  },
  hideHeader: { type: Boolean }
});
const dateTableEmits = { pick: (value) => isObject(value) };
export {
  dateTableEmits,
  dateTableProps,
  getMonthDays,
  getPrevMonthLastDays,
  toNestedArr
};
