react-period-of-stay-input
Version:
React.js component for entering a period of stay in a hotel: check-in + check-out date
1 lines • 107 kB
JSON
{"id":"../node_modules/react-datepicker/es/index.js","dependencies":[{"name":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react-datepicker/package.json","includedInParent":true,"mtime":1533713806755},{"name":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/package.json","includedInParent":true,"mtime":1534141269544},{"name":"react","loc":{"line":1,"column":18},"parent":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react-datepicker/es/index.js","resolved":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react/index.js"},{"name":"prop-types","loc":{"line":2,"column":22},"parent":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react-datepicker/es/index.js","resolved":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/prop-types/index.js"},{"name":"classnames","loc":{"line":3,"column":23},"parent":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react-datepicker/es/index.js","resolved":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/classnames/index.js"},{"name":"react-onclickoutside","loc":{"line":4,"column":27},"parent":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react-datepicker/es/index.js","resolved":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react-onclickoutside/dist/react-onclickoutside.es.js"},{"name":"moment","loc":{"line":5,"column":19},"parent":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react-datepicker/es/index.js","resolved":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/moment/moment.js"},{"name":"react-popper","loc":{"line":6,"column":40},"parent":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react-datepicker/es/index.js","resolved":"/home/ikr/prj/stc-b2b/react-period-of-stay-input/node_modules/react-popper/lib/react-popper.js"}],"generated":{"js":"'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.CalendarContainer = undefined;\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames2 = require('classnames');\n\nvar _classnames3 = _interopRequireDefault(_classnames2);\n\nvar _reactOnclickoutside = require('react-onclickoutside');\n\nvar _reactOnclickoutside2 = _interopRequireDefault(_reactOnclickoutside);\n\nvar _moment = require('moment');\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nvar _reactPopper = require('react-popper');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar inherits = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\nvar possibleConstructorReturn = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\nfunction generateYears(year, noOfYear, minDate, maxDate) {\n var list = [];\n for (var i = 0; i < 2 * noOfYear + 1; i++) {\n var newYear = year + noOfYear - i;\n var isInRange = true;\n\n if (minDate) {\n isInRange = minDate.year() <= newYear;\n }\n\n if (maxDate && isInRange) {\n isInRange = maxDate.year() >= newYear;\n }\n\n if (isInRange) {\n list.push(newYear);\n }\n }\n\n return list;\n}\n\nvar YearDropdownOptions = function (_React$Component) {\n inherits(YearDropdownOptions, _React$Component);\n\n function YearDropdownOptions(props) {\n classCallCheck(this, YearDropdownOptions);\n\n var _this = possibleConstructorReturn(this, _React$Component.call(this, props));\n\n _this.renderOptions = function () {\n var selectedYear = _this.props.year;\n var options = _this.state.yearsList.map(function (year) {\n return _react2.default.createElement(\"div\", {\n className: selectedYear === year ? \"react-datepicker__year-option react-datepicker__year-option--selected_year\" : \"react-datepicker__year-option\",\n key: year,\n ref: year,\n onClick: _this.onChange.bind(_this, year)\n }, selectedYear === year ? _react2.default.createElement(\"span\", { className: \"react-datepicker__year-option--selected\" }, \"\\u2713\") : \"\", year);\n });\n\n var minYear = _this.props.minDate ? _this.props.minDate.year() : null;\n var maxYear = _this.props.maxDate ? _this.props.maxDate.year() : null;\n\n if (!maxYear || !_this.state.yearsList.find(function (year) {\n return year === maxYear;\n })) {\n options.unshift(_react2.default.createElement(\"div\", {\n className: \"react-datepicker__year-option\",\n ref: \"upcoming\",\n key: \"upcoming\",\n onClick: _this.incrementYears\n }, _react2.default.createElement(\"a\", { className: \"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming\" })));\n }\n\n if (!minYear || !_this.state.yearsList.find(function (year) {\n return year === minYear;\n })) {\n options.push(_react2.default.createElement(\"div\", {\n className: \"react-datepicker__year-option\",\n ref: \"previous\",\n key: \"previous\",\n onClick: _this.decrementYears\n }, _react2.default.createElement(\"a\", { className: \"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous\" })));\n }\n\n return options;\n };\n\n _this.onChange = function (year) {\n _this.props.onChange(year);\n };\n\n _this.handleClickOutside = function () {\n _this.props.onCancel();\n };\n\n _this.shiftYears = function (amount) {\n var years = _this.state.yearsList.map(function (year) {\n return year + amount;\n });\n\n _this.setState({\n yearsList: years\n });\n };\n\n _this.incrementYears = function () {\n return _this.shiftYears(1);\n };\n\n _this.decrementYears = function () {\n return _this.shiftYears(-1);\n };\n\n var yearDropdownItemNumber = props.yearDropdownItemNumber,\n scrollableYearDropdown = props.scrollableYearDropdown;\n\n var noOfYear = yearDropdownItemNumber || (scrollableYearDropdown ? 10 : 5);\n\n _this.state = {\n yearsList: generateYears(_this.props.year, noOfYear, _this.props.minDate, _this.props.maxDate)\n };\n return _this;\n }\n\n YearDropdownOptions.prototype.render = function render() {\n var dropdownClass = (0, _classnames3.default)({\n \"react-datepicker__year-dropdown\": true,\n \"react-datepicker__year-dropdown--scrollable\": this.props.scrollableYearDropdown\n });\n\n return _react2.default.createElement(\"div\", { className: dropdownClass }, this.renderOptions());\n };\n\n return YearDropdownOptions;\n}(_react2.default.Component);\n\nYearDropdownOptions.propTypes = {\n minDate: _propTypes2.default.object,\n maxDate: _propTypes2.default.object,\n onCancel: _propTypes2.default.func.isRequired,\n onChange: _propTypes2.default.func.isRequired,\n scrollableYearDropdown: _propTypes2.default.bool,\n year: _propTypes2.default.number.isRequired,\n yearDropdownItemNumber: _propTypes2.default.number\n};\n\nvar dayOfWeekCodes = {\n 1: \"mon\",\n 2: \"tue\",\n 3: \"wed\",\n 4: \"thu\",\n 5: \"fri\",\n 6: \"sat\",\n 7: \"sun\"\n};\n\n// These functions are not exported so\n// that we avoid magic strings like 'days'\nfunction set$1(date, unit, to) {\n return date.set(unit, to);\n}\n\nfunction add(date, amount, unit) {\n return date.add(amount, unit);\n}\n\nfunction subtract(date, amount, unit) {\n return date.subtract(amount, unit);\n}\n\nfunction get$1(date, unit) {\n return date.get(unit);\n}\n\nfunction getStartOf(date, unit) {\n return date.startOf(unit);\n}\n\n// ** Date Constructors **\n\nfunction newDate(point) {\n return (0, _moment2.default)(point);\n}\n\nfunction newDateWithOffset(utcOffset) {\n return (0, _moment2.default)().utc().utcOffset(utcOffset);\n}\n\nfunction now(maybeFixedUtcOffset) {\n if (maybeFixedUtcOffset == null) {\n return newDate();\n }\n return newDateWithOffset(maybeFixedUtcOffset);\n}\n\nfunction cloneDate(date) {\n return date.clone();\n}\n\nfunction parseDate(value, _ref) {\n var dateFormat = _ref.dateFormat,\n locale = _ref.locale;\n\n var m = (0, _moment2.default)(value, dateFormat, locale || _moment2.default.locale(), true);\n return m.isValid() ? m : null;\n}\n\n// ** Date \"Reflection\" **\n\nfunction isMoment(date) {\n return _moment2.default.isMoment(date);\n}\n\nfunction isDate(date) {\n return _moment2.default.isDate(date);\n}\n\n// ** Date Formatting **\n\nfunction formatDate(date, format) {\n return date.format(format);\n}\n\nfunction safeDateFormat(date, _ref2) {\n var dateFormat = _ref2.dateFormat,\n locale = _ref2.locale;\n\n return date && date.clone().locale(locale || _moment2.default.locale()).format(Array.isArray(dateFormat) ? dateFormat[0] : dateFormat) || \"\";\n}\n\n// ** Date Setters **\n\nfunction setTime(date, _ref3) {\n var hour = _ref3.hour,\n minute = _ref3.minute,\n second = _ref3.second;\n\n date.set({ hour: hour, minute: minute, second: second });\n return date;\n}\n\nfunction setMonth(date, month) {\n return set$1(date, \"month\", month);\n}\n\nfunction setYear(date, year) {\n return set$1(date, \"year\", year);\n}\n\n// ** Date Getters **\n\nfunction getSecond(date) {\n return get$1(date, \"second\");\n}\n\nfunction getMinute(date) {\n return get$1(date, \"minute\");\n}\n\nfunction getHour(date) {\n return get$1(date, \"hour\");\n}\n\n// Returns day of week\nfunction getDay(date) {\n return get$1(date, \"day\");\n}\n\nfunction getWeek(date) {\n return get$1(date, \"week\");\n}\n\nfunction getMonth(date) {\n return get$1(date, \"month\");\n}\n\nfunction getYear(date) {\n return get$1(date, \"year\");\n}\n\n// Returns day of month\nfunction getDate(date) {\n return get$1(date, \"date\");\n}\n\nfunction getDayOfWeekCode(day) {\n return dayOfWeekCodes[day.isoWeekday()];\n}\n\n// *** Start of ***\n\nfunction getStartOfDay(date) {\n return getStartOf(date, \"day\");\n}\n\nfunction getStartOfWeek(date) {\n return getStartOf(date, \"week\");\n}\nfunction getStartOfMonth(date) {\n return getStartOf(date, \"month\");\n}\n\nfunction getStartOfDate(date) {\n return getStartOf(date, \"date\");\n}\n\n// *** End of ***\n\n\n// ** Date Math **\n\n// *** Addition ***\n\nfunction addMinutes(date, amount) {\n return add(date, amount, \"minutes\");\n}\n\nfunction addHours(date, amount) {\n return add(date, amount, \"hours\");\n}\n\nfunction addDays(date, amount) {\n return add(date, amount, \"days\");\n}\n\nfunction addWeeks(date, amount) {\n return add(date, amount, \"weeks\");\n}\n\nfunction addMonths(date, amount) {\n return add(date, amount, \"months\");\n}\n\nfunction addYears(date, amount) {\n return add(date, amount, \"years\");\n}\n\n// *** Subtraction ***\nfunction subtractDays(date, amount) {\n return subtract(date, amount, \"days\");\n}\n\nfunction subtractWeeks(date, amount) {\n return subtract(date, amount, \"weeks\");\n}\n\nfunction subtractMonths(date, amount) {\n return subtract(date, amount, \"months\");\n}\n\nfunction subtractYears(date, amount) {\n return subtract(date, amount, \"years\");\n}\n\n// ** Date Comparison **\n\nfunction isBefore(date1, date2) {\n return date1.isBefore(date2);\n}\n\nfunction isAfter(date1, date2) {\n return date1.isAfter(date2);\n}\n\nfunction equals(date1, date2) {\n return date1.isSame(date2);\n}\n\nfunction isSameYear(date1, date2) {\n if (date1 && date2) {\n return date1.isSame(date2, \"year\");\n } else {\n return !date1 && !date2;\n }\n}\n\nfunction isSameMonth(date1, date2) {\n if (date1 && date2) {\n return date1.isSame(date2, \"month\");\n } else {\n return !date1 && !date2;\n }\n}\n\nfunction isSameDay(moment1, moment2) {\n if (moment1 && moment2) {\n return moment1.isSame(moment2, \"day\");\n } else {\n return !moment1 && !moment2;\n }\n}\n\nfunction isDayInRange(day, startDate, endDate) {\n var before = startDate.clone().startOf(\"day\").subtract(1, \"seconds\");\n var after = endDate.clone().startOf(\"day\").add(1, \"seconds\");\n return day.clone().startOf(\"day\").isBetween(before, after);\n}\n\n// *** Diffing ***\n\n\n// ** Date Localization **\n\nfunction localizeDate(date, locale) {\n return date.clone().locale(locale || _moment2.default.locale());\n}\n\nfunction getLocaleData(date) {\n return date.localeData();\n}\n\nfunction getLocaleDataForLocale(locale) {\n return _moment2.default.localeData(locale);\n}\n\nfunction getFormattedWeekdayInLocale(locale, date, formatFunc) {\n return formatFunc(locale.weekdays(date));\n}\n\nfunction getWeekdayMinInLocale(locale, date) {\n return locale.weekdaysMin(date);\n}\n\nfunction getWeekdayShortInLocale(locale, date) {\n return locale.weekdaysShort(date);\n}\n\n// TODO what is this format exactly?\nfunction getMonthInLocale(locale, date, format) {\n return locale.months(date, format);\n}\n\nfunction getMonthShortInLocale(locale, date) {\n return locale.monthsShort(date);\n}\n\n// ** Utils for some components **\n\nfunction isDayDisabled(day) {\n var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n minDate = _ref4.minDate,\n maxDate = _ref4.maxDate,\n excludeDates = _ref4.excludeDates,\n includeDates = _ref4.includeDates,\n filterDate = _ref4.filterDate;\n\n return minDate && day.isBefore(minDate, \"day\") || maxDate && day.isAfter(maxDate, \"day\") || excludeDates && excludeDates.some(function (excludeDate) {\n return isSameDay(day, excludeDate);\n }) || includeDates && !includeDates.some(function (includeDate) {\n return isSameDay(day, includeDate);\n }) || filterDate && !filterDate(day.clone()) || false;\n}\n\nfunction isTimeDisabled(time, disabledTimes) {\n var l = disabledTimes.length;\n for (var i = 0; i < l; i++) {\n if (disabledTimes[i].get(\"hours\") === time.get(\"hours\") && disabledTimes[i].get(\"minutes\") === time.get(\"minutes\")) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction isTimeInDisabledRange(time, _ref5) {\n var minTime = _ref5.minTime,\n maxTime = _ref5.maxTime;\n\n if (!minTime || !maxTime) {\n throw new Error(\"Both minTime and maxTime props required\");\n }\n\n var base = (0, _moment2.default)().hours(0).minutes(0).seconds(0);\n var baseTime = base.clone().hours(time.get(\"hours\")).minutes(time.get(\"minutes\"));\n var min = base.clone().hours(minTime.get(\"hours\")).minutes(minTime.get(\"minutes\"));\n var max = base.clone().hours(maxTime.get(\"hours\")).minutes(maxTime.get(\"minutes\"));\n\n return !(baseTime.isSameOrAfter(min) && baseTime.isSameOrBefore(max));\n}\n\nfunction allDaysDisabledBefore(day, unit) {\n var _ref6 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n minDate = _ref6.minDate,\n includeDates = _ref6.includeDates;\n\n var dateBefore = day.clone().subtract(1, unit);\n return minDate && dateBefore.isBefore(minDate, unit) || includeDates && includeDates.every(function (includeDate) {\n return dateBefore.isBefore(includeDate, unit);\n }) || false;\n}\n\nfunction allDaysDisabledAfter(day, unit) {\n var _ref7 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n maxDate = _ref7.maxDate,\n includeDates = _ref7.includeDates;\n\n var dateAfter = day.clone().add(1, unit);\n return maxDate && dateAfter.isAfter(maxDate, unit) || includeDates && includeDates.every(function (includeDate) {\n return dateAfter.isAfter(includeDate, unit);\n }) || false;\n}\n\nfunction getEffectiveMinDate(_ref8) {\n var minDate = _ref8.minDate,\n includeDates = _ref8.includeDates;\n\n if (includeDates && minDate) {\n return _moment2.default.min(includeDates.filter(function (includeDate) {\n return minDate.isSameOrBefore(includeDate, \"day\");\n }));\n } else if (includeDates) {\n return _moment2.default.min(includeDates);\n } else {\n return minDate;\n }\n}\n\nfunction getEffectiveMaxDate(_ref9) {\n var maxDate = _ref9.maxDate,\n includeDates = _ref9.includeDates;\n\n if (includeDates && maxDate) {\n return _moment2.default.max(includeDates.filter(function (includeDate) {\n return maxDate.isSameOrAfter(includeDate, \"day\");\n }));\n } else if (includeDates) {\n return _moment2.default.max(includeDates);\n } else {\n return maxDate;\n }\n}\n\nfunction getHightLightDaysMap() {\n var highlightDates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var defaultClassName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"react-datepicker__day--highlighted\";\n\n var dateClasses = new Map();\n for (var i = 0, len = highlightDates.length; i < len; i++) {\n var obj = highlightDates[i];\n if (isMoment(obj)) {\n var key = obj.format(\"MM.DD.YYYY\");\n var classNamesArr = dateClasses.get(key) || [];\n if (!classNamesArr.includes(defaultClassName)) {\n classNamesArr.push(defaultClassName);\n dateClasses.set(key, classNamesArr);\n }\n } else if ((typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj)) === \"object\") {\n var keys = Object.keys(obj);\n var className = keys[0];\n var arrOfMoments = obj[keys[0]];\n if (typeof className === \"string\" && arrOfMoments.constructor === Array) {\n for (var k = 0, _len = arrOfMoments.length; k < _len; k++) {\n var _key = arrOfMoments[k].format(\"MM.DD.YYYY\");\n var _classNamesArr = dateClasses.get(_key) || [];\n if (!_classNamesArr.includes(className)) {\n _classNamesArr.push(className);\n dateClasses.set(_key, _classNamesArr);\n }\n }\n }\n }\n }\n\n return dateClasses;\n}\n\nfunction timesToInjectAfter(startOfDay, currentTime, currentMultiplier, intervals, injectedTimes) {\n var l = injectedTimes.length;\n var times = [];\n for (var i = 0; i < l; i++) {\n var injectedTime = addMinutes(addHours(cloneDate(startOfDay), getHour(injectedTimes[i])), getMinute(injectedTimes[i]));\n var nextTime = addMinutes(cloneDate(startOfDay), (currentMultiplier + 1) * intervals);\n\n if (injectedTime.isBetween(currentTime, nextTime)) {\n times.push(injectedTimes[i]);\n }\n }\n\n return times;\n}\n\nvar WrappedYearDropdownOptions = (0, _reactOnclickoutside2.default)(YearDropdownOptions);\n\nvar YearDropdown = function (_React$Component) {\n inherits(YearDropdown, _React$Component);\n\n function YearDropdown() {\n var _temp, _this, _ret;\n\n classCallCheck(this, YearDropdown);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n dropdownVisible: false\n }, _this.renderSelectOptions = function () {\n var minYear = _this.props.minDate ? getYear(_this.props.minDate) : 1900;\n var maxYear = _this.props.maxDate ? getYear(_this.props.maxDate) : 2100;\n\n var options = [];\n for (var i = minYear; i <= maxYear; i++) {\n options.push(_react2.default.createElement(\"option\", { key: i, value: i }, i));\n }\n return options;\n }, _this.onSelectChange = function (e) {\n _this.onChange(e.target.value);\n }, _this.renderSelectMode = function () {\n return _react2.default.createElement(\"select\", {\n value: _this.props.year,\n className: \"react-datepicker__year-select\",\n onChange: _this.onSelectChange\n }, _this.renderSelectOptions());\n }, _this.renderReadView = function (visible) {\n return _react2.default.createElement(\"div\", {\n key: \"read\",\n style: { visibility: visible ? \"visible\" : \"hidden\" },\n className: \"react-datepicker__year-read-view\",\n onClick: function onClick(event) {\n return _this.toggleDropdown(event);\n }\n }, _react2.default.createElement(\"span\", { className: \"react-datepicker__year-read-view--down-arrow\" }), _react2.default.createElement(\"span\", { className: \"react-datepicker__year-read-view--selected-year\" }, _this.props.year));\n }, _this.renderDropdown = function () {\n return _react2.default.createElement(WrappedYearDropdownOptions, {\n key: \"dropdown\",\n ref: \"options\",\n year: _this.props.year,\n onChange: _this.onChange,\n onCancel: _this.toggleDropdown,\n minDate: _this.props.minDate,\n maxDate: _this.props.maxDate,\n scrollableYearDropdown: _this.props.scrollableYearDropdown,\n yearDropdownItemNumber: _this.props.yearDropdownItemNumber\n });\n }, _this.renderScrollMode = function () {\n var dropdownVisible = _this.state.dropdownVisible;\n\n var result = [_this.renderReadView(!dropdownVisible)];\n if (dropdownVisible) {\n result.unshift(_this.renderDropdown());\n }\n return result;\n }, _this.onChange = function (year) {\n _this.toggleDropdown();\n if (year === _this.props.year) return;\n _this.props.onChange(year);\n }, _this.toggleDropdown = function (event) {\n _this.setState({\n dropdownVisible: !_this.state.dropdownVisible\n }, function () {\n if (_this.props.adjustDateOnChange) {\n _this.handleYearChange(_this.props.date, event);\n }\n });\n }, _this.handleYearChange = function (date, event) {\n _this.onSelect(date, event);\n _this.setOpen();\n }, _this.onSelect = function (date, event) {\n if (_this.props.onSelect) {\n _this.props.onSelect(date, event);\n }\n }, _this.setOpen = function () {\n if (_this.props.setOpen) {\n _this.props.setOpen(true);\n }\n }, _temp), possibleConstructorReturn(_this, _ret);\n }\n\n YearDropdown.prototype.render = function render() {\n var renderedDropdown = void 0;\n switch (this.props.dropdownMode) {\n case \"scroll\":\n renderedDropdown = this.renderScrollMode();\n break;\n case \"select\":\n renderedDropdown = this.renderSelectMode();\n break;\n }\n\n return _react2.default.createElement(\"div\", {\n className: \"react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--\" + this.props.dropdownMode\n }, renderedDropdown);\n };\n\n return YearDropdown;\n}(_react2.default.Component);\n\nYearDropdown.propTypes = {\n adjustDateOnChange: _propTypes2.default.bool,\n dropdownMode: _propTypes2.default.oneOf([\"scroll\", \"select\"]).isRequired,\n maxDate: _propTypes2.default.object,\n minDate: _propTypes2.default.object,\n onChange: _propTypes2.default.func.isRequired,\n scrollableYearDropdown: _propTypes2.default.bool,\n year: _propTypes2.default.number.isRequired,\n yearDropdownItemNumber: _propTypes2.default.number,\n date: _propTypes2.default.object,\n onSelect: _propTypes2.default.func,\n setOpen: _propTypes2.default.func\n};\n\nvar MonthDropdownOptions = function (_React$Component) {\n inherits(MonthDropdownOptions, _React$Component);\n\n function MonthDropdownOptions() {\n var _temp, _this, _ret;\n\n classCallCheck(this, MonthDropdownOptions);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.renderOptions = function () {\n return _this.props.monthNames.map(function (month, i) {\n return _react2.default.createElement(\"div\", {\n className: _this.props.month === i ? \"react-datepicker__month-option --selected_month\" : \"react-datepicker__month-option\",\n key: month,\n ref: month,\n onClick: _this.onChange.bind(_this, i)\n }, _this.props.month === i ? _react2.default.createElement(\"span\", { className: \"react-datepicker__month-option--selected\" }, \"\\u2713\") : \"\", month);\n });\n }, _this.onChange = function (month) {\n return _this.props.onChange(month);\n }, _this.handleClickOutside = function () {\n return _this.props.onCancel();\n }, _temp), possibleConstructorReturn(_this, _ret);\n }\n\n MonthDropdownOptions.prototype.render = function render() {\n return _react2.default.createElement(\"div\", { className: \"react-datepicker__month-dropdown\" }, this.renderOptions());\n };\n\n return MonthDropdownOptions;\n}(_react2.default.Component);\n\nMonthDropdownOptions.propTypes = {\n onCancel: _propTypes2.default.func.isRequired,\n onChange: _propTypes2.default.func.isRequired,\n month: _propTypes2.default.number.isRequired,\n monthNames: _propTypes2.default.arrayOf(_propTypes2.default.string.isRequired).isRequired\n};\n\nvar WrappedMonthDropdownOptions = (0, _reactOnclickoutside2.default)(MonthDropdownOptions);\n\nvar MonthDropdown = function (_React$Component) {\n inherits(MonthDropdown, _React$Component);\n\n function MonthDropdown() {\n var _temp, _this, _ret;\n\n classCallCheck(this, MonthDropdown);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n dropdownVisible: false\n }, _this.renderSelectOptions = function (monthNames) {\n return monthNames.map(function (M, i) {\n return _react2.default.createElement(\"option\", { key: i, value: i }, M);\n });\n }, _this.renderSelectMode = function (monthNames) {\n return _react2.default.createElement(\"select\", {\n value: _this.props.month,\n className: \"react-datepicker__month-select\",\n onChange: function onChange(e) {\n return _this.onChange(e.target.value);\n }\n }, _this.renderSelectOptions(monthNames));\n }, _this.renderReadView = function (visible, monthNames) {\n return _react2.default.createElement(\"div\", {\n key: \"read\",\n style: { visibility: visible ? \"visible\" : \"hidden\" },\n className: \"react-datepicker__month-read-view\",\n onClick: _this.toggleDropdown\n }, _react2.default.createElement(\"span\", { className: \"react-datepicker__month-read-view--down-arrow\" }), _react2.default.createElement(\"span\", { className: \"react-datepicker__month-read-view--selected-month\" }, monthNames[_this.props.month]));\n }, _this.renderDropdown = function (monthNames) {\n return _react2.default.createElement(WrappedMonthDropdownOptions, {\n key: \"dropdown\",\n ref: \"options\",\n month: _this.props.month,\n monthNames: monthNames,\n onChange: _this.onChange,\n onCancel: _this.toggleDropdown\n });\n }, _this.renderScrollMode = function (monthNames) {\n var dropdownVisible = _this.state.dropdownVisible;\n\n var result = [_this.renderReadView(!dropdownVisible, monthNames)];\n if (dropdownVisible) {\n result.unshift(_this.renderDropdown(monthNames));\n }\n return result;\n }, _this.onChange = function (month) {\n _this.toggleDropdown();\n if (month !== _this.props.month) {\n _this.props.onChange(month);\n }\n }, _this.toggleDropdown = function () {\n return _this.setState({\n dropdownVisible: !_this.state.dropdownVisible\n });\n }, _temp), possibleConstructorReturn(_this, _ret);\n }\n\n MonthDropdown.prototype.render = function render() {\n var _this2 = this;\n\n var localeData = getLocaleDataForLocale(this.props.locale);\n var monthNames = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map(this.props.useShortMonthInDropdown ? function (M) {\n return getMonthShortInLocale(localeData, newDate({ M: M }));\n } : function (M) {\n return getMonthInLocale(localeData, newDate({ M: M }), _this2.props.dateFormat);\n });\n\n var renderedDropdown = void 0;\n switch (this.props.dropdownMode) {\n case \"scroll\":\n renderedDropdown = this.renderScrollMode(monthNames);\n break;\n case \"select\":\n renderedDropdown = this.renderSelectMode(monthNames);\n break;\n }\n\n return _react2.default.createElement(\"div\", {\n className: \"react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--\" + this.props.dropdownMode\n }, renderedDropdown);\n };\n\n return MonthDropdown;\n}(_react2.default.Component);\n\nMonthDropdown.propTypes = {\n dropdownMode: _propTypes2.default.oneOf([\"scroll\", \"select\"]).isRequired,\n locale: _propTypes2.default.string,\n dateFormat: _propTypes2.default.string.isRequired,\n month: _propTypes2.default.number.isRequired,\n onChange: _propTypes2.default.func.isRequired,\n useShortMonthInDropdown: _propTypes2.default.bool\n};\n\nfunction generateMonthYears(minDate, maxDate) {\n var list = [];\n\n var currDate = getStartOfMonth(cloneDate(minDate));\n var lastDate = getStartOfMonth(cloneDate(maxDate));\n\n while (!isAfter(currDate, lastDate)) {\n list.push(cloneDate(currDate));\n\n addMonths(currDate, 1);\n }\n\n return list;\n}\n\nvar MonthYearDropdownOptions = function (_React$Component) {\n inherits(MonthYearDropdownOptions, _React$Component);\n\n function MonthYearDropdownOptions(props) {\n classCallCheck(this, MonthYearDropdownOptions);\n\n var _this = possibleConstructorReturn(this, _React$Component.call(this, props));\n\n _this.renderOptions = function () {\n return _this.state.monthYearsList.map(function (monthYear) {\n var monthYearPoint = monthYear.valueOf();\n\n var isSameMonthYear = isSameYear(_this.props.date, monthYear) && isSameMonth(_this.props.date, monthYear);\n\n return _react2.default.createElement(\"div\", {\n className: isSameMonthYear ? \"react-datepicker__month-year-option --selected_month-year\" : \"react-datepicker__month-year-option\",\n key: monthYearPoint,\n ref: monthYearPoint,\n onClick: _this.onChange.bind(_this, monthYearPoint)\n }, isSameMonthYear ? _react2.default.createElement(\"span\", { className: \"react-datepicker__month-year-option--selected\" }, \"\\u2713\") : \"\", formatDate(monthYear, _this.props.dateFormat));\n });\n };\n\n _this.onChange = function (monthYear) {\n return _this.props.onChange(monthYear);\n };\n\n _this.handleClickOutside = function () {\n _this.props.onCancel();\n };\n\n _this.state = {\n monthYearsList: generateMonthYears(_this.props.minDate, _this.props.maxDate)\n };\n return _this;\n }\n\n MonthYearDropdownOptions.prototype.render = function render() {\n var dropdownClass = (0, _classnames3.default)({\n \"react-datepicker__month-year-dropdown\": true,\n \"react-datepicker__month-year-dropdown--scrollable\": this.props.scrollableMonthYearDropdown\n });\n\n return _react2.default.createElement(\"div\", { className: dropdownClass }, this.renderOptions());\n };\n\n return MonthYearDropdownOptions;\n}(_react2.default.Component);\n\nMonthYearDropdownOptions.propTypes = {\n minDate: _propTypes2.default.object.isRequired,\n maxDate: _propTypes2.default.object.isRequired,\n onCancel: _propTypes2.default.func.isRequired,\n onChange: _propTypes2.default.func.isRequired,\n scrollableMonthYearDropdown: _propTypes2.default.bool,\n date: _propTypes2.default.object.isRequired,\n dateFormat: _propTypes2.default.string.isRequired\n};\n\nvar WrappedMonthYearDropdownOptions = (0, _reactOnclickoutside2.default)(MonthYearDropdownOptions);\n\nvar MonthYearDropdown = function (_React$Component) {\n inherits(MonthYearDropdown, _React$Component);\n\n function MonthYearDropdown() {\n var _temp, _this, _ret;\n\n classCallCheck(this, MonthYearDropdown);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n dropdownVisible: false\n }, _this.renderSelectOptions = function () {\n var currDate = getStartOfMonth(localizeDate(_this.props.minDate, _this.props.locale));\n var lastDate = getStartOfMonth(localizeDate(_this.props.maxDate, _this.props.locale));\n\n var options = [];\n\n while (!isAfter(currDate, lastDate)) {\n var timepoint = currDate.valueOf();\n options.push(_react2.default.createElement(\"option\", { key: timepoint, value: timepoint }, formatDate(currDate, _this.props.dateFormat)));\n\n addMonths(currDate, 1);\n }\n\n return options;\n }, _this.onSelectChange = function (e) {\n _this.onChange(e.target.value);\n }, _this.renderSelectMode = function () {\n return _react2.default.createElement(\"select\", {\n value: getStartOfMonth(_this.props.date).valueOf(),\n className: \"react-datepicker__month-year-select\",\n onChange: _this.onSelectChange\n }, _this.renderSelectOptions());\n }, _this.renderReadView = function (visible) {\n var yearMonth = formatDate(localizeDate(newDate(_this.props.date), _this.props.locale), _this.props.dateFormat);\n\n return _react2.default.createElement(\"div\", {\n key: \"read\",\n style: { visibility: visible ? \"visible\" : \"hidden\" },\n className: \"react-datepicker__month-year-read-view\",\n onClick: function onClick(event) {\n return _this.toggleDropdown(event);\n }\n }, _react2.default.createElement(\"span\", { className: \"react-datepicker__month-year-read-view--down-arrow\" }), _react2.default.createElement(\"span\", { className: \"react-datepicker__month-year-read-view--selected-month-year\" }, yearMonth));\n }, _this.renderDropdown = function () {\n return _react2.default.createElement(WrappedMonthYearDropdownOptions, {\n key: \"dropdown\",\n ref: \"options\",\n date: _this.props.date,\n dateFormat: _this.props.dateFormat,\n onChange: _this.onChange,\n onCancel: _this.toggleDropdown,\n minDate: localizeDate(_this.props.minDate, _this.props.locale),\n maxDate: localizeDate(_this.props.maxDate, _this.props.locale),\n scrollableMonthYearDropdown: _this.props.scrollableMonthYearDropdown\n });\n }, _this.renderScrollMode = function () {\n var dropdownVisible = _this.state.dropdownVisible;\n\n var result = [_this.renderReadView(!dropdownVisible)];\n if (dropdownVisible) {\n result.unshift(_this.renderDropdown());\n }\n return result;\n }, _this.onChange = function (monthYearPoint) {\n _this.toggleDropdown();\n\n var changedDate = newDate(parseInt(monthYearPoint));\n\n if (isSameYear(_this.props.date, changedDate) && isSameMonth(_this.props.date, changedDate)) {\n return;\n }\n\n _this.props.onChange(changedDate);\n }, _this.toggleDropdown = function () {\n return _this.setState({\n dropdownVisible: !_this.state.dropdownVisible\n });\n }, _temp), possibleConstructorReturn(_this, _ret);\n }\n\n MonthYearDropdown.prototype.render = function render() {\n var renderedDropdown = void 0;\n switch (this.props.dropdownMode) {\n case \"scroll\":\n renderedDropdown = this.renderScrollMode();\n break;\n case \"select\":\n renderedDropdown = this.renderSelectMode();\n break;\n }\n\n return _react2.default.createElement(\"div\", {\n className: \"react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--\" + this.props.dropdownMode\n }, renderedDropdown);\n };\n\n return MonthYearDropdown;\n}(_react2.default.Component);\n\nMonthYearDropdown.propTypes = {\n dropdownMode: _propTypes2.default.oneOf([\"scroll\", \"select\"]).isRequired,\n dateFormat: _propTypes2.default.string.isRequired,\n locale: _propTypes2.default.string,\n maxDate: _propTypes2.default.object.isRequired,\n minDate: _propTypes2.default.object.isRequired,\n date: _propTypes2.default.object.isRequired,\n onChange: _propTypes2.default.func.isRequired,\n scrollableMonthYearDropdown: _propTypes2.default.bool\n};\n\nvar Day = function (_React$Component) {\n inherits(Day, _React$Component);\n\n function Day() {\n var _temp, _this, _ret;\n\n classCallCheck(this, Day);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) {\n if (!_this.isDisabled() && _this.props.onClick) {\n _this.props.onClick(event);\n }\n }, _this.handleMouseEnter = function (event) {\n if (!_this.isDisabled() && _this.props.onMouseEnter) {\n _this.props.onMouseEnter(event);\n }\n }, _this.isSameDay = function (other) {\n return isSameDay(_this.props.day, other);\n }, _this.isKeyboardSelected = function () {\n return !_this.props.inline && !_this.isSameDay(_this.props.selected) && _this.isSameDay(_this.props.preSelection);\n }, _this.isDisabled = function () {\n return isDayDisabled(_this.props.day, _this.props);\n }, _this.getHighLightedClass = function (defaultClassName) {\n var _this$props = _this.props,\n day = _this$props.day,\n highlightDates = _this$props.highlightDates;\n\n if (!highlightDates) {\n return false;\n }\n\n // Looking for className in the Map of {'day string, 'className'}\n var dayStr = day.format(\"MM.DD.YYYY\");\n return highlightDates.get(dayStr);\n }, _this.isInRange = function () {\n var _this$props2 = _this.props,\n day = _this$props2.day,\n startDate = _this$props2.startDate,\n endDate = _this$props2.endDate;\n\n if (!startDate || !endDate) {\n return false;\n }\n return isDayInRange(day, startDate, endDate);\n }, _this.isInSelectingRange = function () {\n var _this$props3 = _this.props,\n day = _this$props3.day,\n selectsStart = _this$props3.selectsStart,\n selectsEnd = _this$props3.selectsEnd,\n selectingDate = _this$props3.selectingDate,\n startDate = _this$props3.startDate,\n endDate = _this$props3.endDate;\n\n if (!(selectsStart || selectsEnd) || !selectingDate || _this.isDisabled()) {\n return false;\n }\n\n if (selectsStart && endDate && selectingDate.isSameOrBefore(endDate)) {\n return isDayInRange(day, selectingDate, endDate);\n }\n\n if (selectsEnd && startDate && selectingDate.isSameOrAfter(startDate)) {\n return isDayInRange(day, startDate, selectingDate);\n }\n\n return false;\n }, _this.isSelectingRangeStart = function () {\n if (!_this.isInSelectingRange()) {\n return false;\n }\n\n var _this$props4 = _this.props,\n day = _this$props4.day,\n selectingDate = _this$props4.selectingDate,\n startDate = _this$props4.startDate,\n selectsStart = _this$props4.selectsStart;\n\n if (selectsStart) {\n return isSameDay(day, selectingDate);\n } else {\n return isSameDay(day, startDate);\n }\n }, _this.isSelectingRangeEnd = function () {\n if (!_this.isInSelectingRange()) {\n return false;\n }\n\n var _this$props5 = _this.props,\n day = _this$props5.day,\n selectingDate = _this$props5.selectingDate,\n endDate = _this$props5.endDate,\n selectsEnd = _this$props5.selectsEnd;\n\n if (selectsEnd) {\n return isSameDay(day, selectingDate);\n } else {\n return isSameDay(day, endDate);\n }\n }, _this.isRangeStart = function () {\n var _this$props6 = _this.props,\n day = _this$props6.day,\n startDate = _this$props6.startDate,\n endDate = _this$props6.endDate;\n\n if (!startDate || !endDate) {\n return false;\n }\n return isSameDay(startDate, day);\n }, _this.isRangeEnd = function () {\n var _this$props7 = _this.props,\n day = _this$props7.day,\n startDate = _this$props7.startDate,\n endDate = _this$props7.endDate;\n\n if (!startDate || !endDate) {\n return false;\n }\n return isSameDay(endDate, day);\n }, _this.isWeekend = function () {\n var weekday = getDay(_this.props.day);\n return weekday === 0 || weekday === 6;\n }, _this.isOutsideMonth = function () {\n return _this.props.month !== undefined && _this.props.month !== getMonth(_this.props.day);\n }, _this.getClassNames = function (date) {\n var dayClassName = _this.props.dayClassName ? _this.props.dayClassName(date) : undefined;\n return (0, _classnames3.default)(\"react-datepicker__day\", dayClassName, \"react-datepicker__day--\" + getDayOfWeekCode(_this.props.day), {\n \"react-datepicker__day--disabled\": _this.isDisabled(),\n \"react-datepicker__day--selected\": _this.isSameDay(_this.props.selected),\n \"react-datepicker__day--keyboard-selected\": _this.isKeyboardSelected(),\n \"react-datepicker__day--range-start\": _this.isRangeStart(),\n \"react-datepicker__day--range-end\": _this.isRangeEnd(),\n \"react-datepicker__day--in-range\": _this.isInRange(),\n \"react-datepicker__day--in-selecting-range\": _this.isInSelectingRange(),\n \"react-datepicker__day--selecting-range-start\": _this.isSelectingRangeStart(),\n \"react-datepicker__day--selecting-range-end\": _this.isSelectingRangeEnd(),\n \"react-datepicker__day--today\": _this.isSameDay(now(_this.props.utcOffset)),\n \"react-datepicker__day--weekend\": _this.isWeekend(),\n \"react-datepicker__day--outside-month\": _this.isOutsideMonth()\n }, _this.getHighLightedClass(\"react-datepicker__day--highlighted\"));\n }, _temp), possibleConstructorReturn(_this, _ret);\n }\n\n Day.prototype.render = function render() {\n return _react2.default.createElement(\"div\", {\n className: this.getClassNames(this.props.day),\n onClick: this.handleClick,\n onMouseEnter: this.handleMouseEnter,\n \"aria-label\": \"day-\" + getDate(this.props.day),\n role: \"option\"\n }, getDate(this.props.day));\n };\n\n return Day;\n}(_react2.default.Component);\n\nDay.propTypes = {\n day: _propTypes2.default.object.isRequired,\n dayClassName: _propTypes2.default.func,\n endDate: _propTypes2.default.object,\n highlightDates: _propTypes2.default.instanceOf(Map),\n inline: _propTypes2.default.bool,\n month: _propTypes2.default.number,\n onClick: _propTypes2.default.func,\n onMouseEnter: _propTypes2.default.func,\n preSelection: _propTypes2.default.object,\n selected: _propTypes2.default.object,\n selectingDate: _propTypes2.default.object,\n selectsEnd: _propTypes2.default.bool,\n selectsStart: _propTypes2.default.bool,\n startDate: _propTypes2.default.object,\n utcOffset: _propTypes2.default.number\n};\n\nvar WeekNumber = function (_React$Component) {\n inherits(WeekNumber, _React$Component);\n\n function WeekNumber() {\n var _temp, _this, _ret;\n\n classCallCheck(this, WeekNumber);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) {\n if (_this.props.onClick) {\n _this.props.onClick(event);\n }\n }, _temp), possibleConstructorReturn(_this, _ret);\n }\n\n WeekNumber.prototype.render = function render() {\n var weekNumberClasses = {\n \"react-datepicker__week-number\": true,\n \"react-datepicker__week-number--clickable\": !!this.props.onClick\n };\n return _react2.default.createElement(\"div\", {\n className: (0, _classnames3.default)(weekNumberClasses),\n \"aria-label\": \"week-\" + this.props.weekNumber,\n onClick: this.handleClick\n }, this.props.weekNumber);\n };\n\n return WeekNumber;\n}(_react2.default.Component);\n\nWeekNumber.propTypes = {\n weekNumber: _propTypes2.default.number.isRequired,\n onClick: _propTypes2.default.func\n};\n\nvar Week = function (_React$Component) {\n inherits(Week, _React$Component);\n\n function Week() {\n var _temp, _this, _ret;\n\n classCallCheck(this, Week);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleDayClick = function (day, event) {\n if (_this.props.onDayClick) {\n _this.props.onDayClick(day, event);\n }\n }, _this.handleDayMouseEnter = function (day) {\n if (_this.props.onDayMouseEnter) {\n _this.props.onDayMouseEnter(day);\n }\n }, _this.handleWeekClick = function (day, weekNumber, event) {\n if (typeof _this.props.onWeekSelect === \"function\") {\n _this.props.onWeekSelect(day, weekNumber, event);\n }\n }, _this.formatWeekNumber = function (startOfWeek) {\n if (_this.props.formatWeekNumber) {\n return _this.props.formatWeekNumber(startOfWeek);\n }\n return getWeek(startOfWeek);\n }, _this.renderDays = function () {\n var startOfWeek = getStartOfWeek(cloneDate(_this.props.day));\n var days = [];\n var weekNumber = _this.formatWeekNumber(startOfWeek);\n if (_this.props.showWeekNumber) {\n var onClickAction = _this.props.onWeekSelect ? _this.handleWeekClick.bind(_this, startOfWeek, weekNumber) : undefined;\n days.push(_react2.default.createElement(WeekNumber, { key: \"W\", weekNumber: weekNumber, onClick: onClickAction }));\n }\n return days.concat([0, 1, 2, 3, 4, 5, 6].map(function (offset) {\n var day = addDays(cloneDate(startOfWeek), offset);\n return _react2.default.createElement(Day, {\n key: offset,\n day: day,\n month: _this.props.month,\n onClick: _this.handleDayClick.bind(_this, day),\n onMouseEnter: _this.handleDayMouseEnter.bind(_this, day),\n minDate: _this.props.minDate,\n maxDate: _this.props.maxDate,\n excludeDates: _this.props.excludeDates,\n includeDates: _this.props.includeDates,\n inline: _this.props.inline,\n highlightDates: _this.props.highlightDates,\n selectingDate: _this.props.selectingDate,\n filterDate: _this.props.filterDate,\n preSelection: _this.props.preSelection,\n selected: _this.props.selected,\n selectsStart: _this.props.selectsStart,\n selectsEnd: _this.props.selectsEnd,\n startDate: _this.props.startDate,\n endDate: _this.props.endDate,\n dayClassName: _this.props.dayClassName,\n utcOffset: _this.props.utcOffset\n });\n }));\n }, _temp), possibleConstructorReturn(_this, _ret);\n }\n\n Week.prototype.render = function render() {\n return _react2.default.createElement(\"div\", { className: \"react-datepicker__week\" }, this.renderDays());\n };\n\n return Week;\n}(_react2.default.Component);\n\nWeek.propTypes = {\n day: _propTypes2.default.object.isRequired,\n dayClassName: _propTypes2.default.func,\n endDate: _propTypes2.default.object,\n excludeDates: _propTypes2.default.array,\n filterDate: _propTypes2.default.func,\n formatWeekNumber: _propTypes2.default.func,\n highlightDates: _propTypes2.default.instanceOf(Map),\n includeDates: _propTypes2.default.array,\n inline: _propTypes2.default.bool,\n maxDate: _propTypes2.default.object,\n minDate: _propTypes2.default.object,\n month: _propTypes2.default.number,\n onDayClick: _propTypes2.default.func,\n onDayMouseEnter: _propTypes2.default.func,\n onWeekSelect: _propTypes2.default.func,\n preSelection: _propTypes2.default.object,\n selected: _propTypes2.default.object,\n selectingDate: _propTypes2.default.object,\n selectsEnd: _propTypes2.default.bool,\n selectsStart: _propTypes2.default.bool,\n showWeekNumber: _propTypes2.default.bool,\n startDate: _propTypes2.default.object,\n utcOffset: _propTypes2.default.number\n};\n\nvar FIXED_HEIGHT_STANDARD_WEEK_COUNT = 6;\n\nvar Month = function (_React$Component) {\n inherits(Month, _React$Component);\n\n function Month() {\n var _temp, _this, _ret;\n\n classCallCheck(this, Month);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleDayClick = function (day, event) {\n if (_this.props.onDayClick) {\n _this.props.onDayClick(day, event);\n }\n }, _this.handleDayMouseEnter = function (day) {\n if (_this.props.onDayMouseEnter) {\n _this.props.onDayMouseEnter(day);\n }\n }, _this.handleMouseLeave = function () {\n if (_this.props.onMouseLeave) {\n _this.props.onMouseLeave();\n }\n }, _this.isWeekInMonth = function (startOfWeek) {\n var day = _this.props.day;\n var endOfWeek = addDays(cloneDate(startOfWeek), 6);\n return isSameMonth(startOfWeek, day) || isSameMonth(endOfWeek, day);\n }, _this.renderWeeks = function () {\n var weeks = [];\n var isFixedHeight = _this.props.fixedHeight;\n var currentWeekStart = getStartOfWeek(getStartOfMonth(cloneDate(_this.props.day)));\n var i = 0;\n var breakAfterNextPush = false;\n\n while (true) {\n weeks.push(_react2.default.createElement(Week, {\n key: i,\n day: currentWeekStart,\n month: getMonth(_this.props.day),\n onDayClick: _this.handleDayClick,\n onDayMouseEnter: _this.handleDayMouseEnter,\n onWeekSelect: _this.props.onWeekSelect,\n formatWeekNumber: _this.props.formatWeekNumber,\n minDate: _this.props.minDate,\n maxDate: _this.props.maxDate,\n excludeDates: _this.props.excludeDates,\n includeDates: _this.props.includeDates,\n inline: _this.props.inline,\n highlightDates: _this.props.highlightDates,\n selectingDate: _this.props.selectingDate,\n filterDate: _this.props.filterDate,\n preSelection: _this.props.preSelection,\n selected: _this.props.selected,\n selectsStart: _this.props.selectsStart,\n selectsEnd: _this.props.selectsEnd,\n showWeekNumber: _this.props.showWeekNumbers,\n startDate: _this.props.startDate,\n endDate: _this.props.endDate,\n dayClassName: _this.props.dayClassName,\n utcOffset: _this.props.utcOffset\n }));\n\n if (breakAfterNextPush) break;\n\n i++;\n currentWeekStart = addWeeks(cloneDate(currentWeekStart), 1);\n\n // If one of these conditions is true, we will either break on this week\n // or break on the next week\n var isFixedAndFinalWeek = isFixedHeight && i >= FIXED_HEIGHT_STANDARD_WEEK_COUNT;\n var isNonFixedAndOutOfMonth = !isFixedHeight && !_this.isWeekInMonth(currentWeekStart);\n\n if (isFixedAndFinalWeek || isNonFixedAndOutOfMonth) {\n if (_this.props.peekNextMonth) {\n breakAfterNextPush = true;\n } else {\n break;\n }\n }\n }\n\n return weeks;\n }, _this.getClassNames = function () {\n var _this$props = _this.props,\n selectingDate = _this$props.selectingDate,\n selectsStart = _this$props.selectsStart,\n selectsEnd = _this$props.selectsEnd;\n\n return (0, _classnames3.default)(\"react-datepicker__month\", {\n \"react-datepicker__month--selecting-range\": selectingDate && (selectsStart || selectsEnd)\n });\n }, _temp), possibleConstructorReturn(_this, _ret);\n }\n\n Month.prototype.render = function render() {\n return _react2.default.createElement(\"div\", {\n className: this.getClassNames(),\n onMouseLeave: this.handleMouseLeave,\n role: \"listbox\"\n }, this.renderWeeks());\n };\n\n return Month;\n}(_react2.default.Component);\n\nMonth.propTypes = {\n day: _propTypes2.default.object.isRequired,\n dayClassName: _propTypes2.default.func,\n endDate: _propTypes2.default.object,\n excludeDates: _propTypes2.default.array,\n filterDate: _propTypes2.default.func,\n fixedHeight: _propTypes2.default.bool,\n formatWeekNumber: _propTypes2.default.func,\n highlightDates: _propTypes2.default.instanceOf(Map),\n includeDates: _propTypes2.default.array,\n inline: _propTypes2.default.bool,\n maxDate: _propTypes2.default.object,\n minDate: _propTypes2.default.object,\n onDayClick: _propTypes2.default.func,\n onDayMouseEnter: _propTypes2.default.func,\n onMouseLeave: _propTypes2.default.func,\n onWeekSelect: _propTypes2.default.func,\n peekNextMonth: _propTypes2.default.bool,\n preSelection: _propTypes2.default.object,\n selected: _propTypes2.default.object,\n selectingDate: _propTypes2.default.object,\n selectsEnd: _propTypes2.default.bool,\n selectsStart: _propTypes2.default.bool,\n showWeekNumbers: _propTypes2.default.bool,\n startDate: _propTypes2.default.object,\n utcOffset: _propTypes2.default.number\n};\n\nvar Time = function (_React$Component) {\n inherits(Time, _React$Component);\n\n function Time() {\n var _temp, _this, _ret;\n\n classCallCheck(this, Time);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (time) {\n if ((_this.props.minTime || _this.props.maxTime) && isTimeInDisabledRange(time, _this.props) || _this.props.excludeTimes && isTimeDisabled(time, _this.props.excludeTimes) || _this.props.includeTimes && !isTimeDisabled(time, _this.props.includeTimes)) {\n return;\n }\n\n _this.props.onChange(time);\n }, _this.liClasses = function (time, currH, currM) {\n var classes = [\"react-datepicker__time-list-item\"];\n\n if (currH === getHour(time) && currM === getMinute(time)) {\n classes.push(\"react-datepicker__time-list-item--selected\");\n }\n if ((_this.props.minTime || _this.props.maxTime) && isTimeInDisabledRange(time, _this.props) || _this.props.excludeTimes && isTimeDisabled(time, _this.props.excludeTimes) || _this.props.includeTimes && !isTimeDisabled(time, _this.props.includeTimes)) {\n classes.push(\"react-datepicker__time-list-item--disabled\");\n }\n if (_this.props.injectTimes && (getHour(time) * 60 + getMinute(time)) % _this.props.intervals !== 0) {\n classes.push(\"react-datepicker__time-list-item--injected\");\n }\n\n return classes.join(\" \");\n }, _this.renderTimes = function () {\n var times = [];\n var format = _this.props.format ? _this.props.format : \"hh:mm A\";\n var intervals = _this.props.intervals;\n var activeTime = _this.props.selected ? _this.props.selected : newDate();\n var currH = getHour(activeTime);\n var currM = getMinute(activeTime);\n var base = getStartOfDay(newDate());\n var multiplier = 1440 / intervals;\n var sortedInjectTimes = _this.props.injectTimes && _this.props.injectTimes.sort(function (a, b) {\n return a - b;\n });\n for (var i = 0; i < multiplier; i++) {\n var currentTime = addMinutes(cloneDate(base), i * intervals);\n times.push(currentTime);\n\n if (sortedInjectTimes) {\n var timesToInject = timesToInjectAfter(base, currentTime, i, intervals, sortedInjectTimes);\n times = times.concat(timesToInject);\n }\n }\n\n return times.map(function (time, i) {\n return _react2.default.createElement(\"li\", {\n key: i,\n onClick: _this.handleClick.bind(_this, time),\n className: _this.liClasses(time, currH, currM)\n }, formatDate(time, format));\n });\n }, _temp), possibleConstructorReturn(_this, _ret);\n }\n\n Time.prototype.componentDidMount = function componentDidMount() {\n // code to ensure selected time will always be in focus within time window when it first appears\n var multiplier = 60 / this.props.intervals;\n var currH = this.props.selected ? getHour(this.props.selected) : getHour(newDate());\n this.list.scrollTop = 30 * (multiplier * currH);\n };\n\n Time.prototype.render = function render() {\n var _this2 = this;\n\n var height = null;\n if (this.props.monthRef) {\n height = this.props.monthRef.clientHeight - 39;\n }\n\n return _react2.default.createElement(\"div\", {\n className: \"react-datepicker__time-container \" + (this.props.todayButton ? \"react-datepicker__time-container--with-today-button\" : \"\")\n }, _react2.default.createElement(\"div\", { className: \"react-datepicker__header react-datepicker__header--time\" }, _react2.default.createElement(\"div\", { className: \"react-datepicker-time__header\" }, this.props.timeCaption)), _react2.default.createElement(\"div\", { className: \"react-datepicker__time\" }, _react2.default.createElement(\"div\", { className: \"react-datepicker__time-box\" }, _react2.default.createElement(\"ul\", {\n className: \"react-datepicker__time-list\",\n ref: function ref(list) {\n _this2.list = list;\n },\n style: height ? { height: height } : {}\n }, this.renderTimes.bind(this)()))));\n };\n\n createClass(Time, null, [{\n key: \"defaultProps\",\n get: function get$$1() {\n return {\n intervals: 30,\n onTimeChange: function onTimeChange() {},\n todayButton: null,\n timeCaption: \"Time\"\n };\n }\n }]);\n return Time;\n}(_react2.default.Component);\n\nTime.propTypes = {\n format: _propTypes2.default.string,\n includeTimes: _propTypes2.default.array,\n intervals: _propTypes2.default.number,\n selected: _propTypes2.default.object,\n onChange: _propTypes2.default.func,\n todayButton: _propTypes2.default.string,\n minTime: _propTypes2.default.object,\n maxTime: _propTypes2.default.object,\n excludeTimes: _propTypes2.default.array,\n monthRef: _propTypes2.default.object,\n timeCaption: _propTypes2.default.string,\n injectTimes: _propTypes2.default.array\n};\n\nfunction CalendarContainer(_ref) {\n var className = _ref.className,\n children = _ref.children;\n\n return _react2.default.createElement(\"div\", { className: className }, _react2.default.createElement(\"div\", { className: \"react-datepicker__triangle\" }), children);\n}\n\nCalendarContainer.propTypes = {\n className: _propTypes2.default.string,\n children: _propTypes2.default.node\n};\n\nvar DROPDOWN_FOCUS_CLASSNAMES = [\"react-datepicker__year-select\", \"react-datepicker__month-select\", \"react-datepicker__month-year-select\"];\n\nvar isDropdownSelect = function isDropdownSelect() {\n var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var classNames = (element.className || \"\").split(/\\s+/);\n return DROPDOWN_FOCUS_CLASSNAMES.some(function (testClassname) {\n return classNames.indexOf(testClassname) >= 0;\n });\n};\n\nvar Calendar = function (_React$Component) {\n inherits(Calendar, _React$Component);\n createClass(Calendar, null, [{\n key: \"defaultProps\",\n get: function get$$1() {\n var _ref;\n\n return _ref = {\n onDropdownFocus: function onDropdownFocus() {},\n monthsShown: 1,\n forceShowMonthNavigation: false,\n timeCaption: \"Time\",\n previousMonthButtonLabel: \"Previous Month\"\n }, _ref[\"previousMonthButtonLabel\"] = \"Next Month\", _ref;\n }\n }]);\n\n function Calendar(props) {\n classCallCheck(this, Calendar);\n\n var _this = possibleConstructorReturn(this, _React$Component.call(this, props));\n\n _this.handleClickOutside = function (event) {\n _this.props.onClickOutside(event);\n };\n\n _this.handleDropdownFocus = function (event) {\n if (isDropdownSelect(event.target)) {\n _this.props.onDropdownFocus();\n }\n };\n\n _this.getDateInView = function () {\n var _this$props = _this.props,\n preSelection = _this$props.preSelection,\n selected = _this$props.selected,\n openToDate = _this$props.openToDate,\n utcOffset = _this$props.utcOffset;\n\n var minDate = getEffectiveMinDate(_this.props);\n var maxDate = getEffectiveMaxDate(_this.props);\n var current = now(utcOffset);\n var initialDate = openToDate || selected || preSelection;\n if (initialDate) {\n return initialDate;\n } else {\n if (minDate && isBefore(current, minDate)) {\n return minDate;\n } else if (maxDate && isAfter(current, maxDate)) {\n return maxDate;\n }\n }\n return current;\n };\n\n _this.localizeDate = function (date) {\n return localizeDate(date, _this.props.locale);\n };\n\n _this.increaseMonth = function () {\n _this.setState({\n date: addMonths(cloneDate(_this.state.date), 1)\n }, function () {\n return _this.handleMonthChange(_this.state.date);\n });\n };\n\n _this.decreaseMonth = function () {\n _this.setState({\n date: subtractMonths(cloneDate(_this.state.date), 1)\n }, function () {\n return _this.handleMonthChange(_this.state.date);\n });\n };\n\n _this.handleDayClick = function (day, event) {\n return _this.props.onSelect(day, event);\n };\n\n _this.handleDayMouseEnter = function (day) {\n return _this.setState({ selectingDate: day });\n };\n\n _this.handleMonthMouseLeave = function () {\n return _this.setState({ selectingDate: null });\n };\n\n _this.handleYearChange = function (date) {\n if (_this.props.onYearChange) {\n _this.props.onYearChange(date);\n }\n };\n\n _this.handleMonthChange = function (date) {\n if (_this.props.onMonthChange) {\n _this.props.onMonthChange(date);\n }\n if (_this.props.adjustDateOnChange) {\n if (_this.props.onSelect) {\n _this.props.onSelect(date);\n }\n if (_this.props.setOpen) {\n _this.props.setOpen(true);\n }\n }\n };\n\n _this.handleMonthYearChange = function (date) {\n _this.handleYearChange(date);\n _this.handleMonthChange(date);\n };\n\n _this.changeYear = function (year) {\n _this.setState({\n date: setYear(cloneDate(_this.state.date), year)\n }, function () {\n return _this.handleYearChange(_this.state.date);\n });\n };\n\n _this.changeMonth = function (month) {\n _this.setState({\n date: setMonth(cloneDate(_this.state.date), month)\n }, function () {\n return _this.handleMonthChange(_this.state.date);\n });\n };\n\n _this.changeMonthYear = function (monthYear) {\n _this.setState({\n date: setYear(setMonth(cloneDate(_this.state.date), getMonth(monthYear)), getYear(monthYear))\n }, function () {\n return _this.handleMonthYearChange(_this.state.date);\n });\n };\n\n _this.header = function () {\n var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.state.date;\n\n var startOfWeek = getStartOfWeek(cloneDate(date));\n var dayNames = [];\n if (_this.props.showWeekNumbers) {\n dayNames.push(_react2.default.createElement(\"div\", { key: \"W\", className: \"react-datepicker__day-name\" }, _this.props.weekLabel || \"#\"));\n }\n return dayNames.concat([0, 1, 2, 3, 4, 5, 6].map(function (offset) {\n var day = addDays(cloneDate(startOfWeek), offset);\n var localeData = getLocaleData(day);\n var weekDayName = _this.formatWeekday(localeData, day);\n\n return _react2.default.createElement(\"div\", { key: offset, className: \"react-datepicker__day-name\" }, weekDayName);\n }));\n };\n\n _this.formatWeekday = function (localeData, day) {\n if (_this.props.formatWeekDay) {\n return getFormattedWeekdayInLocale(localeData, day, _this.props.formatWeekDay);\n }\n return _this.props.useWeekdaysShort ? getWeekdayShortInLocale(localeData, day) : getWeekdayMinInLocale(localeData, day);\n };\n\n _this.renderPreviousMonthButton = function () {\n var allPrevDaysDisabled = allDaysDisabledBefore(_this.state.date, \"month\", _this.props);\n\n if (!_this.props.forceShowMonthNavigation && !_this.props.showDisabledMonthNavigation && allPrevDaysDisabled || _this.props.showTimeSelectOnly) {\n return;\n }\n\n var classes = [\"react-datepicker__navigation\", \"react-datepicker__navigation--previous\"];\n\n var clickHandler = _this.decreaseMonth;\n\n if (allPrevDaysDisabled && _this.props.showDisabledMonthNavigation) {\n classes.push(\"react-datepicker__navigation--previous--disabled\");\n clickHandler = null;\n }\n\n return _react2.default.createElement(\"button\", {\n type: \"button\",\n className: classes.join(\" \"),\n onClick: clickHandler\n }, _this.props.previousMonthButtonLabel);\n };\n\n _this.renderNextMonthButton = function () {\n var allNextDaysDisabled = allDaysDisabledAfter(_this.state.date, \"month\", _this.props);\n\n if (!_this.props.forceShowMonthNavigation && !_this.props.showDisabledMonthNavigation && allNextDaysDisabled || _this.props.showTimeSelectOnly) {\n return;\n }\n\n var classes = [\"react-datepicker__navigation\", \"react-datepicker__navigation--next\"];\n if (_this.props.showTimeSelect) {\n classes.push(\"react-datepicker__navigation--next--with-time\");\n }\n if (_this.props.todayButton) {\n classes.push(\"react-datepicker__navigation--next--with-today-button\");\n }\n\n var clickHandler = _this.increaseMonth;\n\n if (allNextDaysDisabled && _this.props.showDisabledMonthNavigation) {\n classes.push(\"react-datepicker__navigation--next--disabled\");\n clickHandler = null;\n }\n\n return _react2.default.createElement(\"button\", {\n type: \"button\",\n className: classes.join(\" \"),\n onClick: clickHandler\n }, _this.props.nextMonthButtonLabel);\n };\n\n _this.renderCurrentMonth = function () {\n var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.state.date;\n\n var classes = [\"react-datepicker__current-month\"];\n\n if (_this.props.showYearDropdown) {\n classes.push(\"react-datepicker__current-month--hasYearDropdown\");\n }\n if (_this.props.showMonthDropdown) {\n classes.push(\"react-datepicker__current-month--hasMonthDropdown\");\n }\n if (_this.props.showMonthYearDropdown) {\n classes.push(\"react-datepicker__current-month--hasMonthYearDropdown\");\n }\n return _react2.default.createElement(\"div\", { className: classes.join(\" \") }, formatDate(date, _this.props.dateFormat));\n };\n\n _this.renderYearDropdown = function () {\n var overrideHide = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (!_this.props.showYearDropdown || overrideHide) {\n return;\n }\n return _react2.default.createElement(YearDropdown, {\n adjustDateOnChange: _this.props.adjustDateOnChange,\n date: _this.state.date,\n onSelect: _this.props.onSelect,\n setOpen: _this.props.setOpen,\n dropdownMode: _this.props.dropdownMode,\n onChange: _this.changeYear,\n minDate: _this.props.minDate,\n maxDate: _this.props.maxDate,\n year: getYear(_this.state.date),\n scrollableYearDropdown: _this.props.scrollableYearDropdown,\n yearDropdownItemNumber: _this.props.yearDropdownItemNumber\n });\n };\n\n _this.renderMonthDropdown = function () {\n var overrideHide = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (!_this.props.showMonthDropdown || overrideHide) {\n return;\n }\n return _react2.default.createElement(MonthDropdown, {\n dropdownMode: _this.props.dropdownMode,\n locale: _this.props.locale,\n dateFormat: _this.props.dateFormat,\n onChange: _this.changeMonth,\n month: getMonth(_this.state.date),\n useShortMonthInDropdown: _this.props.useShortMonthInDropdown\n });\n };\n\n _this.renderMonthYearDropdown = function () {\n var overrideHide = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (!_this.props.showMonthYearDropdown || overrideHide) {\n return;\n }\n return _react2.default.createElement(MonthYearDropdown, {\n dropdownMode: _this.props.dropdownMode,\n locale: _this.props.locale,\n dateFormat: _this.props.dateFormat,\n onChange: _this.changeMonthYear,\n minDate: _this.props.minDate,\n maxDate: _this.props.maxDate,\n date: _this.state.date,\n scrollableMonthYearDropdown: _this.props.scrollableMonthYearDropdown\n });\n };\n\n _this.renderTodayButton = function () {\n if (!_this.props.todayButton || _this.props.showTimeSelectOnly) {\n return;\n }\n return _react2.default.createElement(\"div\", {\n className: \"react-datepicker__today-button\",\n onClick: function onClick(e) {\n return _this.props.onSelect(getStartOfDate(now(_this.props.utcOffset)), e);\n }\n }, _this.props.todayButton);\n };\n\n _this.renderMonths = function () {\n if (_this.props.showTimeSelectOnly) {\n return;\n }\n\n var monthList = [];\n for (var i = 0; i < _this.props.monthsShown; ++i) {\n var monthDate = addMonths(cloneDate(_this.state.date), i);\n var monthKey = \"month-\" + i;\n monthList.push(_react2.default.createElement(\"div\", {\n key: monthKey,\n ref: function ref(div) {\n _this.monthContainer = div;\n },\n className: \"react-datepicker__month-container\"\n }, _react2.default.createElement(\"div\", { className: \"react-datepicker__header\" }, _this.renderCurrentMonth(monthDate), _react2.default.createElement(\"div\", {\n className: \"react-datepicker__header__dropdown react-datepicker__header__dropdown--\" + _this.props.dropdownMode,\n onFocus: _this.handleDropdownFocus\n }, _this.renderMonthDropdown(i !== 0), _this.renderMonthYearDropdown(i !== 0), _this.renderYearDropdown(i !== 0)), _react2.default.createElement(\"div\", { className: \"react-datepicker__day-names\" }, _this.header(monthDate))), _react2.default.createElement(Month, {\n day: monthDate,\n dayClassName: _this.props.dayClassName,\n onDayClick: _this.handleDayClick,\n onDayMouseEnter: _this.handleDayMouseEnter,\n onMouseLeave: _this.handleMonthMouseLeave,\n onWeekSelect: _this.props.onWeekSelect,\n formatWeekNumber: _this.props.formatWeekNumber,\n minDate: _this.props.minDate,\n maxDate: _this.props.maxDate,\n excludeDates: _this.props.excludeDates,\n highlightDates: _this.props.highlightDates,\n selectingDate: _this.state.selectingDate,\n includeDates: _this.props.includeDates,\n inline: _this.props.inline,\n fixedHeight: _this.props.fixedHeight,\n filterDate: _this.props.filterDate,\n preSelection: _this.props.preSelection,\n selected: _this.props.selected,\n selectsStart: _this.props.selectsStart,\n selectsEnd: _this.props.selectsEnd,\n showWeekNumbers: _this.props.showWeekNumbers,\n startDate: _this.props.startDate,\n endDate: _this.props.endDate,\n peekNextMonth: _this.props.peekNextMonth,\n utcOffset: _this.props.utcOffset\n })));\n }\n return monthList;\n };\n\n _this.renderTimeSection = function () {\n if (_this.props.showTimeSelect) {\n return _react2.default.createElement(Time, {\n selected: _this.props.selected,\n onChange: _this.props.onTimeChange,\n format: _this.props.timeFormat,\n includeTimes: _this.props.includeTimes,\n intervals: _this.props.timeIntervals,\n minTime: _this.props.minTime,\n maxTime: _this.props.maxTime,\n excludeTimes: _this.props.excludeTimes,\n timeCaption: _this.props.timeCaption,\n todayButton: _this.props.todayButton,\n showMonthDropdown: _this.props.showMonthDropdown,\n showMonthYearDropdown: _this.props.showMonthYearDropdown,\n showYearDropdown: _this.props.showYearDropdown,\n withPortal: _this.props.withPortal,\n monthRef: _this.state.monthContainer,\n injectTimes: _this.props.injectTimes\n });\n }\n };\n\n _this.state = {\n date: _this.localizeDate(_this.getDateInView()),\n selectingDate: null,\n monthContainer: _this.monthContainer\n };\n return _this;\n }\n\n Calendar.prototype.componentDidMount = function componentDidMount() {\n var _this2 = this;\n\n // monthContainer height is needed in time component\n // to determine the height for the ul in the time component\n // setState here so height is given after final component\n // layout is rendered\n if (this.props.showTimeSelect) {\n this.assignMonthContainer = function () {\n _this2.setState({ monthContainer: _this2.monthContainer });\n }();\n }\n };\n\n Calendar.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {\n if (this.props.preSelection && !isSameDay(this.props.preSelection, prevProps.preSelection)) {\n this.setState({\n date: this.localizeDate(this.props.preSelection)\n });\n } else if (this.props.openToDate && !isSameDay(this.props.openToDate, prevProps.openToDate)) {\n this.setState({\n date: this.localizeDate(this.props.openToDate)\n });\n }\n };\n\n Calendar.prototype.render = function render() {\n var Container = this.props.container || CalendarContainer;\n\n return _react2.default.createElement(Container, {\n className: (0, _classnames3.default)(\"react-datepicker\", this.props.className, {\n \"react-datepicker--time-only\": this.props.showTimeSelectOnly\n })\n }, this.renderPreviousMonthButton(), this.renderNextMonthButton(), this.renderMonths(), this.renderTodayButton(), this.renderTimeSection(), this.props.children);\n };\n\n return Calendar;\n}(_react2.default.Component);\n\nCalendar.propTypes = {\n adjustDateOnChange: _propTypes2.default.bool,\n className: _propTypes2.default.string,\n children: _propTypes2.default.node,\n container: _propTypes2.default.func,\n dateFormat: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.array]).isRequired,\n dayClassName: _propTypes2.default.func,\n dropdownMode: _propTypes2.default.oneOf([\"scroll\", \"select\"]),\n endDate: _propTypes2.default.object,\n excludeDates: _propTypes2.default.array,\n filterDate: _propTypes2.default.func,\n fixedHeight: _propTypes2.default.bool,\n formatWeekNumber: _propTypes2.default.func,\n highlightDates: _propTypes2.default.instanceOf(Map),\n includeDates: _propTypes2.default.array,\n includeTimes: _propTypes2.default.array,\n injectTimes: _propTypes2.default.array,\n inline: _propTypes2.default.bool,\n locale: _propTypes2.default.string,\n maxDate: _propTypes2.default.object,\n minDate: _propTypes2.default.object,\n monthsShown: _propTypes2.default.number,\n onClickOutside: _propTypes2.default.func.isRequired,\n onMonthChange: _propTypes2.default.func,\n onYearChange: _propTypes2.default.func,\n forceShowMonthNavigation: _propTypes2.default.bool,\n onDropdownFocus: _propTypes2.default.func,\n onSelect: _propTypes2.default.func.isRequired,\n onWeekSelect: _propTypes2.default.func,\n showTimeSelect: _propTypes2.default.bool,\n showTimeSelectOnly: _propTypes2.default.bool,\n timeFormat: _propTypes2.default.string,\n timeIntervals: _propTypes2.default.number,\n onTimeChange: _propTypes2.default.func,\n minTime: _propTypes2.default.object,\n maxTime: _propTypes2.default.object,\n excludeTimes: _propTypes2.default.array,\n timeCaption: _propTypes2.default.string,\n openToDate: _propTypes2.default.object,\n peekNextMonth: _propTypes2.default.bool,\n scrollableYearDropdown: _propTypes2.default.bool,\n scrollableMonthYearDropdown: _propTypes2.default.bool,\n preSelection: _propTypes2.default.object,\n selected: _propTypes2.default.object,\n selectsEnd: _propTypes2.default.bool,\n selectsStart: _propTypes2.default.bool,\n showMonthDropdown: _propTypes2.default.bool,\n showMonthYearDropdown: _propTypes2.default.bool,\n showWeekNumbers: _propTypes2.default.bool,\n showYearDropdown: _propTypes2.default.bool,\n startDate: _propTypes2.default.object,\n todayButton: _propTypes2.default.string,\n useWeekdaysShort: _propTypes2.default.bool,\n formatWeekDay: _propTypes2.default.func,\n withPortal: _propTypes2.default.bool,\n utcOffset: _propTypes2.default.number,\n weekLabel: _propTypes2.default.string,\n yearDropdownItemNumber: _propTypes2.default.number,\n setOpen: _propTypes2.default.func,\n useShortMonthInDropdown: _propTypes2.default.bool,\n showDisabledMonthNavigation: _propTypes2.default.bool,\n previousMonthButtonLabel: _propTypes2.default.string,\n nextMonthButtonLabel: _propTypes2.default.string\n};\n\nvar popperPlacementPositions = [\"auto\", \"auto-left\", \"auto-right\", \"bottom\", \"bottom-end\", \"bottom-start\", \"left\", \"left-end\", \"left-start\", \"right\", \"right-end\", \"right-start\", \"top\", \"top-end\", \"top-start\"];\n\nvar PopperComponent = function (_React$Component) {\n inherits(PopperComponent, _React$Component);\n\n function PopperComponent() {\n classCallCheck(this, PopperComponent);\n return possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n }\n\n PopperComponent.prototype.render = function render() {\n var _props = this.props,\n className = _props.className,\n hidePopper = _props.hidePopper,\n popperComponent = _props.popperComponent,\n popperModifiers = _props.popperModifiers,\n popperPlacement = _props.popperPlacement,\n targetComponent = _props.targetComponent;\n\n var popper = void 0;\n\n if (!hidePopper) {\n var classes = (0, _classnames3.default)(\"react-datepicker-popper\", className);\n popper = _react2.default.createElement(_reactPopper.Popper, {\n className: classes,\n modifiers: popperModifiers,\n placement: popperPlacement\n }, popperComponent);\n }\n\n if (this.props.popperContainer) {\n popper = _react2.default.createElement(this.props.popperContainer, {}, popper);\n }\n\n return _react2.default.createElement(_reactPopper.Manager, null, _react2.default.createElement(_reactPopper.Target, { className: \"react-datepicker-wrapper\" }, targetComponent), popper);\n };\n\n createClass(PopperComponent, null, [{\n key: \"defaultProps\",\n get: function get$$1() {\n return {\n hidePopper: true,\n popperModifiers: {\n preventOverflow: {\n enabled: true,\n escapeWithReference: true,\n boundariesElement: \"viewport\"\n }\n },\n popperPlacement: \"bottom-start\"\n };\n }\n }]);\n return PopperComponent;\n}(_react2.default.Component);\n\nPopperComponent.propTypes = {\n className: _propTypes2.default.string,\n hidePopper: _propTypes2.default.bool,\n popperComponent: _propTypes2.default.element,\n popperModifiers: _propTypes2.default.object, // <datepicker/> props\n popperPlacement: _propTypes2.default.oneOf(popperPlacementPositions), // <datepicker/> props\n popperContainer: _propTypes2.default.func,\n targetComponent: _propTypes2.default.element\n};\n\nvar outsideClickIgnoreClass = \"react-datepicker-ignore-onclickoutside\";\nvar WrappedCalendar = (0, _reactOnclickoutside2.default)(Calendar);\n\n// Compares dates year+month combinations\nfunction hasPreSelectionChanged(date1, date2) {\n if (date1 && date2) {\n return getMonth(date1) !== getMonth(date2) || getYear(date1) !== getYear(date2);\n }\n\n return date1 !== date2;\n}\n\nfunction hasSelectionChanged(date1, date2) {\n if (date1 && date2) {\n return !equals(date1, date2);\n }\n\n return false;\n}\n\n/**\n * General datepicker component.\n */\n\nvar DatePicker = function (_React$Component) {\n inherits(DatePicker, _React$Component);\n createClass(DatePicker, null, [{\n key: \"defaultProps\",\n get: function get$$1() {\n return {\n allowSameDay: false,\n dateFormat: \"L\",\n dateFormatCalendar: \"MMMM YYYY\",\n onChange: function onChange() {},\n\n disabled: false,\n disabledKeyboardNavigation: false,\n dropdownMode: \"scroll\",\n onFocus: function onFocus() {},\n onBlur: function onBlur() {},\n onKeyDown: function onKeyDown() {},\n onSelect: function onSelect() {},\n onClickOutside: function onClickOutside$$1() {},\n onMonthChange: function onMonthChange() {},\n\n preventOpenOnFocus: false,\n onYearChange: function onYearChange() {},\n\n monthsShown: 1,\n readOnly: false,\n withPortal: false,\n shouldCloseOnSelect: true,\n showTimeSelect: false,\n timeIntervals: 30,\n timeCaption: \"Time\",\n previousMonthButtonLabel: \"Previous Month\",\n nextMonthButtonLabel: \"Next month\"\n };\n }\n }]);\n\n function DatePicker(props) {\n classCallCheck(this, DatePicker);\n\n var _this = possibleConstructorReturn(this, _React$Component.call(this, props));\n\n _this.getPreSelection = function () {\n return _this.props.openToDate ? newDate(_this.props.openToDate) : _this.props.selectsEnd && _this.props.startDate ? newDate(_this.props.startDate) : _this.props.selectsStart && _this.props.endDate ? newDate(_this.props.endDate) : now(_this.props.utcOffset);\n };\n\n _this.calcInitialState = function () {\n var defaultPreSelection = _this.getPreSelection();\n var minDate = getEffectiveMinDate(_this.props);\n var maxDate = getEffectiveMaxDate(_this.props);\n var boundedPreSelection = minDate && isBefore(defaultPreSelection, minDate) ? minDate : maxDate && isAfter(defaultPreSelection, maxDate) ? maxDate : defaultPreSelection;\n return {\n open: _this.props.startOpen || false,\n preventFocus: false,\n preSelection: _this.props.selected ? newDate(_this.props.selected) : boundedPreSelection,\n // transforming highlighted days (perhaps nested array)\n // to flat Map for faster access in day.jsx\n highlightDates: getHightLightDaysMap(_this.props.highlightDates),\n focused: false\n };\n };\n\n _this.clearPreventFocusTimeout = function () {\n if (_this.preventFocusTimeout) {\n clearTimeout(_this.preventFocusTimeout);\n }\n };\n\n _this.setFocus = function () {\n if (_this.input && _this.input.focus) {\n _this.input.focus();\n }\n };\n\n _this.setOpen = function (open) {\n _this.setState({\n open: open,\n preSelection: open && _this.state.open ? _this.state.preSelection : _this.calcInitialState().preSelection,\n lastPreSelectChange: PRESELECT_CHANGE_VIA_NAVIGATE\n });\n };\n\n _this.handleFocus = function (event) {\n if (!_this.state.preventFocus) {\n _this.props.onFocus(event);\n if (!_this.props.preventOpenOnFocus && !_this.props.readOnly) {\n _this.setOpen(true);\n }\n }\n _this.setState({ focused: true });\n };\n\n _this.cancelFocusInput = function () {\n clearTimeout(_this.inputFocusTimeout);\n _this.inputFocusTimeout = null;\n };\n\n _this.deferFocusInput = function () {\n _this.cancelFocusInput();\n _this.inputFocusTimeout = setTimeout(function () {\n return _this.setFocus();\n }, 1);\n };\n\n _this.handleDropdownFocus = function () {\n _this.cancelFocusInput();\n };\n\n _this.handleBlur = function (event) {\n if (_this.state.open && !_this.props.withPortal) {\n _this.deferFocusInput();\n } else {\n _this.props.onBlur(event);\n }\n _this.setState({ focused: false });\n };\n\n _this.handleCalendarClickOutside = function (event) {\n if (!_this.props.inline) {\n _this.setOpen(false);\n }\n _this.props.onClickOutside(event);\n if (_this.props.withPortal) {\n event.preventDefault();\n }\n };\n\n _this.handleChange = function () {\n for (var _len = arguments.length, allArgs = Array(_len), _key = 0; _key < _len; _key++) {\n allArgs[_key] = arguments[_key];\n }\n\n var event = allArgs[0];\n if (_this.props.onChangeRaw) {\n _this.props.onChangeRaw.apply(_this, allArgs);\n if (typeof event.isDefaultPrevented !== \"function\" || event.isDefaultPrevented()) {\n return;\n }\n }\n _this.setState({\n inputValue: event.target.value,\n lastPreSelectChange: PRESELECT_CHANGE_VIA_INPUT\n });\n var date = parseDate(event.target.value, _this.props);\n if (date || !event.target.value) {\n _this.setSelected(date, event, true);\n }\n };\n\n _this.handleSelect = function (date, event) {\n // Preventing onFocus event to fix issue\n // https://github.com/Hacker0x01/react-datepicker/issues/628\n _this.setState({ preventFocus: true }, function () {\n _this.preventFocusTimeout = setTimeout(function () {\n return _this.setState({ preventFocus: false });\n }, 50);\n return _this.preventFocusTimeout;\n });\n _this.setSelected(date, event);\n if (!_this.props.shouldCloseOnSelect || _this.props.showTimeSelect) {\n _this.setPreSelection(date);\n } else if (!_this.props.inline) {\n _this.setOpen(false);\n }\n };\n\n _this.setSelected = function (date, event, keepInput) {\n var changedDate = date;\n\n if (changedDate !== null && isDayDisabled(changedDate, _this.props)) {\n return;\n }\n\n if (!isSameDay(_this.props.selected, changedDate) || _this.props.allowSameDay) {\n if (changedDate !== null) {\n if (_this.props.selected) {\n var selected = _this.props.selected;\n if (keepInput) selected = newDate(changedDate);\n changedDate = setTime(newDate(changedDate), {\n hour: getHour(selected),\n minute: getMinute(selected),\n second: getSecond(selected)\n });\n }\n if (!_this.props.inline) {\n _this.setState({\n preSelection: changedDate\n });\n }\n }\n _this.props.onChange(changedDate, event);\n }\n\n _this.props.onSelect(changedDate, event);\n\n if (!keepInput) {\n _this.setState({ inputValue: null });\n }\n };\n\n _this.setPreSelection = function (date) {\n var isDateRangePresent = typeof _this.props.minDate !== \"undefined\" && typeof _this.props.maxDate !== \"undefined\";\n var isValidDateSelection = isDateRangePresent && date ? isDayInRange(date, _this.props.minDate, _this.props.maxDate) : true;\n if (isValidDateSelection) {\n _this.setState({\n preSelection: date\n });\n }\n };\n\n _this.handleTimeChange = function (time) {\n var selected = _this.props.selected ? _this.props.selected : _this.getPreSelection();\n var changedDate = setTime(cloneDate(selected), {\n hour: getHour(time),\n minute: getMinute(time)\n });\n\n _this.setState({\n preSelection: changedDate\n });\n\n _this.props.onChange(changedDate);\n _this.setOpen(false);\n _this.setState({ inputValue: null });\n };\n\n _this.onInputClick = function () {\n if (!_this.props.disabled && !_this.props.readOnly) {\n _this.setOpen(true);\n }\n };\n\n _this.onInputKeyDown = function (event) {\n _this.props.onKeyDown(event);\n var eventKey = event.key;\n if (!_this.state.open && !_this.props.inline && !_this.props.preventOpenOnFocus) {\n if (eventKey === \"ArrowDown\" || eventKey === \"ArrowUp\") {\n _this.onInputClick();\n }\n return;\n }\n var copy = newDate(_this.state.preSelection);\n if (eventKey === \"Enter\") {\n event.preventDefault();\n if ((isMoment(_this.state.preSelection) || isDate(_this.state.preSelection)) && _this.state.lastPreSelectChange === PRESELECT_CHANGE_VIA_NAVIGATE) {\n _this.handleSelect(copy, event);\n !_this.props.shouldCloseOnSelect && _this.setPreSelection(copy);\n } else {\n _this.setOpen(false);\n }\n } else if (eventKey === \"Escape\") {\n event.preventDefault();\n _this.setOpen(false);\n } else if (eventKey === \"Tab\") {\n _this.setOpen(false);\n } else if (!_this.props.disabledKeyboardNavigation) {\n var newSelection = void 0;\n switch (eventKey) {\n case \"ArrowLeft\":\n newSelection = subtractDays(copy, 1);\n break;\n case \"ArrowRight\":\n newSelection = addDays(copy, 1);\n break;\n case \"ArrowUp\":\n newSelection = subtractWeeks(copy, 1);\n break;\n case \"ArrowDown\":\n newSelection = addWeeks(copy, 1);\n break;\n case \"PageUp\":\n newSelection = subtractMonths(copy, 1);\n break;\n case \"PageDown\":\n newSelection = addMonths(copy, 1);\n break;\n case \"Home\":\n newSelection = subtractYears(copy, 1);\n break;\n case \"End\":\n newSelection = addYears(copy, 1);\n break;\n }\n if (!newSelection) return; // Let the input component handle this keydown\n event.preventDefault();\n _this.setState({ lastPreSelectChange: PRESELECT_CHANGE_VIA_NAVIGATE });\n if (_this.props.adjustDateOnChange) {\n _this.setSelected(newSelection);\n }\n _this.setPreSelection(newSelection);\n }\n };\n\n _this.onClearClick = function (event) {\n if (event) {\n if (event.preventDefault) {\n event.preventDefault();\n }\n }\n _this.props.onChange(null, event);\n _this.setState({ inputValue: null });\n };\n\n _this.clear = function () {\n _this.onClearClick();\n };\n\n _this.renderCalendar = function () {\n if (!_this.props.inline && (!_this.state.open || _this.props.disabled || _this.props.readOnly)) {\n return null;\n }\n return _react2.default.createElement(WrappedCalendar, {\n ref: function ref(elem) {\n _this.calendar = elem;\n },\n locale: _this.props.locale,\n adjustDateOnChange: _this.props.adjustDateOnChange,\n setOpen: _this.setOpen,\n dateFormat: _this.props.dateFormatCalendar,\n useWeekdaysShort: _this.props.useWeekdaysShort,\n formatWeekDay: _this.props.formatWeekDay,\n dropdownMode: _this.props.dropdownMode,\n selected: _this.props.selected,\n preSelection: _this.state.preSelection,\n onSelect: _this.handleSelect,\n onWeekSelect: _this.props.onWeekSelect,\n openToDate: _this.props.openToDate,\n minDate: _this.props.minDate,\n maxDate: _this.props.maxDate,\n selectsStart: _this.props.selectsStart,\n selectsEnd: _this.props.selectsEnd,\n startDate: _this.props.startDate,\n endDate: _this.props.endDate,\n excludeDates: _this.props.excludeDates,\n filterDate: _this.props.filterDate,\n onClickOutside: _this.handleCalendarClickOutside,\n formatWeekNumber: _this.props.formatWeekNumber,\n highlightDates: _this.state.highlightDates,\n includeDates: _this.props.includeDates,\n includeTimes: _this.props.includeTimes,\n injectTimes: _this.props.injectTimes,\n inline: _this.props.inline,\n peekNextMonth: _this.props.peekNextMonth,\n showMonthDropdown: _this.props.showMonthDropdown,\n useShortMonthInDropdown: _this.props.useShortMonthInDropdown,\n showMonthYearDropdown: _this.props.showMonthYearDropdown,\n showWeekNumbers: _this.props.showWeekNumbers,\n showYearDropdown: _this.props.showYearDropdown,\n withPortal: _this.props.withPortal,\n forceShowMonthNavigation: _this.props.forceShowMonthNavigation,\n showDisabledMonthNavigation: _this.props.showDisabledMonthNavigation,\n scrollableYearDropdown: _this.props.scrollableYearDropdown,\n scrollableMonthYearDropdown: _this.props.scrollableMonthYearDropdown,\n todayButton: _this.props.todayButton,\n weekLabel: _this.props.weekLabel,\n utcOffset: _this.props.utcOffset,\n outsideClickIgnoreClass: outsideClickIgnoreClass,\n fixedHeight: _this.props.fixedHeight,\n monthsShown: _this.props.monthsShown,\n onDropdownFocus: _this.handleDropdownFocus,\n onMonthChange: _this.props.onMonthChange,\n onYearChange: _this.props.onYearChange,\n dayClassName: _this.props.dayClassName,\n showTimeSelect: _this.props.showTimeSelect,\n showTimeSelectOnly: _this.props.showTimeSelectOnly,\n onTimeChange: _this.handleTimeChange,\n timeFormat: _this.props.timeFormat,\n timeIntervals: _this.props.timeIntervals,\n minTime: _this.props.minTime,\n maxTime: _this.props.maxTime,\n excludeTimes: _this.props.excludeTimes,\n timeCaption: _this.props.timeCaption,\n className: _this.props.calendarClassName,\n container: _this.props.calendarContainer,\n yearDropdownItemNumber: _this.props.yearDropdownItemNumber,\n previousMonthButtonLabel: _this.props.previousMonthButtonLabel,\n nextMonthButtonLabel: _this.props.nextMonthButtonLabel\n }, _this.props.children);\n };\n\n _this.renderDateInput = function () {\n var _classnames, _React$cloneElement;\n\n var className = (0, _classnames3.default)(_this.props.className, (_classnames = {}, _classnames[outsideClickIgnoreClass] = _this.state.open, _classnames));\n\n var customInput = _this.props.customInput || _react2.default.createElement(\"input\", { type: \"text\" });\n var customInputRef = _this.props.customInputRef || \"ref\";\n var inputValue = typeof _this.props.value === \"string\" ? _this.props.value : typeof _this.state.inputValue === \"string\" ? _this.state.inputValue : safeDateFormat(_this.props.selected, _this.props);\n\n return _react2.default.cloneElement(customInput, (_React$cloneElement = {}, _React$cloneElement[customInputRef] = function (input) {\n _this.input = input;\n }, _React$cloneElement.value = inputValue, _React$cloneElement.onBlur = _this.handleBlur, _React$cloneElement.onChange = _this.handleChange, _React$cloneElement.onClick = _this.onInputClick, _React$cloneElement.onFocus = _this.handleFocus, _React$cloneElement.onKeyDown = _this.onInputKeyDown, _React$cloneElement.id = _this.props.id, _React$cloneElement.name = _this.props.name, _React$cloneElement.autoFocus = _this.props.autoFocus, _React$cloneElement.placeholder = _this.props.placeholderText, _React$cloneElement.disabled = _this.props.disabled, _React$cloneElement.autoComplete = _this.props.autoComplete, _React$cloneElement.className = className, _React$cloneElement.title = _this.props.title, _React$cloneElement.readOnly = _this.props.readOnly, _React$cloneElement.required = _this.props.required, _React$cloneElement.tabIndex = _this.props.tabIndex, _React$cloneElement));\n };\n\n _this.renderClearButton = function () {\n if (_this.props.isClearable && _this.props.selected != null) {\n return _react2.default.createElement(\"button\", {\n type: \"button\",\n className: \"react-datepicker__close-icon\",\n onClick: _this.onClearClick,\n title: _this.props.clearButtonTitle,\n tabIndex: -1\n });\n } else {\n return null;\n }\n };\n\n _this.state = _this.calcInitialState();\n return _this;\n }\n\n DatePicker.prototype.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n if (prevProps.inline && hasPreSelectionChanged(prevProps.selected, this.props.selected)) {\n this.setPreSelection(this.props.selected);\n }\n if (prevProps.highlightDates !== this.props.highlightDates) {\n this.setState({\n highlightDates: getHightLightDaysMap(this.props.highlightDates)\n });\n }\n if (!prevState.focused && hasSelectionChanged(prevProps.selected, this.props.selected)) {\n this.setState({ inputValue: null });\n }\n };\n\n DatePicker.prototype.componentWillUnmount = function componentWillUnmount() {\n this.clearPreventFocusTimeout();\n };\n\n DatePicker.prototype.render = function render() {\n var calendar = this.renderCalendar();\n\n if (this.props.inline && !this.props.withPortal) {\n return calendar;\n }\n\n if (this.props.withPortal) {\n return _react2.default.createElement(\"div\", null, !this.props.inline ? _react2.default.createElement(\"div\", { className: \"react-datepicker__input-container\" }, this.renderDateInput(), this.renderClearButton()) : null, this.state.open || this.props.inline ? _react2.default.createElement(\"div\", { className: \"react-datepicker__portal\" }, calendar) : null);\n }\n\n return _react2.default.createElement(PopperComponent, {\n className: this.props.popperClassName,\n hidePopper: !this.state.open || this.props.disabled || this.props.readOnly,\n popperModifiers: this.props.popperModifiers,\n targetComponent: _react2.default.createElement(\"div\", { className: \"react-datepicker__input-container\" }, this.renderDateInput(), this.renderClearButton()),\n popperContainer: this.props.popperContainer,\n popperComponent: calendar,\n popperPlacement: this.props.popperPlacement\n });\n };\n\n return DatePicker;\n}(_react2.default.Component);\n\nDatePicker.propTypes = {\n adjustDateOnChange: _propTypes2.default.bool,\n allowSameDay: _propTypes2.default.bool,\n autoComplete: _propTypes2.default.string,\n autoFocus: _propTypes2.default.bool,\n calendarClassName: _propTypes2.default.string,\n calendarContainer: _propTypes2.default.func,\n children: _propTypes2.default.node,\n className: _propTypes2.default.string,\n customInput: _propTypes2.default.element,\n customInputRef: _propTypes2.default.string,\n // eslint-disable-next-line react/no-unused-prop-types\n dateFormat: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.array]),\n dateFormatCalendar: _propTypes2.default.string,\n dayClassName: _propTypes2.default.func,\n disabled: _propTypes2.default.bool,\n disabledKeyboardNavigation: _propTypes2.default.bool,\n dropdownMode: _propTypes2.default.oneOf([\"scroll\", \"select\"]).isRequired,\n endDate: _propTypes2.default.object,\n excludeDates: _propTypes2.default.array,\n filterDate: _propTypes2.default.func,\n fixedHeight: _propTypes2.default.bool,\n formatWeekNumber: _propTypes2.default.func,\n highlightDates: _propTypes2.default.array,\n id: _propTypes2.default.string,\n includeDates: _propTypes2.default.array,\n includeTimes: _propTypes2.default.array,\n injectTimes: _propTypes2.default.array,\n inline: _propTypes2.default.bool,\n isClearable: _propTypes2.default.bool,\n locale: _propTypes2.default.string,\n maxDate: _propTypes2.default.object,\n minDate: _propTypes2.default.object,\n monthsShown: _propTypes2.default.number,\n name: _propTypes2.default.string,\n onBlur: _propTypes2.default.func,\n onChange: _propTypes2.default.func.isRequired,\n onSelect: _propTypes2.default.func,\n onWeekSelect: _propTypes2.default.func,\n onClickOutside: _propTypes2.default.func,\n onChangeRaw: _propTypes2.default.func,\n onFocus: _propTypes2.default.func,\n onKeyDown: _propTypes2.default.func,\n onMonthChange: _propTypes2.default.func,\n onYearChange: _propTypes2.default.func,\n openToDate: _propTypes2.default.object,\n peekNextMonth: _propTypes2.default.bool,\n placeholderText: _propTypes2.default.string,\n popperContainer: _propTypes2.default.func,\n popperClassName: _propTypes2.default.string, // <PopperComponent/> props\n popperModifiers: _propTypes2.default.object, // <PopperComponent/> props\n popperPlacement: _propTypes2.default.oneOf(popperPlacementPositions), // <PopperComponent/> props\n preventOpenOnFocus: _propTypes2.default.bool,\n readOnly: _propTypes2.default.bool,\n required: _propTypes2.default.bool,\n scrollableYearDropdown: _propTypes2.default.bool,\n scrollableMonthYearDropdown: _propTypes2.default.bool,\n selected: _propTypes2.default.object,\n selectsEnd: _propTypes2.default.bool,\n selectsStart: _propTypes2.default.bool,\n showMonthDropdown: _propTypes2.default.bool,\n showMonthYearDropdown: _propTypes2.default.bool,\n showWeekNumbers: _propTypes2.default.bool,\n showYearDropdown: _propTypes2.default.bool,\n forceShowMonthNavigation: _propTypes2.default.bool,\n showDisabledMonthNavigation: _propTypes2.default.bool,\n startDate: _propTypes2.default.object,\n startOpen: _propTypes2.default.bool,\n tabIndex: _propTypes2.default.number,\n timeCaption: _propTypes2.default.string,\n title: _propTypes2.default.string,\n todayButton: _propTypes2.default.string,\n useWeekdaysShort: _propTypes2.default.bool,\n formatWeekDay: _propTypes2.default.func,\n utcOffset: _propTypes2.default.number,\n value: _propTypes2.default.string,\n weekLabel: _propTypes2.default.string,\n withPortal: _propTypes2.default.bool,\n yearDropdownItemNumber: _propTypes2.default.number,\n shouldCloseOnSelect: _propTypes2.default.bool,\n showTimeSelect: _propTypes2.default.bool,\n showTimeSelectOnly: _propTypes2.default.bool,\n timeFormat: _propTypes2.default.string,\n timeIntervals: _propTypes2.default.number,\n minTime: _propTypes2.default.object,\n maxTime: _propTypes2.default.object,\n excludeTimes: _propTypes2.default.array,\n useShortMonthInDropdown: _propTypes2.default.bool,\n clearButtonTitle: _propTypes2.default.string,\n previousMonthButtonLabel: _propTypes2.default.string,\n nextMonthButtonLabel: _propTypes2.default.string\n};\nvar PRESELECT_CHANGE_VIA_INPUT = \"input\";\nvar PRESELECT_CHANGE_VIA_NAVIGATE = \"navigate\";\n\nexports.CalendarContainer = CalendarContainer;\nexports.default = DatePicker;","map":null},"hash":"8110d906f08bb98cd282bbf274fd0544","cacheData":{"env":{}}}