UNPKG

@instawork/design-system

Version:

The design system for Instawork's web apps

1,217 lines (1,018 loc) 1.03 MB
/******/ (function() { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./node_modules/luxon/src/datetime.js": /*!********************************************!*\ !*** ./node_modules/luxon/src/datetime.js ***! \********************************************/ /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": function() { return /* binding */ DateTime; }, /* harmony export */ "friendlyDateTime": function() { return /* binding */ friendlyDateTime; } /* harmony export */ }); /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js"); /* harmony import */ var core_js_modules_es_math_trunc_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.math.trunc.js */ "./node_modules/core-js/modules/es.math.trunc.js"); /* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js"); /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js"); /* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js"); /* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js"); /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js"); /* harmony import */ var core_js_modules_es_number_is_nan_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.number.is-nan.js */ "./node_modules/core-js/modules/es.number.is-nan.js"); /* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.number.constructor.js */ "./node_modules/core-js/modules/es.number.constructor.js"); /* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js"); /* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.join.js */ "./node_modules/core-js/modules/es.array.join.js"); /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js"); /* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js"); /* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"); /* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js"); /* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"); /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js"); /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js"); /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js"); /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ "./node_modules/core-js/modules/es.regexp.to-string.js"); /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! core-js/modules/es.regexp.exec.js */ "./node_modules/core-js/modules/es.regexp.exec.js"); /* harmony import */ var _duration_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./duration.js */ "./node_modules/luxon/src/duration.js"); /* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./interval.js */ "./node_modules/luxon/src/interval.js"); /* harmony import */ var _settings_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./settings.js */ "./node_modules/luxon/src/settings.js"); /* harmony import */ var _info_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./info.js */ "./node_modules/luxon/src/info.js"); /* harmony import */ var _impl_formatter_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./impl/formatter.js */ "./node_modules/luxon/src/impl/formatter.js"); /* harmony import */ var _zones_fixedOffsetZone_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./zones/fixedOffsetZone.js */ "./node_modules/luxon/src/zones/fixedOffsetZone.js"); /* harmony import */ var _impl_locale_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./impl/locale.js */ "./node_modules/luxon/src/impl/locale.js"); /* harmony import */ var _impl_util_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./impl/util.js */ "./node_modules/luxon/src/impl/util.js"); /* harmony import */ var _impl_zoneUtil_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./impl/zoneUtil.js */ "./node_modules/luxon/src/impl/zoneUtil.js"); /* harmony import */ var _impl_diff_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./impl/diff.js */ "./node_modules/luxon/src/impl/diff.js"); /* harmony import */ var _impl_regexParser_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./impl/regexParser.js */ "./node_modules/luxon/src/impl/regexParser.js"); /* harmony import */ var _impl_tokenParser_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./impl/tokenParser.js */ "./node_modules/luxon/src/impl/tokenParser.js"); /* harmony import */ var _impl_conversions_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./impl/conversions.js */ "./node_modules/luxon/src/impl/conversions.js"); /* harmony import */ var _impl_formats_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./impl/formats.js */ "./node_modules/luxon/src/impl/formats.js"); /* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./errors.js */ "./node_modules/luxon/src/errors.js"); /* harmony import */ var _impl_invalid_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./impl/invalid.js */ "./node_modules/luxon/src/impl/invalid.js"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var INVALID = "Invalid DateTime"; var MAX_DATE = 8.64e15; function unsupportedZone(zone) { return new _impl_invalid_js__WEBPACK_IMPORTED_MODULE_38__.default("unsupported zone", "the zone \"".concat(zone.name, "\" is not supported")); } // we cache week data on the DT object and this intermediates the cache function possiblyCachedWeekData(dt) { if (dt.weekData === null) { dt.weekData = (0,_impl_conversions_js__WEBPACK_IMPORTED_MODULE_35__.gregorianToWeek)(dt.c); } return dt.weekData; } // clone really means, "make a new object with these modifications". all "setters" really use this // to create a new object while only changing some of the properties function clone(inst, alts) { var current = { ts: inst.ts, zone: inst.zone, c: inst.c, o: inst.o, loc: inst.loc, invalid: inst.invalid }; return new DateTime(_objectSpread(_objectSpread(_objectSpread({}, current), alts), {}, { old: current })); } // find the right offset a given local time. The o input is our guess, which determines which // offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST) function fixOffset(localTS, o, tz) { // Our UTC time is just a guess because our offset is just a guess var utcGuess = localTS - o * 60 * 1000; // Test whether the zone matches the offset for this ts var o2 = tz.offset(utcGuess); // If so, offset didn't change and we're done if (o === o2) { return [utcGuess, o]; } // If not, change the ts by the difference in the offset utcGuess -= (o2 - o) * 60 * 1000; // If that gives us the local time we want, we're done var o3 = tz.offset(utcGuess); if (o2 === o3) { return [utcGuess, o2]; } // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)]; } // convert an epoch timestamp into a calendar object with the given offset function tsToObj(ts, offset) { ts += offset * 60 * 1000; var d = new Date(ts); return { year: d.getUTCFullYear(), month: d.getUTCMonth() + 1, day: d.getUTCDate(), hour: d.getUTCHours(), minute: d.getUTCMinutes(), second: d.getUTCSeconds(), millisecond: d.getUTCMilliseconds() }; } // convert a calendar object to a epoch timestamp function objToTS(obj, offset, zone) { return fixOffset((0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.objToLocalTS)(obj), offset, zone); } // create a new DT instance by adding a duration, adjusting for DSTs function adjustTime(inst, dur) { var oPre = inst.o, year = inst.c.year + Math.trunc(dur.years), month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, c = _objectSpread(_objectSpread({}, inst.c), {}, { year: year, month: month, day: Math.min(inst.c.day, (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.daysInMonth)(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7 }), millisToAdd = _duration_js__WEBPACK_IMPORTED_MODULE_23__.default.fromObject({ years: dur.years - Math.trunc(dur.years), quarters: dur.quarters - Math.trunc(dur.quarters), months: dur.months - Math.trunc(dur.months), weeks: dur.weeks - Math.trunc(dur.weeks), days: dur.days - Math.trunc(dur.days), hours: dur.hours, minutes: dur.minutes, seconds: dur.seconds, milliseconds: dur.milliseconds }).as("milliseconds"), localTS = (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.objToLocalTS)(c); var _fixOffset = fixOffset(localTS, oPre, inst.zone), _fixOffset2 = _slicedToArray(_fixOffset, 2), ts = _fixOffset2[0], o = _fixOffset2[1]; if (millisToAdd !== 0) { ts += millisToAdd; // that could have changed the offset by going over a DST, but we want to keep the ts the same o = inst.zone.offset(ts); } return { ts: ts, o: o }; } // helper useful in turning the results of parsing into real dates // by handling the zone options function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) { var setZone = opts.setZone, zone = opts.zone; if (parsed && Object.keys(parsed).length !== 0 || parsedZone) { var interpretationZone = parsedZone || zone, inst = DateTime.fromObject(parsed, _objectSpread(_objectSpread({}, opts), {}, { zone: interpretationZone, specificOffset: specificOffset })); return setZone ? inst : inst.setZone(zone); } else { return DateTime.invalid(new _impl_invalid_js__WEBPACK_IMPORTED_MODULE_38__.default("unparsable", "the input \"".concat(text, "\" can't be parsed as ").concat(format))); } } // if you want to output a technical format (e.g. RFC 2822), this helper // helps handle the details function toTechFormat(dt, format) { var allowZ = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; return dt.isValid ? _impl_formatter_js__WEBPACK_IMPORTED_MODULE_27__.default.create(_impl_locale_js__WEBPACK_IMPORTED_MODULE_29__.default.create("en-US"), { allowZ: allowZ, forceSimple: true }).formatDateTimeFromString(dt, format) : null; } function _toISODate(o, extended) { var longFormat = o.c.year > 9999 || o.c.year < 0; var c = ""; if (longFormat && o.c.year >= 0) c += "+"; c += (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.padStart)(o.c.year, longFormat ? 6 : 4); if (extended) { c += "-"; c += (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.padStart)(o.c.month); c += "-"; c += (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.padStart)(o.c.day); } else { c += (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.padStart)(o.c.month); c += (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.padStart)(o.c.day); } return c; } function _toISOTime(o, extended, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone) { var c = (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.padStart)(o.c.hour); if (extended) { c += ":"; c += (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.padStart)(o.c.minute); if (o.c.second !== 0 || !suppressSeconds) { c += ":"; } } else { c += (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.padStart)(o.c.minute); } if (o.c.second !== 0 || !suppressSeconds) { c += (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.padStart)(o.c.second); if (o.c.millisecond !== 0 || !suppressMilliseconds) { c += "."; c += (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.padStart)(o.c.millisecond, 3); } } if (includeOffset) { if (o.isOffsetFixed && o.offset === 0 && !extendedZone) { c += "Z"; } else if (o.o < 0) { c += "-"; c += (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.padStart)(Math.trunc(-o.o / 60)); c += ":"; c += (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.padStart)(Math.trunc(-o.o % 60)); } else { c += "+"; c += (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.padStart)(Math.trunc(o.o / 60)); c += ":"; c += (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.padStart)(Math.trunc(o.o % 60)); } } if (extendedZone) { c += "[" + o.zone.ianaName + "]"; } return c; } // defaults for unspecified units in the supported calendars var defaultUnitValues = { month: 1, day: 1, hour: 0, minute: 0, second: 0, millisecond: 0 }, defaultWeekUnitValues = { weekNumber: 1, weekday: 1, hour: 0, minute: 0, second: 0, millisecond: 0 }, defaultOrdinalUnitValues = { ordinal: 1, hour: 0, minute: 0, second: 0, millisecond: 0 }; // Units in the supported calendars, sorted by bigness var orderedUnits = ["year", "month", "day", "hour", "minute", "second", "millisecond"], orderedWeekUnits = ["weekYear", "weekNumber", "weekday", "hour", "minute", "second", "millisecond"], orderedOrdinalUnits = ["year", "ordinal", "hour", "minute", "second", "millisecond"]; // standardize case and plurality in units function normalizeUnit(unit) { var normalized = { year: "year", years: "year", month: "month", months: "month", day: "day", days: "day", hour: "hour", hours: "hour", minute: "minute", minutes: "minute", quarter: "quarter", quarters: "quarter", second: "second", seconds: "second", millisecond: "millisecond", milliseconds: "millisecond", weekday: "weekday", weekdays: "weekday", weeknumber: "weekNumber", weeksnumber: "weekNumber", weeknumbers: "weekNumber", weekyear: "weekYear", weekyears: "weekYear", ordinal: "ordinal" }[unit.toLowerCase()]; if (!normalized) throw new _errors_js__WEBPACK_IMPORTED_MODULE_37__.InvalidUnitError(unit); return normalized; } // this is a dumbed down version of fromObject() that runs about 60% faster // but doesn't do any validation, makes a bunch of assumptions about what units // are present, and so on. function quickDT(obj, opts) { var zone = (0,_impl_zoneUtil_js__WEBPACK_IMPORTED_MODULE_31__.normalizeZone)(opts.zone, _settings_js__WEBPACK_IMPORTED_MODULE_25__.default.defaultZone), loc = _impl_locale_js__WEBPACK_IMPORTED_MODULE_29__.default.fromObject(opts), tsNow = _settings_js__WEBPACK_IMPORTED_MODULE_25__.default.now(); var ts, o; // assume we have the higher-order units if (!(0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.isUndefined)(obj.year)) { var _iterator = _createForOfIteratorHelper(orderedUnits), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var u = _step.value; if ((0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.isUndefined)(obj[u])) { obj[u] = defaultUnitValues[u]; } } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } var invalid = (0,_impl_conversions_js__WEBPACK_IMPORTED_MODULE_35__.hasInvalidGregorianData)(obj) || (0,_impl_conversions_js__WEBPACK_IMPORTED_MODULE_35__.hasInvalidTimeData)(obj); if (invalid) { return DateTime.invalid(invalid); } var offsetProvis = zone.offset(tsNow); var _objToTS = objToTS(obj, offsetProvis, zone); var _objToTS2 = _slicedToArray(_objToTS, 2); ts = _objToTS2[0]; o = _objToTS2[1]; } else { ts = tsNow; } return new DateTime({ ts: ts, zone: zone, loc: loc, o: o }); } function diffRelative(start, end, opts) { var round = (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.isUndefined)(opts.round) ? true : opts.round, format = function format(c, unit) { c = (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.roundTo)(c, round || opts.calendary ? 0 : 2, true); var formatter = end.loc.clone(opts).relFormatter(opts); return formatter.format(c, unit); }, differ = function differ(unit) { if (opts.calendary) { if (!end.hasSame(start, unit)) { return end.startOf(unit).diff(start.startOf(unit), unit).get(unit); } else return 0; } else { return end.diff(start, unit).get(unit); } }; if (opts.unit) { return format(differ(opts.unit), opts.unit); } var _iterator2 = _createForOfIteratorHelper(opts.units), _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { var unit = _step2.value; var count = differ(unit); if (Math.abs(count) >= 1) { return format(count, unit); } } } catch (err) { _iterator2.e(err); } finally { _iterator2.f(); } return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]); } function lastOpts(argList) { var opts = {}, args; if (argList.length > 0 && _typeof(argList[argList.length - 1]) === "object") { opts = argList[argList.length - 1]; args = Array.from(argList).slice(0, argList.length - 1); } else { args = Array.from(argList); } return [opts, args]; } /** * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them. * * A DateTime comprises of: * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch. * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone). * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`. * * Here is a brief overview of the most commonly used functionality it provides: * * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}. * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month}, * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors. * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors. * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors. * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}. * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}. * * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation. */ var DateTime = /*#__PURE__*/function () { /** * @access private */ function DateTime(config) { _classCallCheck(this, DateTime); var zone = config.zone || _settings_js__WEBPACK_IMPORTED_MODULE_25__.default.defaultZone; var invalid = config.invalid || (Number.isNaN(config.ts) ? new _impl_invalid_js__WEBPACK_IMPORTED_MODULE_38__.default("invalid input") : null) || (!zone.isValid ? unsupportedZone(zone) : null); /** * @access private */ this.ts = (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.isUndefined)(config.ts) ? _settings_js__WEBPACK_IMPORTED_MODULE_25__.default.now() : config.ts; var c = null, o = null; if (!invalid) { var unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone); if (unchanged) { var _ref = [config.old.c, config.old.o]; c = _ref[0]; o = _ref[1]; } else { var ot = zone.offset(this.ts); c = tsToObj(this.ts, ot); invalid = Number.isNaN(c.year) ? new _impl_invalid_js__WEBPACK_IMPORTED_MODULE_38__.default("invalid input") : null; c = invalid ? null : c; o = invalid ? null : ot; } } /** * @access private */ this._zone = zone; /** * @access private */ this.loc = config.loc || _impl_locale_js__WEBPACK_IMPORTED_MODULE_29__.default.create(); /** * @access private */ this.invalid = invalid; /** * @access private */ this.weekData = null; /** * @access private */ this.c = c; /** * @access private */ this.o = o; /** * @access private */ this.isLuxonDateTime = true; } // CONSTRUCT /** * Create a DateTime for the current instant, in the system's time zone. * * Use Settings to override these default values if needed. * @example DateTime.now().toISO() //~> now in the ISO format * @return {DateTime} */ _createClass(DateTime, [{ key: "get", value: // INFO /** * Get the value of unit. * @param {string} unit - a unit such as 'minute' or 'day' * @example DateTime.local(2017, 7, 4).get('month'); //=> 7 * @example DateTime.local(2017, 7, 4).get('day'); //=> 4 * @return {number} */ function get(unit) { return this[unit]; } /** * Returns whether the DateTime is valid. Invalid DateTimes occur when: * * The DateTime was created from invalid calendar information, such as the 13th month or February 30 * * The DateTime was created by an operation on another invalid date * @type {boolean} */ }, { key: "isValid", get: function get() { return this.invalid === null; } /** * Returns an error code if this DateTime is invalid, or null if the DateTime is valid * @type {string} */ }, { key: "invalidReason", get: function get() { return this.invalid ? this.invalid.reason : null; } /** * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid * @type {string} */ }, { key: "invalidExplanation", get: function get() { return this.invalid ? this.invalid.explanation : null; } /** * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime * * @type {string} */ }, { key: "locale", get: function get() { return this.isValid ? this.loc.locale : null; } /** * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime * * @type {string} */ }, { key: "numberingSystem", get: function get() { return this.isValid ? this.loc.numberingSystem : null; } /** * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime * * @type {string} */ }, { key: "outputCalendar", get: function get() { return this.isValid ? this.loc.outputCalendar : null; } /** * Get the time zone associated with this DateTime. * @type {Zone} */ }, { key: "zone", get: function get() { return this._zone; } /** * Get the name of the time zone. * @type {string} */ }, { key: "zoneName", get: function get() { return this.isValid ? this.zone.name : null; } /** * Get the year * @example DateTime.local(2017, 5, 25).year //=> 2017 * @type {number} */ }, { key: "year", get: function get() { return this.isValid ? this.c.year : NaN; } /** * Get the quarter * @example DateTime.local(2017, 5, 25).quarter //=> 2 * @type {number} */ }, { key: "quarter", get: function get() { return this.isValid ? Math.ceil(this.c.month / 3) : NaN; } /** * Get the month (1-12). * @example DateTime.local(2017, 5, 25).month //=> 5 * @type {number} */ }, { key: "month", get: function get() { return this.isValid ? this.c.month : NaN; } /** * Get the day of the month (1-30ish). * @example DateTime.local(2017, 5, 25).day //=> 25 * @type {number} */ }, { key: "day", get: function get() { return this.isValid ? this.c.day : NaN; } /** * Get the hour of the day (0-23). * @example DateTime.local(2017, 5, 25, 9).hour //=> 9 * @type {number} */ }, { key: "hour", get: function get() { return this.isValid ? this.c.hour : NaN; } /** * Get the minute of the hour (0-59). * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30 * @type {number} */ }, { key: "minute", get: function get() { return this.isValid ? this.c.minute : NaN; } /** * Get the second of the minute (0-59). * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52 * @type {number} */ }, { key: "second", get: function get() { return this.isValid ? this.c.second : NaN; } /** * Get the millisecond of the second (0-999). * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654 * @type {number} */ }, { key: "millisecond", get: function get() { return this.isValid ? this.c.millisecond : NaN; } /** * Get the week year * @see https://en.wikipedia.org/wiki/ISO_week_date * @example DateTime.local(2014, 12, 31).weekYear //=> 2015 * @type {number} */ }, { key: "weekYear", get: function get() { return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN; } /** * Get the week number of the week year (1-52ish). * @see https://en.wikipedia.org/wiki/ISO_week_date * @example DateTime.local(2017, 5, 25).weekNumber //=> 21 * @type {number} */ }, { key: "weekNumber", get: function get() { return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN; } /** * Get the day of the week. * 1 is Monday and 7 is Sunday * @see https://en.wikipedia.org/wiki/ISO_week_date * @example DateTime.local(2014, 11, 31).weekday //=> 4 * @type {number} */ }, { key: "weekday", get: function get() { return this.isValid ? possiblyCachedWeekData(this).weekday : NaN; } /** * Get the ordinal (meaning the day of the year) * @example DateTime.local(2017, 5, 25).ordinal //=> 145 * @type {number|DateTime} */ }, { key: "ordinal", get: function get() { return this.isValid ? (0,_impl_conversions_js__WEBPACK_IMPORTED_MODULE_35__.gregorianToOrdinal)(this.c).ordinal : NaN; } /** * Get the human readable short month name, such as 'Oct'. * Defaults to the system's locale if no locale has been specified * @example DateTime.local(2017, 10, 30).monthShort //=> Oct * @type {string} */ }, { key: "monthShort", get: function get() { return this.isValid ? _info_js__WEBPACK_IMPORTED_MODULE_26__.default.months("short", { locObj: this.loc })[this.month - 1] : null; } /** * Get the human readable long month name, such as 'October'. * Defaults to the system's locale if no locale has been specified * @example DateTime.local(2017, 10, 30).monthLong //=> October * @type {string} */ }, { key: "monthLong", get: function get() { return this.isValid ? _info_js__WEBPACK_IMPORTED_MODULE_26__.default.months("long", { locObj: this.loc })[this.month - 1] : null; } /** * Get the human readable short weekday, such as 'Mon'. * Defaults to the system's locale if no locale has been specified * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon * @type {string} */ }, { key: "weekdayShort", get: function get() { return this.isValid ? _info_js__WEBPACK_IMPORTED_MODULE_26__.default.weekdays("short", { locObj: this.loc })[this.weekday - 1] : null; } /** * Get the human readable long weekday, such as 'Monday'. * Defaults to the system's locale if no locale has been specified * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday * @type {string} */ }, { key: "weekdayLong", get: function get() { return this.isValid ? _info_js__WEBPACK_IMPORTED_MODULE_26__.default.weekdays("long", { locObj: this.loc })[this.weekday - 1] : null; } /** * Get the UTC offset of this DateTime in minutes * @example DateTime.now().offset //=> -240 * @example DateTime.utc().offset //=> 0 * @type {number} */ }, { key: "offset", get: function get() { return this.isValid ? +this.o : NaN; } /** * Get the short human name for the zone's current offset, for example "EST" or "EDT". * Defaults to the system's locale if no locale has been specified * @type {string} */ }, { key: "offsetNameShort", get: function get() { if (this.isValid) { return this.zone.offsetName(this.ts, { format: "short", locale: this.locale }); } else { return null; } } /** * Get the long human name for the zone's current offset, for example "Eastern Standard Time" or "Eastern Daylight Time". * Defaults to the system's locale if no locale has been specified * @type {string} */ }, { key: "offsetNameLong", get: function get() { if (this.isValid) { return this.zone.offsetName(this.ts, { format: "long", locale: this.locale }); } else { return null; } } /** * Get whether this zone's offset ever changes, as in a DST. * @type {boolean} */ }, { key: "isOffsetFixed", get: function get() { return this.isValid ? this.zone.isUniversal : null; } /** * Get whether the DateTime is in a DST. * @type {boolean} */ }, { key: "isInDST", get: function get() { if (this.isOffsetFixed) { return false; } else { return this.offset > this.set({ month: 1, day: 1 }).offset || this.offset > this.set({ month: 5 }).offset; } } /** * Returns true if this DateTime is in a leap year, false otherwise * @example DateTime.local(2016).isInLeapYear //=> true * @example DateTime.local(2013).isInLeapYear //=> false * @type {boolean} */ }, { key: "isInLeapYear", get: function get() { return (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.isLeapYear)(this.year); } /** * Returns the number of days in this DateTime's month * @example DateTime.local(2016, 2).daysInMonth //=> 29 * @example DateTime.local(2016, 3).daysInMonth //=> 31 * @type {number} */ }, { key: "daysInMonth", get: function get() { return (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.daysInMonth)(this.year, this.month); } /** * Returns the number of days in this DateTime's year * @example DateTime.local(2016).daysInYear //=> 366 * @example DateTime.local(2013).daysInYear //=> 365 * @type {number} */ }, { key: "daysInYear", get: function get() { return this.isValid ? (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.daysInYear)(this.year) : NaN; } /** * Returns the number of weeks in this DateTime's year * @see https://en.wikipedia.org/wiki/ISO_week_date * @example DateTime.local(2004).weeksInWeekYear //=> 53 * @example DateTime.local(2013).weeksInWeekYear //=> 52 * @type {number} */ }, { key: "weeksInWeekYear", get: function get() { return this.isValid ? (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.weeksInWeekYear)(this.weekYear) : NaN; } /** * Returns the resolved Intl options for this DateTime. * This is useful in understanding the behavior of formatting methods * @param {Object} opts - the same options as toLocaleString * @return {Object} */ }, { key: "resolvedLocaleOptions", value: function resolvedLocaleOptions() { var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _Formatter$create$res = _impl_formatter_js__WEBPACK_IMPORTED_MODULE_27__.default.create(this.loc.clone(opts), opts).resolvedOptions(this), locale = _Formatter$create$res.locale, numberingSystem = _Formatter$create$res.numberingSystem, calendar = _Formatter$create$res.calendar; return { locale: locale, numberingSystem: numberingSystem, outputCalendar: calendar }; } // TRANSFORM /** * "Set" the DateTime's zone to UTC. Returns a newly-constructed DateTime. * * Equivalent to {@link DateTime#setZone}('utc') * @param {number} [offset=0] - optionally, an offset from UTC in minutes * @param {Object} [opts={}] - options to pass to `setZone()` * @return {DateTime} */ }, { key: "toUTC", value: function toUTC() { var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return this.setZone(_zones_fixedOffsetZone_js__WEBPACK_IMPORTED_MODULE_28__.default.instance(offset), opts); } /** * "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime. * * Equivalent to `setZone('local')` * @return {DateTime} */ }, { key: "toLocal", value: function toLocal() { return this.setZone(_settings_js__WEBPACK_IMPORTED_MODULE_25__.default.defaultZone); } /** * "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime. * * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones. * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class. * @param {Object} opts - options * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this. * @return {DateTime} */ }, { key: "setZone", value: function setZone(zone) { var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref2$keepLocalTime = _ref2.keepLocalTime, keepLocalTime = _ref2$keepLocalTime === void 0 ? false : _ref2$keepLocalTime, _ref2$keepCalendarTim = _ref2.keepCalendarTime, keepCalendarTime = _ref2$keepCalendarTim === void 0 ? false : _ref2$keepCalendarTim; zone = (0,_impl_zoneUtil_js__WEBPACK_IMPORTED_MODULE_31__.normalizeZone)(zone, _settings_js__WEBPACK_IMPORTED_MODULE_25__.default.defaultZone); if (zone.equals(this.zone)) { return this; } else if (!zone.isValid) { return DateTime.invalid(unsupportedZone(zone)); } else { var newTS = this.ts; if (keepLocalTime || keepCalendarTime) { var offsetGuess = zone.offset(this.ts); var asObj = this.toObject(); var _objToTS3 = objToTS(asObj, offsetGuess, zone); var _objToTS4 = _slicedToArray(_objToTS3, 1); newTS = _objToTS4[0]; } return clone(this, { ts: newTS, zone: zone }); } } /** * "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime. * @param {Object} properties - the properties to set * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' }) * @return {DateTime} */ }, { key: "reconfigure", value: function reconfigure() { var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, locale = _ref3.locale, numberingSystem = _ref3.numberingSystem, outputCalendar = _ref3.outputCalendar; var loc = this.loc.clone({ locale: locale, numberingSystem: numberingSystem, outputCalendar: outputCalendar }); return clone(this, { loc: loc }); } /** * "Set" the locale. Returns a newly-constructed DateTime. * Just a convenient alias for reconfigure({ locale }) * @example DateTime.local(2017, 5, 25).setLocale('en-GB') * @return {DateTime} */ }, { key: "setLocale", value: function setLocale(locale) { return this.reconfigure({ locale: locale }); } /** * "Set" the values of specified units. Returns a newly-constructed DateTime. * You can only set units with this method; for "setting" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}. * @param {Object} values - a mapping of units to numbers * @example dt.set({ year: 2017 }) * @example dt.set({ hour: 8, minute: 30 }) * @example dt.set({ weekday: 5 }) * @example dt.set({ year: 2005, ordinal: 234 }) * @return {DateTime} */ }, { key: "set", value: function set(values) { if (!this.isValid) return this; var normalized = (0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.normalizeObject)(values, normalizeUnit), settingWeekStuff = !(0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.isUndefined)(normalized.weekYear) || !(0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.isUndefined)(normalized.weekNumber) || !(0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.isUndefined)(normalized.weekday), containsOrdinal = !(0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.isUndefined)(normalized.ordinal), containsGregorYear = !(0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.isUndefined)(normalized.year), containsGregorMD = !(0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.isUndefined)(normalized.month) || !(0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.isUndefined)(normalized.day), containsGregor = containsGregorYear || containsGregorMD, definiteWeekDef = normalized.weekYear || normalized.weekNumber; if ((containsGregor || containsOrdinal) && definiteWeekDef) { throw new _errors_js__WEBPACK_IMPORTED_MODULE_37__.ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); } if (containsGregorMD && containsOrdinal) { throw new _errors_js__WEBPACK_IMPORTED_MODULE_37__.ConflictingSpecificationError("Can't mix ordinal dates with month/day"); } var mixed; if (settingWeekStuff) { mixed = (0,_impl_conversions_js__WEBPACK_IMPORTED_MODULE_35__.weekToGregorian)(_objectSpread(_objectSpread({}, (0,_impl_conversions_js__WEBPACK_IMPORTED_MODULE_35__.gregorianToWeek)(this.c)), normalized)); } else if (!(0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.isUndefined)(normalized.ordinal)) { mixed = (0,_impl_conversions_js__WEBPACK_IMPORTED_MODULE_35__.ordinalToGregorian)(_objectSpread(_objectSpread({}, (0,_impl_conversions_js__WEBPACK_IMPORTED_MODULE_35__.gregorianToOrdinal)(this.c)), normalized)); } else { mixed = _objectSpread(_objectSpread({}, this.toObject()), normalized); // if we didn't set the day but we ended up on an overflow date, // use the last day of the right month if ((0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.isUndefined)(normalized.day)) { mixed.day = Math.min((0,_impl_util_js__WEBPACK_IMPORTED_MODULE_30__.daysInMonth)(mixed.year, mixed.month), mixed.day); } } var _objToTS5 = objToTS(mixed, this.o, this.zone), _objToTS6 = _slicedToArray(_objToTS5, 2), ts = _objToTS6[0], o = _objToTS6[1]; return clone(this, { ts: ts, o: o }); } /** * Add a period of time to this DateTime and return the resulting DateTime * * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between. * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() * @example DateTime.now().plus(123) //~> in 123 milliseconds * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow