@seafile/seafile-calendar
Version:
React Calendar
1,265 lines (1,065 loc) • 275 kB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"), require("react-dom"));
else if(typeof define === 'function' && define.amd)
define(["react", "react-dom"], factory);
else if(typeof exports === 'object')
exports["@seafile/seafile-calendar"] = factory(require("react"), require("react-dom"));
else
root["@seafile/seafile-calendar"] = factory(root["React"], root["ReactDOM"]);
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_40__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 60);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_0__;
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports.default = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _typeof2 = __webpack_require__(49);
var _typeof3 = _interopRequireDefault(_typeof2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
};
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _setPrototypeOf = __webpack_require__(94);
var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
var _create = __webpack_require__(98);
var _create2 = _interopRequireDefault(_create);
var _typeof2 = __webpack_require__(49);
var _typeof3 = _interopRequireDefault(_typeof2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
}
subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
};
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
if (process.env.NODE_ENV !== 'production') {
var ReactIs = __webpack_require__(54);
// By explicitly using `prop-types` you are opting into new development behavior.
// http://fb.me/prop-types-in-prod
var throwOnDirectAccess = true;
module.exports = __webpack_require__(103)(ReactIs.isElement, throwOnDirectAccess);
} else {
// By explicitly using `prop-types` you are opting into new production behavior.
// http://fb.me/prop-types-in-prod
module.exports = __webpack_require__(106)();
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(19)))
/***/ }),
/* 5 */
/***/ (function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
/***/ }),
/* 6 */
/***/ (function(module, exports) {
var core = module.exports = { version: '2.6.12' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(18)(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 8 */
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/* global define */
(function () {
'use strict';
var hasOwn = {}.hasOwnProperty;
function classNames () {
var classes = '';
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (arg) {
classes = appendClass(classes, parseValue(arg));
}
}
return classes;
}
function parseValue (arg) {
if (typeof arg === 'string' || typeof arg === 'number') {
return arg;
}
if (typeof arg !== 'object') {
return '';
}
if (Array.isArray(arg)) {
return classNames.apply(null, arg);
}
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
return arg.toString();
}
var classes = '';
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes = appendClass(classes, key);
}
}
return classes;
}
function appendClass (value, newClass) {
if (!newClass) {
return value;
}
if (value) {
return value + ' ' + newClass;
}
return value + newClass;
}
if (typeof module !== 'undefined' && module.exports) {
classNames.default = classNames;
module.exports = classNames;
} else if (true) {
// register as 'classnames', consistent with npm package name
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
return classNames;
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {
window.classNames = classNames;
}
}());
/***/ }),
/* 10 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* unused harmony export getCurrentDate */
/* unused harmony export getCurrentMonth */
/* unused harmony export getCurrentYear */
/* unused harmony export getCurrentTime */
/* unused harmony export DATE_FORMATS */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CALENDAR_STATUS; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return syncCurrentTime; });
/* harmony export (immutable) */ __webpack_exports__["f"] = getTodayTime;
/* harmony export (immutable) */ __webpack_exports__["e"] = getTitleString;
/* harmony export (immutable) */ __webpack_exports__["g"] = getTodayTimeStr;
/* harmony export (immutable) */ __webpack_exports__["c"] = getMonthName;
/* harmony export (immutable) */ __webpack_exports__["k"] = syncTime;
/* harmony export (immutable) */ __webpack_exports__["d"] = getTimeConfig;
/* unused harmony export isTimeValidByConfig */
/* unused harmony export isTimeValid */
/* harmony export (immutable) */ __webpack_exports__["i"] = isAllowedDate;
/* harmony export (immutable) */ __webpack_exports__["b"] = formatDate;
/* unused harmony export isLeapYear */
/* unused harmony export validateCalendarDay */
/* harmony export (immutable) */ __webpack_exports__["l"] = tokenizeFormattedDate;
/* unused harmony export hasSpecialChar */
/* unused harmony export validateTime */
/* unused harmony export delimate */
/* unused harmony export validateCalendarYear */
/* unused harmony export validateAndNormalizeDate */
/* unused harmony export getDatePart */
/* harmony export (immutable) */ __webpack_exports__["h"] = initializeStr;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__ = __webpack_require__(26);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_dayjs__ = __webpack_require__(20);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_dayjs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_dayjs__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_dayjs_plugin_utc__ = __webpack_require__(58);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_dayjs_plugin_utc___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_dayjs_plugin_utc__);
__WEBPACK_IMPORTED_MODULE_1_dayjs___default.a.extend(__WEBPACK_IMPORTED_MODULE_2_dayjs_plugin_utc___default.a);
var getCurrentDate = function getCurrentDate() {
return __WEBPACK_IMPORTED_MODULE_1_dayjs___default()().date();
};
var getCurrentMonth = function getCurrentMonth() {
return __WEBPACK_IMPORTED_MODULE_1_dayjs___default()().month() + 1;
};
var getCurrentYear = function getCurrentYear() {
return __WEBPACK_IMPORTED_MODULE_1_dayjs___default()().year();
};
var getCurrentTime = function getCurrentTime() {
return __WEBPACK_IMPORTED_MODULE_1_dayjs___default()().format('HH:mm');
};
var DATE_FORMATS = {
ISO: 'YYYY-MM-DD',
ISOAndTime: 'YYYY-MM-DD HH:mm',
US: 'M/D/YYYY',
USAndTime: 'M/D/YYYY HH:mm',
European: 'DD/MM/YYYY',
EuropeanAndTime: 'DD/MM/YYYY HH:mm',
Germany_Russia_etc: 'DD.MM.YYYY',
Germany_Russia_etcAndTime: 'DD.MM.YYYY HH:mm'
};
var CALENDAR_STATUS = {
SPECIFIC_TIME: 'specific_time',
CURRENT_TIME: 'current_time'
};
var syncCurrentTime = function syncCurrentTime(date, status) {
if (status === CALENDAR_STATUS.CURRENT_TIME) {
return date.hour(__WEBPACK_IMPORTED_MODULE_1_dayjs___default()().hour()).minute(__WEBPACK_IMPORTED_MODULE_1_dayjs___default()().minute()).second(__WEBPACK_IMPORTED_MODULE_1_dayjs___default()().second());
}
return date;
};
var defaultDisabledTime = {
disabledHours: function disabledHours() {
return [];
},
disabledMinutes: function disabledMinutes() {
return [];
},
disabledSeconds: function disabledSeconds() {
return [];
}
};
function getTodayTime(value) {
var today = __WEBPACK_IMPORTED_MODULE_1_dayjs___default()();
today = today.locale(value.locale()).utcOffset(value.utcOffset());
return today;
}
function getTitleString(value) {
return value.format('LL');
}
function getTodayTimeStr(value) {
var today = getTodayTime(value);
return getTitleString(today);
}
function getMonthName(month) {
var locale = month.locale();
var localeData = month.localeData();
return localeData[locale === 'zh-cn' ? 'months' : 'monthsShort'](month);
}
function syncTime(from, to) {
if (!__WEBPACK_IMPORTED_MODULE_1_dayjs___default.a.isDayjs(from) || !__WEBPACK_IMPORTED_MODULE_1_dayjs___default.a.isDayjs(to)) return;
to = to.hour(from.hour());
to = to.minute(from.minute());
to = to.second(from.second());
to = to.millisecond(from.millisecond());
}
function getTimeConfig(value, disabledTime) {
var disabledTimeConfig = disabledTime ? disabledTime(value) : {};
disabledTimeConfig = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, defaultDisabledTime, disabledTimeConfig);
return disabledTimeConfig;
}
function isTimeValidByConfig(value, disabledTimeConfig) {
var invalidTime = false;
if (value) {
var hour = value.hour();
var minutes = value.minute();
var seconds = value.second();
var disabledHours = disabledTimeConfig.disabledHours();
if (disabledHours.indexOf(hour) === -1) {
var disabledMinutes = disabledTimeConfig.disabledMinutes(hour);
if (disabledMinutes.indexOf(minutes) === -1) {
var disabledSeconds = disabledTimeConfig.disabledSeconds(hour, minutes);
invalidTime = disabledSeconds.indexOf(seconds) !== -1;
} else {
invalidTime = true;
}
} else {
invalidTime = true;
}
}
return !invalidTime;
}
function isTimeValid(value, disabledTime) {
var disabledTimeConfig = getTimeConfig(value, disabledTime);
return isTimeValidByConfig(value, disabledTimeConfig);
}
function isAllowedDate(value, disabledDate, disabledTime) {
if (disabledDate) {
if (disabledDate(value)) {
return false;
}
}
if (disabledTime) {
if (!isTimeValid(value, disabledTime)) {
return false;
}
}
return true;
}
function formatDate(value, format) {
if (!value) {
return '';
}
if (Array.isArray(format)) {
format = format[0];
}
return value.format(format);
}
var isLeapYear = function isLeapYear(year) {
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
};
function validateCalendarDay(dayStr) {
if (!/^\d+$/.test(dayStr)) return false;
var day = Number(dayStr);
var MONTHS_WITH_31_DAYS = [1, 3, 5, 7, 8, 10, 12];
var MONTHS_WITH_30_DAYS = [4, 6, 9, 11];
if (MONTHS_WITH_31_DAYS.includes(getCurrentMonth())) {
return day >= 1 && day <= 31;
}
if (MONTHS_WITH_30_DAYS.includes(getCurrentMonth())) {
return day >= 1 && day <= 30;
}
if (getCurrentMonth() === 2) {
var year = getCurrentYear();
if (isLeapYear(year)) {
return day >= 1 && day <= 29;
}
return day >= 1 && day <= 28;
}
}
function tokenizeFormattedDate(formatStr, format) {
var str = formatStr || '';
var cleanStr = void 0;
switch (format) {
case DATE_FORMATS.ISO:
case DATE_FORMATS.ISOAndTime:
cleanStr = str.replace(/[^0-9]+/g, '-');
return cleanStr.split('-').filter(Boolean).map(String);
case DATE_FORMATS.US:
case DATE_FORMATS.USAndTime:
case DATE_FORMATS.European:
case DATE_FORMATS.EuropeanAndTime:
cleanStr = str.replace(/[^0-9]+/g, '/');
return cleanStr.split('/').filter(Boolean).map(String);
case DATE_FORMATS.Germany_Russia_etc:
case DATE_FORMATS.Germany_Russia_etcAndTime:
cleanStr = str.replace(/[^0-9]+/g, '.');
return cleanStr.split('.').filter(Boolean).map(String);
default:
return [];
}
}
function hasSpecialChar(str) {
var matches = str.match(/[^0-9]/g);
return matches ? matches.length : 0;
}
function validateTime(inputTime) {
if (!inputTime || typeof inputTime !== 'string') {
return getCurrentTime();
}
var trimmed = inputTime.trim();
var timeRegex = /^(\d{2}):(\d{2})$/;
var match = trimmed.match(timeRegex);
if (!match) {
return getCurrentTime();
}
var hour = Number(match[1]);
var minute = Number(match[2]);
if (hour > 23 || minute > 59) {
return getCurrentTime();
}
return match[1] + ':' + match[2];
}
function delimate(format) {
var delimiter = void 0;
if (format === DATE_FORMATS.Germany_Russia_etc || format === DATE_FORMATS.Germany_Russia_etcAndTime) {
delimiter = '.';
} else if (format === DATE_FORMATS.ISO || format === DATE_FORMATS.ISOAndTime) {
delimiter = '-';
} else {
delimiter = '/';
}
return delimiter;
}
function validateCalendarYear(yearStr) {
var year = yearStr;
if (!year || isNaN(year)) return getCurrentYear();
if (year.length === 2) {
if (Number(year) >= 0 && Number(year) < 69) {
return year ? '20' + year : getCurrentYear();
} else if (Number(year) >= 69 && Number(year) < 100) {
return year ? '19' + year : getCurrentYear();
}
}
if (year.length === 4) {
return year;
}
return year ? year.padStart(4, '0') : getCurrentYear();
}
function validateAndNormalizeDate(dayStr, monthStr, yearStr) {
var day = Number(dayStr);
var month = Number(monthStr);
var year = yearStr;
var isInThirtyOneDaysMonths = [1, 3, 5, 7, 8, 10, 12].includes(month);
var isInThirtyDaysMonths = [4, 6, 9, 11].includes(month);
var isValidDayThirtyOne = day < 1 || day > 31;
var isValidDayThirty = day < 1 || day > 30;
var isValidDayTwentyNight = day < 1 || day > 29;
var isValidDayTwentyEight = day < 1 || day > 28;
if (month > 12 || month < 0 || !month) {
day = getCurrentDate();
month = getCurrentMonth();
year = getCurrentYear();
}
if (isInThirtyOneDaysMonths && isValidDayThirtyOne || isInThirtyDaysMonths && isValidDayThirty) {
day = getCurrentDate();
month = getCurrentMonth();
year = getCurrentYear();
}
if (month === 2) {
if (isLeapYear(year) && isValidDayTwentyNight) {
day = getCurrentDate();
month = getCurrentMonth();
year = getCurrentYear();
} else if (isValidDayTwentyEight) {
day = getCurrentDate();
month = getCurrentMonth();
year = getCurrentYear();
}
}
return { day: day, month: month, year: year };
}
function getDatePart(str) {
if (typeof str !== 'string') return '';
var parts = str.trim().split(/\s+/);
return parts[0];
}
function initializeStr(str, format) {
var inputStr = str;
var inputStrLength = inputStr.length;
var time = getCurrentTime();
var hasSpecial = hasSpecialChar(inputStr);
var formattedArray = tokenizeFormattedDate(inputStr, format);
var dateDelimater = delimate(format);
if (format === DATE_FORMATS.ISO) {
var numStr = inputStr.replace(/[^0-9]/g, '');
if (numStr.length === 7 || numStr.length === 8) {
var yearStr = numStr.slice(0, 4);
var monthStr = numStr.slice(4, 6) || '01';
var dateStr = numStr.slice(6, numStr.length) || '01';
var validateYear = validateCalendarYear(yearStr);
var _validateAndNormalize = validateAndNormalizeDate(dateStr, monthStr, validateYear),
day = _validateAndNormalize.day,
month = _validateAndNormalize.month;
var _validateAndNormalize2 = validateAndNormalizeDate(dateStr, monthStr, validateYear),
year = _validateAndNormalize2.year;
day = String(day).padStart(2, 0);
month = String(month).padStart(2, 0);
return '' + year + dateDelimater + month + dateDelimater + day;
}
if (hasSpecial) {
var _validateYear = validateCalendarYear(formattedArray[0]);
var _validateAndNormalize3 = validateAndNormalizeDate(formattedArray[2] || '01', formattedArray[1] || '01', _validateYear),
_day = _validateAndNormalize3.day,
_month = _validateAndNormalize3.month; // eslint-disable-line max-len
var _validateAndNormalize4 = validateAndNormalizeDate(formattedArray[2] || '01', formattedArray[1] || '01', _validateYear),
_year = _validateAndNormalize4.year; // eslint-disable-line max-len
_day = String(_day).padStart(2, 0);
_month = String(_month).padStart(2, 0);
return '' + _year + dateDelimater + _month + dateDelimater + _day;
} else if (inputStrLength >= 1 && inputStrLength <= 8) {
var _yearStr = inputStr.slice(0, 4);
var _monthStr = inputStr.slice(4, 6) || '01';
var _dateStr = inputStr.slice(6, 8) || '01';
var _validateYear2 = validateCalendarYear(_yearStr);
var _validateAndNormalize5 = validateAndNormalizeDate(_dateStr, _monthStr, _validateYear2),
_day2 = _validateAndNormalize5.day,
_month2 = _validateAndNormalize5.month;
var _validateAndNormalize6 = validateAndNormalizeDate(_dateStr, _monthStr, _validateYear2),
_year2 = _validateAndNormalize6.year;
_day2 = String(_day2).padStart(2, 0);
_month2 = String(_month2).padStart(2, 0);
return '' + _year2 + dateDelimater + _month2 + dateDelimater + _day2;
} else if (inputStrLength > 8) {
return '' + getCurrentYear() + dateDelimater + String(getCurrentMonth()).padStart(2, 0) + dateDelimater + String(getCurrentDate()).padStart(2, 0); // eslint-disable-line max-len
}
} else if (format === DATE_FORMATS.ISOAndTime) {
var datePart = getDatePart(inputStr);
var formattedDateArray = tokenizeFormattedDate(datePart, format);
var isDateSpecial = hasSpecialChar(datePart);
var _numStr = datePart.replace(/[^0-9]/g, '');
if (_numStr.length === 7 || _numStr.length === 8) {
var _yearStr2 = _numStr.slice(0, 4);
var _monthStr2 = _numStr.slice(4, 6) || '01';
var _dateStr2 = _numStr.slice(6, _numStr.length) || '01';
if (formattedArray.length === 3) {
time = validateTime(formattedArray[1] + ':' + formattedArray[2]);
}
if (formattedArray.length === 4) {
time = validateTime(formattedArray[2] + ':' + formattedArray[3]);
}
if (formattedArray.length === 5) {
time = validateTime(formattedArray[3] + ':' + formattedArray[4]);
}
var _validateYear3 = validateCalendarYear(_yearStr2);
var _validateAndNormalize7 = validateAndNormalizeDate(_dateStr2, _monthStr2, _validateYear3),
_day3 = _validateAndNormalize7.day,
_month3 = _validateAndNormalize7.month;
var _validateAndNormalize8 = validateAndNormalizeDate(_dateStr2, _monthStr2, _validateYear3),
_year3 = _validateAndNormalize8.year;
_day3 = String(_day3).padStart(2, 0);
_month3 = String(_month3).padStart(2, 0);
return '' + _year3 + dateDelimater + _month3 + dateDelimater + _day3 + ' ' + time;
}
if (isDateSpecial) {
if (formattedDateArray.length < 3) {
formattedArray.splice(2, 0, '01');
}
var _validateYear4 = validateCalendarYear(formattedArray[0]);
var _validateAndNormalize9 = validateAndNormalizeDate(formattedArray[2] || '01', formattedArray[1] || '01', _validateYear4),
_day4 = _validateAndNormalize9.day,
_month4 = _validateAndNormalize9.month; // eslint-disable-line max-len
var _validateAndNormalize10 = validateAndNormalizeDate(formattedArray[2] || '01', formattedArray[1] || '01', _validateYear4),
_year4 = _validateAndNormalize10.year; // eslint-disable-line max-len
time = validateTime(formattedArray[3] + ':' + formattedArray[4]);
_day4 = String(_day4).padStart(2, 0);
_month4 = String(_month4).padStart(2, 0);
return '' + _year4 + dateDelimater + _month4 + dateDelimater + _day4 + ' ' + time;
} else if (datePart.length >= 1 && datePart.length <= 8) {
var _yearStr3 = datePart.slice(0, 4);
var _monthStr3 = datePart.slice(4, 6) || '01';
var _dateStr3 = datePart.slice(6, 8) || '01';
var timeParts = tokenizeFormattedDate(inputStr, format);
time = validateTime(timeParts[1] + ':' + timeParts[2]);
var _validateYear5 = validateCalendarYear(_yearStr3);
var _validateAndNormalize11 = validateAndNormalizeDate(_dateStr3, _monthStr3, _validateYear5),
_day5 = _validateAndNormalize11.day,
_month5 = _validateAndNormalize11.month;
var _validateAndNormalize12 = validateAndNormalizeDate(_dateStr3, _monthStr3, _validateYear5),
_year5 = _validateAndNormalize12.year;
_day5 = String(_day5).padStart(2, 0);
_month5 = String(_month5).padStart(2, 0);
return '' + _year5 + dateDelimater + _month5 + dateDelimater + _day5 + ' ' + time;
} else if (datePart.length > 8) {
return '' + getCurrentYear() + dateDelimater + String(getCurrentMonth()).padStart(2, 0) + dateDelimater + String(getCurrentDate()).padStart(2, 0) + ' ' + getCurrentTime(); // eslint-disable-line max-len
}
} else if (format === DATE_FORMATS.US) {
if (hasSpecial) {
var _validateYear6 = validateCalendarYear(formattedArray[2]);
var _validateAndNormalize13 = validateAndNormalizeDate(formattedArray[1] || '1', formattedArray[0], _validateYear6),
_day6 = _validateAndNormalize13.day,
_month6 = _validateAndNormalize13.month,
_year6 = _validateAndNormalize13.year; // eslint-disable-line max-len
return '' + _month6 + dateDelimater + _day6 + dateDelimater + _year6;
} else if (inputStrLength >= 1 && inputStrLength <= 8) {
var _monthStr4 = inputStr.slice(0, 2);
var _dateStr4 = inputStr.slice(2, 4) || '1';
var _yearStr4 = inputStr.slice(4, inputStr.length);
var _validateYear7 = validateCalendarYear(_yearStr4);
var _validateAndNormalize14 = validateAndNormalizeDate(_dateStr4, _monthStr4, _validateYear7),
_day7 = _validateAndNormalize14.day,
_month7 = _validateAndNormalize14.month,
_year7 = _validateAndNormalize14.year;
return '' + _month7 + dateDelimater + _day7 + dateDelimater + _year7; // eslint-disable-line max-len
} else if (inputStrLength > 8) {
return '' + String(getCurrentMonth()).padStart(2, 0) + dateDelimater + String(getCurrentDate()).padStart(2, 0) + dateDelimater + getCurrentYear(); // eslint-disable-line max-len
}
} else if (format === DATE_FORMATS.USAndTime) {
var _datePart = getDatePart(inputStr);
var _formattedDateArray = tokenizeFormattedDate(_datePart, format);
var _isDateSpecial = hasSpecialChar(_datePart);
if (_isDateSpecial) {
if (_formattedDateArray.length < 3) {
formattedArray.splice(2, 0, String(getCurrentYear()));
}
var _validateYear8 = validateCalendarYear(formattedArray[2]);
var _validateAndNormalize15 = validateAndNormalizeDate(formattedArray[1] || '1', formattedArray[0], _validateYear8),
_day8 = _validateAndNormalize15.day,
_month8 = _validateAndNormalize15.month,
_year8 = _validateAndNormalize15.year; // eslint-disable-line max-len
time = validateTime(formattedArray[3] + ':' + formattedArray[4]);
return '' + _month8 + dateDelimater + _day8 + dateDelimater + _year8 + ' ' + time;
} else if (_datePart.length >= 1 && _datePart.length <= 8) {
var _monthStr5 = _datePart.slice(0, 2);
var _dateStr5 = _datePart.slice(2, 4) || '1';
var _yearStr5 = _datePart.slice(4, _datePart.length);
var _validateYear9 = validateCalendarYear(_yearStr5); // eslint-disable-line max-len
var _validateAndNormalize16 = validateAndNormalizeDate(_dateStr5, _monthStr5, _validateYear9),
_day9 = _validateAndNormalize16.day,
_month9 = _validateAndNormalize16.month,
_year9 = _validateAndNormalize16.year;
var _timeParts = tokenizeFormattedDate(inputStr, format);
time = validateTime(_timeParts[1] + ':' + _timeParts[2]) || getCurrentTime();
return '' + _month9 + dateDelimater + _day9 + dateDelimater + _year9 + ' ' + time;
} else if (_datePart.length > 8) {
return '' + String(getCurrentMonth()).padStart(2, 0) + dateDelimater + String(getCurrentDate()).padStart(2, 0) + dateDelimater + getCurrentYear() + ' ' + getCurrentTime(); // eslint-disable-line max-len
}
} else if (format === DATE_FORMATS.European || format === DATE_FORMATS.Germany_Russia_etc) {
if (hasSpecial) {
var _validateYear10 = validateCalendarYear(formattedArray[2]);
var _validateAndNormalize17 = validateAndNormalizeDate(formattedArray[0], formattedArray[1], _validateYear10),
_day10 = _validateAndNormalize17.day,
_month10 = _validateAndNormalize17.month; // eslint-disable-line max-len
var _validateAndNormalize18 = validateAndNormalizeDate(formattedArray[0], formattedArray[1], _validateYear10),
_year10 = _validateAndNormalize18.year; // eslint-disable-line max-len
_day10 = String(_day10).padStart(2, 0);
_month10 = String(_month10).padStart(2, 0);
return '' + _day10 + dateDelimater + _month10 + dateDelimater + _year10;
} else if (inputStrLength >= 1 && inputStrLength <= 8) {
var _dateStr6 = inputStr.slice(0, 2);
var _monthStr6 = inputStr.slice(2, 4) || getCurrentMonth();
var _yearStr6 = inputStr.slice(4, inputStr.length);
var _validateYear11 = validateCalendarYear(_yearStr6);
var _validateAndNormalize19 = validateAndNormalizeDate(_dateStr6, _monthStr6, _validateYear11),
_year11 = _validateAndNormalize19.year; // eslint-disable-line max-len
var _validateAndNormalize20 = validateAndNormalizeDate(_dateStr6, _monthStr6, _validateYear11),
_day11 = _validateAndNormalize20.day,
_month11 = _validateAndNormalize20.month; // eslint-disable-line max-len
_day11 = String(_day11).padStart(2, 0);
_month11 = String(_month11).padStart(2, 0);
return '' + _day11 + dateDelimater + _month11 + dateDelimater + _year11;
} else if (inputStrLength > 8) {
return '' + String(getCurrentDate()).padStart(2, 0) + dateDelimater + String(getCurrentMonth()).padStart(2, 0) + dateDelimater + getCurrentYear(); // eslint-disable-line max-len
}
} else if (format === DATE_FORMATS.EuropeanAndTime || format === DATE_FORMATS.Germany_Russia_etcAndTime) {
var _datePart2 = getDatePart(inputStr);
var _formattedDateArray2 = tokenizeFormattedDate(_datePart2, format);
var _isDateSpecial2 = hasSpecialChar(_datePart2);
if (_isDateSpecial2) {
if (_formattedDateArray2.length < 3) {
formattedArray.splice(2, 0, String(getCurrentYear()));
}
var _validateYear12 = validateCalendarYear(formattedArray[2]);
var _validateAndNormalize21 = validateAndNormalizeDate(formattedArray[0], formattedArray[1], _validateYear12),
_day12 = _validateAndNormalize21.day,
_month12 = _validateAndNormalize21.month; // eslint-disable-line max-len
var _validateAndNormalize22 = validateAndNormalizeDate(formattedArray[0], formattedArray[1], _validateYear12),
_year12 = _validateAndNormalize22.year; // eslint-disable-line max-len
time = validateTime(formattedArray[3] + ':' + formattedArray[4]);
_day12 = String(_day12).padStart(2, 0);
_month12 = String(_month12).padStart(2, 0);
return '' + _day12 + dateDelimater + _month12 + dateDelimater + _year12 + ' ' + time;
} else if (_datePart2.length >= 1 && _datePart2.length <= 8) {
var _dateStr7 = _datePart2.slice(0, 2);
var _monthStr7 = _datePart2.slice(2, 4) || getCurrentMonth();
var _yearStr7 = _datePart2.slice(4, _datePart2.length);
var _timeParts2 = tokenizeFormattedDate(inputStr, format);
time = validateTime(_timeParts2[1] + ':' + _timeParts2[2]);
var _validateYear13 = validateCalendarYear(_yearStr7);
var _validateAndNormalize23 = validateAndNormalizeDate(_dateStr7, _monthStr7, _validateYear13),
_day13 = _validateAndNormalize23.day,
_month13 = _validateAndNormalize23.month;
var _validateAndNormalize24 = validateAndNormalizeDate(_dateStr7, _monthStr7, _validateYear13),
_year13 = _validateAndNormalize24.year;
_day13 = String(_day13).padStart(2, 0);
_month13 = String(_month13).padStart(2, 0);
return '' + _day13 + dateDelimater + _month13 + dateDelimater + _year13 + ' ' + time;
} else if (_datePart2.length > 8) {
return '' + String(getCurrentDate()).padStart(2, 0) + dateDelimater + String(getCurrentMonth()).padStart(2, 0) + dateDelimater + getCurrentYear() + ' ' + getCurrentTime(); // eslint-disable-line max-len
}
}
}
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(12);
var createDesc = __webpack_require__(21);
module.exports = __webpack_require__(7) ? function (object, key, value) {
return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(17);
var IE8_DOM_DEFINE = __webpack_require__(44);
var toPrimitive = __webpack_require__(27);
var dP = Object.defineProperty;
exports.f = __webpack_require__(7) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
/***/ }),
/* 13 */
/***/ (function(module, exports) {
module.exports = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(47);
var defined = __webpack_require__(28);
module.exports = function (it) {
return IObject(defined(it));
};
/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
var store = __webpack_require__(31)('wks');
var uid = __webpack_require__(24);
var Symbol = __webpack_require__(5).Symbol;
var USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function (name) {
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};
$exports.store = store;
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(5);
var core = __webpack_require__(6);
var ctx = __webpack_require__(43);
var hide = __webpack_require__(11);
var has = __webpack_require__(8);
var PROTOTYPE = 'prototype';
var $export = function (type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var IS_WRAP = type & $export.W;
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
var expProto = exports[PROTOTYPE];
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
var key, own, out;
if (IS_GLOBAL) source = name;
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
if (own && has(exports, key)) continue;
// export native or passed
out = own ? target[key] : source[key];
// prevent global pollution for namespaces
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
// bind timers to global for call from export context
: IS_BIND && own ? ctx(out, global)
// wrap global constructors for prevent change them in library
: IS_WRAP && target[key] == out ? (function (C) {
var F = function (a, b, c) {
if (this instanceof C) {
switch (arguments.length) {
case 0: return new C();
case 1: return new C(a);
case 2: return new C(a, b);
} return new C(a, b, c);
} return C.apply(this, arguments);
};
F[PROTOTYPE] = C[PROTOTYPE];
return F;
// make static versions for prototype methods
})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
if (IS_PROTO) {
(exports.virtual || (exports.virtual = {}))[key] = out;
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
}
}
};
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(13);
module.exports = function (it) {
if (!isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
/***/ }),
/* 18 */
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
/***/ }),
/* 19 */
/***/ (function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) { return [] }
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
!function(t,e){ true?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},D="en",v={};v[D]=M;var p=function(t){return t instanceof _},S=function(t,e,n){var r;if(!t)return D;if("string"==typeof t)v[t]&&(r=t),e&&(v[t]=e,r=t);else{var i=t.name;v[i]=t,r=i}return!n&&r&&(D=r),r||!n&&D},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var D=this.$locale().weekStart||0,v=(y<D?y+7:y)-D;return $(r?m-v:m+(6-v),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].substr(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,D=O.m(this,M);return D=(l={},l[c]=D/12,l[f]=D,l[h]=D/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?D:O.a(D)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return v[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCSt