'use strict';

var chunkFVTTRDL6_cjs = require('./chunk-FVTTRDL6.cjs');
var classnames = require('classnames');
var React = require('react');
var reactDayPicker = require('react-day-picker');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var classnames__default = /*#__PURE__*/_interopDefault(classnames);
var React__default = /*#__PURE__*/_interopDefault(React);

var CLASS_NAMES2 = {
  ...chunkFVTTRDL6_cjs.CLASS_NAMES,
  day_range_start: classnames__default.default(chunkFVTTRDL6_cjs.DateCalendar_default.calendarRangeEndpoint, chunkFVTTRDL6_cjs.DateCalendar_default.calendarRangeStart),
  day_range_middle: chunkFVTTRDL6_cjs.DateCalendar_default.calendarRangeMiddle,
  day_range_end: classnames__default.default(chunkFVTTRDL6_cjs.DateCalendar_default.calendarRangeEndpoint, chunkFVTTRDL6_cjs.DateCalendar_default.calendarRangeEnd)
};
function DateRangeCalendar({
  selected,
  onSelect,
  min,
  max,
  footer
}) {
  const disabled = React.useMemo(() => chunkFVTTRDL6_cjs.buildDisabledMatchers(min, max), [min, max]);
  const fromYear = min != null ? min.getFullYear() : chunkFVTTRDL6_cjs.DEFAULT_FROM_YEAR;
  const toYear = max != null ? max.getFullYear() : chunkFVTTRDL6_cjs.DEFAULT_TO_YEAR;
  const calendarFooter = footer == null ? void 0 : /* @__PURE__ */ React__default.default.createElement("div", {
    className: chunkFVTTRDL6_cjs.DateCalendar_default.calendarRangeFooter
  }, footer);
  return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(reactDayPicker.DayPicker, {
    mode: "range",
    selected,
    onSelect,
    disabled,
    defaultMonth: selected?.from,
    classNames: CLASS_NAMES2,
    components: chunkFVTTRDL6_cjs.CALENDAR_COMPONENTS,
    captionLayout: "dropdown-buttons",
    fromYear,
    toYear,
    numberOfMonths: 2,
    pagedNavigation: true
  }), calendarFooter);
}

exports.DateRangeCalendar = DateRangeCalendar;
//# sourceMappingURL=chunk-5ZFHOY66.cjs.map
//# sourceMappingURL=chunk-5ZFHOY66.cjs.map